Skip to content

Commit

Permalink
First public release
Browse files Browse the repository at this point in the history
  • Loading branch information
yancharkin committed Nov 14, 2024
0 parents commit d1c8352
Show file tree
Hide file tree
Showing 67 changed files with 6,863 additions and 0 deletions.
97 changes: 97 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot
*.po~

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# Vim
*.swp

# Games Nebula
_tmp
TODO
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Ivan Yancharkin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Games Nebula

Unofficial (Linux) CLI and GUI(WIP) client for GOG.

## Important Disclaimer

**The application is only partially functional (more info below), and its development is currently on hold. The original plan was to release it in 2022, but *unforeseen circumstances* delayed progress, and I have had different priorities since then. As of writing this, I've found some time to piece together the already written code and create a somewhat usable application.**

**The previous (prototype) version is available [here]() and likely still works.**

## What it is and what it is not

It is a simple application for listing, downloading, installing, and playing games from GOG - nothing more. One notable feature is that, with the app, you can make an offline copy of your GOG library without having to install every single game. I'd also like to add most (but not all) features from the [prototype](), so you can check it out to get an idea of what to expect. However, in general, I’d like to keep it even simpler.

It is **not** a full-featured client like GOG Galaxy, both because it’s impossible for someone outside of CD Projekt to create one, and because I don’t want to.

## CLI
Mostly complete. There may still be a few bugs here and there, but it should be usable. It can be used in both interactive (shell-like) mode and non-interactive mode (like a simpler version of [lgogdownloader]()).

<p align="center">
<img src="screenshots/screenshot_cli.webp" width="80%">
</p>

## GUI

Almost nothing works yet. It's possible to view and sort your library, and launch games that were installed using the CLI client. Also, the first launch will take some time, as the app needs to download images for all the games in the library, and right now it is implemented in a less-than-ideal way.

<p align="center">
<img src="screenshots/screenshot_gui.webp" width="80%">
</p>


## Dependencies

Nothing(?) for CLI, PyQt and PyQtWebEngine 5 or 6 for GUI

## Installation

- There is no need to install the app. After installing the dependencies, you can launch it by executing the 'games_nebula' file in the 'bin' directory.

- A PKGBUILD file is included to create an Arch Linux package.

- Any other method for building and installing a Python package should also work, but the app expects certain files to be placed in system directories. Since it's not a good idea to install files there without a package manager, I recommend sticking to the first method if you're not on an Arch-based system, or creating a package for your distro.

## Running the app

- Type 'games_nebula' (without any arguments) in the terminal to run the interactive CLI app.
- Type 'games_nebula --help' in the terminal to see which arguments can be used with the non-interactive CLI app.
- Type 'games_nebula --gui' to run the GUI version of the app.

## More OSes

Originally, I planned to make the app cross-platform, so with a little extra work, it should be possible to run it on most desktop OSes. However, this task is currently a very low priority.

## Future of the project

Actually, I think most of the work is already done, and it shouldn't be too hard to implement the rest. However, I currently lack both the time and motivation to continue. Hopefully, this will change, as I'd prefer not to abandon the project.
27 changes: 27 additions & 0 deletions pkgbuild/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Maintainer: Ivan Yancharkin <yancharkin@gmail.com>

pkgname="games_nebula"
pkgver=2024.dev1
pkgrel=1
pkgdesc="Unofficial client for GOG.",
url="https://github.com/yancharkin/games_nebula"
arch=('any')
license=('MIT')
makedepends=('python-build' 'python-installer' 'python-wheel')
depends=('python' 'python-pyqt6')

pkgver() {
ver=$(cat ../../src/games_nebula/_version.py | head -1 | rev | cut -d "'" -f 2 | rev)
echo "${ver}"
#echo "${ver/./_}"
}

build() {
cd ../..
python -m build --wheel --no-isolation
}

package() {
cd ../..
python -m installer --destdir="${pkgdir}" dist/*.whl
}
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
Binary file added screenshots/screenshot_cli.webp
Binary file not shown.
Binary file added screenshots/screenshot_gui.webp
Binary file not shown.
17 changes: 17 additions & 0 deletions scripts/compile_mo_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

OWN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${OWN_DIR}/languages"

function compile_mo() {
LANG="${1}"
msgfmt --output-file="../src/data/locale/${LANG}/LC_MESSAGES/games_nebula.mo" \
"../src/data/locale/${LANG}/LC_MESSAGES/games_nebula.po"
}

cd "${OWN_DIR}"
for LANG in "${LANGUAGES[@]}"; do
if [ -f "../src/data/locale/${LANG}/LC_MESSAGES/games_nebula.po" ]; then
compile_mo "${LANG}"
fi
done
50 changes: 50 additions & 0 deletions scripts/gen_po_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

source ./languages

function gen_pot() {
xgettext --language="Python" --keyword="_tr" --output="./games_nebula.pot" \
"../src/games_nebula/client/api_wrapper.py" \
"../src/games_nebula/client/commands.py" \
"../src/games_nebula/client/config.py" \
"../src/games_nebula/client/downloader.py" \
"../src/games_nebula/client/installer.py" \
"../src/games_nebula/client/launcher.py" \
"../src/games_nebula/client/logger.py" \
"../src/games_nebula/client/uninstaller.py" \
"../src/games_nebula/client/cli/argparse_tr_hack.py" \
"../src/games_nebula/client/cli/header.py" \
"../src/games_nebula/client/cli/help.py" \
"../src/games_nebula/client/cli/interactive.py" \
"../src/games_nebula/client/cli/noninteractive.py" \
"../src/games_nebula/client/cli/pager.py" \
"../src/games_nebula/client/cli/valid_commands.py" \
"../src/games_nebula/client/gui/gamewidget.py" \
"../src/games_nebula/client/gui/gui.py" \
"../src/games_nebula/client/gui/login.py" \
"../src/games_nebula/client/gui/main_window.py" \
"../src/games_nebula/client/gui/setup_window.py" \
"../src/games_nebula/client/gui/sort_filter_proxy_model.py" \
"../src/games_nebula/client/gui/systray.py" \
"../src/games_nebula/client/utils/convert_from_bytes.py" \
"../src/games_nebula/client/utils/downloader.py" \
"../src/games_nebula/client/utils/reinput.py" \
"../src/games_nebula/client/utils/unzipper.py"
}

function gen_po() {
LANG="${1}"
mkdir -p "../src/data/locale/${LANG}/LC_MESSAGES"
if [ ! -f "../src/data/locale/${LANG}/LC_MESSAGES/games_nebula.po" ]; then
msginit --locale="${LANG}" --input="./games_nebula.pot" \
--output="../src/data/locale/${LANG}/LC_MESSAGES/games_nebula.po"
else
msgmerge --update "../src/data/locale/${LANG}/LC_MESSAGES/games_nebula.po" "./games_nebula.pot"
fi
}

gen_pot
for LANG in "${LANGUAGES[@]}"; do
gen_po "${LANG}"
done
rm "./games_nebula.pot"
1 change: 1 addition & 0 deletions scripts/languages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LANGUAGES=(en ru)
47 changes: 47 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import setuptools
import subprocess
from glob import glob
import sys, os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'src')))
from games_nebula import __version__

subprocess.run(['bash', 'scripts/compile_mo_files.sh'])

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

locales = []
for l in os.listdir('./src/data/locale/'):
locales.append((f'share/locale/{l}/LC_MESSAGES', glob(f'src/data/locale/{l}/LC_MESSAGES/*.mo')))
data_files = [
#('share/applications', ['src/data/games_nebula.desktop']),
('share/icons', ['src/data/icons/games_nebula.png']),
('share/games_nebula/images', glob('src/data/images/*.png')),
('share/games_nebula/images/black', glob('src/data/images/black/*.png'))
]
data_files.extend(locales)

setuptools.setup(
name="games_nebula",
version=__version__,
author="Ivan Yancharkin",
author_email="yancharkin@gmail.com",
description="Unofficial (Linux) client for GOG.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/yancharkin/games_nebula",
project_urls={
"Bug Tracker": "https://github.com/yancharkin/games_nebula/issues",
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
],
package_dir={"": "src"},
packages=setuptools.find_packages(where="src", exclude=['bin', 'data']),
scripts=['src/bin/games_nebula'],
data_files=data_files,
python_requires=">=3.6",
install_requires=['PyQt6']
)
25 changes: 25 additions & 0 deletions src/bin/games_nebula
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python3
#-*- coding: utf-8; -*-

import sys
try:
from games_nebula.client.cli.interactive import InteractiveApp
from games_nebula.client.cli.noninteractive import NonInteractiveApp
from games_nebula.client.gui.gui import GuiApp
except:
# Hack to launch the app in the development environment
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from games_nebula.client.cli.interactive import InteractiveApp
from games_nebula.client.cli.noninteractive import NonInteractiveApp
from games_nebula.client.gui.gui import GuiApp

if __name__ == '__main__':
if not sys.argv[1:]:
app = InteractiveApp()
else:
if sys.argv[1] != '--gui':
app = NonInteractiveApp()
else:
app = GuiApp()
app.start()
9 changes: 9 additions & 0 deletions src/data/games_nebula.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=Games Nebula
Comment=Unofficial client for GOG
Type=Application
Exec=games_nebula --gui
Icon=games_nebula
Terminal=true
StartupNotify=true
Categories=Game;
Binary file added src/data/icons/games_nebula.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/data/images/black/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/data/images/black/view_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/data/images/black/view_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/data/images/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/data/images/view_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/data/images/view_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d1c8352

Please sign in to comment.