Commit d2e47eeb authored by Norris Hua's avatar Norris Hua
Browse files

bug fix

parent 3b615806
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -19,11 +19,10 @@ def newConfig():
    username=input('Username: ')
    passwd=input('Password: ')
    f=open('config.json','w')
    config={"username": username, "password": passwd, "testUrl": "http://www.v2ex.com/generate_204", "interval_retry_connection": "30", "interval_retry_login": "30", "interval_check_status": "300", "max_times_retry_login": "5"}
    config={"username": username, "password": passwd, "testUrl": "http://www.v2ex.com/generate_204", "interval_retry_connection": "30", "interval_retry_login": "30", "interval_check_status": "60", "max_times_retry_login": "5"}
    f.write(json.dumps(config))
    f.close()
    printWithTimeStamp('Configurations successfully saved.')    
    return config
    
def readConfig():
    try:
@@ -54,7 +53,8 @@ def loadConfig():
        return readConfig()
    else:
        printWithTimeStamp('No configuration file found.')
        return newConfig()
        newConfig()
        return readConfig()

def ifLoggedIn(test):
    if test.status_code==204:
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ requests 2.10.0
'username': Your SUSTC studnet ID   
'password': CAS login password  
'interval_retry_connection': In second. If the status check failed (e.g. the server was down or there is no Internet connection), how long the program will wait before next attempt. Default value is 30.  
'interval_check_status':  In second. Determine how long the program will wait before next status check. Default value is 300.  
'interval_check_status':  In second. Determine how long the program will wait before next status check. Default value is 60.  
'interval_retry_login':  In second. If the login failed (e.g. wrong username & password combination, or the CAS server was down), how long the program will wait before next attempt. Default value is 30.  
'max_times_retry_login': Maximum time the program will try to login to the server. Default value is 5.
## Contacts