Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 2 new functions (trademark info, history of changes) #72

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions pyladies/main.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import argparse
import sys
import webbrowser
import os

import pkg_resources

Expand All @@ -19,29 +20,59 @@ def _handbook():
_exit_code = 1


def _trade_mark_info():
global _exit_code
print('The PyLadies wordmark and logo is trademarked.')

webbrowser.open("http://kit.pyladies.com/en/latest/misc/trademark.html")

_exit_code = 1

def _change_log():
global _exit_code

os.chdir(os.getcwd()[::-1][9::][::-1])

with open('CHANGES.md', 'r', encoding='utf-8') as f:
print(f.read())
f.close()

_exit_code = 1




def main(argv=sys.argv[1:]):
global _old_hook
global _exit_code

dist = pkg_resources.get_distribution('pyladies')

parser = argparse.ArgumentParser(
description="Everything you need to start your own PyLadies location"
)
parser.add_argument(
'handbook',
'--handbook',
help='read the handbook',
)
parser.add_argument('--version',
action='version', default=argparse.SUPPRESS,
version=dist.version,
parser.add_argument('--version', action='version', default=argparse.SUPPRESS, version=dist.version, \
help="show program's version number and exit"
)

parser.add_argument('--trademark', help='show trademark info')
parser.add_argument('--history', help='Here u can see changes of program versions')

parsed_args = parser.parse_args(argv)

if parsed_args.handbook:
_handbook()
return _exit_code
elif parsed_args.trademark:
_trade_mark_info()
return _exit_code
elif parsed_args.history:
_change_log()
return _exit_code


if __name__ == '__main__':
Expand Down