Wojciech Malinowski avatar Wojciech Malinowski committed 8e3f507

install.py can now be run inside the site-packages

Comments (0)

Files changed (5)

Empty file added.


             print '> cd ..'
             print '> python install.py'
-            sys.exit(0)
+            #sys.exit(0)
     def readyForRequests(self):
         """Declare ready for getting requests.
         print 'Please run install.py in the Webware directory:'
         print '> cd', os.path.abspath(webwareDir)
         print '> python install.py'
-        sys.exit(1)
+        #sys.exit(1)
     # Now assemble a new clean Python search path:
     path = [] # the new search path will be collected here
     webKitDir = os.path.abspath(os.path.join(webwareDir, 'WebKit'))
     def __init__(self):
         import Properties
         webware_dir = os.path.dirname(Properties.__file__)
+        os.chdir(webware_dir)
         self._props = PropertiesObject(os.path.join(webware_dir, 'Properties.py'))
         self._props['dirname'] = webware_dir
         self._comps = []
         wr("<% footer() %>")
         ht = '\n'.join(ht)
         ht = self.processPyTemplate(ht, self._props)
-        open('Docs/ComponentIndex.html', 'w').write(ht)
+        import Properties
+        webware_path = os.path.dirname(os.path.abspath(Properties.__file__))
+        open(os.path.join(webware_path, 'Docs', 'ComponentIndex.html'), 'w').write(ht)
     def createComponentIndexes(self, keep):
         """Create start page for all components."""
                 open(initFile, 'w').write(
                     '# this can be browsed as a Webware context\n')
         # Copy favicon to the default context
-        open('WebKit/Examples/favicon.ico', 'wb').write(
-            open('Docs/favicon.ico', 'rb').read())
+        import Properties
+        webware_path = os.path.dirname(os.path.abspath(Properties.__file__))
+        open(os.path.join(webware_path, 'WebKit', 'Examples', 'favicon.ico'), 'wb').write(
+            open(os.path.join(webware_path, 'Docs', 'favicon.ico'), 'rb').read())
     def backupConfigs(self):
         """Copy *.config to *.config.default, if they don't already exist.
     def htHeaderAndFooter(self):
         """Return header and footer from HTML template."""
-        template = open('Docs/Template.html').read()
+        import Properties
+        webware_path = os.path.dirname(os.path.abspath(Properties.__file__))
+        template = open(os.path.join(webware_path, 'Docs', 'Template.html')).read()
         return template.split('\n<!-- page content -->\n', 1)
     def processHtmlDocFile(self, htmlFile):
-      package_data={'WebKit': ['Adapters/*.cgi', 'Cache/*', 'Configs/*.config',
-                               'StartScripts/*', 'error404.html',
-                               'AppServer', 'AppServer.bat']},
+      package_data={'CGIWrapper': ['Docs/*'],
+                    'COMKit': ['Docs/*'],
+                    'Docs': ['*'],
+                    'DocSupport': ['*'],
+                    'KidKit': ['Docs/*', 'Examples/*'],
+                    'MiddleKit': ['Docs/*.phtml', 'Docs/*.text', 'Resources/Template.mkmodel/*'],
+                    'MiscUtils': ['Docs/*', 'Tests/*'],
+                    'PSP': ['Docs/*', 'Examples/*'],
+                    'TaskKit': ['Docs/*'],
+                    'UserKit': ['Docs/*', 'Tests/UserManagerTest.mkmodel/*'],
+                    'WebKit': ['Adapters/*.cgi', 'Cache/*', 'Configs/*.config',
+                               'Docs/*', 'StartScripts/*', 'error404.html',
+                               'AppServer', 'AppServer.bat', 
+                               'Tests/Basic/Configs/*', 'Tests/Basic/error404.html',
+                               'Tests/stress/*', 'Tests/twill/*',
+                               ],
+                    'WebUtils': ['Docs/*'],
+                    },                    
       extras_require = {
-            'Kid':  ["Kid"],
+            'KidKit':  ["kid > 0.6"],
+            'JSONRPC': ["simplejson"],
+            'images': ['PIL'],
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.