Skip to content

Commit

Permalink
Type hint shared module
Browse files Browse the repository at this point in the history
  • Loading branch information
kra-mo committed Jul 30, 2024
1 parent 2394201 commit 22a755c
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cartridges/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from cartridges.importer.desktop_source import DesktopSource
from cartridges.importer.flatpak_source import FlatpakSource
from cartridges.importer.heroic_source import HeroicSource
from cartridges.importer.importer import Importer
from cartridges.importer.importer import Importer # yo dawg
from cartridges.importer.itch_source import ItchSource
from cartridges.importer.legendary_source import LegendarySource
from cartridges.importer.lutris_source import LutrisSource
Expand Down
78 changes: 78 additions & 0 deletions cartridges/shared.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# shared.pyi
#
# Copyright 2024 kramo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: GPL-3.0-or-later

from pathlib import Path
from typing import Optional

from gi.repository import Gio

from cartridges.importer.importer import Importer
from cartridges.store.store import Store
from cartridges.window import CartridgesWindow


class AppState:
DEFAULT: int
LOAD_FROM_DISK: int
IMPORT: int
REMOVE_ALL_GAMES: int
UNDO_REMOVE_ALL_GAMES: int


APP_ID: str
VERSION: str
PREFIX: str
PROFILE: str
TIFF_COMPRESSION: str
SPEC_VERSION: float

schema: Gio.Settings
state_schema: Gio.Settings

home: Path

data_dir: Path
host_data_dir: Path

config_dir: Path
host_config_dir: Path

cache_dir: Path
host_cache_dir: Path

flatpak_dir: Path

games_dir: Path
covers_dir: Path

appdata_dir: Path
local_appdata_dir: Path
programfiles32_dir: Path

app_support_dir: Path


scale_factor: int
image_size: int

win: Optional[CartridgesWindow]
importer: Optional[Importer]
import_time: Optional[int]
store = Optional[Store]
log_files: list[Path]
4 changes: 4 additions & 0 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"reportRedeclaration": "none",
"reportMissingModuleSource": "none"
}

0 comments on commit 22a755c

Please sign in to comment.