genome_dict = getAvailableGenomes(genome_dir)
mapper_dict = constructMapperDict(genome_dict)
+ logging.debug(data)
+
f = open(cfg_filepath, 'w')
f.write(data % (mapper_dict))
f.close()
- return True
+ return True
from optparse import OptionParser, IndentedHelpFormatter
from ConfigParser import SafeConfigParser
+import logging
import os
import sys
-import urllib
+import urllib2
CONFIG_SYSTEM = '/etc/ga_frontend/ga_frontend.conf'
CONFIG_USER = os.path.expanduser('~/.ga_frontend.conf')
f = open(output_filepath, 'w')
#try:
- web = urllib.urlopen(url)
+ try:
+ web = urllib2.urlopen(url)
+ except urllib2.URLError, e:
+ errmsg = 'URLError: %d' % (e.code,)
+ logging.error(errmsg)
+ logging.error('opened %s' % (url,))
+ logging.error('%s' % ( e.read(),))
+ raise IOError(errmsg)
+
#except IOError, msg:
# if str(msg).find("Connection refused") >= 0:
# print 'Error: Connection refused for: %s' % (url)
f.write(data)
web.close()
f.close()
- print 'Wrote config file to %s' % (output_filepath)
+ logging.info('Wrote config file to %s' % (output_filepath,))