1. Enis Afgan
  2. mi-deployment


John Chilton  committed 6a2f3e8

Cleaning up package structure setup code in setup.py.

  • Participants
  • Parent commits d20219e
  • Branches default

Comments (0)

Files changed (1)

File setup.py

View file
 from os.path import join, isdir
 from shutil import copytree, copy, rmtree
+## Setup python package with needed module structure in lib directory.
-def setup_package_directory(directory):
-    target_dir = join('lib', directory)
-    try:
-        makedirs(target_dir)
-    except:
-        pass
+def create_init_file(directory):
+    target_dir = join(lib_dir, directory)
     init_path = join(target_dir, '__init__.py')
     with file(init_path, 'a'):
         utime(init_path, None)
-for file_to_copy in ['data_fabfile.py', 'mi_fabfile.py', 'tools_fabfile.py', 'volume_manipulations_fab.py', 'util', 'tools']:
+makedirs(join(lib_dir, "mi_deployment"))
+package_files = ['data_fabfile.py', 
+                 'mi_fabfile.py', 
+                 'tools_fabfile.py', 
+                 'volume_manipulations_fab.py', 
+                 'util', 
+                 'tools']
+for file_to_copy in package_files:
     if isdir(file_to_copy):
         copy_func = copytree
         copy_func = copy
     copy_func(file_to_copy, join("lib", "mi_deployment", file_to_copy))
-setup_package_directory(join("mi_deployment", "tools"))
+create_init_file(join("mi_deployment", "tools"))