Source

Webware / install.py

Diff from to

install.py

     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):