Changeset 990
- Timestamp:
- 12/14/10 10:47:01 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
metadata/trunk/toolkit/scripts/dir2cmdicollection.py
r962 r990 31 31 32 32 if not simple_dir_structure: 33 for root, dirs, files in os.walk(os.getcwd()): 34 startpath = os.getcwd() 35 for d in dirs: 36 if d == "0": 37 rootList.append(generate_branch(root, dirs)) 33 root = os.getcwd() 34 dirs = filter (os.path.isdir, os.listdir(root)) 35 dirs.remove(target_dir.replace("/","")) 36 #for root, dirs, files in os.walk(os.getcwd()): 37 print dirs 38 for d in dirs: 39 rootList.append(generate_branch(root, [d], d)) 40 #startpath = os.getcwd() 41 #for d in dirs: 42 #if d == "0": 43 38 44 else: 39 45 rootList.append(generate_branch(os.getcwd(), [""], "lrt_inventory")) 40 46 writeCollection(rootList, "collection_root.cmdi", "olac-root") 41 47 42 def generate_branch(root, dirs): 43 collectionName = os.path.relpath(root) 44 return generate_branch(root, dirs, collectionName) 48 #def generate_branch(root, dirs): 49 # collectionName = os.path.relpath(root) 50 # print collectionName 51 # return generate_branch(root, dirs, collectionName) 45 52 46 53 def generate_branch(root, dirs, collectionName): … … 52 59 for d in dirs: 53 60 fullpath = os.path.join(root, d) 61 print fullpath 54 62 for file in os.listdir(fullpath): 55 63 if ".cmdi" in file:
Note: See TracChangeset
for help on using the changeset viewer.