Changeset 335
- Timestamp:
- 03/26/10 10:36:39 (11 years ago)
- Location:
- trunk/factory/src/backends
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/factory/src/backends/__init__.py
r247 r335 52 52 self.application = config.get(section, 'application').lower() 53 53 self.version = config.get(section, 'version').lower() 54 self.doctype = config.get(section, 'doctype')54 self.doctype = [s.strip() for s in config.get(section, 'doctype').split(',')] 55 55 self.formats = [s.strip() for s in config.get(section, 'formats').split(',')] 56 56 … … 68 68 job['application'].lower() == self.application and 69 69 job['version'].lower() == self.version and 70 job['doctype'] ==self.doctype and70 job['doctype'] in self.doctype and 71 71 (job['format'] == '' or job['format'] in self.formats) 72 72 ) 73 73 74 return eligable 74 75 -
trunk/factory/src/backends/oooserver.py
r172 r335 16 16 17 17 from backends import Backend, BackendException 18 from com.sun.star.uno import RuntimeException 18 19 from com.sun.star.beans import PropertyValue 19 20 from com.sun.star.connection import NoConnectException … … 122 123 src_file_url = self.file_url(src_file) 123 124 filter_name = self.filter_name(job['doctype'], job['format']) 124 document = self.desktop.loadComponentFromURL(src_file_url, "_blank", 0, _unoProps(Hidden=True, ReadOnly=True, UpdateDocMode=QUIET_UPDATE))125 125 126 if document is None:127 raise OOOServerException("The document '%s' could not be opened." % src_file_url, True)126 try: 127 document = self.desktop.loadComponentFromURL(src_file_url, "_blank", 0, _unoProps(Hidden=True, ReadOnly=True, UpdateDocMode=QUIET_UPDATE)) 128 128 129 document.storeToURL(self.file_url(dst_file), _unoProps(FilterName=filter_name)) 130 document.close(True) 129 if document is None: 130 raise OOOServerException("The document '%s' could not be opened." % src_file_url, True) 131 132 document.storeToURL(self.file_url(dst_file), _unoProps(FilterName=filter_name)) 133 document.close(True) 134 except RuntimeException: 135 raise OOOServerException("UNO RuntimeException in OOOServer. The server probably died. Unloading backend.", False) 131 136 132 137 logging.info('OOOServer converted %s to %s' % (src_file, dst_file))
Note: See TracChangeset
for help on using the changeset viewer.