commit/galaxy-central: greg: Always attempt to remove previously written temporary xml files when persisting the current datatypes registry.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/e65f4e953914/ changeset: e65f4e953914 user: greg date: 2011-12-16 23:08:35 summary: Always attempt to remove previously written temporary xml files when persisting the current datatypes registry. affected #: 2 files diff -r 48b3531465ee90f26680291971c837670ad0b7f0 -r e65f4e9539144c882f4f07355a033f53a1963ddd lib/galaxy/app.py --- a/lib/galaxy/app.py +++ b/lib/galaxy/app.py @@ -126,8 +126,7 @@ try: # If the datatypes registry was persisted, attempt to # remove the temporary file in which it was written. - tmp_filename = self.datatypes_registry.xml_filename - if tmp_filename: - os.unlink( tmp_filename ) + if self.datatypes_registry.xml_filename is not None: + os.unlink( self.datatypes_registry.xml_filename ) except: pass diff -r 48b3531465ee90f26680291971c837670ad0b7f0 -r e65f4e9539144c882f4f07355a033f53a1963ddd lib/galaxy/datatypes/registry.py --- a/lib/galaxy/datatypes/registry.py +++ b/lib/galaxy/datatypes/registry.py @@ -432,6 +432,14 @@ rval[ 'auto' ] = rval[ 'txt' ] return rval def to_xml_file( self ): + if self.xml_filename is not None: + # If persisted previously, attempt to remove + # the temporary file in which we were written. + try: + os.unlink( self.xml_filename ) + except: + pass + self.xml_filename = None fd, filename = tempfile.mkstemp() self.xml_filename = filename if self.converters_path_attr: Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket