Browse Source

Ignore credentials, fix terminal printing and new credentials saving

Cammy 7 năm trước cách đây
mục cha
commit
f317458b2f
4 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 2 0
      .gitignore
  2. 4 4
      cAuthCookie.py
  3. 0 2
      cMain.py
  4. 0 0
      credentials.json

+ 2 - 0
.gitignore

@@ -1 +1,3 @@
 *.pyc
+
+credentials\.json

+ 4 - 4
cAuthCookie.py

@@ -55,7 +55,7 @@ def login(username, password):
             # login new
             api = Client(
                 username, password,
-                on_login=lambda x: onlogin_callback(x, settings))
+                on_login=lambda x: onlogin_callback(x, settings_file))
         else:
             with open(settings_file) as file_data:
                 cached_settings = json.load(file_data, object_hook=from_json)
@@ -78,13 +78,13 @@ def login(username, password):
             on_login=lambda x: onlogin_callback(x, settings))
 
     except ClientLoginError as e:
-        print('[E] ClientLoginError {0!s}'.format(e), "RED")
+        cLogger.log('[E] ClientLoginError: {0!s}'.format(e), "RED")
         exit(9)
     except ClientError as e:
-        print('[E] ClientError {0!s} (Code: {1:d}, Response: {2!s})'.format(e.msg, e.code, e.error_response), "RED")
+        cLogger.log('[E] ClientError: {0!s}'.format(e), "RED")
         exit(9)
     except Exception as e:
-        print('[E] Unexpected Exception: {0!s}'.format(e), "RED")
+        cLogger.log('[E] Unexpected Exception: {0!s}'.format(e), "RED")
         exit(99)
 
     # Show when login expires

+ 0 - 2
cMain.py

@@ -14,8 +14,6 @@ from socket import timeout
 from ssl import SSLError
 from urllib2 import URLError
 
-# "naxunaw" "pyinstalive" "credentials.json"
-
 global api, args, seperator
 parser = argparse.ArgumentParser(description='Login')
 parser.add_argument('-u', '--username', dest='username', type=str, required=True)

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
credentials.json


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác