Пример #1
0
 def load_conf(
     self,
     name,
     dbname,
 ):
     settings.refresh()
     global db
     if dbname == "Almanca" or "German":
         dbname = "German"
     if name == "":
         return False
     settings.apply_settings(nm=name, )
     db = database(dbname.capitalize() + "-" + settings.language)
     return True
Пример #2
0
 def hello_(self):
     try:
         if fb.status == "terminate":
             return None
     except Exception as e:
         print("Error", e)
     if settings.dictionary == "none":
         return False
     else:
         global db
         settings.refresh()
         db = database(settings.dictionary.capitalize() + "-" +
                       settings.language.capitalize())
         return True
Пример #3
0
def update():
    try:
        settings.refresh()
        settings.connection = settings.connect()
    except Exception as e:
        print(e)
        settings.default_settings()
        settings.refresh()
    try:
        if not settings.connection == False:
            fb.version_control()
            if fb.status == "update":
                print("An update have done")
            elif fb.status == "major":
                print("MAJOR UPDATE NEEDED")
        else:
            print("PLEASE CONNECT TO INTERNET TO CHECK FOR UPDATES")
    except Exception as e:
        print("Update failed, ERROR : ", errorlog(e))
Пример #4
0
 def upd(self):
     settings.refresh()
     user.cal_progress(udb=udb)
     self.user_info.text = language_pack().text("Hoş Geldin len ") + str(
         settings.user_name) + " ! \n\n"
     self.user_info.text += language_pack().text("İlerleme Durumunuz \n")
     for i in udb.fetchall("progress"):
         self.pbar_basic, self.pbar_common, self.pbar_rare, self.pbar_advantage, self.pbar_general = int(
             i[0]) * 10, int(i[1]) * 10, int(i[2]) * 10, int(
                 i[3]) * 10, int(i[4]) * 10,
         self.pbar_primary.value = max(self.pbar_basic, self.pbar_common,
                                       self.pbar_rare, self.pbar_advantage,
                                       self.pbar_general)
         if self.pbar_primary.value == self.pbar_basic:
             self.pbar.text = language_pack().text("TEMEL KELİMELER")
         if self.pbar_primary.value == self.pbar_common:
             self.pbar.text = language_pack().text("YAYGIN KULLANILAN")
         if self.pbar_primary.value == self.pbar_rare:
             self.pbar.text = language_pack().text("NADİR KULLANILAN")
         if self.pbar_primary.value == self.pbar_advantage:
             self.pbar.text = language_pack().text("İLERİ SEVİYE")
Пример #5
0
    def start_progress(self):
        if not self.myweb.is_started():
            QMessageBox.warning(self, 'No Browser',
                                'Browser not nonnected/activated')
            return

        if settings.check_file_modified():
            reply = QMessageBox.question(
                self, 'Load INI', 'INI file has been modified. Reload?',
                QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
            if reply == QMessageBox.Yes:
                settings.refresh()

        if self.myweb.check_rule_file_modified():
            if self.myweb.rule_data:
                msg = 'JSON file has been modified. Reload it?'
            else:
                msg = 'JSON file not loaded. Load it?'

            reply = QMessageBox.question(self, 'Load JSON', msg,
                                         QMessageBox.Yes | QMessageBox.No,
                                         QMessageBox.No)
            if reply == QMessageBox.Yes:
                if not self.myweb.load_rules() and self.myweb.rule_data:
                    self.postal.log(
                        "Continue with previously loaded JSON data")

        if self.myweb.rule_data:
            self.myweb.clear()
            self.myweb.pause(False)
            self.web_thread = WebThread(self.myweb)
            self.web_thread.start()
            self.start_button.setDisabled(True)
            self.stop_button.setDisabled(False)
            self.update_connection_info()
            self.postal.log("Control started")
        else:
            self.postal.log("Unable to start. JSON data not loaded")
Пример #6
0
import poloniex, settings, polopublic, poloprivate
from utils import *


BOT_PAIR = sys.argv[1].upper()
BOT_CYCLE = 1
BOT_COMMENT = ""

settings = settings.Settings(BOT_PAIR)
config = settings.settings
polopublic = polopublic.PoloPublic(BOT_PAIR, config)
poloprivate = poloprivate.PoloPrivate(BOT_PAIR, config)

while True:
	settings.refresh()
	config = settings.settings
	polopublic.refresh(config)
	poloprivate.refresh(config)

	if poloprivate.status == "none":
		BOT_COMMENT = poloprivate.open(
			polopublic.data_chart
		)

	else:
		BOT_COMMENT = poloprivate.close()
		BOT_COMMENT += poloprivate.update_open(
			polopublic.data_chart
		)
Пример #7
0
 def set_lang(self, langg):
     settings.apply_settings(lang=langg)
     settings.refresh()