def start(): try: command =input('Your Command is: ') except IOError: print('IOError') else: if command=="index": index.get() start() if command=='exit': exit; else:getstock.get(command);start()
def write_index(self): index_path = os.path.join(self.unity["root"], "index.html") if os.path.exists(index_path): os.remove(index_path) file(index_path, "w").write(index.get(self))
def find_matches(self, requirement): candidates = [] for c in get(requirement.name, requirement.extras): version = str(c.version) if version in requirement.specifier and c.filetype == "wheel": candidates.append(c) return candidates
def get(self, key, value): "A simple query for a key=value" value = str(value) cachekey = "%s:%s" % (key, value) try: return self.cache[cachekey] except KeyError: pass self.oups += 1 index = self._index(key) try: b = index.get(value) v = bitset.fromblob(self.cpt, b) except KeyError: v = bitset.empty(self.cpt) self.cache[cachekey] = v return v
from index import get, post, put filter_request = { 'page': 0, 'size': 3, } print(get('demo/', filter_request))