コード例 #1
0
ファイル: pump_csv.py プロジェクト: couchbase/couchbase-cli
    def check(opts, spec, source_map) -> Tuple[couchbaseConstants.PUMP_ERROR, Any]:
        rv: couchbaseConstants.PUMP_ERROR = 0
        if spec.endswith(".csv"):
            if spec.startswith(CSVSink.CSV_JSON_SCHEME):
                targetpath = spec[len(CSVSink.CSV_JSON_SCHEME):]
            else:
                targetpath = spec[len(CSVSink.CSV_SCHEME):]
            targetpath = os.path.normpath(targetpath)
            rv = pump.mkdirs(targetpath)

        return rv, None
コード例 #2
0
ファイル: pump_csv.py プロジェクト: uajaykumar/couchbase-cli
    def check(opts, spec, source_map):
        rv = 0
        if spec.endswith(".csv"):
            if spec.startswith(CSVSink.CSV_JSON_SCHEME):
                targetpath = spec[len(CSVSink.CSV_JSON_SCHEME):]
            else:
                targetpath = spec[len(CSVSink.CSV_SCHEME):]
            targetpath = os.path.normpath(targetpath)
            rv = pump.mkdirs(targetpath)

        return rv, None
コード例 #3
0
ファイル: pump_csv.py プロジェクト: mikewied/couchbase-cli
    def check(opts, spec, source_map):
        rv = 0
        if spec.endswith(".csv"):
            if spec.startswith(CSVSink.CSV_JSON_SCHEME):
                targetpath = spec[len(CSVSink.CSV_JSON_SCHEME):]
            else:
                targetpath = spec[len(CSVSink.CSV_SCHEME):]
            targetpath = os.path.normpath(targetpath)
            rv = pump.mkdirs(targetpath)

        return rv, None
コード例 #4
0
ファイル: pump_csv.py プロジェクト: pauldx/couchbase-cli
    def check(opts, spec,
              source_map) -> Tuple[couchbaseConstants.PUMP_ERROR, Any]:
        rv: couchbaseConstants.PUMP_ERROR = 0
        if spec.endswith(".csv"):
            if spec.startswith(CSVSink.CSV_JSON_SCHEME):
                targetpath = spec[len(CSVSink.CSV_JSON_SCHEME):]
            else:
                targetpath = spec[len(CSVSink.CSV_SCHEME):]
            targetpath = os.path.normpath(targetpath)
            rv = pump.mkdirs(targetpath)

        return rv, None
コード例 #5
0
ファイル: pump_bfd.py プロジェクト: abhijpes/couchbase-cli
 def write_index_file(sink_spec, source_bucket, index_defs, file_name):
     if index_defs:
         path = BFD.get_file_path(sink_spec, source_bucket['name'], file_name)
         try:
             rv = pump.mkdirs(path)
             if rv:
                 return rv, None
             f = open(path, 'w')
             f.write(index_defs)
             f.close()
         except IOError, e:
             return ("error: could not write %s; exception: %s") % (path, e), None
コード例 #6
0
ファイル: pump_bfd.py プロジェクト: couchbase/couchbase-cli
 def write_index_file(sink_spec: str, source_bucket: Dict[str, Any], index_defs: str, file_name: str):
     if index_defs:
         path = BFD.get_file_path(sink_spec, source_bucket['name'], file_name)
         try:
             rv = pump.mkdirs(path)
             if rv:
                 return rv, None
             f = open(path, 'w')
             f.write(index_defs)
             f.close()
         except IOError as e:
             return f'error: could not write {path}; exception: {e}', None
     return 0
コード例 #7
0
ファイル: pump_bfd.py プロジェクト: uajaykumar/couchbase-cli
 def write_index_file(sink_spec, source_bucket, index_defs, file_name):
     if index_defs:
         path = BFD.get_file_path(sink_spec, source_bucket['name'],
                                  file_name)
         try:
             rv = pump.mkdirs(path)
             if rv:
                 return rv, None
             f = open(path, 'w')
             f.write(index_defs)
             f.close()
         except IOError, e:
             return ("error: could not write %s; exception: %s") % (path,
                                                                    e), None
コード例 #8
0
ファイル: pump_bfd.py プロジェクト: huixiang/couchbase-cli
 def consume_design(opts, sink_spec, sink_map, source_bucket, source_map,
                    source_design):
     if source_design:
         fname = BFD.design_path(sink_spec, source_bucket['name'])
         try:
             rv = pump.mkdirs(fname)
             if rv:
                 return rv, None
             f = open(fname, 'w')
             f.write(source_design)
             f.close()
         except IOError, e:
             return ("error: could not write design: %s" +
                     "; exception: %s") % (fname, e), None
コード例 #9
0
 def write_index_file(sink_spec: str, source_bucket: Dict[str, Any],
                      index_defs: str, file_name: str):
     if index_defs:
         path = BFD.get_file_path(sink_spec, source_bucket['name'],
                                  file_name)
         try:
             rv = pump.mkdirs(path)
             if rv:
                 return rv, None
             f = open(path, 'w')
             f.write(index_defs)
             f.close()
         except IOError as e:
             return f'error: could not write {path}; exception: {e}', None
     return 0
コード例 #10
0
 def consume_design(opts, sink_spec, sink_map,
                    source_bucket, source_map, source_design):
     if source_design:
         fname = BFD.design_path(sink_spec,
                                 source_bucket['name'])
         try:
             rv = pump.mkdirs(fname)
             if rv:
                 return rv, None
             f = open(fname, 'w')
             f.write(source_design)
             f.close()
         except IOError, e:
             return ("error: could not write design: %s" +
                     "; exception: %s") % (fname, e), None