Обновление v2.2
This commit is contained in:
parent
34fe5f0063
commit
5d2da989d6
@ -1,5 +1,6 @@
|
|||||||
## Добро пожаловать в AutoZoom!
|
## Добро пожаловать в AutoZoom!
|
||||||
|
|
||||||
|
Contact me [directly](https://t.me/profitroll) or via [Support Center](https://www.tidio.com/talk/ydqcvfvgkud3jjk2482uaesvjpeohlh3) if you need English translation.
|
||||||
В этом файле описаны все шаги которые нужно выполнить для работы с программой.
|
В этом файле описаны все шаги которые нужно выполнить для работы с программой.
|
||||||
|
|
||||||
### Содержание
|
### Содержание
|
||||||
@ -12,6 +13,7 @@
|
|||||||
* [GitHub вики проекта](https://github.com/profitrollgame/autozoom/wiki)
|
* [GitHub вики проекта](https://github.com/profitrollgame/autozoom/wiki)
|
||||||
* [Обратная связь и предложения](https://t.me/profitroll)
|
* [Обратная связь и предложения](https://t.me/profitroll)
|
||||||
* [Сообщить об ошибке/баге](https://github.com/profitrollgame/autozoom/issues)
|
* [Сообщить об ошибке/баге](https://github.com/profitrollgame/autozoom/issues)
|
||||||
|
* [Центр поддержки](https://www.tidio.com/talk/ydqcvfvgkud3jjk2482uaesvjpeohlh3)
|
||||||
|
|
||||||
### 1. Информация и описание программы
|
### 1. Информация и описание программы
|
||||||
|
|
||||||
|
27
daemon.py
27
daemon.py
@ -44,12 +44,6 @@ import ast
|
|||||||
import inputimeout
|
import inputimeout
|
||||||
import telegram_send
|
import telegram_send
|
||||||
|
|
||||||
if getOS() == "windows":
|
|
||||||
import winsound
|
|
||||||
from playsound import playsound
|
|
||||||
else:
|
|
||||||
from playsound import playsound
|
|
||||||
|
|
||||||
menu_choose = None
|
menu_choose = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -273,7 +267,26 @@ def main(source='deamon'):
|
|||||||
|
|
||||||
today = date.today().strftime("%d.%m.%Y")
|
today = date.today().strftime("%d.%m.%Y")
|
||||||
|
|
||||||
if (today == lesson_date) or (getDayNum(today) == lesson_repeat_day):
|
diff = ((datetime.strptime(today, "%d.%m.%Y") - datetime.strptime(lesson_date, "%d.%m.%Y")).days)
|
||||||
|
|
||||||
|
if getConfig("debug"):
|
||||||
|
print(f'{nowtime()} Конференция {CYAN}{lesson_name}{RESET}: Разница дней {BRED}{diff}{RESET}, Повторение {BRED}{lesson_repeat}{RESET}.')
|
||||||
|
|
||||||
|
if diff > 0 and not lesson_repeat:
|
||||||
|
|
||||||
|
if getConfig("remove_old"):
|
||||||
|
|
||||||
|
del lessons_list[lessons_list.index(les)]
|
||||||
|
|
||||||
|
saveJson(files_folder+'lessons.json', lessons_list)
|
||||||
|
appendLog(f'Old lesson named {lesson_name} removed')
|
||||||
|
|
||||||
|
if getConfig("debug"):
|
||||||
|
print(f'{nowtime()} Старая конференция {CYAN}{lesson_name}{RESET} за {CYAN}{lesson_date} {RESET}в {BRED}{lesson_time}{RESET} удалена.')
|
||||||
|
|
||||||
|
lessons_list = getLessons()
|
||||||
|
|
||||||
|
elif (today == lesson_date) or (getDayNum(today) == lesson_repeat_day):
|
||||||
print(f'{BBLACK}================================================{RESET}\n')
|
print(f'{BBLACK}================================================{RESET}\n')
|
||||||
|
|
||||||
print(f'{nowtime()} Найдена конференция {CYAN}{lesson_name}{RESET} в {BRED}{lesson_time}{RESET}. Ждём начала...')
|
print(f'{nowtime()} Найдена конференция {CYAN}{lesson_name}{RESET} в {BRED}{lesson_time}{RESET}. Ждём начала...')
|
||||||
|
51
editor.py
51
editor.py
@ -65,8 +65,11 @@ def listLessons(from_where='remove'):
|
|||||||
|
|
||||||
|
|
||||||
def sortLessons(dictionary):
|
def sortLessons(dictionary):
|
||||||
dictionary.sort(key = lambda x: datetime.strptime(x['time'], '%H:%M'))
|
if getConfig("debug"):
|
||||||
dictionary.sort(key = lambda x: datetime.strptime(x['date'], '%d.%m.%Y'))
|
print(dictionary)
|
||||||
|
|
||||||
|
dictionary.sort(key = lambda x: datetime.strptime(x["time"], '%H:%M'))
|
||||||
|
dictionary.sort(key = lambda x: datetime.strptime(x["date"], '%d.%m.%Y'))
|
||||||
appendLog('Lessons dictionary sorted')
|
appendLog('Lessons dictionary sorted')
|
||||||
|
|
||||||
|
|
||||||
@ -366,10 +369,23 @@ def editLesson():
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
clear()
|
clear()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
lesstime = input(f'{RESET}Введите время конференции ({BRED}ЧЧ:ММ{RESET}):\n\nОригинальное время: {BRED}{lessons_got[edi]["time"]}{RESET}\n\n > {BRED}')
|
lesstime = input(f'{RESET}Введите время конференции ({BRED}ЧЧ:ММ{RESET}):\n\nОригинальное время: {BRED}{lessons_got[edi]["time"]}{RESET}\n\n > {BRED}')
|
||||||
finallesstime = (datetime.strptime(lesstime, "%H:%M"))
|
|
||||||
|
if lesstime == '':
|
||||||
|
finallesstime = lessons_got[edi]["time"]
|
||||||
|
lesstime = lessons_got[edi]["time"]
|
||||||
|
|
||||||
local_lessons.update({"time": lesstime})
|
local_lessons.update({"time": lesstime})
|
||||||
|
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
finallesstime = (datetime.strptime(lesstime, "%H:%M"))
|
||||||
|
finallesstime = lesstime
|
||||||
|
|
||||||
|
local_lessons.update({"time": lesstime})
|
||||||
|
|
||||||
abort = "skip"
|
abort = "skip"
|
||||||
conflict = False
|
conflict = False
|
||||||
conflictles = ''
|
conflictles = ''
|
||||||
@ -408,12 +424,15 @@ def editLesson():
|
|||||||
|
|
||||||
if abort == "restart":
|
if abort == "restart":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
except Exception as exp:
|
except Exception as exp:
|
||||||
none = input(exp)
|
none = input(exp)
|
||||||
pass
|
pass
|
||||||
|
except:
|
||||||
|
continue
|
||||||
|
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
@ -587,6 +606,32 @@ def removeAllLessons():
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def debugLesson():
|
||||||
|
try:
|
||||||
|
from profile import debuglink, name
|
||||||
|
appendLog('Debug link added to the list')
|
||||||
|
|
||||||
|
local_lessons = {}
|
||||||
|
lessons_got = getLessons()
|
||||||
|
|
||||||
|
local_lessons.update({"name": "Debug Lesson"})
|
||||||
|
local_lessons.update({"date": date.today().strftime("%d.%m.%Y")})
|
||||||
|
local_lessons.update({"time": "00:00"})
|
||||||
|
local_lessons.update({"link": debuglink})
|
||||||
|
local_lessons.update({"repeat": False})
|
||||||
|
local_lessons.update({"repeat_day": None})
|
||||||
|
local_lessons.update({"record": True})
|
||||||
|
|
||||||
|
lessons_got.append(dict(local_lessons))
|
||||||
|
sortLessons(lessons_got)
|
||||||
|
saveJson(files_folder+'lessons.json', lessons_got)
|
||||||
|
|
||||||
|
return f"{RESET}Конференция для отладки профиля {CYAN}{name} {RESET}была добавлена."
|
||||||
|
|
||||||
|
except:
|
||||||
|
return f"{RESET}Для отладки нужен профиль {BRED}profile.py {RESET}со ссылкой на конференцию {BRED}debuglink {RESET}и именем {BRED}name{RESET}."
|
||||||
|
|
||||||
|
|
||||||
def editor():
|
def editor():
|
||||||
try:
|
try:
|
||||||
setTitle("AutoZoom (Редактор)", getOS())
|
setTitle("AutoZoom (Редактор)", getOS())
|
||||||
|
@ -31,6 +31,7 @@ default_config = {
|
|||||||
"run_fullscreen": False,
|
"run_fullscreen": False,
|
||||||
"use_rpc": True,
|
"use_rpc": True,
|
||||||
"sounds": True,
|
"sounds": True,
|
||||||
|
"remove_old": True,
|
||||||
"end_mode": "shutdown",
|
"end_mode": "shutdown",
|
||||||
"obs_exe": None,
|
"obs_exe": None,
|
||||||
"obs_core": None,
|
"obs_core": None,
|
||||||
@ -70,6 +71,14 @@ else:
|
|||||||
clear = lambda: os.system('clear')
|
clear = lambda: os.system('clear')
|
||||||
|
|
||||||
|
|
||||||
|
# Импортирование игралки звуков
|
||||||
|
if getOS() == "windows":
|
||||||
|
import winsound
|
||||||
|
from playsound import playsound
|
||||||
|
elif getOS() == "unix":
|
||||||
|
from playsound import playsound
|
||||||
|
|
||||||
|
|
||||||
# Установка заголовка окна cmd.exe
|
# Установка заголовка окна cmd.exe
|
||||||
def setTitle(title, system):
|
def setTitle(title, system):
|
||||||
if system == "windows":
|
if system == "windows":
|
||||||
|
@ -116,6 +116,7 @@ if getOS() != "android":
|
|||||||
libs.append("playsound")
|
libs.append("playsound")
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
if not "play-audio" in os.popen('pkg list-all').read():
|
||||||
os.system('pkg install play-audio')
|
os.system('pkg install play-audio')
|
||||||
except:
|
except:
|
||||||
appendLog("Could not install play-audio")
|
appendLog("Could not install play-audio")
|
||||||
|
29
main.py
29
main.py
@ -36,7 +36,7 @@ import keyboard
|
|||||||
import getpass
|
import getpass
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
|
|
||||||
version = 2.1
|
version = 2.2
|
||||||
path = Path(__file__).resolve().parent
|
path = Path(__file__).resolve().parent
|
||||||
|
|
||||||
def mainMenu():
|
def mainMenu():
|
||||||
@ -282,10 +282,12 @@ def devMenu():
|
|||||||
print(f' {BRED}1.{RESET} PlaySound test')
|
print(f' {BRED}1.{RESET} PlaySound test')
|
||||||
print(f' {BRED}2.{RESET} WinSound test')
|
print(f' {BRED}2.{RESET} WinSound test')
|
||||||
print(f' {BRED}3.{RESET} Play-audio test')
|
print(f' {BRED}3.{RESET} Play-audio test')
|
||||||
print(f' {BRED}4.{RESET} OS check test')
|
print(f' {BRED}4.{RESET} playSound function test')
|
||||||
print(f' {BRED}5.{RESET} Telegram test')
|
print(f' {BRED}5.{RESET} OS check test')
|
||||||
print(f' {BRED}6.{RESET} Color test')
|
print(f' {BRED}6.{RESET} Telegram test')
|
||||||
print(f' {BRED}7.{RESET} Exit to menu')
|
print(f' {BRED}7.{RESET} Zoom meeting test')
|
||||||
|
print(f' {BRED}8.{RESET} Color test')
|
||||||
|
print(f' {BRED}9.{RESET} Exit to menu')
|
||||||
|
|
||||||
choose = input(f'\n > {BRED}')
|
choose = input(f'\n > {BRED}')
|
||||||
|
|
||||||
@ -304,17 +306,27 @@ def devMenu():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
elif choose == '4':
|
elif choose == '4':
|
||||||
|
playSound("debug")
|
||||||
|
continue
|
||||||
|
|
||||||
|
elif choose == '5':
|
||||||
clear()
|
clear()
|
||||||
none = input(f'{RESET}{getOS()}\n\n > ')
|
none = input(f'{RESET}{getOS()}\n\n > ')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
elif choose == '5':
|
elif choose == '6':
|
||||||
clear()
|
clear()
|
||||||
import telegram_send
|
import telegram_send
|
||||||
telegram_send.send(messages=["Telegram message test"], parse_mode="markdown", conf=files_folder+"telegram.conf")
|
telegram_send.send(messages=["Telegram message test"], parse_mode="markdown", conf=files_folder+"telegram.conf")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
elif choose == '6':
|
elif choose == '7':
|
||||||
|
clear()
|
||||||
|
print(editor.debugLesson())
|
||||||
|
none = input(f'{RESET}\n > ')
|
||||||
|
continue
|
||||||
|
|
||||||
|
elif choose == '8':
|
||||||
clear()
|
clear()
|
||||||
print(f'{BLACK}███{RED}███{GREEN}███{YELLOW}███{BLUE}███{MAGENTA}███{CYAN}███{WHITE}███')
|
print(f'{BLACK}███{RED}███{GREEN}███{YELLOW}███{BLUE}███{MAGENTA}███{CYAN}███{WHITE}███')
|
||||||
print(f'{BBLACK}███{BRED}███{BGREEN}███{BYELLOW}███{BBLUE}███{BMAGENTA}███{BCYAN}███{BWHITE}███')
|
print(f'{BBLACK}███{BRED}███{BGREEN}███{BYELLOW}███{BBLUE}███{BMAGENTA}███{BCYAN}███{BWHITE}███')
|
||||||
@ -324,7 +336,7 @@ def devMenu():
|
|||||||
none = input(RESET+'\n > ')
|
none = input(RESET+'\n > ')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
elif choose == '7':
|
elif choose == '9':
|
||||||
rpc.inMenu()
|
rpc.inMenu()
|
||||||
clear()
|
clear()
|
||||||
setTitle("AutoZoom (Главная)", getOS())
|
setTitle("AutoZoom (Главная)", getOS())
|
||||||
@ -382,6 +394,7 @@ def updater(serv_ver, version):
|
|||||||
print(f' {BRED}1.{RESET} Установить')
|
print(f' {BRED}1.{RESET} Установить')
|
||||||
print(f' {BRED}2.{RESET} Отменить')
|
print(f' {BRED}2.{RESET} Отменить')
|
||||||
updater_decide = input(f'\n > {BRED}')
|
updater_decide = input(f'\n > {BRED}')
|
||||||
|
print(RESET)
|
||||||
|
|
||||||
if updater_decide == '1':
|
if updater_decide == '1':
|
||||||
appendLog('Trying to update AutoZoom')
|
appendLog('Trying to update AutoZoom')
|
||||||
|
24
rpc.py
24
rpc.py
@ -6,7 +6,7 @@ import sys
|
|||||||
from colors import *
|
from colors import *
|
||||||
from functions import *
|
from functions import *
|
||||||
|
|
||||||
version = '2.1'
|
version = '2.2'
|
||||||
|
|
||||||
import libinstaller
|
import libinstaller
|
||||||
from pypresence import Presence
|
from pypresence import Presence
|
||||||
@ -59,7 +59,7 @@ def waitLesson(lesson, start):
|
|||||||
if getConfig("use_rpc") and getOS != "android":
|
if getConfig("use_rpc") and getOS != "android":
|
||||||
if connected == False:
|
if connected == False:
|
||||||
connect()
|
connect()
|
||||||
RPC.update(large_image='1024_cover', small_image='status_waiting', large_text=f'AutoZoom • v{version}\nhttp://bit.ly/auto_zoom', small_text='Ожидание', state=f'Ждём начала «{lesson}»', details='Конференция не началась', start=start)
|
RPC.update(large_image='1024_cover', small_image='status_waiting', large_text=f'AutoZoom • v{str(version)}\nhttp://bit.ly/auto_zoom', small_text='Ожидание', state=f'Ждём начала «{lesson}»', details='Конференция не началась', start=start)
|
||||||
appendLog(f'Discord RPC changed to waitLesson (Lesson: {lesson}, Start: {start})')
|
appendLog(f'Discord RPC changed to waitLesson (Lesson: {lesson}, Start: {start})')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
appendLog('Discord RPC failed to change status')
|
appendLog('Discord RPC failed to change status')
|
||||||
@ -77,7 +77,7 @@ def onLesson(lesson, start):
|
|||||||
if getConfig("use_rpc") and getOS != "android":
|
if getConfig("use_rpc") and getOS != "android":
|
||||||
if connected == False:
|
if connected == False:
|
||||||
connect()
|
connect()
|
||||||
RPC.update(large_image='1024_cover', small_image='status_lesson', large_text=f'AutoZoom • v{version}\nhttp://bit.ly/auto_zoom', small_text='Конференция', state=f'Слушаем «{lesson}»', details='Идёт конференция', start=start)
|
RPC.update(large_image='1024_cover', small_image='status_lesson', large_text=f'AutoZoom • v{str(version)}\nhttp://bit.ly/auto_zoom', small_text='Конференция', state=f'Слушаем «{lesson}»', details='Идёт конференция', start=start)
|
||||||
appendLog(f'Discord RPC changed to onLesson (Lesson: {lesson}, Start: {start})')
|
appendLog(f'Discord RPC changed to onLesson (Lesson: {lesson}, Start: {start})')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
appendLog('Discord RPC failed to change status')
|
appendLog('Discord RPC failed to change status')
|
||||||
@ -95,7 +95,7 @@ def inMenu():
|
|||||||
if getConfig("use_rpc") and getOS != "android":
|
if getConfig("use_rpc") and getOS != "android":
|
||||||
if connected == False:
|
if connected == False:
|
||||||
connect()
|
connect()
|
||||||
RPC.update(large_image='1024_cover', small_image='status_menu', large_text=f'AutoZoom • v{version}\nhttp://bit.ly/auto_zoom', small_text='Главное меню', state='Открыт список опций', details='В главном меню')
|
RPC.update(large_image='1024_cover', small_image='status_menu', large_text=f'AutoZoom • v{str(version)}\nhttp://bit.ly/auto_zoom', small_text='Главное меню', state='Открыт список опций', details='В главном меню')
|
||||||
appendLog('Discord RPC changed to inMenu')
|
appendLog('Discord RPC changed to inMenu')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
appendLog('Discord RPC failed to change status')
|
appendLog('Discord RPC failed to change status')
|
||||||
@ -113,7 +113,7 @@ def shutdown(end):
|
|||||||
if getConfig("use_rpc") and getOS != "android":
|
if getConfig("use_rpc") and getOS != "android":
|
||||||
if connected == False:
|
if connected == False:
|
||||||
connect()
|
connect()
|
||||||
RPC.update(large_image='1024_cover', small_image='status_shutdown', large_text=f'AutoZoom • v{version}\nhttp://bit.ly/auto_zoom', small_text='Выключение', state='Отсчёт до авто-выключения', details='Выключение ПК', end=end)
|
RPC.update(large_image='1024_cover', small_image='status_shutdown', large_text=f'AutoZoom • v{str(version)}\nhttp://bit.ly/auto_zoom', small_text='Выключение', state='Отсчёт до авто-выключения', details='Выключение ПК', end=end)
|
||||||
appendLog(f'Discord RPC changed to shutdown (End: {end})')
|
appendLog(f'Discord RPC changed to shutdown (End: {end})')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
appendLog('Discord RPC failed to change status')
|
appendLog('Discord RPC failed to change status')
|
||||||
@ -131,7 +131,7 @@ def inSettings():
|
|||||||
if getConfig("use_rpc") and getOS != "android":
|
if getConfig("use_rpc") and getOS != "android":
|
||||||
if connected == False:
|
if connected == False:
|
||||||
connect()
|
connect()
|
||||||
RPC.update(large_image='1024_cover', small_image='status_settings', large_text=f'AutoZoom • v{version}\nhttp://bit.ly/auto_zoom', small_text='Настройки', state='Открыты настройки', details='В главном меню')
|
RPC.update(large_image='1024_cover', small_image='status_settings', large_text=f'AutoZoom • v{str(version)}\nhttp://bit.ly/auto_zoom', small_text='Настройки', state='Открыты настройки', details='В главном меню')
|
||||||
appendLog('Discord RPC changed to inSettings')
|
appendLog('Discord RPC changed to inSettings')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
appendLog('Discord RPC failed to change status')
|
appendLog('Discord RPC failed to change status')
|
||||||
@ -149,7 +149,7 @@ def inDebug():
|
|||||||
if getConfig("use_rpc") and getOS != "android":
|
if getConfig("use_rpc") and getOS != "android":
|
||||||
if connected == False:
|
if connected == False:
|
||||||
connect()
|
connect()
|
||||||
RPC.update(large_image='1024_cover', small_image='status_debug', large_text=f'AutoZoom • v{version}\nhttp://bit.ly/auto_zoom', small_text='Отладка', state='Открыто меню отладки', details='В меню разработчика')
|
RPC.update(large_image='1024_cover', small_image='status_debug', large_text=f'AutoZoom • v{str(version)}\nhttp://bit.ly/auto_zoom', small_text='Отладка', state='Открыто меню отладки', details='В меню разработчика')
|
||||||
appendLog('Discord RPC changed to inDebug')
|
appendLog('Discord RPC changed to inDebug')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
appendLog('Discord RPC failed to change status')
|
appendLog('Discord RPC failed to change status')
|
||||||
@ -167,7 +167,7 @@ def inEditor():
|
|||||||
if getConfig("use_rpc") and getOS != "android":
|
if getConfig("use_rpc") and getOS != "android":
|
||||||
if connected == False:
|
if connected == False:
|
||||||
connect()
|
connect()
|
||||||
RPC.update(large_image='1024_cover', small_image='status_editing', large_text=f'AutoZoom • v{version}\nhttp://bit.ly/auto_zoom', small_text='Редактор', state='Открыт редактор', details='В главном меню')
|
RPC.update(large_image='1024_cover', small_image='status_editing', large_text=f'AutoZoom • v{str(version)}\nhttp://bit.ly/auto_zoom', small_text='Редактор', state='Открыт редактор', details='В главном меню')
|
||||||
appendLog('Discord RPC changed to inEditor')
|
appendLog('Discord RPC changed to inEditor')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
appendLog('Discord RPC failed to change status')
|
appendLog('Discord RPC failed to change status')
|
||||||
@ -185,7 +185,7 @@ def inUpdater():
|
|||||||
if getConfig("use_rpc") and getOS != "android":
|
if getConfig("use_rpc") and getOS != "android":
|
||||||
if connected == False:
|
if connected == False:
|
||||||
connect()
|
connect()
|
||||||
RPC.update(large_image='1024_cover', small_image='status_updating', large_text=f'AutoZoom • v{version}\nhttp://bit.ly/auto_zoom', small_text='Обновление', state='Открыт центр обновлений', details='В главном меню')
|
RPC.update(large_image='1024_cover', small_image='status_updating', large_text=f'AutoZoom • v{str(version)}\nhttp://bit.ly/auto_zoom', small_text='Обновление', state='Открыт центр обновлений', details='В главном меню')
|
||||||
appendLog('Discord RPC changed to inUpdater')
|
appendLog('Discord RPC changed to inUpdater')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
appendLog('Discord RPC failed to change status')
|
appendLog('Discord RPC failed to change status')
|
||||||
@ -203,7 +203,7 @@ def inHelp():
|
|||||||
if getConfig("use_rpc") and getOS != "android":
|
if getConfig("use_rpc") and getOS != "android":
|
||||||
if connected == False:
|
if connected == False:
|
||||||
connect()
|
connect()
|
||||||
RPC.update(large_image='1024_cover', small_image='status_support', large_text=f'AutoZoom • v{version}\nhttp://bit.ly/auto_zoom', small_text='Помощь', state='Открыта помощь', details='В главном меню')
|
RPC.update(large_image='1024_cover', small_image='status_support', large_text=f'AutoZoom • v{str(version)}\nhttp://bit.ly/auto_zoom', small_text='Помощь', state='Открыта помощь', details='В главном меню')
|
||||||
appendLog('Discord RPC changed to inHelp')
|
appendLog('Discord RPC changed to inHelp')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
appendLog('Discord RPC failed to change status')
|
appendLog('Discord RPC failed to change status')
|
||||||
@ -221,7 +221,7 @@ def lessonEnded():
|
|||||||
if getConfig("use_rpc") and getOS != "android":
|
if getConfig("use_rpc") and getOS != "android":
|
||||||
if connected == False:
|
if connected == False:
|
||||||
connect()
|
connect()
|
||||||
RPC.update(large_image='1024_cover', small_image='status_waiting', large_text=f'AutoZoom • v{version}\nhttp://bit.ly/auto_zoom', small_text='Ожидание', state=f'Ждём указаний', details='Все конференции закончились')
|
RPC.update(large_image='1024_cover', small_image='status_waiting', large_text=f'AutoZoom • v{str(version)}\nhttp://bit.ly/auto_zoom', small_text='Ожидание', state=f'Ждём указаний', details='Все конференции закончились')
|
||||||
appendLog('Discord RPC changed to lessonEnded')
|
appendLog('Discord RPC changed to lessonEnded')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
appendLog('Discord RPC failed to change status')
|
appendLog('Discord RPC failed to change status')
|
||||||
@ -238,7 +238,7 @@ def lessonEnded():
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
RPC.connect()
|
RPC.connect()
|
||||||
RPC.update(large_image='1024_cover', small_image='status_settings', large_text=f'AutoZoom • v{version}\nhttp://bit.ly/auto_zoom', small_text='Отладка', state='Модуль Discord RPC запущен в режиме тестирования', details='Режим отладки')
|
RPC.update(large_image='1024_cover', small_image='status_settings', large_text=f'AutoZoom • v{str(version)}\nhttp://bit.ly/auto_zoom', small_text='Отладка', state='Модуль Discord RPC запущен в режиме тестирования', details='Режим отладки')
|
||||||
appendLog('Discord RPC changed to debug')
|
appendLog('Discord RPC changed to debug')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
appendLog('Discord RPC failed to change status')
|
appendLog('Discord RPC failed to change status')
|
||||||
|
26
settings.py
26
settings.py
@ -413,6 +413,13 @@ def settings3():
|
|||||||
else:
|
else:
|
||||||
logs_val = f'{BRED}ERROR{RESET}'
|
logs_val = f'{BRED}ERROR{RESET}'
|
||||||
|
|
||||||
|
if getConfig("remove_old"):
|
||||||
|
remove_val = f'{BGREEN}Вкл.{RESET}'
|
||||||
|
elif not getConfig("remove_old"):
|
||||||
|
remove_val = f'{BRED}Выкл.{RESET}'
|
||||||
|
else:
|
||||||
|
remove_val = f'{BRED}ERROR{RESET}'
|
||||||
|
|
||||||
shutdown_time_val = getConfig("shutdown_timeout")
|
shutdown_time_val = getConfig("shutdown_timeout")
|
||||||
start_val = getConfig("start")
|
start_val = getConfig("start")
|
||||||
stop_val = getConfig("stop")
|
stop_val = getConfig("stop")
|
||||||
@ -428,10 +435,13 @@ def settings3():
|
|||||||
print(f' {BRED}3.{RESET} Добавить в автозапуск')
|
print(f' {BRED}3.{RESET} Добавить в автозапуск')
|
||||||
print(f' {BBLACK}{winOnly(BRED, BBLACK, sysname, end=" ")}Автоматически запускать демона при входе в систему\n')
|
print(f' {BBLACK}{winOnly(BRED, BBLACK, sysname, end=" ")}Автоматически запускать демона при входе в систему\n')
|
||||||
|
|
||||||
print(f' {BRED}4.{RESET} Сбросить все настройки')
|
print(f' {BRED}4.{RESET} Удалять старые конференции ({remove_val})')
|
||||||
|
print(f' {BBLACK}Автоматически удалять одноразовые конференции которые были до дня запуска\n')
|
||||||
|
|
||||||
|
print(f' {BRED}5.{RESET} Сбросить все настройки')
|
||||||
print(f' {BBLACK}Восстановить настройки по умолчанию\n')
|
print(f' {BBLACK}Восстановить настройки по умолчанию\n')
|
||||||
|
|
||||||
print(f' {BRED}5.{RESET} Назад')
|
print(f' {BRED}6.{RESET} Назад')
|
||||||
print(f' {BBLACK}Вернуться на предыдущую страницу{RESET}\n')
|
print(f' {BBLACK}Вернуться на предыдущую страницу{RESET}\n')
|
||||||
|
|
||||||
print(f' {BBLACK}Для переключения параметров Вкл/Выкл просто введите номер{RESET}') #\n Если окно приложения слишком мелкое - увеличьте его или листайте это меню{RESET}')
|
print(f' {BBLACK}Для переключения параметров Вкл/Выкл просто введите номер{RESET}') #\n Если окно приложения слишком мелкое - увеличьте его или листайте это меню{RESET}')
|
||||||
@ -468,18 +478,18 @@ def settings3():
|
|||||||
|
|
||||||
shutil.copyfile('daemon.bat', 'startdaemon.bat')
|
shutil.copyfile('daemon.bat', 'startdaemon.bat')
|
||||||
|
|
||||||
with open('startdaemon.bat', 'r') as f :
|
with open('startdaemon.bat', 'r', encoding='utf-8') as f :
|
||||||
filedata = f.read()
|
filedata = f.read()
|
||||||
filedata = filedata.replace('python daemon.py', f'python {path}\\daemon.py')
|
filedata = filedata.replace('python daemon.py', f'python {path}\\daemon.py')
|
||||||
|
|
||||||
with open('startdaemon.bat', 'w') as f:
|
with open('startdaemon.bat', 'w', encoding="utf-8") as f:
|
||||||
f.write(filedata)
|
f.write(filedata)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
swl.create_lnk(f'{path}\\startdaemon.bat', f'{pathlib.Path.home()}\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\AutoZoomDaemon.lnk')
|
swl.create_lnk(f'{path}\\startdaemon.bat', f'{pathlib.Path.home()}\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\AutoZoomDaemon.lnk')
|
||||||
appendLog('Autorun script added')
|
appendLog('Autorun script added')
|
||||||
|
|
||||||
none = input(f'Демон AutoZoom был добавлен в автозапуск.\nПуть: {BRED}{pathlib.Path.home()}\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\AutoZoomDaemon.lnk{RESET}\n\n > ')
|
none = input(f'{RESET}Демон AutoZoom был добавлен в автозапуск.\nПуть: {BRED}{pathlib.Path.home()}\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\AutoZoomDaemon.lnk{RESET}\n\n > ')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
except Exception as exp:
|
except Exception as exp:
|
||||||
@ -494,6 +504,10 @@ def settings3():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
elif settings_choose == '4':
|
elif settings_choose == '4':
|
||||||
|
setConfig("remove_old", not getConfig("remove_old"))
|
||||||
|
appendLog(f'Changed option "remove_old" to {getConfig("remove_old")}')
|
||||||
|
|
||||||
|
elif settings_choose == '5':
|
||||||
appendLog('Resetting configuration')
|
appendLog('Resetting configuration')
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@ -527,7 +541,7 @@ def settings3():
|
|||||||
clear()
|
clear()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
elif settings_choose == '5':
|
elif settings_choose == '6':
|
||||||
appendLog('Returned to settings page 2')
|
appendLog('Returned to settings page 2')
|
||||||
clear()
|
clear()
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user