22import subprocess , sys , os
33from datetime import date , timedelta , datetime
44from letters import stringToMatrix
5+ from logo import logo
56
67def add_random_letter_to_file (repo , file_name ):
78 command = f'cd { repo } && echo "a" >> { file_name } '
@@ -22,7 +23,10 @@ def make_commit_with_specified_date(repo, date, commit_message = None):
2223
2324def git_push_to_remote_repo (repo ):
2425 command = f"cd { repo } && git push"
25- subprocess .call (command , shell = True , stdout = subprocess .DEVNULL )
26+ print (f"Pushing..." , end = "\r " )
27+ subprocess .call (command , shell = True , stdout = subprocess .DEVNULL , stderr = subprocess .DEVNULL )
28+ print (f"Pushed successfully!" )
29+ print ("-" * 70 )
2630
2731def clone_repo_if_not_exists_already (username , repo , protocol = "ssh" ):
2832 if protocol == "ssh" :
@@ -31,7 +35,7 @@ def clone_repo_if_not_exists_already(username, repo, protocol = "ssh"):
3135 command = f"git clone https://github.com/{ username } /{ repo } .git"
3236
3337 if not os .path .exists (repo ):
34- subprocess .call (command , shell = True , stdout = subprocess .DEVNULL )
38+ subprocess .call (command , shell = True , stdout = subprocess .DEVNULL , stderr = subprocess . DEVNULL )
3539
3640
3741
@@ -43,7 +47,7 @@ def execute(repo, date, numbers_of_commits_per_day = 1):
4347 print (f"Number of dates: { len (dates )} " )
4448 print (f"Number of commits per day: { numbers_of_commits_per_day } " )
4549 print (f"Number of commits: { total_commits } " )
46- print ("-" * 50 )
50+ print ("-" * 70 )
4751 for date in dates :
4852 for i in range (numbers_of_commits_per_day ):
4953 start_time = datetime .now ()
@@ -56,6 +60,7 @@ def execute(repo, date, numbers_of_commits_per_day = 1):
5660 percentage = (commits / total_commits ) * 100
5761 print (f"Status: Commits: { commits } -- { percentage :.2f} % -- ETA: { formatted_eta } " , end = "\r " )
5862 print (f"Commits: { commits } -- 100%" )
63+ print ("-" * 70 )
5964
6065if __name__ == "__main__" :
6166
@@ -81,10 +86,14 @@ def execute(repo, date, numbers_of_commits_per_day = 1):
8186
8287
8388 # Start
84- print ("-" * 50 )
89+ print ("-" * 70 )
90+ print (logo )
91+ print ("-" * 70 )
8592 print (f"Starting write { message } to { username } 's github history." )
8693 print (f"Using repo: { username } /{ repo } " )
87- print ("-" * 50 )
94+ print ("-" * 70 )
8895 clone_repo_if_not_exists_already (username , repo )
8996 execute (repo , dates , number_of_commits_per_day )
90- git_push_to_remote_repo (repo )
97+ git_push_to_remote_repo (repo )
98+ print ("Art completed" )
99+ print ("-" * 70 )
0 commit comments