Changeset 836
- Timestamp:
- 04/04/07 10:19:38
- Files:
-
- qPloneSkinDump/trunk/HISTORY.txt (modified) (1 diff)
- qPloneSkinDump/trunk/skin_template/Extensions/utils.py (modified) (2 diffs)
- qPloneSkinDump/trunk/utils.py (modified) (1 diff)
- qPloneSkinDump/trunk/version.txt (modified) (1 diff)
- qPloneSkinDump/trunk/write_utils.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneSkinDump/trunk/HISTORY.txt
r788 r836 1 qPloneSkinDump 0.7.3 2 - Add support skins, generated under older qPloneSkinDump version. 3 - Fix some issues 4 1 5 qPloneSkinDump 0.7.2 2 6 - Fixed id.extension - meta_type confusing bug. qPloneSkinDump/trunk/skin_template/Extensions/utils.py
r503 r836 21 21 SUMMARY_CLEAN = "> Finished cleaning." 22 22 CREXP_INVALID_ID = re.compile('^The id \"(.*?)\" is invalid - it is already in use.$', re.DOTALL|re.IGNORECASE|re.MULTILINE) 23 CSS_BASE_IDS_QPSD053 = ['id','expression','enabled','cookable','media','rel','title','rendering'] # supporting qPSD-0.5.3 version 23 24 ################ CHECK IMPORTING ################ 24 25 def checkIfImport(): … … 319 320 print >> out, "!!! - BAD: your Resource Regestry have'nt %%s resource(s), which may lead to some problems." %% unexistent 320 321 322 def getVersion(res_list): 323 """Check version of skin product generator.""" 324 return (res_list and not '::' in res_list[0] and '0.5') or '0.7' 325 321 326 def uninstallResource(portal_res, original_res_list, RESOURCE_SKIN_LIST, resRegisterFunction): 322 327 # Prepare Resource Registry data for backup to original state 323 328 original_res_regestry = {} 329 genVersion = getVersion(original_res_list) 324 330 for rec in original_res_list: 325 331 resource = {} 326 [resource.update({prop.split('::')[0]:prop.split('::')[1]}) for prop in rec.split(";")] 332 if genVersion == '0.7': 333 [resource.update({prop.split('::')[0]:prop.split('::')[1]}) for prop in rec.split(";")] 334 elif genVersion == '0.5': 335 props = rec.split(";") 336 [resource.update({CSS_BASE_IDS_QPSD053[i]:props[i]}) for i in range(len(CSS_BASE_IDS_QPSD053))] 327 337 original_res_regestry[resource.pop('id')] = resource 328 338 # Work up actual Resource Registry qPloneSkinDump/trunk/utils.py
r788 r836 17 17 'Page Template', 18 18 'Script (Python)' ] 19 _acceptable_meta_types = _write_custom_meta_type_list + ['Folder' ]19 _acceptable_meta_types = _write_custom_meta_type_list + ['Folder',] 20 20 ospJoin = os.path.join 21 21 qPloneSkinDump/trunk/version.txt
r788 r836 1 0.7. 21 0.7.3 qPloneSkinDump/trunk/write_utils.py
r537 r836 3 3 # was made some correction in ControllerBaseMetadata forming procedure 4 4 # 5 import sys 5 6 6 7 def writeObjectsMeta( obj_meta, basepath ): … … 116 117 "Write a list of strings to a file, joining list items with '\n'." 117 118 f = open( filename, 'wb' ) 118 f.write( '\n'.join( [prepareData(item) for item in data]) ) 119 try: 120 f.write( '\n'.join( [prepareData(item) for item in data]) ) 121 except: 122 exc_type, exc_value, trace = sys.exc_info() 123 raise Exception("There is %s (%s) exception while dumping %s file." % (exc_value, exc_type, filename)) 119 124 f.close() 120 125
