filecache.py

changeset 58
86014c443635
parent 54
0c686d10eb49
child 92
b8d72909d593
equal deleted inserted replaced
57:c147116768f4 58:86014c443635
39 def __init__(self, ldraw_directories): 39 def __init__(self, ldraw_directories):
40 ''' 40 '''
41 Initializes a new subfile cache 41 Initializes a new subfile cache
42 ''' 42 '''
43 self.cache = dict() 43 self.cache = dict()
44 self.ldraw_directories = [ 44 if ldraw_directories and isinstance(ldraw_directories[0], str):
45 Path(os.path.expanduser(directory)) 45 self.ldraw_directories = [
46 for directory in ldraw_directories 46 Path(os.path.expanduser(directory))
47 ] 47 for directory in ldraw_directories
48 ]
49 else:
50 from copy import copy
51 self.ldraw_directories = copy(ldraw_directories)
48 self.reference_stack = [] 52 self.reference_stack = []
49 def flatness_of(self, filename): 53 def flatness_of(self, filename):
50 ''' 54 '''
51 Returns the set of all directiones the specified file is flat in. 55 Returns the set of all directiones the specified file is flat in.
52 ''' 56 '''

mercurial