Code

- put all methods for parsing a message into a list and call all in a
[roundup.git] / roundup / init.py
index 8506f22aefee3dbc20dfd435d5391e1a93dd2a7b..d4afecc9e8a50da5e33c7fc7d0dee6a3ff4e6918 100644 (file)
@@ -30,7 +30,7 @@ from roundup.i18n import _
 def copytree(src, dst, symlinks=0):
     """Recursively copy a directory tree using copyDigestedFile().
 
-    The destination directory os allowed to exist.
+    The destination directory is allowed to exist.
 
     If the optional symlinks flag is true, symbolic links in the
     source tree result in symbolic links in the destination tree; if
@@ -39,7 +39,9 @@ def copytree(src, dst, symlinks=0):
 
     This was copied from shutil.py in std lib.
     """
-    names = os.listdir(src)
+
+    # Prevent 'hidden' files (those starting with '.') from being considered.
+    names = [f for f in os.listdir(src) if not f.startswith('.')]
     try:
         os.mkdir(dst)
     except OSError, error:
@@ -174,10 +176,12 @@ def saveTemplateInfo(dir, info):
     finally:
         f.close()
 
-def write_select_db(instance_home, backend):
+def write_select_db(instance_home, backend, dbdir = 'db'):
     ''' Write the file that selects the backend for the tracker
     '''
-    dbdir = os.path.join(instance_home, 'db')
+    # dbdir may be a relative pathname, os.path.join does the right
+    # thing when the second component of a join is an absolute path
+    dbdir = os.path.join (instance_home, dbdir)
     if not os.path.exists(dbdir):
         os.makedirs(dbdir)
     f = open(os.path.join(dbdir, 'backend_name'), 'w')