123456789101112131415161718192021222324252627282930 |
- import model
- from util import random_chars
- def generate_keys(count=1):
-
- for i in range(count):
- key = '-'.join(random_chars(5) for _ in range(5))
- model.save_key(key)
- print(key)
- def unused_keys():
- print("\n".join(model.unused_keys()))
- def cleanup():
- if model.connection is not None:
- model.connection.commit()
- model.connection.close()
- if __name__ == '__main__':
- generate_keys(count=2)
- print(model.new_stocks(timeout=30, count=1))
-
-
- cleanup()
|