Commits

hideki nara committed 3436d9a

--init

Comments (0)

Files changed (6)

profiles/django_project/.hgignore

+\.pyc$
+\.pyo$
+\.swp$
+.egg-info
+^docs/build/
+build
+dist

profiles/django_project/setup.py

 
 if __name__=='__main__':
     setup(
-        name = 'mandb',
+        name = NAME,
         version = get_version(),
         license = 'Simplfied BSD License',
         author = '{{ fullname }}',

profiles/library/.hgignore

+\.pyc$
+\.pyo$
+\.swp$
+.egg-info
+^docs/build/
+build
+dist

profiles/library/setup.py

 
 if __name__=='__main__':
     setup(
-        name = 'mandb',
+        name = NAME,
         version = get_version(),
         license = 'Simplfied BSD License',
         author = '{{ fullname }}',
 
 if __name__=='__main__':
     setup(
-        name = 'mandb',
+        name = NAME,
         version = get_version(),
         license = 'Simplfied BSD License',
         author = 'Hideki Nara',

src/scripts/bitinit.py

 import os
+import sys
+import shutil
 import yaml
 from jinja2 import Template, Environment, FileSystemLoader
 
 
-DEF_CONF="conf.yml"
-conf = yaml.load( open(DEF_CONF).read() ) 
-BASE = os.path.dirname( os.path.dirname( os.path.dirname(os.path.abspath(__file__)) ) )
-#TODO
-#  - distribute profiles with setup.py
+def main():
 
-DEF_PROFILE=os.path.join(BASE,"profiles/%(profile)s"%conf )
+    BASE = os.path.dirname( os.path.dirname( os.path.dirname(os.path.abspath(__file__)) ) )
+    DEF_CONF="conf.yml"
 
-env = Environment(
-    loader=FileSystemLoader(DEF_PROFILE, encoding='utf8'),
-    autoescape=False,
-  )
+    if len(sys.argv)>1 and sys.argv[1] =='--init':
+        shutil.copy( os.path.join(BASE,DEF_CONF),'./')        
+        return
 
-def main():
+    conf = yaml.load( open(DEF_CONF).read() ) 
+    #TODO
+    #  - distribute profiles with setup.py
+    
+    DEF_PROFILE=os.path.join(BASE,"profiles/%(profile)s"%conf )
+    
+    env = Environment(
+        loader=FileSystemLoader(DEF_PROFILE, encoding='utf8'),
+        autoescape=False,
+      )
 
     for f in os.listdir(DEF_PROFILE):
         if not os.path.isdir(f):