diff --git a/calculator/.gitignore b/.gitignore similarity index 91% rename from calculator/.gitignore rename to .gitignore index c02afb2..f6c30e2 100644 --- a/calculator/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ lib64/ parts/ sdist/ var/ +*.dist-info/ *.egg-info/ .installed.cfg *.egg @@ -57,10 +58,5 @@ var/ ## mpeltonen/sbt-idea plugin .idea_modules/ -# Briefcase build directories -iOS/ -macOS/ -windows/ -android/ -linux/ -django/ +# Briefcase log files +logs/ diff --git a/calculator/src/calculator/__init__.py b/CHANGELOG similarity index 100% rename from calculator/src/calculator/__init__.py rename to CHANGELOG diff --git a/calculator/LICENSE b/LICENSE similarity index 100% rename from calculator/LICENSE rename to LICENSE diff --git a/calculator/README.rst b/README.rst similarity index 100% rename from calculator/README.rst rename to README.rst diff --git a/calculator/pyproject.toml b/calculator/pyproject.toml deleted file mode 100644 index 5eae34c..0000000 --- a/calculator/pyproject.toml +++ /dev/null @@ -1,49 +0,0 @@ -[tool.briefcase] -project_name = "Calculator" -bundle = "com.abirshandilya.calculator" -version = "0.0.1" -url = "https://abirshandilya.com/calculator" -license = "BSD license" -author = 'Abir Shandilya' -author_email = "abirshandilya@gmail.com" - -[tool.briefcase.app.calculator] -formal_name = "Calculator" -description = "A basic calculator beeware application" -icon = "src/calculator/resources/calculator" -sources = ['src/calculator'] -requires = [] - - -[tool.briefcase.app.calculator.macOS] -requires = [ - 'toga-cocoa>=0.3.0.dev20', -] - -[tool.briefcase.app.calculator.linux] -requires = [ - 'toga-gtk>=0.3.0.dev20', -] -system_requires = [ - 'libgirepository1.0-dev', - 'libcairo2-dev', - 'libpango1.0-dev', - 'libwebkitgtk-3.0-0', - 'gir1.2-webkit-3.0', -] - -[tool.briefcase.app.calculator.windows] -requires = [ - 'toga-winforms>=0.3.0.dev20', -] - -# Mobile deployments -[tool.briefcase.app.calculator.iOS] -requires = [ - 'toga-iOS>=0.3.0.dev20', -] - -[tool.briefcase.app.calculator.android] -requires = [ - 'toga-android>=0.3.0.dev20', -] diff --git a/calculator/src/calculator.dist-info/INSTALLER b/calculator/src/calculator.dist-info/INSTALLER deleted file mode 100644 index 0d8da94..0000000 --- a/calculator/src/calculator.dist-info/INSTALLER +++ /dev/null @@ -1 +0,0 @@ -briefcase diff --git a/calculator/src/calculator.dist-info/METADATA b/calculator/src/calculator.dist-info/METADATA deleted file mode 100644 index aafb757..0000000 --- a/calculator/src/calculator.dist-info/METADATA +++ /dev/null @@ -1,10 +0,0 @@ -Metadata-Version: 2.1 -Briefcase-Version: 0.3.5 -Name: calculator -Formal-Name: Calculator -App-ID: com.abirshandilya.calculator.calculator -Version: 0.0.1 -Home-page: https://abirshandilya.com/calculator -Author: Abir Shandilya -Author-email: abirshandilya@gmail.com -Summary: A basic calculator beeware application diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d13eb20 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,149 @@ +[tool.briefcase] +project_name = "Calculator" +bundle = "com.abirshandilya.calculator" +version = "0.0.1" +url = "https://abirshandilya.com/calculator" +license = "BSD license" +author = 'Abir Shandilya' +author_email = "abirshandilya@gmail.com" + +[tool.briefcase.app.calculator] +formal_name = "Calculator" +description = "A basic calculator beeware application" +long_description = """More details about the app should go here. +""" +icon = "src/calculator/resources/calculator" +sources = ['src/calculator',] +test_sources = [ + "tests", +] +requires = [] +test_requires = [ + "pytest", +] + + +[tool.briefcase.app.calculator.macOS] +requires = [ + "toga-cocoa~=0.4.8", + "std-nslog~=1.0.0" +] + +[tool.briefcase.app.calculator.linux] +requires = [ + "toga-gtk~=0.4.8", +] + +[tool.briefcase.app.calculator.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.calculator.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.calculator.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.calculator.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.calculator.linux.flatpak] +flatpak_runtime = "org.gnome.Platform" +flatpak_runtime_version = "44" +flatpak_sdk = "org.gnome.Sdk" + +[tool.briefcase.app.calculator.windows] +requires = [ + "toga-winforms~=0.4.8", +] + +# Mobile deployments +[tool.briefcase.app.calculator.iOS] +requires = [ + "toga-iOS~=0.4.8", + "std-nslog~=1.0.0" +] + +[tool.briefcase.app.calculator.android] +requires = [ + "toga-android~=0.4.8" +] + +# Web deployments +[tool.briefcase.app.calculator.web] +requires = [ + "toga-web~=0.4.8", +] +style_framework = "Shoelace v2.3" diff --git a/calculator/src/calculator/resources/__init__.py b/src/calculator/__init__.py similarity index 100% rename from calculator/src/calculator/resources/__init__.py rename to src/calculator/__init__.py diff --git a/calculator/src/calculator/__main__.py b/src/calculator/__main__.py similarity index 100% rename from calculator/src/calculator/__main__.py rename to src/calculator/__main__.py diff --git a/calculator/src/calculator/app.py b/src/calculator/app.py similarity index 98% rename from calculator/src/calculator/app.py rename to src/calculator/app.py index 2ef7d01..eaea97a 100644 --- a/calculator/src/calculator/app.py +++ b/src/calculator/app.py @@ -108,6 +108,8 @@ def enterdata(self,widget,number): def calculate(self,widget): output = eval(self.input_text.value) + if output == "": + output = "ERROR!" self.input_text.value = output def main(): return Calculator() diff --git a/src/calculator/resources/__init__.py b/src/calculator/resources/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/calculator/src/calculator/resources/calculator.icns b/src/calculator/resources/calculator.icns similarity index 100% rename from calculator/src/calculator/resources/calculator.icns rename to src/calculator/resources/calculator.icns diff --git a/calculator/src/calculator/resources/calculator.ico b/src/calculator/resources/calculator.ico similarity index 100% rename from calculator/src/calculator/resources/calculator.ico rename to src/calculator/resources/calculator.ico diff --git a/calculator/src/calculator/resources/calculator.png b/src/calculator/resources/calculator.png similarity index 100% rename from calculator/src/calculator/resources/calculator.png rename to src/calculator/resources/calculator.png