Commits

Ionel Cristian Mărieș committed 30c38a3

stuff

  • Participants
  • Parent commits 632357e

Comments (0)

Files changed (6)

File appengine-monkey/build/lib/appengine_monkey_files/pth_relpath_fixup.py

     f.write(new_link)
     f.close()
 
+def split_path(path):
+    parts = []
+    while path:
+        path, part = os.path.split(path)
+        if not part: 
+            break
+        parts.insert(0, part)
+    return parts
+    
+    
 def make_relative_path(source, dest, dest_is_directory=True):
     """
     Make a filename relative, where the filename is dest, and it is
     being referred to from the filename source.
 
+        >>> make_relative_path('c:/foo/bar/something/a-file.pth',
+        ...                    'c:/foo/another-place/src/Directory')
+        '..\\..\\another-place\\src\\Directory'
+        
         >>> make_relative_path('/usr/share/something/a-file.pth',
         ...                    '/usr/share/another-place/src/Directory')
         '../another-place/src/Directory'
         >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/')
         './'
     """
+    print `dest`, `source`
     source = os.path.dirname(source)
     if not dest_is_directory:
         dest_filename = os.path.basename(dest)
         dest = os.path.dirname(dest)
     dest = os.path.normpath(os.path.abspath(dest))
     source = os.path.normpath(os.path.abspath(source))
-    dest_parts = dest.strip(os.path.sep).split(os.path.sep)
-    source_parts = source.strip(os.path.sep).split(os.path.sep)
+    dest_parts = split_path(dest)
+    source_parts = split_path(source)
     while dest_parts and source_parts and dest_parts[0] == source_parts[0]:
         dest_parts.pop(0)
         source_parts.pop(0)
     if not full_parts:
         # Special case for the current directory (otherwise it'd be '')
         return './'
-    return os.path.sep.join(full_parts)
+    return os.path.join(*full_parts)
                 
 
 if __name__ == '__main__':

File appengine-monkey/build/lib/pth_relpath_fixup.py

     f.write(new_link)
     f.close()
 
+def split_path(path):
+    parts = []
+    while path:
+        path, part = os.path.split(path)
+        if not part: 
+            break
+        parts.insert(0, part)
+    return parts
+    
+    
 def make_relative_path(source, dest, dest_is_directory=True):
     """
     Make a filename relative, where the filename is dest, and it is
     being referred to from the filename source.
 
+        >>> make_relative_path('c:/foo/bar/something/a-file.pth',
+        ...                    'c:/foo/another-place/src/Directory')
+        '..\\..\\another-place\\src\\Directory'
+        
         >>> make_relative_path('/usr/share/something/a-file.pth',
         ...                    '/usr/share/another-place/src/Directory')
         '../another-place/src/Directory'
         >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/')
         './'
     """
+    print `dest`, `source`
     source = os.path.dirname(source)
     if not dest_is_directory:
         dest_filename = os.path.basename(dest)
         dest = os.path.dirname(dest)
     dest = os.path.normpath(os.path.abspath(dest))
     source = os.path.normpath(os.path.abspath(source))
-    dest_parts = dest.strip(os.path.sep).split(os.path.sep)
-    source_parts = source.strip(os.path.sep).split(os.path.sep)
+    dest_parts = split_path(dest)
+    source_parts = split_path(source)
     while dest_parts and source_parts and dest_parts[0] == source_parts[0]:
         dest_parts.pop(0)
         source_parts.pop(0)
     if not full_parts:
         # Special case for the current directory (otherwise it'd be '')
         return './'
-    return os.path.sep.join(full_parts)
+    return os.path.join(*full_parts)
                 
 
 if __name__ == '__main__':

File appengine-monkey/pth_relpath_fixup.py

     f.write(new_link)
     f.close()
 
+def split_path(path):
+    parts = []
+    while path:
+        path, part = os.path.split(path)
+        if not part: 
+            break
+        parts.insert(0, part)
+    return parts
+    
+    
 def make_relative_path(source, dest, dest_is_directory=True):
     """
     Make a filename relative, where the filename is dest, and it is
     being referred to from the filename source.
 
+        >>> make_relative_path('c:/foo/bar/something/a-file.pth',
+        ...                    'c:/foo/another-place/src/Directory')
+        '..\\..\\another-place\\src\\Directory'
+        
         >>> make_relative_path('/usr/share/something/a-file.pth',
         ...                    '/usr/share/another-place/src/Directory')
         '../another-place/src/Directory'
         >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/')
         './'
     """
+    print `dest`, `source`
     source = os.path.dirname(source)
     if not dest_is_directory:
         dest_filename = os.path.basename(dest)
         dest = os.path.dirname(dest)
     dest = os.path.normpath(os.path.abspath(dest))
     source = os.path.normpath(os.path.abspath(source))
-    dest_parts = dest.strip(os.path.sep).split(os.path.sep)
-    source_parts = source.strip(os.path.sep).split(os.path.sep)
+    dest_parts = split_path(dest)
+    source_parts = split_path(source)
     while dest_parts and source_parts and dest_parts[0] == source_parts[0]:
         dest_parts.pop(0)
         source_parts.pop(0)
     if not full_parts:
         # Special case for the current directory (otherwise it'd be '')
         return './'
-    return os.path.sep.join(full_parts)
+    return os.path.join(*full_parts)
                 
 
 if __name__ == '__main__':

File development.ini

 
 [app:the-app]
 ## Change this to whatever you name your application:
-use = egg:JuicerApp
+use = egg:juicer_app
 ## other settings...
 
 ## Another option, if you want this config file to point at another file, is to do:

File juicer_app/juicer_app/config/environment.py

     config['pylons.app_globals'].mako_lookup = TemplateLookup(
         directories=paths['templates'],
         error_handler=handle_mako_error,
-        module_directory=os.path.join(app_conf['cache_dir'], 'templates'),
+        #~ module_directory=os.path.join(app_conf['cache_dir'], 'templates'),
         input_encoding='utf-8', output_encoding='utf-8',
         imports=['from webhelpers.html import escape'],
         default_filters=['escape'])
-appengine-monkey\appengine-boot.py --no-site-packages --paste-deploy --clear webmonkey 
-copy /y development.ini webmonkey\development.ini
-webmonkey\Scripts\easy_install --zip-ok Mako==dev FormEncode==dev simplejson==dev Pylons==dev
-xcopy /Y /E juicer_app webmonkey\src\juicer_app\
-cd webmonkey\src\juicer_app\
-..\Scripts\python setup.py develop
+appengine-monkey\appengine-boot.py --no-site-packages --paste-deploy --clear webjuicer 
+copy /y development.ini webjuicer\development.ini
+webjuicer\Scripts\easy_install --zip-ok Mako==dev FormEncode==dev simplejson==dev Pylons==dev
+xcopy /Y /E juicer_app webjuicer\src\juicer_app\
+cd webjuicer\src\juicer_app\
+..\..\Scripts\python setup.py develop
 cd ..\..\..
-webmonkey\Scripts\python -m pth_relpath_fixup
+webjuicer\Scripts\python -m pth_relpath_fixup