cleanup stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Jun 2009 16:58:28 +0200
branchstable
changeset 2157 a4acf959d07e
parent 2156 fadb86b040a9
child 2158 a2f2430dcd50
cleanup
schema.py
skeleton/__pkginfo__.py.tmpl
--- a/schema.py	Wed Jun 24 16:58:12 2009 +0200
+++ b/schema.py	Wed Jun 24 16:58:28 2009 +0200
@@ -32,8 +32,6 @@
 schema.use_py_datetime()
 nodes.use_py_datetime()
 
-_ = unicode
-
 BASEGROUPS = ('managers', 'users', 'guests', 'owners')
 
 _LOGGER = getLogger('cubicweb.schemaloader')
--- a/skeleton/__pkginfo__.py.tmpl	Wed Jun 24 16:58:12 2009 +0200
+++ b/skeleton/__pkginfo__.py.tmpl	Wed Jun 24 16:58:28 2009 +0200
@@ -17,16 +17,16 @@
 short_desc = '%(shortdesc)s'
 long_desc = '''%(longdesc)s'''
 
-from os import listdir as _listdir
-from os.path import join, isdir
-
 web = 'http://www.cubicweb.org/project/%%s' %% distname
 
 pyversions = ['2.4']
 
-#from cubicweb.devtools.pkginfo import get_distutils_datafiles
-CUBES_DIR = join('share', 'cubicweb', 'cubes')
-THIS_CUBE_DIR = join(CUBES_DIR, '%(cubename)s')
+
+from os import listdir as _listdir
+from os.path import join, isdir, exists, dirname
+from glob import glob
+
+THIS_CUBE_DIR = join('share', 'cubicweb', 'cubes', modname)
 
 def listdir(dirpath):
     return [join(dirpath, fname) for fname in _listdir(dirpath)
@@ -34,12 +34,11 @@
             and not fname.endswith('~')
             and not isdir(join(dirpath, fname))]
 
-from glob import glob
 try:
     data_files = [
         # common files
         [THIS_CUBE_DIR, [fname for fname in glob('*.py') if fname != 'setup.py']],
-        ]    
+        ]
     # check for possible extended cube layout
     for dirname in ('entities', 'views', 'sobjects', 'hooks', 'schema', 'data', 'i18n', 'migration'):
         if isdir(dirname):
@@ -47,8 +46,9 @@
     # Note: here, you'll need to add subdirectories if you want
     # them to be included in the debian package
 except OSError:
+    if exists(dirname(__file__)):
+        raise
     # we are in an installed directory
-    pass
 
 
 cube_eid = None # <=== FIXME if you need direct bug-subscription