def execute(self): super(ConfigRequest, self).execute() configure.readConfig() for key in self.keys: if configure.CONFIG.has_key(key): self.values.append(configure.CONFIG[key]) else: raise KeyError('there is no config entry with the name \''+key+'\'') answer = {"type":self.type, "keys":self.keys, "values":self.values} return answer
def run(): m_info = configure.readConfig() work_dir = m_info['work_dir'] exist_runs = common.glob(work_dir + '/[0-9]*_[0-9]*') print 'Launch: ' print '%s: %s' %(0, 'Create new') print '\n'.join('%s: %s' %(i + 1, e) for i, e in enumerate(exist_runs)) idx = int(raw_input('Select work:')) if idx == 0: s_timestamp = workdir.setup(m_info) else: s_timestamp = common.getBasename(exist_runs[idx - 1]) workdir.makeWorkDirs(m_info, s_timestamp) runWork(m_info, s_timestamp)