python-adfs

changeset 49:8fe9de493130

Found that the create_directory method was splitting the path of the directory to be created until it reached "/", at which point it would loop indefinitely.
author David Boddie <david@boddie.org.uk>
date Thu Jul 03 01:05:49 2003 +0200
parents fe9f6b48cabc
children 86844fe8700b
files ADFSlib.py setup.py
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/ADFSlib.py	Wed Jul 02 23:20:58 2003 +0200
     1.2 +++ b/ADFSlib.py	Thu Jul 03 01:05:49 2003 +0200
     1.3 @@ -26,8 +26,8 @@
     1.4  """
     1.5  
     1.6  __author__ = "David Boddie <david@boddie.org.uk>"
     1.7 -__date__ = "Wed 2nd July 2003"
     1.8 -__version__ = "0.13"
     1.9 +__date__ = "Thu 3rd July 2003"
    1.10 +__version__ = "0.14"
    1.11  
    1.12  
    1.13  import os, string
    1.14 @@ -1214,13 +1214,17 @@
    1.15      def create_directory(self, path, name = None):
    1.16      
    1.17          elements = []
    1.18 -         
    1.19 -        while path != "":
    1.20 +        
    1.21 +        while not os.path.exists(path) and path != "":
    1.22          
    1.23              path, file = os.path.split(path)
    1.24              
    1.25              elements.insert(0, file)
    1.26          
    1.27 +        if path != "":
    1.28 +        
    1.29 +            elements.insert(0, path)
    1.30 +        
    1.31          if name is not None:
    1.32          
    1.33              elements.append(name)
     2.1 --- a/setup.py	Wed Jul 02 23:20:58 2003 +0200
     2.2 +++ b/setup.py	Thu Jul 03 01:05:49 2003 +0200
     2.3 @@ -32,7 +32,7 @@
     2.4      author="David Boddie",
     2.5      author_email="david@boddie.org.uk",
     2.6      url="http://www.boddie.org.uk/david/Projects/Python/ADFSlib/",
     2.7 -    version="0.13",
     2.8 +    version="0.14",
     2.9      py_modules=["ADFSlib"],
    2.10      scripts=["ADF2INF.py"]
    2.11      )