Skip to content

Commit

Permalink
improve schedule.py
Browse files Browse the repository at this point in the history
  • Loading branch information
monperrus committed Oct 1, 2024
1 parent 439750e commit 2d71f7c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/schedule.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#!/usr/bin/python3
# automate the preparation of the schedule
# usage ./schedule.py week4

import subprocess

# get current date and time
import datetime
import re
import sys

# get output of command ls

# get output of command ls
# and store it in a variable

WEEK="week4"
WEEK=sys.argv[1]

output = subprocess.getoutput("git log --oneline contributions/presentation/"+WEEK+" contributions/demo/"+WEEK+"/ contributions/scientific-paper/"+WEEK+"/").split("\n")
output.reverse()

Expand Down Expand Up @@ -47,7 +50,7 @@ def get_title(content):
# get commit hash
commit_hash = i.split(" ")[0]
# get list of files in the commit using git command
files = [x for x in subprocess.getoutput(f"git diff-tree --no-commit-id --name-only -r {commit_hash}").split("\n") if ".md" in x.lower() and ("presentation" in x or "demo" in x or "scientific-paper" in x )]
files = [x for x in subprocess.getoutput(f"git diff-tree --no-commit-id --name-only -r {commit_hash}").split("\n") if ".md" in x.lower() and ("presentation" in x or "demo" in x or "scientific-paper" in x ) and WEEK in x]
# print the commit hash
#print(commit_hash)
# get content of first file
Expand Down

0 comments on commit 2d71f7c

Please sign in to comment.