def full_names(self): if not self._full_names: fn = util.data_file(op.join('tectonics', 'gsrm1_plates.txt')) with open(fn, 'r') as f: self._full_names = dict(line.strip().split(None, 1) for line in f) return self._full_names
def full_names(self): if not self._full_names: fn = util.data_file(op.join('tectonics', 'gsrm1_plates.txt')) with open(fn, 'r') as f: self._full_names = dict( line.strip().split(None, 1) for line in f) return self._full_names
def cpt(name): if os.path.exists(name): return name if not re.match(r'[A-Za-z0-9_]+', name): raise Exception('invalid cpt name') fn = util.data_file(os.path.join('colortables', '%s.cpt' % name)) if not os.path.exists(fn): raise Exception('cpt file does not exist: %s' % fn) return fn