diff options
Diffstat (limited to 'otp2289/__init__.py')
| -rw-r--r-- | otp2289/__init__.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/otp2289/__init__.py b/otp2289/__init__.py new file mode 100644 index 0000000..d2f6386 --- /dev/null +++ b/otp2289/__init__.py | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | """A pure Python implementation of RFC-2289""" | ||
| 3 | |||
| 4 | from .generator import (OTP_ALGO_MD5, | ||
| 5 | OTP_ALGO_SHA1, | ||
| 6 | OTPGenerator, | ||
| 7 | OTPGeneratorException) | ||
| 8 | |||
| 9 | |||
| 10 | __author__ = 'Simeon Simeonov' | ||
| 11 | __version__ = '1.0.0' | ||
| 12 | __license__ = 'GPL3' | ||
| 13 | |||
| 14 | |||
| 15 | def int_or_str(value): | ||
| 16 | """Returns int value of value when possible""" | ||
| 17 | try: | ||
| 18 | return int(value) | ||
| 19 | except ValueError: | ||
| 20 | return value | ||
| 21 | |||
| 22 | |||
| 23 | VERSION = tuple(map(int_or_str, __version__.split('.'))) | ||
| 24 | |||
| 25 | __all__ = ['OTP_ALGO_MD5', | ||
| 26 | 'OTP_ALGO_SHA1', | ||
| 27 | 'OTPGenerator', | ||
| 28 | 'OTPGeneratorException'] | ||
