예제 #1
0
 def resolve_dataval(self):
     if self.string_callback is not None:
         decoded_dataval = decode_datavalue(self.ref)
         self.string_callback(decoded_dataval)
     else:
         create_datavalue_file(self.ref)
         self.set_filename(filename_for_ref(self.ref), True)
         self.result(True, None)
예제 #2
0
파일: fetcher.py 프로젝트: ZubairNabi/ciel
 def resolve_dataval(self):
     if self.string_callback is not None:
         decoded_dataval = decode_datavalue(self.ref)
         self.string_callback(decoded_dataval)
     else:
         create_datavalue_file(self.ref)
         self.set_filename(filename_for_ref(self.ref), True)
         self.result(True, None)
예제 #3
0
 def use_local_file(self):
     filename = filename_for_ref(self.ref)
     if os.path.exists(filename):
         self.set_filename(filename, True)
         self.result(True, None)
     else:
         raise PlanFailedError(
             "Plan use-local-file failed for %s: no such file %s" %
             (self.ref, filename), "BLOCKSTORE", logging.DEBUG)
예제 #4
0
파일: fetcher.py 프로젝트: ZubairNabi/ciel
 def use_local_file(self):
     filename = filename_for_ref(self.ref)
     if os.path.exists(filename):
         self.set_filename(filename, True)
         self.result(True, None)
     else:
         raise PlanFailedError(
             "Plan use-local-file failed for %s: no such file %s" % (self.ref, filename), "BLOCKSTORE", logging.DEBUG
         )
예제 #5
0
파일: producer.py 프로젝트: ZubairNabi/ciel
def write_fixed_ref_string(string, fixed_ref):
    output_ctx = make_local_output(fixed_ref.id)
    with open(filename_for_ref(fixed_ref), "w") as fp:
        fp.write(string)
    output_ctx.close()
예제 #6
0
def write_fixed_ref_string(string, fixed_ref):
    output_ctx = make_local_output(fixed_ref.id)
    with open(filename_for_ref(fixed_ref), "w") as fp:
        fp.write(string)
    output_ctx.close()