Skip to content

Commit

Permalink
Merge pull request #1 from JiangGua/master
Browse files Browse the repository at this point in the history
修复体育课报NoneType found错误的问题
  • Loading branch information
1970633640 authored Jan 19, 2020
2 parents 57f09a7 + e40ce01 commit 8f815ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions json_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
cal.add('X-WR-TIMEZONE','Asia/Shanghai')

MODE = "CN"
FIRST = datetime.strptime("2019-09-01 00:00:00","%Y-%m-%d %H:%M:%S").astimezone(timezone("Asia/Shanghai")) # 学期第一周的周日,即开学前一天
FIRST = datetime.strptime("2020-02-16 00:00:00","%Y-%m-%d %H:%M:%S").astimezone(timezone("Asia/Shanghai")) # 学期第一周的周日,即开学前一天

s = str(open("1.json", 'r', encoding='UTF-8').readlines())
xx = demjson.decode(s)
Expand All @@ -21,8 +21,8 @@
ii = 0
for c in x['studentTableVm']['activities']:
summary = c['courseName']
location = " ".join([c['campus'], c['room']])
description = " ".join([c['campus'], c['building'], " ".join(c['teachers']), c['weeksStr'] + "周", c['lessonCode'],
location = " ".join([c['campus'] or c['customPlace'], c['room'] or ''])
description = " ".join([c['campus'] or c['customPlace'], c['building'] or '', " ".join(c['teachers']), c['weeksStr'] + "周", c['lessonCode'],
str(c['credits']) + '学分'])
status = 0 # 0每周 1单周 2双周
weeksStr = str(c['weeksStr'])
Expand Down

0 comments on commit 8f815ae

Please sign in to comment.