def get_kind(sfield, fileo): """Return kinds value from file object.""" filename = fileo.filename elms = filename.split('_') name = elms[0] obj = Value._instance(None, sfield, name, name, name) return obj
def get_node(nfield, fileo): """Return node value form file object.""" path_elms = fileo.path.split('/') region = path_elms[0] node = path_elms[1] name = '{}_{}'.format(region, node) name = normalize_path_elms(name) part = os.path.join(region, node) obj = Value._instance(None, nfield, name, part, name) nfield._values.add(obj) return obj
def get_kind(sfield, fileo): """Return kind value from file object.""" filename = fileo.filename part = filename.split('-')[0] return Value._instance(None, sfield, part, part, part)