Ver Fonte

Ignore credentials, fix terminal printing and new credentials saving

Cammy há 7 anos atrás
pai
commit
f317458b2f
4 ficheiros alterados com 6 adições e 6 exclusões
  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)

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
credentials.json


Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff