Skip to content

Commit 14cd043

Browse files
committed
added among us letter and put all stderr to dev/null
1 parent 51fcf2c commit 14cd043

2 files changed

Lines changed: 29 additions & 15 deletions

File tree

github-artist.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
def add_random_letter_to_file(repo, file_name):
88
command = f'cd {repo} && echo "a" >> {file_name}'
9-
subprocess.call(command, shell=True, stdout=subprocess.DEVNULL)
9+
subprocess.call(command, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
1010

1111
def git_add_all_to_stage(repo):
1212
command = f'cd {repo} && git add .'
13-
subprocess.call(command, shell=True, stdout=subprocess.DEVNULL)
13+
subprocess.call(command, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
1414

1515
def git_commit_with_specified_date(repo, date, commit_message = None):
1616
command = f'cd {repo} && git commit --date="{date}" -m "{date}"'
17-
subprocess.call(command, shell=True, stdout=subprocess.DEVNULL)
17+
subprocess.call(command, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
1818

1919
def make_commit_with_specified_date(repo, date, commit_message = None):
2020
add_random_letter_to_file(repo, "test")
@@ -43,18 +43,22 @@ def clone_repo_if_not_exists_already(username, repo, protocol = "ssh"):
4343
def execute(repo, date, numbers_of_commits_per_day = 1):
4444
commits = 0
4545
total_commits = len(dates) * numbers_of_commits_per_day
46+
time_per_commit = None
4647
print("Info:")
4748
print(f"Number of dates: {len(dates)}")
4849
print(f"Number of commits per day: {numbers_of_commits_per_day}")
4950
print(f"Number of commits: {total_commits}")
5051
print("-" * 70)
5152
for date in dates:
5253
for i in range(numbers_of_commits_per_day):
53-
start_time = datetime.now()
54-
make_commit_with_specified_date(repo, date)
55-
end_time = datetime.now()
56-
total_seconds = (end_time - start_time).total_seconds()
57-
eta = total_seconds * (total_commits - commits)
54+
if not time_per_commit:
55+
start_time = datetime.now()
56+
make_commit_with_specified_date(repo, date)
57+
end_time = datetime.now()
58+
time_per_commit = (end_time - start_time).total_seconds()
59+
else:
60+
make_commit_with_specified_date(repo, date)
61+
eta = time_per_commit * (total_commits - commits)
5862
formatted_eta = str(timedelta(seconds=int(eta)))
5963
commits += 1
6064
percentage = (commits / total_commits) * 100

letters.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,13 @@
362362
],
363363

364364
" ": [
365-
[0, 0],
366-
[0, 0],
367-
[0, 0],
368-
[0, 0],
369-
[0, 0],
370-
[0, 0],
371-
[0, 0],
365+
[0],
366+
[0],
367+
[0],
368+
[0],
369+
[0],
370+
[0],
371+
[0],
372372
],
373373

374374
".": [
@@ -389,6 +389,16 @@
389389
[0],
390390
[1],
391391
[1],
392+
],
393+
394+
"x": [
395+
[0, 0, 0, 1, 1, 1, 0],
396+
[0, 0, 1, 0, 0, 1, 0],
397+
[0, 1, 1, 0, 1, 1, 1],
398+
[1, 0, 1, 0, 1, 1, 1],
399+
[0, 1, 1, 0, 0, 1, 0],
400+
[0, 0, 1, 1, 1, 1, 0],
401+
[0, 0, 1, 0, 0, 1, 0]
392402
]
393403

394404
}

0 commit comments

Comments
 (0)