id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31,800 | update_osm_keys_tags.py | searx_searx/searx_extra/update/update_osm_keys_tags.py | #!/usr/bin/env python
# lint: pylint
# pylint: disable=missing-function-docstring
"""Fetch OSM keys and tags.
To get the i18n names, the scripts uses `Wikidata Query Service`_ instead of for
example `OSM tags API`_ (sidenote: the actual change log from
map.atownsend.org.uk_ might be useful to normalize OSM tags)
.. _... | 6,972 | Python | .py | 177 | 32.966102 | 97 | 0.630194 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,801 | update_firefox_version.py | searx_searx/searx_extra/update/update_firefox_version.py | #!/usr/bin/env python
import json
import requests
import re
from os.path import dirname, join
from urllib.parse import urlparse, urljoin
from packaging.version import Version, parse
from lxml import html
from searx import searx_dir
URL = 'https://ftp.mozilla.org/pub/firefox/releases/'
RELEASE_PATH = '/pub/firefox/rel... | 1,937 | Python | .py | 52 | 31.480769 | 89 | 0.644195 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,802 | update_external_bangs.py | searx_searx/searx_extra/update/update_external_bangs.py | #!/usr/bin/env python
"""
Update searx/data/external_bangs.json using the duckduckgo bangs.
https://duckduckgo.com/newbang loads
* a javascript which provides the bang version ( https://duckduckgo.com/bv1.js )
* a JSON file which contains the bangs ( https://duckduckgo.com/bang.v260.js for example )
This script loads... | 4,461 | Python | .py | 117 | 31.282051 | 94 | 0.615009 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,803 | update_currencies.py | searx_searx/searx_extra/update/update_currencies.py | #!/usr/bin/env python
import re
import unicodedata
import json
# set path
from sys import path
from os.path import realpath, dirname, join
from searx import searx_dir, settings
from searx.engines.wikidata import send_wikidata_query
# ORDER BY (with all the query fields) is important to keep a deterministic result ... | 4,728 | Python | .py | 113 | 36.415929 | 100 | 0.648973 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,804 | update_ahmia_blacklist.py | searx_searx/searx_extra/update/update_ahmia_blacklist.py | #!/usr/bin/env python
# This script saves Ahmia's blacklist for onion sites.
# More info in https://ahmia.fi/blacklist/
# set path
from os.path import join
import requests
from searx import searx_dir
URL = 'https://ahmia.fi/blacklist/banned/'
def fetch_ahmia_blacklist():
resp = requests.get(URL, timeout=3.0)
... | 741 | Python | .py | 20 | 33.35 | 88 | 0.718706 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,805 | stackexchange.py | searx_searx/searx/engines/stackexchange.py | # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
"""Stack Exchange API v2.3
* https://api.stackexchange.com/
"""
import html
from json import loads
from urllib.parse import urlencode
about = {
"website": 'https://stackexchange.com',
"wikidata_id": 'Q3495447',
"official_api_documentation": 'ht... | 1,528 | Python | .tac | 49 | 25.734694 | 77 | 0.609172 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,806 | stackoverflow.py | searx_searx/searx/engines/stackoverflow.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Stackoverflow (IT)
"""
from urllib.parse import urlencode, urljoin, urlparse
from lxml import html
from searx.utils import extract_text
from searx.exceptions import SearxEngineCaptchaException
# about
about = {
"website": 'https://stackoverflow.com/',
"wikidat... | 1,712 | Python | .tac | 50 | 29.56 | 93 | 0.673953 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,807 | shared_uwsgi.py | searx_searx/searx/shared/shared_uwsgi.py | # SPDX-License-Identifier: AGPL-3.0-or-later
import time
import uwsgi # pylint: disable=E0401
from . import shared_abstract
_last_signal = 10
class UwsgiCacheSharedDict(shared_abstract.SharedDict):
def get_int(self, key):
value = uwsgi.cache_get(key)
if value is None:
return value... | 1,689 | Python | .wsgi | 50 | 25.7 | 79 | 0.606769 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,808 | searx.conf:uwsgi | searx_searx/utils/templates/etc/httpd/sites-available/searx.conf:uwsgi | # -*- coding: utf-8; mode: apache -*-
LoadModule headers_module ${APACHE_MODULES}/mod_headers.so
LoadModule proxy_module ${APACHE_MODULES}/mod_proxy.so
LoadModule proxy_uwsgi_module ${APACHE_MODULES}/mod_proxy_uwsgi.so
# LoadModule setenvif_module ${APACHE_MODULES}/mod_setenvif.so
# SetEnvIf Request_U... | 754 | Python | .wsgi | 19 | 35.947368 | 68 | 0.712517 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,809 | installation-uwsgi.rst | searx_searx/docs/admin/installation-uwsgi.rst | .. _searx uwsgi:
=====
uwsgi
=====
.. sidebar:: further reading
- `systemd.unit`_
- `uWSGI Emperor`_
.. contents:: Contents
:depth: 2
:local:
:backlinks: entry
.. _systemd.unit: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
.. _One service per app in systemd:
https://uwsgi-... | 4,912 | Python | .wsgi | 101 | 44.425743 | 91 | 0.725745 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,810 | uwsgi.ini | searx_searx/dockerfiles/uwsgi.ini | [uwsgi]
# Who will run the code
uid = searx
gid = searx
# Number of workers (usually CPU count)
workers = 4
# The right granted on the created socket
chmod-socket = 666
# Plugin to use and interpreter config
single-interpreter = true
master = true
plugin = python3
lazy-apps = true
enable-threads = true
# Module to ... | 1,077 | Python | .wsgi | 37 | 27.837838 | 71 | 0.776699 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,811 | optional_settings.py.in | lutris_lutris/optional_settings.py.in | """Optional configuration automatically generated by the build system"""
# Paths
LOCALE_DIR = "@localedir_path@"
| 114 | Python | .py | 3 | 36.666667 | 72 | 0.781818 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,812 | setup.py | lutris_lutris/setup.py | #!/usr/bin/env python3
import os
import sys
from setuptools import setup
from lutris import __version__ as VERSION
if sys.version_info < (3, 8):
sys.exit("Python >= 3.8 is required to run Lutris")
data_files = []
for directory, _, filenames in os.walk("share"):
dest = directory[6:]
if filenames:
... | 2,452 | Python | .py | 80 | 23.725 | 85 | 0.609045 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,813 | copyright | lutris_lutris/debian/copyright | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: lutris
Upstream-Contact: Mathieu Comandon <mathieucomandon@gmail.com>
Upstream-Source: https://github.com/lutris
Files: *
Copyright: 2009 Mathieu Comandon <mathieucomandon@gmail.com>
License: GPL-3.0-or-later
On Debian systems, ... | 669 | Python | .py | 14 | 46.357143 | 77 | 0.80245 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,814 | meson_post_install.py | lutris_lutris/utils/meson_post_install.py | #!/usr/bin/env python3
from os import environ, path
from subprocess import call
prefix = environ.get("MESON_INSTALL_PREFIX", "/usr/local")
datadir = path.join(prefix, "share")
destdir = environ.get("DESTDIR", "")
# Package managers set this so we don't need to run
if not destdir:
print("Updating icon cache...")
... | 527 | Python | .py | 12 | 41.25 | 83 | 0.706458 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,815 | issuelocker.py | lutris_lutris/utils/issuelocker.py | #!/usr/bin/env python
import json
import os
import subprocess
PROJECT_ROOT = os.path.expanduser("~/Projects/lutris")
OWNER = "lutris"
REPO = "lutris"
response = subprocess.check_output(
"gh issue list -L 200 --state closed --json number --search 'is:unlocked'",
shell=True,
cwd=PROJECT_ROOT,
)
issues = jso... | 570 | Python | .py | 19 | 26.789474 | 109 | 0.695811 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,816 | clean_configs.py | lutris_lutris/utils/clean_configs.py | import os
from lutris.database.games import get_games
CONFIG_DIR = os.path.expanduser("~/.config/lutris/games")
config_paths = set()
for dbgame in get_games():
config_paths.add(dbgame["configpath"] + ".yml")
config_files = set()
for filename in os.listdir(CONFIG_DIR):
config_files.add(filename)
extra_conf... | 542 | Python | .py | 15 | 33.866667 | 57 | 0.75 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,817 | cleanup_prefix.py | lutris_lutris/utils/cleanup_prefix.py | import os
import shutil
import sys
from copy import copy
PROGRAM_FILES_IGNORES = {
"Common Files": {"Microsoft Shared": "*", "System": "*", "InstallShield": "*"},
"Internet Explorer": "*",
"Windows Media Player": "*",
"Windows NT": "*",
"InstallShield Installation Information": "*",
"Microsoft ... | 5,823 | Python | .py | 190 | 23.926316 | 83 | 0.58877 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,818 | bios_format.py | lutris_lutris/utils/bios_format.py | import json
bios_list = """
gb_bios.bin Game Boy BIOS - Optional 32fbbd84168d3482956eb3c5051637f5
gbc_bios.bin Game Boy Color BIOS - Optional dbfce9db9deaa2567f6a84fde55f9680
"""
bioses = []
for bios_line in bios_list.split("\n"):
if not bios_line:
continue
filename, _rest = bios_line.split(maxsp... | 560 | Python | .py | 19 | 24.052632 | 78 | 0.657356 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,819 | test_installer.py | lutris_lutris/tests/test_installer.py | from unittest import TestCase
from lutris.installer.errors import ScriptingError
from lutris.installer.interpreter import ScriptInterpreter
TEST_INSTALLER = {
"script": {"game": {"exe": "test"}},
"version": "test",
"game_slug": "test",
"name": "test",
"slug": "test",
"runner": "linux",
}
cla... | 2,013 | Python | .py | 50 | 31.86 | 90 | 0.618536 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,820 | test_api.py | lutris_lutris/tests/test_api.py | import unittest
from unittest.mock import patch
from lutris import api
RUNTIME_VERSIONS = {
"client_version": "0.5.17",
"runners": {
"wine": [
{
"name": "wine",
"version": "wine-ge-8-26",
"url": "https://github.com/GloriousEggroll/wine-ge-cus... | 2,633 | Python | .py | 62 | 34.758065 | 147 | 0.623098 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,821 | test_wine.py | lutris_lutris/tests/test_wine.py | from unittest import TestCase
from lutris.runners import wine
from lutris.util.test_config import setup_test_environment
setup_test_environment()
class TestDllOverrides(TestCase):
def test_env_format(self):
overrides = {
"d3dcompiler_43": "native,builtin",
"d3dcompiler_47": "nati... | 663 | Python | .py | 16 | 33.4375 | 117 | 0.657854 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,822 | test_utils.py | lutris_lutris/tests/test_utils.py | import os
from collections import OrderedDict
from unittest import TestCase
from lutris.util import fileio, strings, system
from lutris.util.steam import vdfutils
from lutris.util.wine import wine
class TestFileUtils(TestCase):
def test_file_ids_are_correctly_transformed(self):
file_id = "foo-bar"
... | 8,032 | Python | .py | 156 | 43.391026 | 113 | 0.645836 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,823 | check_prefixes.py | lutris_lutris/tests/check_prefixes.py | #!/usr/bin/env python3
import os
import subprocess
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from lutris.util.wine.registry import WineRegistry
PREFIXES_PATH = os.path.expanduser("~/Games/wine/prefixes")
def get_registries():
registry_list = []
directories = ... | 1,491 | Python | .py | 36 | 35.583333 | 83 | 0.688581 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,824 | test_glxinfo.py | lutris_lutris/tests/test_glxinfo.py | import os
from unittest import TestCase
from lutris.util.graphics.glxinfo import GlxInfo
FIXTURES_PATH = os.path.join(os.path.dirname(__file__), "fixtures")
class BaseGlxInfo(TestCase):
fixture = None
def setUp(self):
output = self.read_fixture(self.fixture)
self.glxinfo = GlxInfo(output)
... | 1,550 | Python | .py | 32 | 41.625 | 115 | 0.705452 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,825 | test_pga.py | lutris_lutris/tests/test_pga.py | import os
import unittest
from sqlite3 import OperationalError
from lutris import settings
from lutris.database import games as games_db
from lutris.database import schema, sql
from lutris.util.test_config import setup_test_environment
setup_test_environment()
class DatabaseTester(unittest.TestCase):
def setUp(... | 5,149 | Python | .py | 108 | 39.601852 | 103 | 0.636237 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,826 | test_lutris_wrapper.py | lutris_lutris/tests/test_lutris_wrapper.py | import os
import os.path
import subprocess
import sys
import unittest
if os.path.isfile("share/lutris/bin/lutris-wrapper"):
lutris_wrapper_bin = "share/lutris/bin/lutris-wrapper"
else:
lutris_wrapper_bin = "lutris-wrapper"
class LutrisWrapperTestCase(unittest.TestCase):
def test_excluded_initial_process(... | 4,447 | Python | .py | 112 | 26.714286 | 100 | 0.541166 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,827 | test_moddb_helper.py | lutris_lutris/tests/test_moddb_helper.py | import unittest
from lutris.util.log import logger
try:
import moddb
SKIP_TESTS = False
except ImportError:
moddb = object
logger.error("ModDB tests skipped")
SKIP_TESTS = True
from lutris.util.log import logger
from lutris.util.moddb import ModDB, is_moddb_url
class ModDBHelperTests(unittest.T... | 6,253 | Python | .py | 157 | 30.987261 | 108 | 0.635044 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,828 | test_dialogs.py | lutris_lutris/tests/test_dialogs.py | from unittest import TestCase
from lutris import runners
from lutris.gui.application import Application
from lutris.gui.config.add_game_dialog import AddGameDialog
from lutris.gui.config.game_common import GameDialogCommon
from lutris.gui.views.store import sort_func
from lutris.util.test_config import setup_test_envi... | 3,420 | Python | .py | 80 | 34.9375 | 91 | 0.62549 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,829 | test_registry.py | lutris_lutris/tests/test_registry.py | import os
from unittest import TestCase
from lutris.util.wine.registry import WineRegistry, WineRegistryKey
FIXTURES_PATH = os.path.join(os.path.dirname(__file__), "fixtures")
class TestWineRegistry(TestCase):
def setUp(self):
self.registry_path = os.path.join(FIXTURES_PATH, "user.reg")
self.reg... | 5,049 | Python | .py | 93 | 45.967742 | 114 | 0.663557 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,830 | test_resources.py | lutris_lutris/tests/test_resources.py | from unittest import TestCase
from lutris.api import parse_installer_url
class TestInstallerUrls(TestCase):
def test_legacy_url(self):
result = parse_installer_url("lutris:quake")
self.assertEqual(result["game_slug"], "quake")
self.assertEqual(result["revision"], None)
self.assert... | 1,410 | Python | .py | 27 | 44.481481 | 77 | 0.685548 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,831 | test_runners.py | lutris_lutris/tests/runners/test_runners.py | import logging
from unittest.mock import patch
from test_pga import DatabaseTester
from lutris import runners
from lutris.config import LutrisConfig
from lutris.util.test_config import setup_test_environment
LOGGER = logging.getLogger(__name__)
setup_test_environment()
class ImportRunnerTest(DatabaseTester):
d... | 4,311 | Python | .py | 91 | 36.010989 | 106 | 0.593817 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,832 | test_scummvm.py | lutris_lutris/tests/runners/test_scummvm.py | from unittest import TestCase
from unittest.mock import patch
from lutris.config import LutrisConfig
from lutris.runners.runner import Runner
from lutris.runners.scummvm import scummvm
class TestScummvm(TestCase):
def test_custom_data_dir(self):
scummvm_runner = scummvm()
scummvm_runner.config = ... | 830 | Python | .py | 16 | 45.3125 | 93 | 0.709518 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,833 | test_vita3k.py | lutris_lutris/tests/runners/test_vita3k.py | import unittest
from unittest.mock import MagicMock, patch
from lutris.runners.vita3k import MissingVitaTitleIDError, vita3k
class TestVita3kRunner(unittest.TestCase):
def setUp(self):
self.runner = vita3k()
self.runner.get_executable = lambda: "vita3k"
self.runner.get_command = lambda: [... | 1,916 | Python | .py | 42 | 38 | 85 | 0.656852 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,834 | test_snes9x.py | lutris_lutris/tests/runners/test_snes9x.py | import logging
from unittest import TestCase
from lutris.runners.snes9x import snes9x
LOGGER = logging.getLogger(__name__)
class TestSnes9x(TestCase):
def test_set_option(self):
snes9x_runner = snes9x()
if snes9x_runner.is_installed():
snes9x_runner.set_option("full_screen_on_open", ... | 403 | Python | .py | 11 | 30.545455 | 64 | 0.688144 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,835 | test_pcsx2.py | lutris_lutris/tests/runners/test_pcsx2.py | import unittest
from unittest.mock import MagicMock, patch
from lutris.exceptions import MissingGameExecutableError
from lutris.runners.pcsx2 import pcsx2
class TestPCSX2Runner(unittest.TestCase):
def setUp(self):
self.runner = pcsx2()
self.runner.get_executable = lambda: "pcsx2"
self.run... | 3,334 | Python | .py | 72 | 38.361111 | 96 | 0.648433 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,836 | test_drivers.py | lutris_lutris/tests/util/graphics/test_drivers.py | import io
import subprocess
import unittest
from unittest.mock import patch
from lutris.util.graphics import drivers, glxinfo
PROPRIETARY_MODULE_VERSION_FILE = """\
NVRM version: NVIDIA UNIX x86_64 Kernel Module 525.105.17 Tue Mar 28 18:02:59 UTC 2023
GCC version: gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)
... | 9,999 | Python | .py | 218 | 39.862385 | 112 | 0.682462 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,837 | runtime.py | lutris_lutris/lutris/runtime.py | """Runtime handling module"""
import concurrent.futures
import os
import threading
import time
from gettext import gettext as _
from typing import Any, Dict, List, Optional
from lutris import settings
from lutris.api import (
check_stale_runtime_versions,
download_runtime_versions,
format_runner_version,
... | 20,886 | Python | .py | 423 | 40.465721 | 118 | 0.663065 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,838 | runner_interpreter.py | lutris_lutris/lutris/runner_interpreter.py | """Transform runner parameters to data usable for runtime execution"""
import os
import shlex
import stat
from lutris.util import cache_single, system
from lutris.util.graphics.gpu import GPUS
from lutris.util.linux import LINUX_SYSTEM
from lutris.util.log import logger
def get_mangohud_conf(system_config):
"""... | 6,870 | Python | .py | 141 | 41.886525 | 103 | 0.673933 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,839 | config.py | lutris_lutris/lutris/config.py | """Handle the game, runner and global system configurations."""
import os
import time
from shutil import copyfile
from lutris import settings, sysoptions
from lutris.runners import InvalidRunnerError, import_runner
from lutris.util.log import logger
from lutris.util.system import path_exists
from lutris.util.yaml imp... | 10,191 | Python | .py | 226 | 35.597345 | 117 | 0.615578 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,840 | settings.py | lutris_lutris/lutris/settings.py | """Internal settings."""
import json
import os
import sys
from gettext import gettext as _
from gi.repository import GLib
from lutris import __version__
from lutris.util.log import logger
from lutris.util.settings import SettingsIO
PROJECT = "Lutris"
VERSION = __version__
COPYRIGHT = _("(c) 2009 Lutris Team")
AUTHO... | 5,081 | Python | .py | 100 | 46.08 | 116 | 0.696126 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,841 | monitored_command.py | lutris_lutris/lutris/monitored_command.py | """Threading module, used to launch games while monitoring them."""
import contextlib
import fcntl
import io
import os
import shlex
import subprocess
import sys
import uuid
from copy import copy
from gi.repository import GLib
from lutris import runtime, settings
from lutris.util import system
from lutris.util.log im... | 10,364 | Python | .py | 259 | 30.482625 | 113 | 0.609802 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,842 | exception_backstops.py | lutris_lutris/lutris/exception_backstops.py | from functools import wraps
from typing import Any, Callable, Iterable
from gi.repository import Gio, GLib, GObject, Gtk
from lutris.gui.dialogs import display_error
from lutris.util.log import logger
def watch_game_errors(game_stop_result, game=None):
"""Decorator used to catch exceptions and send events inste... | 6,375 | Python | .py | 123 | 42.902439 | 116 | 0.667846 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,843 | startup.py | lutris_lutris/lutris/startup.py | """Check to run at program start"""
import os
import sqlite3
from gettext import gettext as _
import gi
gi.require_version("Gdk", "3.0")
gi.require_version("Gtk", "3.0")
from gi.repository import GdkPixbuf
from lutris import runners, settings
from lutris.database.games import get_games
from lutris.database.schema ... | 4,815 | Python | .py | 119 | 33.453782 | 116 | 0.670447 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,844 | search.py | lutris_lutris/lutris/search.py | import copy
import time
from typing import Any, Callable, Optional, Set
from lutris.database import games
from lutris.database.categories import (
get_game_ids_for_categories,
get_uncategorized_game_ids,
normalized_category_names,
)
from lutris.exceptions import InvalidSearchTermError
from lutris.runners i... | 16,325 | Python | .py | 352 | 36.178977 | 120 | 0.623558 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,845 | game.py | lutris_lutris/lutris/game.py | """Module that actually runs the games."""
# pylint: disable=too-many-public-methods disable=too-many-lines
import json
import os
import shlex
import shutil
import signal
import subprocess
import time
from gettext import gettext as _
from typing import cast
from gi.repository import Gio, GLib, Gtk
from lutris import... | 46,304 | Python | .py | 973 | 37.453237 | 119 | 0.626501 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,846 | api.py | lutris_lutris/lutris/api.py | """Functions to interact with the Lutris REST API"""
import json
import os
import re
import socket
import time
import urllib.error
import urllib.parse
import urllib.request
from collections import OrderedDict
from datetime import datetime
from gettext import gettext as _
from typing import Any, Dict, Optional, Tuple
... | 19,142 | Python | .py | 442 | 36.739819 | 115 | 0.66396 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,847 | cache.py | lutris_lutris/lutris/cache.py | """Module for handling the PGA cache"""
import os
import shutil
from lutris import settings
from lutris.util.log import logger
from lutris.util.system import merge_folders
def get_cache_path():
"""Returns the directory under which Lutris caches install files. This can be specified
by the user, but defaults ... | 1,665 | Python | .py | 41 | 35.02439 | 91 | 0.699752 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,848 | sysoptions.py | lutris_lutris/lutris/sysoptions.py | """Options list for system config."""
import os
from collections import OrderedDict
from gettext import gettext as _
from lutris import runners
from lutris.util import linux, system
from lutris.util.display import DISPLAY_MANAGER, SCREEN_SAVER_INHIBITOR, is_compositing_enabled, is_display_x11
from lutris.util.graphic... | 19,061 | Python | .py | 538 | 27.076208 | 120 | 0.546604 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,849 | search_predicate.py | lutris_lutris/lutris/search_predicate.py | from abc import ABC, abstractmethod
from typing import Any, Callable, Dict, List, Optional
from lutris.util.strings import strip_accents
FLAG_TEXTS: Dict[str, Optional[bool]] = {"true": True, "yes": True, "false": False, "no": False}
def format_flag(flag: Optional[bool]) -> str:
return "yes" if flag else "no"
... | 9,106 | Python | .py | 203 | 36.359606 | 98 | 0.634613 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,850 | exceptions.py | lutris_lutris/lutris/exceptions.py | """Exception handling module"""
from gettext import gettext as _
class LutrisError(Exception):
"""Base exception for Lutris related errors"""
def __init__(self, message, *args, **kwarg):
super().__init__(message, *args, **kwarg)
self.message = message
class MisconfigurationError(LutrisErro... | 4,157 | Python | .py | 77 | 47.194805 | 120 | 0.681706 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,851 | game_actions.py | lutris_lutris/lutris/game_actions.py | """Handle game specific actions"""
# Standard Library
# pylint: disable=too-many-public-methods
import os
from gettext import gettext as _
from typing import List
from gi.repository import Gio, Gtk
from lutris.config import duplicate_game_config
from lutris.database.games import add_game, get_game_by_field
from lutr... | 20,526 | Python | .py | 410 | 40.378049 | 120 | 0.628151 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,852 | style_manager.py | lutris_lutris/lutris/style_manager.py | import enum
from gi.repository import Gio, GLib, GObject, Gtk
from lutris import settings
from lutris.util.log import logger
PORTAL_BUS_NAME = "org.freedesktop.portal.Desktop"
PORTAL_OBJECT_PATH = "/org/freedesktop/portal/desktop"
PORTAL_SETTINGS_INTERFACE = "org.freedesktop.portal.Settings"
class ColorScheme(enum... | 5,244 | Python | .py | 132 | 30.606061 | 83 | 0.61446 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,853 | tosec.py | lutris_lutris/lutris/scanners/tosec.py | import os
from lutris import settings
from lutris.util import http
from lutris.util.extract import extract_archive
from lutris.util.log import logger
from lutris.util.system import get_md5_hash
archive_formats = [".zip", ".7z", ".rar", ".gz"]
save_formats = [".srm"]
PLATFORM_PATTERNS = {
"3DO": "3do",
"Amiga ... | 5,215 | Python | .py | 145 | 28.255172 | 111 | 0.581175 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,854 | default_installers.py | lutris_lutris/lutris/scanners/default_installers.py | DEFAULT_INSTALLERS = {
"3do": {
"runner": "libretro",
"game": {"core": "opera", "main_file": "rom"},
},
"sms": {
"runner": "libretro",
"game": {"core": "genesis_plus_gx", "main_file": "rom"},
},
"gg": {
"runner": "libretro",
"game": {"core": "genesis_p... | 4,279 | Python | .py | 106 | 33.820755 | 112 | 0.477594 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,855 | lutris.py | lutris_lutris/lutris/scanners/lutris.py | import os
from lutris.api import get_api_games, get_game_installers
from lutris.database.games import get_games
from lutris.installer.errors import MissingGameDependencyError
from lutris.installer.interpreter import ScriptInterpreter
from lutris.services.lutris import download_lutris_media
from lutris.util.log import ... | 3,597 | Python | .py | 86 | 34.5 | 101 | 0.663805 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,856 | retroarch.py | lutris_lutris/lutris/scanners/retroarch.py | import os
from lutris.config import write_game_config
from lutris.database.games import add_game, get_games
from lutris.util.log import logger
from lutris.util.retroarch.core_config import RECOMMENDED_CORES
from lutris.util.strings import slugify
SCANNERS = {
"mesen": "NES",
"gambatte": "Gameboy / Gameboy Col... | 2,394 | Python | .py | 76 | 24.960526 | 100 | 0.598094 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,857 | migrate_hidden_ids.py | lutris_lutris/lutris/migrations/migrate_hidden_ids.py | """Move hidden games from settings to database"""
from lutris import settings
from lutris.game import Game
def get_hidden_ids():
"""Return a list of game IDs to be excluded from the library view"""
# Load the ignore string and filter out empty strings to prevent issues
ignores_raw = settings.read_setting... | 739 | Python | .py | 19 | 33.631579 | 75 | 0.681119 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,858 | migrate_hidden_category.py | lutris_lutris/lutris/migrations/migrate_hidden_category.py | from sqlite3 import OperationalError
from lutris.database.games import get_games
from lutris.game import Game
from lutris.util.log import logger
def migrate():
"""Put all previously hidden games into the new '.hidden' category."""
logger.info("Moving hidden games to the '.hidden' category")
try:
... | 695 | Python | .py | 17 | 35.176471 | 74 | 0.681009 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,859 | retrieve_discord_appids.py | lutris_lutris/lutris/migrations/retrieve_discord_appids.py | from lutris import settings
from lutris.api import get_api_games
from lutris.database.games import get_games, sql
from lutris.util.log import logger
def migrate():
"""
Update Games that does not have a Discord ID
"""
logger.info("Updating Games Discord APP ID's")
# Get Slugs from all games
slu... | 679 | Python | .py | 18 | 32.555556 | 108 | 0.665653 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,860 | mess_to_mame.py | lutris_lutris/lutris/migrations/mess_to_mame.py | """Migrate MESS games to MAME"""
from lutris.database.games import get_games
from lutris.game import Game
def migrate():
"""Run migration"""
for pga_game in get_games():
game = Game(pga_game["id"])
if game.runner_name != "mess":
continue
if "mess" in game.config.game_level... | 456 | Python | .py | 13 | 28.307692 | 79 | 0.618182 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,861 | migrate_sortname.py | lutris_lutris/lutris/migrations/migrate_sortname.py | from lutris import settings
from lutris.api import get_api_games
from lutris.database import sql
from lutris.database.games import get_games
from lutris.util.log import logger
def migrate():
"""Add blank sortname field to games that do not yet have one"""
logger.info("Adding blank sortname field to database")... | 678 | Python | .py | 14 | 43.857143 | 94 | 0.697885 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,862 | migrate_banners.py | lutris_lutris/lutris/migrations/migrate_banners.py | """Migrate banners from .local/share/lutris to .cache/lutris"""
import os
from lutris import settings
from lutris.util.log import logger
def migrate():
dest_dir = settings.BANNER_PATH
src_dir = os.path.join(settings.DATA_DIR, "banners")
try:
# init_lutris() creates the new banners directory
... | 876 | Python | .py | 21 | 31.619048 | 63 | 0.603774 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,863 | __init__.py | lutris_lutris/lutris/migrations/__init__.py | import importlib
from lutris import settings
from lutris.util.log import logger
MIGRATION_VERSION = 14 # Never decrease this number
# Replace deprecated migrations with empty lists
MIGRATIONS = [
[],
[],
[],
[],
[],
[],
[],
["mess_to_mame"],
["migrate_hidden_ids"],
["migrate_... | 1,054 | Python | .py | 33 | 26.818182 | 75 | 0.678184 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,864 | migrate_steam_appids.py | lutris_lutris/lutris/migrations/migrate_steam_appids.py | """Set service ID for Steam games"""
from lutris import settings
from lutris.database.games import get_games, sql
def migrate():
"""Run migration"""
for game in get_games():
if not game.get("steamid"):
continue
if game["runner"] and game["runner"] != "steam":
continue
... | 520 | Python | .py | 14 | 29.928571 | 110 | 0.586481 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,865 | lutriswindow.py | lutris_lutris/lutris/gui/lutriswindow.py | """Main window for the Lutris interface."""
# pylint: disable=too-many-lines
# pylint: disable=no-member
import os
from collections import namedtuple
from gettext import gettext as _
from typing import Iterable, List
from urllib.parse import unquote, urlparse
from gi.repository import Gdk, Gio, GLib, GObject, Gtk
fr... | 57,332 | Python | .py | 1,140 | 39.803509 | 134 | 0.63428 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,866 | download_queue.py | lutris_lutris/lutris/gui/download_queue.py | # pylint: disable=no-member
import os
from typing import Any, Callable, Dict, Iterable, List, Set
from gi.repository import Gtk
from lutris.gui.widgets.gi_composites import GtkTemplate
from lutris.gui.widgets.progress_box import ProgressBox
from lutris.util import datapath
from lutris.util.jobs import AsyncCall
from ... | 7,224 | Python | .py | 137 | 42.883212 | 104 | 0.664445 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,867 | installerwindow.py | lutris_lutris/lutris/gui/installerwindow.py | """Window used for game installers"""
# pylint: disable=too-many-lines
import os
import traceback
from gettext import gettext as _
from gi.repository import Gdk, Gio, GLib, Gtk
from lutris import settings
from lutris.config import LutrisConfig
from lutris.game import Game
from lutris.gui.dialogs import (
Directo... | 42,842 | Python | .py | 844 | 40.648104 | 147 | 0.650207 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,868 | application.py | lutris_lutris/lutris/gui/application.py | # pylint: disable=wrong-import-position
# pylint: disable=too-many-lines
#
# Copyright (C) 2009 Mathieu Comandon <mathieucomandon@gmail.com>
#
# 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, eit... | 40,277 | Python | .py | 954 | 30.392034 | 120 | 0.569906 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,869 | addgameswindow.py | lutris_lutris/lutris/gui/addgameswindow.py | import os
from gettext import gettext as _
from gi.repository import Gio, Gtk
from lutris import api, sysoptions
from lutris.gui.config.add_game_dialog import AddGameDialog
from lutris.gui.dialogs import ErrorDialog, ModelessDialog
from lutris.gui.dialogs.game_import import ImportGameDialog
from lutris.gui.widgets.co... | 24,690 | Python | .py | 481 | 41.68815 | 120 | 0.643237 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,870 | log_text_view.py | lutris_lutris/lutris/gui/widgets/log_text_view.py | # Third Party Libraries
from gi.repository import Gtk
class LogTextView(Gtk.TextView):
# pylint: disable=no-member
def __init__(self, buffer=None, autoscroll=True, wrap_mode=Gtk.WrapMode.CHAR):
super().__init__(visible=True)
if buffer:
self.set_buffer(buffer)
self.set_edi... | 3,433 | Python | .py | 70 | 39.442857 | 85 | 0.651121 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,871 | gi_composites.py | lutris_lutris/lutris/gui/widgets/gi_composites.py | """GtkTemplate implementation for PyGI
Blog post
http://www.virtualroadside.com/blog/index.php/2015/05/24/gtk3-composite-widget-templates-for-python/
Github
https://github.com/virtuald/pygi-composite-templates/blob/master/gi_composites.py
This should have landed in PyGObect and will be available without this shim in... | 9,477 | Python | .py | 211 | 37.507109 | 116 | 0.664709 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,872 | window.py | lutris_lutris/lutris/gui/widgets/window.py | # Third Party Libraries
from gi.repository import Gtk
class BaseApplicationWindow(Gtk.ApplicationWindow):
"""Window used to guide the user through a issue reporting process"""
def __init__(self, application):
Gtk.ApplicationWindow.__init__(self, icon_name="lutris", application=application)
se... | 1,427 | Python | .py | 31 | 37.83871 | 91 | 0.670266 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,873 | download_collection_progress_box.py | lutris_lutris/lutris/gui/widgets/download_collection_progress_box.py | import os
import time
from gettext import gettext as _
from gi.repository import GObject, Gtk, Pango
from lutris.gui.dialogs import display_error
from lutris.util.downloader import Downloader
from lutris.util.jobs import schedule_repeating_at_idle
from lutris.util.log import logger
from lutris.util.strings import gtk... | 9,527 | Python | .py | 206 | 36.291262 | 107 | 0.624946 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,874 | game_bar.py | lutris_lutris/lutris/gui/widgets/game_bar.py | from datetime import datetime
from gettext import gettext as _
from gi.repository import Gtk, Pango
from lutris import runners, services
from lutris.database.games import get_game_for_service
from lutris.game import GAME_INSTALLED, GAME_START, GAME_STARTED, GAME_STOPPED, GAME_UPDATED, Game
from lutris.game_actions im... | 11,728 | Python | .py | 238 | 38.920168 | 109 | 0.636586 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,875 | contextual_menu.py | lutris_lutris/lutris/gui/widgets/contextual_menu.py | from gi.repository import Gtk
def update_action_widget_visibility(widgets, visible_predicate):
"""This sets the visibility on a set of widgets, like menu items. You provide a function
that indicates if an item is visible, or None for separators that are visible based on
their neighbors. Returns the count ... | 2,390 | Python | .py | 58 | 31.637931 | 92 | 0.633059 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,876 | sidebar.py | lutris_lutris/lutris/gui/widgets/sidebar.py | """Sidebar for the main window"""
import locale
from gettext import gettext as _
from typing import List
from gi.repository import GObject, Gtk, Pango
from lutris import runners, services
from lutris.config import LutrisConfig
from lutris.database import categories as categories_db
from lutris.database import games ... | 28,726 | Python | .py | 617 | 36.570502 | 120 | 0.623142 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,877 | cellrenderers.py | lutris_lutris/lutris/gui/widgets/cellrenderers.py | # pylint: disable=no-member
# pylint:disable=using-constant-test
# pylint:disable=comparison-with-callable
from gettext import gettext as _
from math import floor
import gi
from lutris.util.jobs import schedule_at_idle
from lutris.util.log import logger
gi.require_version("PangoCairo", "1.0")
import cairo
from gi.r... | 22,655 | Python | .py | 450 | 40.031111 | 116 | 0.629289 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,878 | download_progress_box.py | lutris_lutris/lutris/gui/widgets/download_progress_box.py | import os
from gettext import gettext as _
from typing import Optional
from urllib.parse import urlparse
from gi.repository import GObject, Gtk, Pango
from lutris.gui.dialogs import display_error
from lutris.util.downloader import Downloader
from lutris.util.jobs import schedule_repeating_at_idle
from lutris.util.log... | 5,861 | Python | .py | 135 | 34.348148 | 100 | 0.635152 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,879 | utils.py | lutris_lutris/lutris/gui/widgets/utils.py | """Various utilities using the GObject framework"""
import array
import os
from typing import Optional
import cairo
from gi.repository import Gdk, GdkPixbuf, Gio, GLib, Gtk
from lutris import settings
from lutris.exceptions import MissingMediaError
from lutris.gui.widgets import NotificationSource
from lutris.util i... | 10,080 | Python | .py | 212 | 41.891509 | 116 | 0.693037 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,880 | __init__.py | lutris_lutris/lutris/gui/widgets/__init__.py | from typing import Callable, Dict, List, Optional, Tuple
from lutris.util.jobs import schedule_at_idle
class NotificationRegistration:
"""Represents a registered callback; can be used to remove the registration. Obtain this
by calling NotificationSource.register; a null-object that represent no registration
... | 3,517 | Python | .py | 59 | 52.186441 | 103 | 0.710962 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,881 | navigation_stack.py | lutris_lutris/lutris/gui/widgets/navigation_stack.py | """Window used for game installers"""
# pylint: disable=too-many-lines
from gi.repository import Gtk
class NavigationStack(Gtk.Stack):
"""
This is a Stack widget that supports a back button and
lazy-creation of pages.
Pages should be set up via add_named_factory(), then displayed
with present_pa... | 7,407 | Python | .py | 146 | 41.575342 | 114 | 0.665375 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,882 | searchable_combobox.py | lutris_lutris/lutris/gui/widgets/searchable_combobox.py | """Extended combobox with search"""
# pylint: disable=unsubscriptable-object
from gi.repository import GLib, GObject, Gtk
from lutris.gui.dialogs import display_error
class SearchableCombobox(Gtk.Bin):
"""Combox box with autocompletion.
Well fitted for large lists.
"""
__gsignals__ = {
"cha... | 3,310 | Python | .py | 75 | 35.72 | 96 | 0.653619 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,883 | status_icon.py | lutris_lutris/lutris/gui/widgets/status_icon.py | """AppIndicator/AyatanaAppIndicator based tray icon"""
from gettext import gettext as _
import gi
from gi.repository import Gtk
from lutris.database.games import get_games
from lutris.game import Game
from lutris.util.display import is_display_x11
try:
gi.require_version("AppIndicator3", "0.1")
from gi.repo... | 5,525 | Python | .py | 126 | 34.428571 | 100 | 0.632402 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,884 | progress_box.py | lutris_lutris/lutris/gui/widgets/progress_box.py | from typing import Callable
from gi.repository import Gtk, Pango
from lutris.util.jobs import schedule_repeating_at_idle
from lutris.util.log import logger
class ProgressInfo:
"""Contains the current state of a process being monitored. This can also provide
for stopping the process via a function you can pr... | 4,637 | Python | .py | 94 | 40.62766 | 110 | 0.662458 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,885 | notifications.py | lutris_lutris/lutris/gui/widgets/notifications.py | from gi.repository import Gio
from lutris.util.log import logger
def send_notification(title, text, file_path_to_icon="lutris"):
icon_file = Gio.File.new_for_path(file_path_to_icon)
icon = Gio.FileIcon.new(icon_file)
notification = Gio.Notification.new(title)
notification.set_body(text)
notificat... | 488 | Python | .py | 12 | 36.25 | 63 | 0.753715 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,886 | common.py | lutris_lutris/lutris/gui/widgets/common.py | """Misc widgets used in the GUI."""
# Standard Library
import os
import shlex
import urllib.parse
from gettext import gettext as _
# Third Party Libraries
from gi.repository import GLib, GObject, Gtk, Pango
from lutris.gui.widgets.utils import open_uri
# Lutris Modules
from lutris.util import system
from lutris.uti... | 16,005 | Python | .py | 339 | 36.911504 | 112 | 0.621495 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,887 | scaled_image.py | lutris_lutris/lutris/gui/widgets/scaled_image.py | from gi.repository import Gtk
from lutris.gui.widgets.utils import (
ICON_SIZE,
get_default_icon_path,
get_pixbuf_by_path,
get_required_pixbuf_by_path,
get_runtime_icon_path,
has_stock_icon,
)
class ScaledImage(Gtk.Image):
"""This class provides a rather basic feature the GtkImage doesn't... | 4,055 | Python | .py | 76 | 44.723684 | 104 | 0.663299 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,888 | media_loader.py | lutris_lutris/lutris/gui/views/media_loader.py | """Loads game media in parallel"""
import concurrent.futures
from lutris.gui.widgets.utils import MEDIA_CACHE_INVALIDATED
from lutris.util import system
from lutris.util.log import logger
def download_media(media_urls, service_media):
"""Download a list of media files concurrently.
Limits the number of sim... | 1,120 | Python | .py | 27 | 33.296296 | 111 | 0.660534 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,889 | store_item.py | lutris_lutris/lutris/gui/views/store_item.py | """Game representation for views"""
import time
from lutris.database import games
from lutris.runners import get_runner_human_name
from lutris.services import SERVICES
from lutris.util.log import logger
from lutris.util.strings import get_formatted_playtime, gtk_safe
class StoreItem:
"""Representation of a game... | 5,762 | Python | .py | 142 | 32.091549 | 111 | 0.621573 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,890 | __init__.py | lutris_lutris/lutris/gui/views/__init__.py | """Common values used for views"""
(
COL_ID,
COL_SLUG,
COL_NAME,
COL_SORTNAME,
COL_MEDIA_PATHS,
COL_YEAR,
COL_RUNNER,
COL_RUNNER_HUMAN_NAME,
COL_PLATFORM,
COL_LASTPLAYED,
COL_LASTPLAYED_TEXT,
COL_INSTALLED,
COL_INSTALLED_AT,
COL_INSTALLED_AT_TEXT,
COL_PLAYTIM... | 613 | Python | .py | 28 | 17.535714 | 41 | 0.64837 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,891 | base.py | lutris_lutris/lutris/gui/views/base.py | import time
from typing import List
from gi.repository import Gdk, Gio, GObject, Gtk
from lutris.database.games import get_game_for_service
from lutris.database.services import ServiceGameCollection
from lutris.game import GAME_START, Game
from lutris.game_actions import GameActions, get_game_actions
from lutris.gui.... | 8,119 | Python | .py | 165 | 38.351515 | 112 | 0.628033 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,892 | grid.py | lutris_lutris/lutris/gui/views/grid.py | """Grid view for the main window"""
# pylint: disable=no-member
from gi.repository import Gtk
from lutris import settings
from lutris.gui.views import COL_ID, COL_INSTALLED, COL_MEDIA_PATHS, COL_NAME, COL_PLATFORM
from lutris.gui.views.base import GameView
from lutris.gui.widgets.cellrenderers import GridViewCellRend... | 3,776 | Python | .py | 84 | 36.202381 | 96 | 0.654129 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,893 | store.py | lutris_lutris/lutris/gui/views/store.py | """Store object for a list of games"""
# pylint: disable=not-an-iterable
import time
from gi.repository import GLib, GObject, Gtk
from lutris import settings
from lutris.database import sql
from lutris.database.games import get_all_installed_game_for_service, get_games
from lutris.gui.views.store_item import StoreIt... | 7,058 | Python | .py | 191 | 27.39267 | 95 | 0.588252 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,894 | list.py | lutris_lutris/lutris/gui/views/list.py | """TreeView based game list"""
from gettext import gettext as _
# Third Party Libraries
# pylint: disable=no-member
from gi.repository import Gdk, Gtk, Pango
# Lutris Modules
from lutris import settings
from lutris.gui.views import (
COL_ID,
COL_INSTALLED,
COL_INSTALLED_AT,
COL_INSTALLED_AT_TEXT,
... | 7,728 | Python | .py | 179 | 34.385475 | 112 | 0.633799 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,895 | edit_game_categories.py | lutris_lutris/lutris/gui/config/edit_game_categories.py | # pylint: disable=no-member
from gettext import gettext as _
from typing import Sequence
from gi.repository import Gtk
from lutris.database import categories as categories_db
from lutris.database.categories import is_reserved_category
from lutris.game import Game
from lutris.gui.dialogs import QuestionDialog, Savable... | 6,973 | Python | .py | 136 | 39.007353 | 110 | 0.616821 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,896 | boxes.py | lutris_lutris/lutris/gui/config/boxes.py | """Widget generators and their signal handlers"""
# Standard Library
# pylint: disable=no-member,too-many-public-methods
import os
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gdk, Gtk
# Lutris Modules
from lutris import settings, sysoptions
from lutris.gui.widgets.common import... | 35,355 | Python | .py | 741 | 36.25776 | 117 | 0.605366 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,897 | preferences_dialog.py | lutris_lutris/lutris/gui/config/preferences_dialog.py | """Configuration dialog for client and system options"""
# pylint: disable=no-member
from gettext import gettext as _
from textwrap import dedent
from gi.repository import GObject, Gtk
from lutris.config import LutrisConfig
from lutris.gui.config.accounts_box import AccountsBox
from lutris.gui.config.boxes import Sy... | 6,110 | Python | .py | 111 | 46.765766 | 115 | 0.684642 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,898 | runners_box.py | lutris_lutris/lutris/gui/config/runners_box.py | """Add, remove and configure runners"""
from gettext import gettext as _
from gi.repository import Gtk
from lutris import runners, settings
from lutris.gui.config.base_config_box import BaseConfigBox
from lutris.gui.config.runner_box import RunnerBox
from lutris.gui.widgets.utils import open_uri
from lutris.search i... | 2,667 | Python | .py | 60 | 35.933333 | 119 | 0.65625 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,899 | sysinfo_box.py | lutris_lutris/lutris/gui/config/sysinfo_box.py | from gettext import gettext as _
from typing import Dict, Iterable, List
from gi.repository import Gdk, Gtk
from lutris.gui.config.base_config_box import BaseConfigBox
from lutris.gui.widgets.log_text_view import LogTextView
from lutris.util import linux, system
from lutris.util.linux import gather_system_info_dict
f... | 6,408 | Python | .py | 130 | 39.630769 | 106 | 0.617722 | lutris/lutris | 7,694 | 676 | 284 | GPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |