def compileProxy(path, human): name = os.path.basename(path) try: npzpath = os.path.splitext(path)[0] + '.mhpxy' try: proxy_ = proxy.loadTextProxy(human, path, type=None) except: print(('Could not load proxy file {}.'.format(path))) import traceback traceback.print_exc(file=sys.stdout) return False proxy.saveBinaryProxy(proxy_, npzpath) except: print(('Unable to save compiled proxy for file {}'.format(path))) import traceback traceback.print_exc(file=sys.stdout) if os.path.isfile(npzpath): # Remove file again, in case an empty file is left try: os.remove(npzpath) except: pass return False return True
def compileProxy(path, human): name = os.path.basename(path) try: npzpath = os.path.splitext(path)[0] + '.mhpxy' try: proxy_ = proxy.loadTextProxy(human, path, type=None) except: print 'Could not load proxy file %s.' % path import traceback traceback.print_exc(file=sys.stdout) return False proxy.saveBinaryProxy(proxy_, npzpath) except: print 'Unable to save compiled proxy for file %s' % path import traceback traceback.print_exc(file=sys.stdout) if os.path.isfile(npzpath): # Remove file again, in case an empty file is left try: os.remove(npzpath) except: pass return False return True
def compileProxy(path, human): name = os.path.basename(path) try: npzpath = os.path.splitext(path)[0] + '.mhpxy' try: proxy_ = proxy.loadTextProxy(human, path, type=None) except: print 'Could not load proxy file %s.' % path import traceback traceback.print_exc(file=sys.stdout) return False proxy.saveBinaryProxy(proxy_, npzpath) except: print 'Unable to save compiled proxy for file %s' % path #import traceback #traceback.print_exc(file=sys.stdout) return False return True