-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from GrbavaCigla/dev
Added __main__.py and it's entry
- Loading branch information
Showing
3 changed files
with
63 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from .main import RandomProfile | ||
import argparse | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-n", help="Number of random profiles", type=int, default=1) | ||
|
||
group = parser.add_mutually_exclusive_group() | ||
group.add_argument( | ||
"-f", | ||
"--fullname", | ||
help="Get full name instead of first name", | ||
action="store_true", | ||
) | ||
group.add_argument( | ||
"-p", | ||
"--profile", | ||
help="Get full profile instead of first name", | ||
action="store_true", | ||
) | ||
group.add_argument( | ||
"-l", | ||
"--lastname", | ||
help="Get last name instead of first name", | ||
action="store_true", | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
rp = RandomProfile(args.n) | ||
if args.fullname: | ||
print(*rp.full_name(), sep="\n") | ||
elif args.profile: | ||
print(*rp.full_profile(), sep="\n") | ||
elif args.lastname: | ||
print(*rp.last_name(), sep="\n") | ||
else: | ||
print(*rp.first_name()) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,32 @@ | ||
import setuptools | ||
|
||
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
setuptools.setup( | ||
#Here is the module name. | ||
# Here is the module name. | ||
name="random_profile", | ||
|
||
#version of the module | ||
# version of the module | ||
version="0.1.0", | ||
|
||
#Name of Author | ||
# Name of Author | ||
author="CodePerfectPlus", | ||
|
||
#your Email address | ||
# your Email address | ||
author_email="[email protected]", | ||
|
||
#Small Description about module | ||
# Small Description about module | ||
description="Generate Random Profile", | ||
|
||
long_description=long_description, | ||
|
||
#Specifying that we are using markdown file for description | ||
# Specifying that we are using markdown file for description | ||
long_description_content_type="text/markdown", | ||
|
||
#Any link to reach this module, if you have any webpage or github profile | ||
# Any link to reach this module, if you have any webpage or github profile | ||
url="https://github.com/codePerfectPlus/Random-Profile-Generator", | ||
packages=setuptools.find_packages(), | ||
|
||
#classifiers like program is suitable for python3, just leave as it is. | ||
# classifiers like program is suitable for python3, just leave as it is. | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
], | ||
entry_points={ | ||
"console_scripts": ["random_profile = random_profile.__main__:main"], | ||
}, | ||
) |