Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rachpt committed Jun 16, 2020
1 parent 1339a7b commit 31a045d
Show file tree
Hide file tree
Showing 18 changed files with 198 additions and 432 deletions.
320 changes: 0 additions & 320 deletions lanzou.ui

This file was deleted.

4 changes: 3 additions & 1 deletion lanzou/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from lanzou.api.core import LanZouCloud

__all__ = ['utils', 'types', 'models', 'LanZouCloud']
version = '2.5.0'

__all__ = ['utils', 'types', 'models', 'LanZouCloud', 'version']
1 change: 1 addition & 0 deletions lanzou/gui/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = '0.3.0'
15 changes: 9 additions & 6 deletions lanzou/gui/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import sys
from pickle import load, dump


__all__ = ['config']

KEY = 152
config_file = os.path.dirname(sys.argv[0]) + os.sep + '.config'

Expand Down Expand Up @@ -76,7 +76,6 @@ def decrypt(ksa, s):


def save_config(cf):
print(config_file)
with open(config_file, 'wb') as f:
dump(cf, f)

Expand Down Expand Up @@ -118,6 +117,7 @@ def update_user(self):
if self._name:
self._users[self._name] = (self._cookie, self._name, self._pwd,
self._work_id, self._settings)
save_config(self)

def del_user(self, name) -> bool:
name = self.encode(name)
Expand All @@ -139,13 +139,16 @@ def change_user(self, name) -> bool:
return True
return False

def get_users_name(self) -> list:
@property
def users_name(self) -> list:
return [self.decode(user) for user in self._users]

def get_user_info(self, name):
name = self.encode(name)
if name in self._users:
return self._users[name]
"""返回用户名、pwd、cookie"""
en_name = self.encode(name)
if en_name in self._users:
user_info = self._users[en_name]
return (name, self.decode(user_info[2]), self.decode(user_info[0]))

def default_path(self):
path = default_settings()['dl_path']
Expand Down
2 changes: 1 addition & 1 deletion lanzou/gui/dialogs/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from PyQt5.QtWidgets import (QPushButton, QDialog, QLabel, QFormLayout,
QDialogButtonBox, QVBoxLayout, QHBoxLayout)

from lanzou.gui.utils import others_style, btn_style
from lanzou.gui.qss import others_style, btn_style


class AboutDialog(QDialog):
Expand Down
2 changes: 1 addition & 1 deletion lanzou/gui/dialogs/captcha.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import (QLineEdit, QDialog, QLabel, QDialogButtonBox, QVBoxLayout)

from lanzou.gui.utils import others_style, btn_style
from lanzou.gui.qss import others_style, btn_style

class CaptchaDialog(QDialog):
captcha = pyqtSignal(object)
Expand Down
Loading

0 comments on commit 31a045d

Please sign in to comment.