Commits

Wojciech Malinowski committed 1018d2d

Replaced some sys.path manipulation with a new location of the packages (still doing it using __file__)

  • Participants
  • Parent commits 631fc56

Comments (0)

Files changed (3)

File bin/MakeAppWorkDir.py

                 oldname = os.path.join(self._webKitDir, name)
                 if os.path.exists(oldname):
                     self.msg("\t%s" % newname)
-                    shutil.copyfile(oldname, newname)
+                    #shutil.copyfile(oldname, newname)
+                    newfile = open(newname, 'w')
+                    newfile.write(open(oldname, 'r').read().replace('PYTHON=python',
+                                                                    'PYTHON='+sys.executable))
+                    newfile.close()
                     if chmod:
                         os.chmod(newname, 0755)
                 else:
 group = %(group)r
 
 import sys
-sys.path.insert(0, webwareDir)
+#sys.path.insert(0, webwareDir)
 
 from WebKit import Launch
 
 serviceDeps = []
 
 import sys, os
-sys.path.insert(0, webwareDir)
+#sys.path.insert(0, webwareDir)
 
 from WebKit import AppServerService as service
 
     if not scriptName or scriptName == '-c':
         scriptName = 'MakeAppWorkDir.py'
     binDir = os.path.dirname(os.path.abspath(scriptName))
-    webwareDir = os.path.abspath(os.path.join(binDir, os.pardir))
+    import Properties
+    webwareDir = os.path.abspath(os.path.dirname(Properties.__file__))
     mawd = MakeAppWorkDir(webwareDir, workDir, True, None,
         contextName, contextDir, libraryDirs, cvsIgnore, uid, gid)
     mawd.buildWorkDir() # go!
     ## Init ##
 
     def __init__(self):
-        self._props = PropertiesObject('Properties.py')
-        self._props['dirname'] = '.'
+        import Properties
+        webware_dir = os.path.dirname(Properties.__file__)
+        self._props = PropertiesObject(os.path.join(webware_dir, 'Properties.py'))
+        self._props['dirname'] = webware_dir
         self._comps = []
         self._htHeader, self._htFooter = self.htHeaderAndFooter()
         from DocSupport.pytp import PyTP
       maintainer_email='wojciech.malinowski@gmail.com',
       package_dir={'': '.'},
       packages=find_packages('.'),
+      py_modules=['Properties'],
       include_package_data=True,
-      package_data={},
+      package_data={'WebKit': ['Adapters/*.cgi', 'Cache/*', 'Configs/*.config',
+                               'StartScripts/*', 'error404.html',
+                               'AppServer', 'AppServer.bat']},
       zip_safe=False,
       install_requires=[
       ],
+      extras_require = {
+            'Kid':  ["Kid"],
+      },
       entry_points={
       },
       scripts=['bin/checksrc.py',