if user == username and passwd == password:
print("\033[32;1mUser has passed authentication\033[0m")
res = func(*args, **kwargs)
print("atfer".center(60, "-"))
return res
else:
exit("\033[32;1mInvalid username or password \033[0m")
elif auth_type == 'ldap':
print("搞毛线ldap, 啥都不会 。。 。。。 ")
return wrapper
return outer_wrapper
def index():
print("welcome to index page")
@auth(auth_type='local')
def home():
print("welcome to home page")
return "from home"
@auth(auth_type='ldap')
def bbs():
print("welcome to bbs page")
def producer(name):
c = consumer('A')
c2 = consumer('B')
c.__next__()
c2.__next__()
print("老子开始准备做包子了!!!")
for i in range(10):
time.sleep(1)
print("做了两个包子!!!!")
c.send(i)
c2.send(i)
def producer(name):
c = consumer('A')
c2 = consumer('B')
c.__next__()
c2.__next__()
print("老子开始准备做包子了!!!")
for i in range(10):
time.sleep(1)
print("做了两个包子!!!!")
c.send(i)
c2.send(i)