Skip to content

Commit

Permalink
Add __main__.py for creating OAuth token
Browse files Browse the repository at this point in the history
  • Loading branch information
bhrutledge committed Nov 29, 2019
1 parent 32fbebe commit c591a97
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -10,4 +10,6 @@ dist
.idea/
.tox/
.DS_Store
example
example
venv
.env
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -78,7 +78,7 @@ Run

::

python ./trello/util.py
python -m trello oauth

Required Python modules
=======================
Expand Down
17 changes: 17 additions & 0 deletions trello/__main__.py
@@ -0,0 +1,17 @@
import sys

from trello.util import create_oauth_token


def main():
try:
command = sys.argv[1]
except IndexError:
return

if command == "oauth":
create_oauth_token()


if __name__ == "__main__":
sys.exit(main())
3 changes: 0 additions & 3 deletions trello/util.py
Expand Up @@ -87,7 +87,4 @@ def create_oauth_token(expiration=None, scope=None, key=None, secret=None, name=

return access_token

if __name__ == '__main__':
create_oauth_token()

# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4

0 comments on commit c591a97

Please sign in to comment.