commit/galaxy-central: greg: Create a new, empty hgweb.config file if one isn't found in the configured location.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/3419a45c1f01/ changeset: 3419a45c1f01 user: greg date: 2012-11-13 19:45:03 summary: Create a new, empty hgweb.config file if one isn't found in the configured location. affected #: 2 files diff -r 4471a94e8fbff8d8c165c58f0f76867500953b82 -r 3419a45c1f01790b3108d1726253fcb46feedbf4 lib/galaxy/webapps/community/app.py --- a/lib/galaxy/webapps/community/app.py +++ b/lib/galaxy/webapps/community/app.py @@ -49,5 +49,6 @@ # Let the HgwebConfigManager know where the hgweb.config file is located. self.hgweb_config_manager = self.model.hgweb_config_manager self.hgweb_config_manager.hgweb_config_dir = self.config.hgweb_config_dir + print >> sys.stderr, "Tool shed hgweb.config file is: ", self.hgweb_config_manager.hgweb_config def shutdown( self ): pass diff -r 4471a94e8fbff8d8c165c58f0f76867500953b82 -r 3419a45c1f01790b3108d1726253fcb46feedbf4 lib/galaxy/webapps/community/util/hgweb_config.py --- a/lib/galaxy/webapps/community/util/hgweb_config.py +++ b/lib/galaxy/webapps/community/util/hgweb_config.py @@ -4,6 +4,11 @@ log = logging.getLogger( __name__ ) +new_hgweb_config_template = """ +[paths] + +""" + class HgWebConfigManager( object ): def __init__( self ): self.hgweb_config_dir = None @@ -41,7 +46,13 @@ def hgweb_config( self ): hgweb_config = os.path.join( self.hgweb_config_dir, 'hgweb.config' ) if not os.path.exists( hgweb_config ): - raise Exception( "Required file %s does not exist - check config setting for hgweb_config_dir." % hgweb_config ) + # We used to raise an exception here... + # raise Exception( "Required file %s does not exist - check config setting for hgweb_config_dir." % hgweb_config ) + # ...but now we just log the missing file and create a new empty one. + log.debug( "Required file %s does not exist, so creating a new, empty file. Check your config setting for hgweb_config_dir." % hgweb_config ) + hgweb_config_file = open( hgweb_config, 'wb' ) + hgweb_config_file.write( new_hgweb_config_template ) + hgweb_config_file.close() return os.path.abspath( hgweb_config ) def make_backup( self ): # Make a backup of the hgweb.config file. 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