fix color not enough
This commit is contained in:
parent
80ad7feaef
commit
0307791891
@ -235,7 +235,9 @@ def getSchedule(Ip, S):
|
|||||||
temp_lesson['color'] = lesson_set[l['Content'][0]['Name']]
|
temp_lesson['color'] = lesson_set[l['Content'][0]['Name']]
|
||||||
else:
|
else:
|
||||||
color = random.randint(0, 8)
|
color = random.randint(0, 8)
|
||||||
while color_set[color] and color_used:
|
while color_set[color]:
|
||||||
|
if color_used <= 0:
|
||||||
|
break;
|
||||||
color = random.randint(0, 8)
|
color = random.randint(0, 8)
|
||||||
temp_lesson['color'] = color
|
temp_lesson['color'] = color
|
||||||
lesson_set[l['Content'][0]['Name']] = color
|
lesson_set[l['Content'][0]['Name']] = color
|
||||||
@ -272,4 +274,10 @@ def getSchedule(Ip, S):
|
|||||||
temp_lesson['Time_split'] = Time
|
temp_lesson['Time_split'] = Time
|
||||||
lesson[i][j*2+k].append(temp_lesson)
|
lesson[i][j*2+k].append(temp_lesson)
|
||||||
data_cache = {'lesson':lesson,'days_per_week':days_per_week,'cur_week':CurWeek}
|
data_cache = {'lesson':lesson,'days_per_week':days_per_week,'cur_week':CurWeek}
|
||||||
return {'errcode': 200, 'errmsg': 'ok', 'data': data_cache}
|
return {'errcode': 200, 'errmsg': 'ok', 'data': data_cache}
|
||||||
|
|
||||||
|
data = connection('2018002129','cust5313.','')
|
||||||
|
print(data)
|
||||||
|
print(getGrade(data['ip'],data['s']))
|
||||||
|
|
||||||
|
print(getSchedule(data['ip'],data['s']))
|
Loading…
x
Reference in New Issue
Block a user