def upload(dot_path, svg_path, function_address, tag, par_tag): try: #get the file's hashcode dot_hashvalue = hashfile(dot_path) svg_hashvalue = hashfile(svg_path) if dot_hashvalue is None or svg_hashvalue is None : return False if udload.upload_to_ceph(dot_path, dot_hashvalue) == False or udload.upload_to_ceph(svg_path, svg_hashvalue) == False : return False if db_operation.add_ImageMagick_match(dot_hashvalue, svg_hashvalue, function_address, tag, par_tag) < 0: return False return True except Exception, e: print e return False
def upload(fpath, commit, repo): try: hashvalue = hashfile(fpath) if hashvalue is None: return False hashvalue += '.zip' if udload.upload_to_ceph(fpath, hashvalue) == False: return False if db_operation.add_commit_version(hashvalue, commit, repo) < 0: return False return True except Exception, e: print e return False
def upload(fpath, fname, tag): try: #get the file's hashcode hashvalue = hashfile(fpath) if hashvalue is None: return False if udload.upload_to_ceph(fpath, hashvalue) == False: return False if db_operation.add_ImageMagick_bin(hashvalue, fname, tag) < 0: return False return True except Exception, e: print e return False