/
VolcanoByte
/
vbNotes
Обзор
Документация
Войти
/
VolcanoByte
/
vbNotes
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
sources/uConsts.py
166 строк
4 KB
Eugene Gavrilyuk
Sync on start and finish
01 апр 2026, 15:32
01 апр 2026, 15:32
f2a8bd9
Код
Авторство
О чём код?
""" Константы """ import os import zipfile from PyQt6.QtGui import QPalette ROOT_DIR = os.path.normpath(os.path.dirname(__file__) + "\\..") INI_FILE_NAME = os.path.join(ROOT_DIR, 'vbNotes.ini') DEFAULT_DB_SHORT_NAME = 'Default.notes' DEFAULT_DB_FULL_NAME = os.path.join(ROOT_DIR, DEFAULT_DB_SHORT_NAME) FILE_FILTERS = ["Notes collections (*.notes)", "All files (*)",] ZIP_COMPRESSION = zipfile.ZIP_DEFLATED ZIP_LEVEL = 9 style_example = ''' ```python # This is an example class Math: @staticmethod def fib(n: int) -> Iterator[int]: # Fibonacci series up to n. a, b = 0, 1 while a < n: yield a a, b = b, a + b result = sum(Math.fib(42)) print(f"The answer is {result}") ``` ''' # Константы тем class ThemeConsts: Light = 'light' Dark = 'dark' # Константы приложения class AppConsts: OrganizationName = "VolcanoByte" Title = 'VolcanoByte Notes' Version = '1.1' Icon = os.path.join(ROOT_DIR, 'vbNotes.ico') CollectionKind = 'notes' DefaultCodeStyle = 'emacs' DefaultCodeFontName = "Fira code" DefaultCodeFontSize = '10' DefaultCodeTabSize = '2' DefaultMethod = 'None' DefaultTheme = ThemeConsts.Light DefaultLanguage = 'English' MaxRecentFiles = 4 # Константы хранилища class StoreConsts: DBFileName = 'DBFileName' MainFormGeometry = 'MainFormGeometry' MainFormState = 'MainFormState' OptionsFormGeometry = 'OptionsFormGeometry' OptionsTheme = 'OptionsTheme' OptionsStyle = 'OptionsStyle' OptionsFontName = 'OptionsFontName' OptionsFontSize = 'OptionsFontSize' OptionsTabSize = 'OptionsTabSize' OptionsUpdateStart = 'OptionsUpdateStart' OptionsUpdateFinish = 'OptionsUpdateFinish' OptionsWebDavHost = 'OptionsWebGavHost' OptionsWebDavLogin = 'OptionsWebDavLogin' OptionsWebDavPassword = 'OptionsWebDavPassword' OptionsLanguage = 'OptionsLanguage' PropertiesFormGeometry = 'PropertiesFormGeometry' SearchFormGeometry = 'SearchFormGeometry' SearchTitle = 'SearchTitle' SearchDescription = 'SearchDescription' SearchText = 'SearchText' SearchHistory = 'SearchHistory' # Страницы в стеке class PageConsts: PageWelcome = 0 PageView = 1 PageEdit = 2 PageSearchNotFound = 3 PageGeneral = 0 PageAppearance = 1 PageSynchronization = 0 class SyncConsts: YoungerDB = 0 YoungerBackup = 1 YoungerIdentical = 2 class ColorConsts: Role = ( QPalette.ColorRole.Button, QPalette.ColorRole.ButtonText, QPalette.ColorRole.Highlight, QPalette.ColorRole.HighlightedText, QPalette.ColorRole.Link, QPalette.ColorRole.LinkVisited, QPalette.ColorRole.PlaceholderText, QPalette.ColorRole.Text, QPalette.ColorRole.ToolTipBase, QPalette.ColorRole.ToolTipText, QPalette.ColorRole.Window, QPalette.ColorRole.WindowText, QPalette.ColorRole.Accent, QPalette.ColorRole.Base, QPalette.ColorRole.AlternateBase, QPalette.ColorRole.BrightText, QPalette.ColorRole.Dark, QPalette.ColorRole.Light, QPalette.ColorRole.Mid, QPalette.ColorRole.Midlight, QPalette.ColorRole.Shadow ) class StyleSheetConst: StatusBarCounter = "border-style :None;color : Green" LightTheme = """ QListView { background : #f0f0f0; outline: 0; } QListView::item { border-radius: 8px; border: 1px solid #e0e4e7; padding: 2px 5px; background : lightblue; } QListView::item:selected { background : #378add; } """ DarkTheme = """ QListView { background : #353535; outline: 0; } QListView::item { border-radius: 8px; border: 1px solid black; padding: 2px 5px; background : lightgray; color: #000000; } QListView::item:selected { background : #378add; color: #ffffff; } """