Code

Fix typo in server address (bug #822967).
[roundup.git] / demo.py
diff --git a/demo.py b/demo.py
index 299133a21fdf9cedcfe394036f65773f65e55e8f..b047e843418c9d099117b49bdae17a08ed48e4fd 100644 (file)
--- a/demo.py
+++ b/demo.py
@@ -2,7 +2,7 @@
 #
 # Copyright (c) 2003 Richard Jones (richard@mechanicalcat.net)
 # 
-# $Id: demo.py,v 1.1 2003-05-09 05:04:33 richard Exp $
+# $Id: demo.py,v 1.5 2003-07-28 23:17:50 richard Exp $
 
 import sys, os, string, re, urlparse
 import shutil, socket, errno, BaseHTTPServer
@@ -10,15 +10,17 @@ from glob import glob
 
 def install_demo(home):
     # create the instance
-    try:
+    if os.path.exists(home):
         shutil.rmtree(home)
-    except os.error, error:
-        if error.errno != errno.ENOENT:
-            raise
     from roundup import init, instance, password
     init.install(home, os.path.join('templates', 'classic'))
     # don't have email flying around
     os.remove(os.path.join(home, 'detectors', 'nosyreaction.py'))
+    try:
+        os.remove(os.path.join(home, 'detectors', 'nosyreaction.pyc'))
+    except os.error, error:
+        if error.errno != errno.ENOENT:
+            raise
     init.write_select_db(home, 'anydbm')
 
     # figure basic params for server