示例#1
0
文件: cache.py 项目: smurfix/pybble
	def run(self, args=(), db=None,key=None, help=False):
		if help or not key:
			self.parser.print_help()
			sys.exit(not help)
		if db is None:
			r = config.regions['default'].backend.client
		else:
			import dbm
			r = dbm.open(db,'r')
		n = delete(*key)
		if not n:
			print("Key not found")
		elif n == 1:
			print("Entry deleted")
		else:
			print("{} entries deleted".format(n))
示例#2
0
文件: cache.py 项目: smurfix/pybble
 def run(self, args=(), db=None, key=None, help=False):
     if help or not key:
         self.parser.print_help()
         sys.exit(not help)
     if db is None:
         r = config.regions['default'].backend.client
     else:
         import dbm
         r = dbm.open(db, 'r')
     n = delete(*key)
     if not n:
         print("Key not found")
     elif n == 1:
         print("Entry deleted")
     else:
         print("{} entries deleted".format(n))
示例#3
0
    def __call__(self, app, *args):
        from pytest import main as testmain
        from pybble import cache

        cache.delete("*")
        testmain(*args)
示例#4
0
文件: test.py 项目: smurfix/pybble
	def __call__(self,app, *args):
		from pytest import main as testmain
		from pybble import cache

		cache.delete("*")
		testmain(*args)