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

Minimum Commits Daily. #27

Closed
wants to merge 4 commits into from
Closed
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
16 changes: 14 additions & 2 deletions contribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,37 @@ def message(date):

def contributions_per_day(args):
max_c = args.max_commits
min_c = args.min_commits
if max_c > 20:
max_c = 20
if max_c < 1:
max_c = 1
return randint(1, max_c)
if min_c < 1:
min_c = 1
if min_c > max_c:
min_c, max_c = max_c, min_c
return randint(min_c, max_c)


def arguments(argsval):
parser = argparse.ArgumentParser()
parser.add_argument('-nw', '--no_weekends',
required=False, action='store_true', default=False,
help="""do not commit on weekends""")
parser.add_argument('-mc', '--max_commits', type=int, default=10,
parser.add_argument('-maxc', '--max_commits', type=int, default=10,
required=False, help="""Defines the maximum amount of
commits a day the script can make. Accepts a number
from 1 to 20. If N is specified the script commits
from 1 to N times a day. The exact number of commits
is defined randomly for each day. The default value
is 10.""")
parser.add_argument('-minc', '--min_commits', type=int, default=1,
required=False, help="""Defines the minimum amount of
commits a day the script can make. Accepts a number
from 1 to 20. If N is specified the script commits
from N to max_commits times a day. The exact number of commits
is defined randomly for each day. The default value
is 1.""")
parser.add_argument('-fr', '--frequency', type=int, default=80,
required=False, help="""Percentage of days when the
script performs commits. If N is specified, the script
Expand Down
Loading