diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..691f282 --- /dev/null +++ b/.gitignore @@ -0,0 +1,65 @@ +# 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/ + +# Briefcase local configuratoin +.briefcase/ diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..050cbe2 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,5 @@ +# Just Get It Release Notes + +## 0.0.1 (06 Jan 2026) + +* Initial release diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4ffa4e3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2026, Ignace +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8420444 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,196 @@ +# This project was generated with 0.3.26 using template: https://github.com/beeware/briefcase-template @ v0.3.26 +[tool.briefcase] +project_name = "Just Get It" +bundle = "nl.suy" +version = "0.0.1" +url = "https://suy.nl/justgetit" +license.file = "LICENSE" +author = "Ignace" +author_email = "ignace@suy.nl" + +[tool.briefcase.app.justgetit] +formal_name = "Just Get It" +description = "Just Get It App" +long_description = """More details about the app should go here. +""" +sources = [ + "src/justgetit", + "src/justgetit/images", +] +test_sources = [ + "tests", +] + +requires = [ + "requests", +] +test_requires = [ + "pytest", +] + +[tool.briefcase.app.justgetit.macOS] +universal_build = true +requires = [ + "toga-cocoa~=0.5.0", + "std-nslog~=1.0.3", +] + +[tool.briefcase.app.justgetit.linux] +requires = [ + "toga-gtk~=0.5.0", + # PyGObject 3.52.1 enforces a requirement on libgirepository-2.0-dev. This library + # isn't available on Debian 12/Ubuntu 22.04. If you don't need to support those (or + # older) releases, you can remove this version pin. See beeware/toga#3143. + "pygobject < 3.52.1", +] + +[tool.briefcase.app.justgetit.linux.system.debian] +system_requires = [ + # Needed to compile pycairo wheel + "libcairo2-dev", + # One of the following two packages are needed to compile PyGObject wheel. If you + # remove the pygobject pin in the requires list, you should also change to the + # version 2.0 of the girepository library. See beeware/toga#3143. + "libgirepository1.0-dev", + # "libgirepository-2.0-dev", +] + +system_runtime_requires = [ + # Needed to provide GTK and its GI bindings + "gir1.2-gtk-3.0", + # One of the following two packages are needed to use PyGObject at runtime. If you + # remove the pygobject pin in the requires list, you should also change to the + # version 2.0 of the girepository library. See beeware/toga#3143. + "libgirepository-1.0-1", + # "libgirepository-2.0-0", + # Dependencies that GTK looks for at runtime + "libcanberra-gtk3-module", + # Needed to provide WebKit2 at runtime + # Note: Debian 11 requires gir1.2-webkit2-4.0 instead + # "gir1.2-webkit2-4.1", +] + +[tool.briefcase.app.justgetit.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", + # Dependencies that GTK looks for at runtime + "libcanberra-gtk3", + # Needed to provide WebKit2 at runtime + # "webkit2gtk3", +] + +[tool.briefcase.app.justgetit.linux.system.suse] +system_requires = [ + # Needed to compile pycairo wheel + "cairo-devel", + # Needed to compile PyGObject wheel + "gobject-introspection-devel", +] + +system_runtime_requires = [ + # Needed to provide GTK + "gtk3", + # Needed to support Python bindings to GTK + "gobject-introspection", "typelib(Gtk) = 3.0", + # Dependencies that GTK looks for at runtime + "libcanberra-gtk3-module", + # Needed to provide WebKit2 at runtime + # "libwebkit2gtk3", "typelib(WebKit2)", +] + +[tool.briefcase.app.justgetit.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.justgetit.linux.appimage] +manylinux = "manylinux_2_28" + +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", +] + +linuxdeploy_plugins = [ + "DEPLOY_GTK_VERSION=3 gtk", +] + +[tool.briefcase.app.justgetit.linux.flatpak] +flatpak_runtime = "org.gnome.Platform" +flatpak_runtime_version = "48" +flatpak_sdk = "org.gnome.Sdk" + +[tool.briefcase.app.justgetit.windows] +requires = [ + "toga-winforms~=0.5.0", +] + +# Mobile deployments +[tool.briefcase.app.justgetit.iOS] +requires = [ + "toga-iOS~=0.5.0", + "std-nslog~=1.0.3", +] + +[tool.briefcase.app.justgetit.android] +requires = [ + "toga-android~=0.5.0", +] + +base_theme = "Theme.MaterialComponents.Light.DarkActionBar" + +build_gradle_dependencies = [ + "com.google.android.material:material:1.13.0", + # Needed for DetailedList + # "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0", + # Needed for MapView + # "org.osmdroid:osmdroid-android:6.1.20", +] + +# Web deployments +[tool.briefcase.app.justgetit.web] +requires = [ + "toga-web~=0.5.0", +] + diff --git a/src/justgetit/__init__.py b/src/justgetit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/justgetit/__main__.py b/src/justgetit/__main__.py new file mode 100644 index 0000000..2d999c6 --- /dev/null +++ b/src/justgetit/__main__.py @@ -0,0 +1,4 @@ +from justgetit.app import main + +if __name__ == "__main__": + main().main_loop() diff --git a/src/justgetit/app.py b/src/justgetit/app.py new file mode 100644 index 0000000..d26c59b --- /dev/null +++ b/src/justgetit/app.py @@ -0,0 +1,40 @@ +import toga +from toga.style.pack import COLUMN, ROW, CENTER, START, END +from toga.style import Pack +import requests +from justgetit.constants import * +from justgetit.login import Login +from justgetit.register import Register + + +class JustEatIt(toga.App): + login_screen = toga.Box() + register_screen = toga.Box() + + + def goto_next_page(self, widget): + """ + ask app to activate a next page, id of the page is in the id of the widget + + :param widget: the widget that called this function + """ + print(f"action 6 {widget.id}") + if widget.id == 'register': + self.main_window.content = self.register_screen + elif widget.id =='login': + self.main_window.content = self.login_screen + + + def startup(self): + self.login_screen = Login(navigate_to=self.goto_next_page) + self.register_screen = Register(navigate_to=self.goto_next_page) + + self.main_window = toga.MainWindow(title=self.formal_name, size=(SCREENWIDTH, SCREENHEIGHT)) + self.main_window.content = self.register_screen + self.main_window.show() + + + + +def main(): + return JustEatIt() \ No newline at end of file diff --git a/src/justgetit/constants.py b/src/justgetit/constants.py new file mode 100644 index 0000000..5efa2b8 --- /dev/null +++ b/src/justgetit/constants.py @@ -0,0 +1,2 @@ +SCREENWIDTH = 380 +SCREENHEIGHT = 680 diff --git a/src/justgetit/images/login.png b/src/justgetit/images/login.png new file mode 100644 index 0000000..4a73409 Binary files /dev/null and b/src/justgetit/images/login.png differ diff --git a/src/justgetit/images/register.png b/src/justgetit/images/register.png new file mode 100644 index 0000000..0c604cf Binary files /dev/null and b/src/justgetit/images/register.png differ diff --git a/src/justgetit/images/save.png b/src/justgetit/images/save.png new file mode 100644 index 0000000..f0986fc Binary files /dev/null and b/src/justgetit/images/save.png differ diff --git a/src/justgetit/images/save72.png b/src/justgetit/images/save72.png new file mode 100644 index 0000000..1a8443c Binary files /dev/null and b/src/justgetit/images/save72.png differ diff --git a/src/justgetit/login.py b/src/justgetit/login.py new file mode 100644 index 0000000..bb59c86 --- /dev/null +++ b/src/justgetit/login.py @@ -0,0 +1,106 @@ +import toga +from toga.style import Pack +from toga.style.pack import COLUMN, ROW, END, START, CENTER +from justgetit.constants import SCREENHEIGHT, SCREENWIDTH + + +class Login(toga.Box): + + def __init__(self, navigate_to, *args, **kwargs): + super().__init__(*args, **kwargs) + self.navigate_to= navigate_to + + register_button = toga.Button( + icon=toga.Icon("images/register"), + style=Pack( + width=50, + margin=5, + ), + id="register", + on_press=self.navigate_to) + + liner =toga.Box(style=Pack(width=SCREENWIDTH, height = 2, background_color="#ddd")) + + menu_bar= toga.Row( + children=[register_button, liner], + style=Pack( + justify_content=END, + width = SCREENWIDTH, + background_color="#eee" + ) + ) + + # Title icon + my_image = toga.Image("images/login.png") + title = toga.ImageView(my_image, style=Pack( + width=50, + margin_bottom=20 + )) + + # Email input + name_input = toga.TextInput( + placeholder="Could be you here", + style=Pack( + width=250, + margin_bottom=10 + ) + ) + + # Password input + password_input = toga.PasswordInput( + placeholder="Feeling lucky?", + style=Pack( + width=250, + margin_bottom=20 + ) + ) + + # Login button + login_button = toga.Button( + icon=toga.Icon("images/save"), + style=Pack( + width=50, + margin=10, + background_color="white" + ), + on_press=self.login_button_press) + + login_area= toga.Box( + children=[login_button], + style=Pack( + width=250, + direction=ROW, + align_items=START, + margin=20 + ) + ) + + # Main content box (centered) + content_box = toga.Column( + children=[ + title, + name_input, + password_input, + login_area + ], + style=Pack( + align_items=CENTER, + height=SCREENHEIGHT - 50, # iPhone height + margin=20, + ) + ) + + # Outer box to simulate iPhone screen + screen = toga.Column( + children=[menu_bar, + liner, + content_box], + style=Pack( + width=SCREENWIDTH, # iPhone width + ) + ) + + self.add(screen) + + def login_button_press(self, widget): + print("pressesd") \ No newline at end of file diff --git a/src/justgetit/register.py b/src/justgetit/register.py new file mode 100644 index 0000000..cdf8ada --- /dev/null +++ b/src/justgetit/register.py @@ -0,0 +1,107 @@ +import toga +from toga.style import Pack +from toga.style.pack import COLUMN, ROW, END, START, CENTER +from justgetit.constants import SCREENHEIGHT, SCREENWIDTH + + +class Register(toga.Box): + + def __init__(self, navigate_to, *args, **kwargs): + super().__init__(*args, **kwargs) + self.navigate_to= navigate_to + + register_button = toga.Button( + icon=toga.Icon("images/login"), + style=Pack( + width=50, + margin=5, + ), + id="login", + on_press=self.navigate_to) + + liner = toga.Box(style=Pack(width=SCREENWIDTH, height = 2, background_color="#ddd")) + + menu_bar= toga.Row( + children=[register_button, liner], + style=Pack( + justify_content=END, + width = SCREENWIDTH, + background_color="#eee" + ) + ) + + # Title icon + my_image = toga.Image("images/register.png") + title = toga.ImageView(my_image, style=Pack( + width=50, + margin_bottom=20 + )) + + # Email input + name_input = toga.TextInput( + placeholder="Gimme you wallet", + style=Pack( + width=250, + margin_bottom=10 + ) + ) + + # Password input + password_input = toga.PasswordInput( + placeholder="You have a secret?", + style=Pack( + width=250, + margin_bottom=20 + ) + ) + + # Login button + login_button = toga.Button( + icon=toga.Icon("images/save"), + style=Pack( + width=50, + margin=10, + background_color="white" + ), + + on_press=self.register_button_press) + + login_area= toga.Box( + children=[login_button], + style=Pack( + width=250, + direction=ROW, + align_items=START, + margin=20 + ) + ) + + # Main content box (centered) + content_box = toga.Column( + children=[ + title, + name_input, + password_input, + login_area + ], + style=Pack( + align_items=CENTER, + height=SCREENHEIGHT - 50, # iPhone height + margin=20, + ) + ) + + # Outer box to simulate iPhone screen + screen = toga.Column( + children=[menu_bar, + liner, + content_box], + style=Pack( + width=SCREENWIDTH, # iPhone width + ) + ) + + self.add(screen) + + def register_button_press(self, widget): + print("presses register") \ No newline at end of file diff --git a/src/justgetit/resources/README b/src/justgetit/resources/README new file mode 100644 index 0000000..4ef2794 --- /dev/null +++ b/src/justgetit/resources/README @@ -0,0 +1,2 @@ +Put any application resources (e.g., icons and resources) here; +they can be referenced in code as "resources/filename". diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/justgetit.py b/tests/justgetit.py new file mode 100644 index 0000000..d59e9f3 --- /dev/null +++ b/tests/justgetit.py @@ -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() diff --git a/tests/test_app.py b/tests/test_app.py new file mode 100644 index 0000000..e1a335f --- /dev/null +++ b/tests/test_app.py @@ -0,0 +1,3 @@ +def test_first(): + """An initial test for the app.""" + assert 1 + 1 == 2