First commit

This commit is contained in:
Homer S. 2023-06-11 22:44:14 +02:00
commit cc1f7fb4b6
15 changed files with 317 additions and 0 deletions

62
.gitignore vendored Normal file
View File

@ -0,0 +1,62 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# OSX useful to ignore
*.DS_Store
.AppleDouble
.LSOverride
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.dist-info/
*.egg-info/
.installed.cfg
*.egg
# IntelliJ Idea family of suites
.idea
*.iml
## File-based project format:
*.ipr
*.iws
## mpeltonen/sbt-idea plugin
.idea_modules/
# Briefcase log files
logs/

5
CHANGELOG Normal file
View File

@ -0,0 +1,5 @@
# Sloth Release Notes
## 0.0.1 (11 Jun 2023)
* Initial release

16
LICENSE Normal file
View File

@ -0,0 +1,16 @@
Sloth: A fediverse client
Copyright (C) 2023 Homer S.
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/>.

12
README.rst Normal file
View File

@ -0,0 +1,12 @@
Sloth
=====
**This cross-platform app was generated by** `Briefcase`_ **- part of**
`The BeeWare Project`_. **If you want to see more tools like Briefcase, please
consider** `becoming a financial member of BeeWare`_.
A fediverse client
.. _`Briefcase`: https://briefcase.readthedocs.io/
.. _`The BeeWare Project`: https://beeware.org/
.. _`becoming a financial member of BeeWare`: https://beeware.org/contributing/membership

153
pyproject.toml Normal file
View File

@ -0,0 +1,153 @@
# This project was generated with Unknown using template: https://github.com/beeware/briefcase-template@v0.3.14
[tool.briefcase]
project_name = "Sloth"
bundle = "net.ismus"
version = "0.0.1"
url = "https://git.ismus.net/homer77/sloth"
license = "GNU General Public License v3 or later (GPLv3+)"
author = "Homer S."
author_email = "homer77@ismus.net"
[tool.briefcase.app.sloth]
formal_name = "Sloth"
description = "A fediverse client"
long_description = """More details about the app should go here.
"""
icon = "src/sloth/resources/sloth"
sources = [
"src/sloth",
]
test_sources = [
"tests",
]
requires = [
]
test_requires = [
"pytest",
]
[tool.briefcase.app.sloth.macOS]
requires = [
"toga-cocoa~=0.3.1",
"std-nslog~=1.0.0"
]
[tool.briefcase.app.sloth.linux]
requires = [
"toga-gtk~=0.3.1",
]
[tool.briefcase.app.sloth.linux.system.debian]
system_requires = [
# Needed to compile pycairo wheel
"libcairo2-dev",
# Needed to compile PyGObject wheel
"libgirepository1.0-dev",
]
system_runtime_requires = [
# Needed to provide GTK
"libgtk-3-0",
# Needed to provide GI bindings to GTK
"libgirepository-1.0-1",
"gir1.2-gtk-3.0",
# Needed to provide WebKit2 at runtime
# "libwebkit2gtk-4.0-37",
# "gir1.2-webkit2-4.0",
]
[tool.briefcase.app.sloth.linux.system.rhel]
system_requires = [
# Needed to compile pycairo wheel
"cairo-gobject-devel",
# Needed to compile PyGObject wheel
"gobject-introspection-devel",
]
system_runtime_requires = [
# Needed to support Python bindings to GTK
"gobject-introspection",
# Needed to provide GTK
"gtk3",
# Needed to provide WebKit2 at runtime
# "webkit2gtk3",
]
[tool.briefcase.app.sloth.linux.system.arch]
system_requires = [
# Needed to compile pycairo wheel
"cairo",
# Needed to compile PyGObject wheel
"gobject-introspection",
# Runtime dependencies that need to exist so that the
# Arch package passes final validation.
# Needed to provide GTK
"gtk3",
# Dependencies that GTK looks for at runtime
"libcanberra",
# Needed to provide WebKit2
# "webkit2gtk",
]
system_runtime_requires = [
# Needed to provide GTK
"gtk3",
# Needed to provide PyGObject bindings
"gobject-introspection-runtime",
# Dependencies that GTK looks for at runtime
"libcanberra",
# Needed to provide WebKit2 at runtime
# "webkit2gtk",
]
[tool.briefcase.app.sloth.linux.appimage]
manylinux = "manylinux2014"
system_requires = [
# Needed to compile pycairo wheel
"cairo-gobject-devel",
# Needed to compile PyGObject wheel
"gobject-introspection-devel",
# Needed to provide GTK
"gtk3-devel",
# Dependencies that GTK looks for at runtime, that need to be
# in the build environment to be picked up by linuxdeploy
"libcanberra-gtk3",
"PackageKit-gtk3-module",
"gvfs-client",
# Needed to provide WebKit2 at runtime
# "webkit2gtk3",
]
linuxdeploy_plugins = [
"DEPLOY_GTK_VERSION=3 gtk",
]
[tool.briefcase.app.sloth.linux.flatpak]
flatpak_runtime = "org.gnome.Platform"
flatpak_runtime_version = "44"
flatpak_sdk = "org.gnome.Sdk"
[tool.briefcase.app.sloth.windows]
requires = [
"toga-winforms~=0.3.1",
]
# Mobile deployments
[tool.briefcase.app.sloth.iOS]
requires = [
"toga-iOS~=0.3.1",
"std-nslog~=1.0.0"
]
[tool.briefcase.app.sloth.android]
requires = [
"toga-android~=0.3.1"
]
# Web deployments
[tool.briefcase.app.sloth.web]
requires = [
"toga-web~=0.3.1",
]
style_framework = "Shoelace v2.3"

0
src/sloth/__init__.py Normal file
View File

4
src/sloth/__main__.py Normal file
View File

@ -0,0 +1,4 @@
from sloth.app import main
if __name__ == '__main__':
main().main_loop()

27
src/sloth/app.py Normal file
View File

@ -0,0 +1,27 @@
"""
A fediverse client
"""
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
class Sloth(toga.App):
def startup(self):
"""
Construct and show the Toga application.
Usually, you would add your application to a main content box.
We then create a main window (with a name matching the app), and
show the main window.
"""
main_box = toga.Box()
self.main_window = toga.MainWindow(title=self.formal_name)
self.main_window.content = main_box
self.main_window.show()
def main():
return Sloth()

View File

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

0
tests/__init__.py Normal file
View File

35
tests/sloth.py Normal file
View File

@ -0,0 +1,35 @@
import os
import sys
import tempfile
from pathlib import Path
import pytest
def run_tests():
project_path = Path(__file__).parent.parent
os.chdir(project_path)
# Determine any args to pass to pytest. If there aren't any,
# default to running the whole test suite.
args = sys.argv[1:]
if len(args) == 0:
args = ["tests"]
returncode = pytest.main(
[
# Turn up verbosity
"-vv",
# Disable color
"--color=no",
# Overwrite the cache directory to somewhere writable
"-o",
f"cache_dir={tempfile.gettempdir()}/.pytest_cache",
] + args
)
print(f">>>>>>>>>> EXIT {returncode} <<<<<<<<<<")
if __name__ == "__main__":
run_tests()

3
tests/test_app.py Normal file
View File

@ -0,0 +1,3 @@
def test_first():
"An initial test for the app"
assert 1 + 1 == 2