def unlock(self): conf = config() if self.passwordLineEdit.text() == conf.decrypt(conf.getOption('system', 'password')): self.accept() else: self.Tips("密码错误,请重试") self.passwordLineEdit.setText("")
def __init__(self): self.conf = config() log = logger() self.path = os.path.dirname(os.path.realpath(sys.argv[0])) self.confwebdav = log.getlogger('webdav') self.options = {} self.client = None
def __init__(self): self.conf = config() self.systemName = self.conf.getOption('system', 'name') self.systemName = "tomato.exe" self.name = 'tomatoFarm' # 要添加的项值名称 self.path = '"' + os.path.abspath(self.systemName) + '" slient' # 要添加的exe路径 # 注册表项名 self.KeyName = 'Software\\Microsoft\\Windows\\CurrentVersion\\Run'
def __init__(self, filePath): self.file = filePath self.path = os.path.dirname(os.path.realpath(sys.argv[0])) log = logger() self.conf = config() self.confsql = log.getlogger('conf') self.webDav = webDavService() self.connect()
def __init__(self, parent=None): super(settingDialogImpl, self).__init__(parent) self.setupUi(self) self.conf = config() self.reg = winReg() self.loadConf() self.buttonBox.accepted.connect(self.saveConf) self.sqlite = sqlite('/config/tomato.db')
def __init__(self, parent=None): super(miniBarImpl, self).__init__(parent) self.setupUi(self) self.conf = config() log = logger() self.confmini = log.getlogger('gui') self.task = {} self.timer = QTimer() self.messageView = messageWidgetImpl() self.move(int(self.conf.getOption('miniBar', 'placeX')), int(self.conf.getOption('miniBar', 'placeY'))) self.taskLabel.setText("无","white") self.normalSizeButton.clicked.connect(self.normalSize) self.timer.timeout.connect(self.taskStageShow) self.redoButton.clicked.connect(self.redoTask) self.startButton.clicked.connect(self.startTask) self.pauseButton.clicked.connect(self.pauseTask) self.stopButton.clicked.connect(self.stopTask)
def __init__(self, parent=None): super(todoWidgetImpl, self).__init__(parent) self.setupUi(self) self.flag = False self.unLock = False self.mouseflag = False self.taskRan = False log = logger() self.conftodo = log.getlogger('gui') self.messageView = messageWidgetImpl() self.showHideWidget.setVisible(False) self.conf = config() self.checkLock() self.sqlite = sqlite('/config/tomato.db') self.move(int(self.conf.getOption('todoList', 'placeX')), int(self.conf.getOption('todoList', 'placeY'))) self.lockButton.clicked.connect(self.checkLock) #锁定/解锁 self.changeButton.clicked.connect(self.changeCurrentPage) #切换当前页面
# -*- coding: utf-8 -*- # @Time : 2020/11/13 10:49 # @Author : Jaywatson # @File : config.py.py # @Soft : new_control from __future__ import print_function from __future__ import division import os from util.loadConf import config con = config() N_PIXELS = int(con.getOption('system', 'N_PIXELS')) FPS = int(con.getOption('system', 'FPS')) MIC_RATE = int(con.getOption('system', 'MIC_RATE')) SOFTWARE_GAMMA_CORRECTION = False GAMMA_TABLE_PATH = os.path.join(os.path.dirname(__file__), 'config/gamma_table.npy') _max_led_FPS = int(((N_PIXELS * 30e-6) + 50e-6)**-1.0) assert FPS <= _max_led_FPS, 'FPS must be <= {}'.format(_max_led_FPS) MIN_FREQUENCY = 880 """Frequencies below this value will be removed during audio processing""" MAX_FREQUENCY = 1512 """Frequencies above this value will be removed during audio processing""" N_FFT_BINS = 24 """Number of frequency bins to use when transforming audio to frequency domain Fast Fourier transforms are used to transform time-domain audio data to the
def __init__(self, parent=None): super(mainWindowImpl, self).__init__(parent) self.setupUi(self) self.centralwidget.setMouseTracking(True) self.setMouseTracking(True) self.mainWidget.setMouseTracking(True) self.windowBar.setMouseTracking(True) self.conf = config() self.closeNow = True self.task = {} self.webDav = webDavService() if self.conf.getOption('webDav', 'enable') == "True": self.webDav.download('/config/tomato.db') self.sqlite = sqlite('/config/tomato.db') log = logger() self.confmain = log.getlogger('gui') self.trayIcon() self.checkOverdue() self.timer = QTimer() #界面初始化 self.unlockDialog = unlockDialogImpl() self.settingDialog = settingDialogImpl() self.miniBar = miniBarImpl() self.todolist = todoWidgetImpl() self.messageView = messageWidgetImpl() self.miniSizeButton.setDisabled(True) self.taskTitleLabel.setText("无") self.readyTomatoLabel.setText("0") self.totalTomatoLabel.setText("0") self.timeLcd.display("00:00") self.firstWidget = firstWidgetImpl() statisWidget = statisWidgetImpl() self.taskWidget = taskWidgetImpl() memoWidget = memoWidgetImpl() marketWidget = marketWidgetImpl() self.stackedWidget.addWidget(self.firstWidget) self.stackedWidget.addWidget(statisWidget) self.stackedWidget.addWidget(self.taskWidget) self.stackedWidget.addWidget(memoWidget) self.stackedWidget.addWidget(marketWidget) self.reloadConf() #信号绑定 self.allRefreshSignal.connect(self.firstWidget.refreshAll) self.allRefreshSignal.connect(statisWidget.refreshAll) self.allRefreshSignal.connect(self.taskWidget.refreshAll) self.allRefreshSignal.connect(memoWidget.loadTree) self.allRefreshSignal.connect(marketWidget.refreshAll) self.taskRefreshSignal.connect(self.firstWidget.refreshAll) self.taskRefreshSignal.connect(statisWidget.refreshAll) self.taskRefreshSignal.connect(self.taskWidget.refreshAll) self.coinRefreshSignal.connect(self.firstWidget.refreshAllCoin) self.coinRefreshSignal.connect(marketWidget.sumCoin) self.rateRefreshSignal.connect(marketWidget.getRate) marketWidget.coinRefreshSignal.connect(self.firstWidget.refreshAllCoin) self.miniSizeSignal.connect(self.miniBar.miniShow) self.taskCheckSignal.connect(self.firstWidget.taskCheck) self.miniBar.normalSizeSignal.connect(self.normalShow) self.miniBar.taskFinishSignal.connect(self.taskfinish) self.miniBar.taskStopSignal.connect(self.stopTask) self.firstWidget.taskRefreshSignal.connect(self.taskWidget.refreshAll) self.taskWidget.taskRefreshSignal.connect(self.firstWidget.refreshAll) self.firstWidget.taskStartSignal.connect(self.taskStart) self.coinRefreshSignal.emit() #功能绑定 self.firstPageButton.clicked.connect( lambda: self.stackedWidget.setCurrentIndex(0)) self.statisButton.clicked.connect( lambda: self.stackedWidget.setCurrentIndex(1)) self.taskButton.clicked.connect( lambda: self.stackedWidget.setCurrentIndex(2)) self.memoButton.clicked.connect( lambda: self.stackedWidget.setCurrentIndex(3)) self.marketButton.clicked.connect( lambda: self.stackedWidget.setCurrentIndex(4)) self.settingButton.clicked.connect(self.setting) self.introButton.clicked.connect(self.infoDialog) self.redoTimerButton.clicked.connect(self.redoTask) self.startTimerButton.clicked.connect(self.startTask) self.pauseTimerButton.clicked.connect(self.pauseTask) self.stopTimerButton.clicked.connect(self.stopTask) self.miniSizeButton.clicked.connect(self.miniSize) self.sizePushButton.clicked.connect(self.windowSizeChange) self.timer.timeout.connect(self.taskStageShow)