diff --git a/.gitignore b/.gitignore index 266e2a4..7da16bb 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ easydict.glade~ /easydict_gtk.egg-info/ /easydict-gtk.egg-info/ venv +test_venv dist diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index dcdb6fd..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,3 +0,0 @@ -recursive-include easydict * -prune easydict/garbage -global-exclude easydict/ui/easydict.glade~ \ No newline at end of file diff --git a/README.md b/README.md index ee03c37..2cb7659 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,6 @@ The first open source translator which is completely open with dictionary data too. The homepage is http://easydict.jiri.one. On this page you can also try the search results, which will be the same as in the app (however, the web application does not use TinyDB+orjson as a backend, but uses RethinkDB - the source data is the same). **The application is at an early stage of development, but the features and dictionaries that have already been implemented work very well.** -## Table of Contents - -[TOC] - ## What is it EasyDict is a simple translator that will translate, typically, one word in one language into another language. This translator has several, sometimes unique, features. @@ -44,8 +40,8 @@ To-Do-List - [X] get the homepage https://easydict.jiri.one back online - [ ] create tests for backend - [ ] add the possibility to use other dictionaries -- [ ] optimize the application for touch control so that it can be run on Phosh - https://puri.sm/projects/phosh/ using libhanda - https://gitlab.gnome.org/GNOME/libhandy -- [ ] ? maybe swith to poetry +- [ ] optimize the application for touch control so that it can be run on Phosh - https://puri.sm/projects/phosh/ using libhandy - https://gitlab.gnome.org/GNOME/libhandy +- [X] ? maybe swith to poetry - [ ] create FlatPak package and publish it on FlatHub - [ ] create ArchLinux package an publish it on AUR - [ ] ... diff --git a/easydict/__init__.py b/easydict/__init__.py deleted file mode 100644 index 5e269b0..0000000 --- a/easydict/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .src.easydict import EasyDict - -__all__ = ['EasyDict'] \ No newline at end of file diff --git a/easydict/__main__.py b/easydict/__main__.py deleted file mode 100644 index 300b32c..0000000 --- a/easydict/__main__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .src.easydict import main - -main() \ No newline at end of file diff --git a/easydict_gtk/__init__.py b/easydict_gtk/__init__.py new file mode 100644 index 0000000..f4d2496 --- /dev/null +++ b/easydict_gtk/__init__.py @@ -0,0 +1,3 @@ +from easydict_gtk.easydict import EasyDict + +__all__ = ['EasyDict'] diff --git a/easydict_gtk/__main__.py b/easydict_gtk/__main__.py new file mode 100644 index 0000000..5d452f5 --- /dev/null +++ b/easydict_gtk/__main__.py @@ -0,0 +1,3 @@ +from easydict_gtk.easydict import main + +main() diff --git a/easydict/data/eng-cze.json b/easydict_gtk/data/eng-cze.json similarity index 100% rename from easydict/data/eng-cze.json rename to easydict_gtk/data/eng-cze.json diff --git a/easydict/data/help_eng.txt b/easydict_gtk/data/help_eng.txt similarity index 100% rename from easydict/data/help_eng.txt rename to easydict_gtk/data/help_eng.txt diff --git a/easydict/data/settings.json b/easydict_gtk/data/settings.json similarity index 100% rename from easydict/data/settings.json rename to easydict_gtk/data/settings.json diff --git a/easydict/src/easydict.py b/easydict_gtk/easydict.py similarity index 100% rename from easydict/src/easydict.py rename to easydict_gtk/easydict.py diff --git a/easydict/garbage/easydict_backup.py b/easydict_gtk/garbage/easydict_backup.py similarity index 100% rename from easydict/garbage/easydict_backup.py rename to easydict_gtk/garbage/easydict_backup.py diff --git a/easydict/garbage/easydict_first.py b/easydict_gtk/garbage/easydict_first.py similarity index 100% rename from easydict/garbage/easydict_first.py rename to easydict_gtk/garbage/easydict_first.py diff --git a/easydict/garbage/easydict_run.py b/easydict_gtk/garbage/easydict_run.py similarity index 100% rename from easydict/garbage/easydict_run.py rename to easydict_gtk/garbage/easydict_run.py diff --git a/easydict/garbage/easydict_tray.py b/easydict_gtk/garbage/easydict_tray.py similarity index 100% rename from easydict/garbage/easydict_tray.py rename to easydict_gtk/garbage/easydict_tray.py diff --git a/easydict/garbage/tinydb_test.py b/easydict_gtk/garbage/tinydb_test.py similarity index 100% rename from easydict/garbage/tinydb_test.py rename to easydict_gtk/garbage/tinydb_test.py diff --git a/easydict/src/handlers.py b/easydict_gtk/handlers.py similarity index 100% rename from easydict/src/handlers.py rename to easydict_gtk/handlers.py diff --git a/easydict/src/html_generator.py b/easydict_gtk/html_generator.py similarity index 100% rename from easydict/src/html_generator.py rename to easydict_gtk/html_generator.py diff --git a/easydict/images/ed_icon.png b/easydict_gtk/images/ed_icon.png similarity index 100% rename from easydict/images/ed_icon.png rename to easydict_gtk/images/ed_icon.png diff --git a/easydict/images/ed_pref_icon.png b/easydict_gtk/images/ed_pref_icon.png similarity index 100% rename from easydict/images/ed_pref_icon.png rename to easydict_gtk/images/ed_pref_icon.png diff --git a/easydict/images/ed_tray_icon.png b/easydict_gtk/images/ed_tray_icon.png similarity index 100% rename from easydict/images/ed_tray_icon.png rename to easydict_gtk/images/ed_tray_icon.png diff --git a/easydict/images/flag_cze.svg b/easydict_gtk/images/flag_cze.svg similarity index 100% rename from easydict/images/flag_cze.svg rename to easydict_gtk/images/flag_cze.svg diff --git a/easydict/images/flag_eng.svg b/easydict_gtk/images/flag_eng.svg similarity index 100% rename from easydict/images/flag_eng.svg rename to easydict_gtk/images/flag_eng.svg diff --git a/easydict/src/orjson_storage.py b/easydict_gtk/orjson_storage.py similarity index 100% rename from easydict/src/orjson_storage.py rename to easydict_gtk/orjson_storage.py diff --git a/easydict/src/settings.py b/easydict_gtk/settings.py similarity index 98% rename from easydict/src/settings.py rename to easydict_gtk/settings.py index 78124f1..7e843f6 100644 --- a/easydict/src/settings.py +++ b/easydict_gtk/settings.py @@ -7,7 +7,7 @@ from pathlib import Path # set current working directory -cwd = Path(__file__).parent.parent +cwd = Path(__file__).parent cwd_images = cwd / "images" cfg_dir = Path.home() / ".config" / "easydict" # set user config directory cfg_dir.mkdir(exist_ok=True) # create the config directory if not exists diff --git a/easydict/src/tray_menu.py b/easydict_gtk/tray_menu.py similarity index 100% rename from easydict/src/tray_menu.py rename to easydict_gtk/tray_menu.py diff --git a/easydict/ui/easydict.glade b/easydict_gtk/ui/easydict.glade similarity index 100% rename from easydict/ui/easydict.glade rename to easydict_gtk/ui/easydict.glade diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..515e8d1 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,86 @@ +[[package]] +name = "orjson" +version = "3.6.4" +description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" +category = "main" +optional = false +python-versions = ">=3.7" + +[[package]] +name = "pycairo" +version = "1.20.1" +description = "Python interface for cairo" +category = "main" +optional = false +python-versions = ">=3.6, <4" + +[[package]] +name = "pygobject" +version = "3.42.0" +description = "Python bindings for GObject Introspection" +category = "main" +optional = false +python-versions = ">=3.6, <4" + +[package.dependencies] +pycairo = ">=1.16,<2.0" + +[[package]] +name = "tinydb" +version = "4.5.2" +description = "TinyDB is a tiny, document oriented database optimized for your happiness :)" +category = "main" +optional = false +python-versions = ">=3.5,<4.0" + +[metadata] +lock-version = "1.1" +python-versions = "^3.9" +content-hash = "a8d9a7b141527dc1b58d9e0fc4cfc8bfa74bd6ea61d806ed88f54287bb43d149" + +[metadata.files] +orjson = [ + {file = "orjson-3.6.4-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:fc01a15f3101628fd619158daec79b30d7461149735e73542ca8c13be6b835be"}, + {file = "orjson-3.6.4-cp310-cp310-manylinux_2_24_aarch64.whl", hash = "sha256:48a69fed90f551bf9e9bb7a63e363fed4f67fc7c6e6bfb057054dc78f6721e9e"}, + {file = "orjson-3.6.4-cp310-cp310-manylinux_2_24_x86_64.whl", hash = "sha256:3722f02f50861d5e2a6be9d50bfe8da27a5155bb60043118a4e1ceb8c7040cf7"}, + {file = "orjson-3.6.4-cp310-none-win_amd64.whl", hash = "sha256:231a99a728322d0271e970b149c57deb67315e6837e6cd4166cf51d30161700c"}, + {file = "orjson-3.6.4-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:6cd300421b41f7e84e388b1792a18c3fc4c440ae3039434b9320956be05f0102"}, + {file = "orjson-3.6.4-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:e55ef66ee1d35b1c43db275aff3a1ba7e0408b31e624912a612bd799df14e73e"}, + {file = "orjson-3.6.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eef8d332af8e6f7d6d2c1f3b5384c8d239800c1405b136da5f1710e802918d57"}, + {file = "orjson-3.6.4-cp37-cp37m-manylinux_2_24_aarch64.whl", hash = "sha256:8896e242a92733e454378e22711bd43a55fda4e80604fcefcc064ca977623673"}, + {file = "orjson-3.6.4-cp37-cp37m-manylinux_2_24_x86_64.whl", hash = "sha256:bdfa6f29f7b6aad70ce14591b99fba651008afa6bc3759f158887bcdc568b452"}, + {file = "orjson-3.6.4-cp37-none-win_amd64.whl", hash = "sha256:7c16c44872d33da0b97050a9ea8f7bc04e930c56e8185657bc200e1875a671da"}, + {file = "orjson-3.6.4-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:b467551f3be1dd08aff70c261cc883b63483eb0e31861ffe2cd8dac4fec7cfa9"}, + {file = "orjson-3.6.4-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:7bf61afef12f6416db3ea377f3491ca8ac677d3cac6db1ebffb7a5fe92cce3ca"}, + {file = "orjson-3.6.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:014ea74d4a5dd6a7e98540768072d5bd8c2fedbcbbedcbbaecbb614e66080e81"}, + {file = "orjson-3.6.4-cp38-cp38-manylinux_2_24_aarch64.whl", hash = "sha256:705cb90c536b4b9336c06b4a62c3c62e50354ddf20a2e48eb62bf34fb93d5b1f"}, + {file = "orjson-3.6.4-cp38-cp38-manylinux_2_24_x86_64.whl", hash = "sha256:159e2240fc36720a5cb51a1cbc9905dcb8758aad50b3e7f14f6178ce2e842004"}, + {file = "orjson-3.6.4-cp38-none-win_amd64.whl", hash = "sha256:d2ae087866a1050de83c2a28490850badb41aeeb8a4605c84dd6004d4e58b5a4"}, + {file = "orjson-3.6.4-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:b4a7efe039b1154b23e5df8787ac01e4621213aed303b6304a5f8ad89c01455d"}, + {file = "orjson-3.6.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:7b24f97ed76005f447e152b0e493abce8c60f010131998295175446312a71caf"}, + {file = "orjson-3.6.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1121187e2a721864b52e5dbb3cf8dd4a4546519a5fef1e13fa777347fb8884a2"}, + {file = "orjson-3.6.4-cp39-cp39-manylinux_2_24_aarch64.whl", hash = "sha256:4edffd9e2298ff4f4f939aa67248eba043dc65c9e7d940c28a62c5502c6f2aa8"}, + {file = "orjson-3.6.4-cp39-cp39-manylinux_2_24_x86_64.whl", hash = "sha256:e236fe94d8a77532f0065870fe265bd53e229012f39af99f79f5f1d4a8b0067c"}, + {file = "orjson-3.6.4-cp39-none-win_amd64.whl", hash = "sha256:5448cc1edd4c4bafc968404f92f0e9a582b4326ca442346bd1d1179a6faf52d9"}, + {file = "orjson-3.6.4.tar.gz", hash = "sha256:f8dbc428fc6d7420f231a7133d8dff4c882e64acb585dcf2fda74bdcfe1a6d9d"}, +] +pycairo = [ + {file = "pycairo-1.20.1-cp310-cp310-win32.whl", hash = "sha256:736ffc618e851601e861a630293e5c910ef016b83b2d035a336f83a367bf56ab"}, + {file = "pycairo-1.20.1-cp310-cp310-win_amd64.whl", hash = "sha256:261c69850d4b2ec03346c9745bad2a835bb8124e4c6961b8ceac503d744eb3b3"}, + {file = "pycairo-1.20.1-cp36-cp36m-win32.whl", hash = "sha256:6db823a18e7be1eb2a29c28961f2f01e84d3b449f06be7338d05ac8f90592cd5"}, + {file = "pycairo-1.20.1-cp36-cp36m-win_amd64.whl", hash = "sha256:5525da2d8de912750dd157752aa96f1f0a42a437c5625e85b14c936b5c6305ae"}, + {file = "pycairo-1.20.1-cp37-cp37m-win32.whl", hash = "sha256:c8c2bb933974d91c5d19e54b846d964de177e7bf33433bf34ac34c85f9b30e94"}, + {file = "pycairo-1.20.1-cp37-cp37m-win_amd64.whl", hash = "sha256:9a32e4a3574a104aa876c35d5e71485dfd6986b18d045534c6ec510c44d5d6a7"}, + {file = "pycairo-1.20.1-cp38-cp38-win32.whl", hash = "sha256:0d7a6754d410d911a46f00396bee4be96500ccd3d178e7e98aef1140e3dd67ae"}, + {file = "pycairo-1.20.1-cp38-cp38-win_amd64.whl", hash = "sha256:b605151cdd23cedb31855b8666371b6e26b80f02753a52c8b8023a916b1df812"}, + {file = "pycairo-1.20.1-cp39-cp39-win32.whl", hash = "sha256:e800486b51fffeb11ed867b4f2220d446e2a60a81a73b7c377123e0cbb72f49d"}, + {file = "pycairo-1.20.1-cp39-cp39-win_amd64.whl", hash = "sha256:f123d3818e30b77b7209d70a6dcfd5b4e34885f9fa539d92dd7ff3e4e2037213"}, + {file = "pycairo-1.20.1.tar.gz", hash = "sha256:1ee72b035b21a475e1ed648e26541b04e5d7e753d75ca79de8c583b25785531b"}, +] +pygobject = [ + {file = "PyGObject-3.42.0.tar.gz", hash = "sha256:b9803991ec0b0b4175e81fee0ad46090fa7af438fe169348a9b18ae53447afcd"}, +] +tinydb = [ + {file = "tinydb-4.5.2-py3-none-any.whl", hash = "sha256:3c5e5c72c98db07e707be4e25f9e135a8a14b96938e4745b1b7187fec523ff58"}, + {file = "tinydb-4.5.2.tar.gz", hash = "sha256:7d18b2d0217827c188f177cd23df60e5cd5316a717e836a8e21c8c2488262cf5"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..77cddeb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +[tool.poetry] +name = "easydict-gtk" +version = "0.3.7" +description = "The first open source translator which is completely open with dictionary data too." +authors = ["jiri.one "] +license = "GPL-3.0-only" +readme = "README.md" +exclude = ["easydict_gtk/garbage"] + + +[tool.poetry.dependencies] +python = "^3.9" +PyGObject = "^3.42.0" +pycairo = "^1.20.1" +tinydb = "^4.5.2" +orjson = "^3.6.4" + +[tool.poetry.dev-dependencies] + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.poetry.scripts] +easydict-gtk = 'easydict_gtk.easydict:main' + diff --git a/setup.py b/setup.py deleted file mode 100644 index 45468b2..0000000 --- a/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup - -with open('README.md') as f: - long_description = ''.join(f.readlines()) - -setup( - name='easydict-gtk', - version='v0.3.6', - description='The first open source translator which is completely open with dictionary data too.', - long_description=long_description, - long_description_content_type="text/markdown", - variant="GFM", - author='Jiří Němec', - author_email='nemec@jiri.one', - keywords='translator,dict', - license='GPL3', - url='https://github.com/jiri-one/easydict-gtk', - include_package_data=True, - classifiers=[ - 'Intended Audience :: End Users/Desktop', - 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: 3', - 'Environment :: X11 Applications :: GTK', - ], - python_requires=">=3.7", - zip_safe=False, - install_requires=['tinydb', 'orjson', 'pycairo', 'PyGObject'], - entry_points={ - 'console_scripts': [ - 'easydict-gtk = easydict.src.easydict:main', - ], - }, -)