comparison json_data_source_mod.py @ 18:2c58e3cc1b30 draft

Uploaded 20170601
author fabio
date Thu, 01 Jun 2017 17:45:01 -0400
parents 3eabece82abb
children 8c0633c02758
comparison
equal deleted inserted replaced
17:1224f3d9b5c7 18:2c58e3cc1b30
114 # reserve the underscore for the collection searator 114 # reserve the underscore for the collection searator
115 filename = os.path.basename( entry.name ).replace("_", "-") 115 filename = os.path.basename( entry.name ).replace("_", "-")
116 extension = splitext( filename )[1] 116 extension = splitext( filename )[1]
117 # pattern: (?P<identifier_0>[^_]+)_(?P<identifier_1>[^_]+)_(?P<ext>[^_]+)_(?P<dbkey>[^_]+) 117 # pattern: (?P<identifier_0>[^_]+)_(?P<identifier_1>[^_]+)_(?P<ext>[^_]+)_(?P<dbkey>[^_]+)
118 if (len(extension) > 0): 118 if (len(extension) > 0):
119 filename = (filename[0:len(filename)-(len(extension)+1)]).replace(".", "-") + "_" + extension 119 filename = (filename[0:len(filename)-(len(extension)+1)]).replace(".", "-") + "." + extension + "_" + extension
120 else: 120 else:
121 extension = "auto" 121 extension = "auto"
122 filename_with_collection_prefix = archive_name + "_" + filename + "_" + db_key 122 filename_with_collection_prefix = archive_name + "_" + filename + "_" + db_key
123 target_entry_output_filename = os.path.join(appdata_path, filename_with_collection_prefix) 123 target_entry_output_filename = os.path.join(appdata_path, filename_with_collection_prefix)
124 store_file_from_archive( fileobj, target_entry_output_filename ) 124 store_file_from_archive( fileobj, target_entry_output_filename )