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

Issue#15 #19

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions alumni.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"gauravrpjain
bad-smruti
OrkoHunter
AvijitGhosh82
kshitij10496
mayank-kgp
Shorit
nishnik
62 changes: 62 additions & 0 deletions autogen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
"""
This script generates .txt from the secrets/Contacts repo.
The name of the .txt file will be the same as that of the .csv file used.
Please provide the path to the Contacts folder while running the script.
e.g: python autogen.py ../secrets/Contacts/
(The last '/' is mandatory.)
Note: Latest year = freshers, latest - 1 = executives,
<latest - 2 = seniors, hyphen joined filename = Alumni
"""

import os
import os.path
import sys
import glob

pathname = sys.argv[1]
filelist = glob.glob(pathname + "*.csv")

namemap = dict()
yearlist = list()

for csv in filelist:
f = os.path.basename(csv)[:-4]
if '-' in f:
"""
Many old year members punched into one file.
Must be our respected alumni.
"""
namemap[f] = "alumni"
else:
yearlist.append(int(f))

yearlist.sort()
namemap[str(yearlist[-1])] = "freshers"
namemap[str(yearlist[-2])] = "executives"
for i in yearlist[:-2]:
namemap[str(i)] = "seniors"


for csv in filelist:
f = open(csv, "r")
w = open(namemap[os.path.basename(csv)[:-4]] + ".txt", "w")

f.readline()
for line in f.readlines():
handle = line.split(",")[5]
handle = handle.strip()
handle = handle.split("/")[0]
w.write(handle+'\n')

print ".txt files generated!. Do you want to run json_maker.py and main.py?"
choice = str(raw_input(" [y/n] "))

if choice == "y":
os.system("python json_maker.py")
os.system("python main.py")
elif choice == "n":
print "Bye!"
else:
print "Unknown choice entered! Aborting"

print "\n"
27 changes: 15 additions & 12 deletions executives.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
pungi-man
defcon
anomaly_
shubham5
madan96
parthvader
pratham_pc
tormenta
shikha
minatox
mr-yamraj
saksham0037
berserker
xypnox
anushkashukla
arnav-t
Ayushk4
Gaurav314
themousepotato
nikhilch23
PetalsOnWind
piyush27ranjan
krritik
thealphadollar
taapasX28
vivekrj0
yashrsharma44
35 changes: 12 additions & 23 deletions freshers.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
jsadhi05
amritashbharadwaj
ankita13
rava-dosa
aribis369
aryan
ashishkg
obitors
chelsi
dj.barnwal
dibyadas
hn2907
kev6808
tibrewalpratik17
vernwalrahul
roshni
sachin.uttarwar007
samruddhi
rishukid
americast
shaildaswani
deadshourya
sipah00
aman11verma
AnjayGoel
debajyotidasgupta
mukul-kgp
Shankusu7
parthmax99
N
rka87338
rajuthegr8
grapheo12
soumyajit
runtimeTerror
28 changes: 9 additions & 19 deletions seniors.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
gauravrpjain
bad-smruti
orkohunter
avijit
kshitij10496
mayank-kgp
pr4nay
rik
nishnik
anomaly_
defcon
nitinkgp23
DefCon-007
madan96
parthvader
pungi-man
Parth-Vader
pranitbauva1997
shubham5
saksham0037
shikha
pratham_pc
minato
tormenta
mr-yamraj
shikhapanwar
pratham-pc

sangeet259
americast