Skip to content

Commit

Permalink
cleanup unnecessary comments and code
Browse files Browse the repository at this point in the history
  • Loading branch information
Piees committed Jan 24, 2016
1 parent 88e8fef commit 737a916
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions allSoup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,20 @@ def sortByDate(list):
splitTr.append(s)

# remove non-class tr
for i in splitTr:
for y in i:
if re.search(".*Uke.*", y) != None:
year = y[y.index('Uke')+8:y.index('Uke')+12]
break
if (len(i) != 8):
splitTr.remove(i)
if year == "":
for i in splitTr:
for y in i:
if re.search(".*Uke.*", y) != None:
year = y[y.index('Uke')+8:y.index('Uke')+12]
break
# if (len(i) != 8):
# splitTr.remove(i)

# remove non-class tr not removed due to
# in-loop indexerror
for i in splitTr:
if (len(i) != 8):
splitTr.remove(i)
# for i in splitTr:
# if (len(i) != 8):
# splitTr.remove(i)

for i in splitTr:
temp = []
Expand All @@ -102,6 +103,7 @@ def sortByDate(list):
# append teacher name
dHold["tName"] = y[6][1:]
# test
# print year + str(textDateToInt(dHold['date'][3:])) + dHold['date'][:2] + dHold['time'].split("-")[0].replace(".", "")
dHold['dateVal'] = year + str(textDateToInt(dHold['date'][3:])) + dHold['date'][:2] + dHold['time'].split("-")[0].replace(".", "")
finalTr.append(dHold)
except:
Expand All @@ -117,8 +119,8 @@ def sortByDate(list):

courses = ast.literal_eval(courses)

for x in courses:
x['dateVal'] = year + str(textDateToInt(x['date'][3:])) + x['date'][:2] + x['time'].split("-")[0].replace(".", "")
#for x in courses:
# x['dateVal'] = year + str(textDateToInt(x['date'][3:])) + x['date'][:2] + x['time'].split("-")[0].replace(".", "")

t = open('textsoup.txt', 'w')
t.truncate()
Expand Down

0 comments on commit 737a916

Please sign in to comment.