Skip to content

Commit

Permalink
#7 Updated Documentation and Tweaked UI
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmujtabaraza committed Apr 12, 2022
1 parent 8aca9cd commit a9c0e48
Show file tree
Hide file tree
Showing 22 changed files with 90 additions and 29 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@ files/
output/
!src/lib/
!src/android/lib/
!buildozer.spec
!buildozer.spec
!vocabtoanki.spec
1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified README.md
Binary file not shown.
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ dependencies:
- kivy[full]
- kivymd
- lxml
- pyinstaller[encryption]
- user_agent
Binary file added images/icon/vocabtoanki.ico
Binary file not shown.
1 change: 1 addition & 0 deletions images/icon/vocabtoanki.svg
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 images/icon/vocabtoanki_1024x1024.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 images/icon/vocabtoanki_512x512.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 images/sample/flashcard-1-back.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 images/sample/flashcard-1-front.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 images/sample/flashcard-2-back.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 images/sample/flashcard-2-front.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 images/sample/interface-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 images/sample/interface-2.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 images/sample/interface-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@
# <external-path name="external_files" path="Android/data/org.test.vocabtoanki/files" />
# </paths>

# pyinstaller --noconfirm --onedir --windowed --add-data "C:/Users/Standard User/miniconda3/envs/vocab-to-anki-app/Lib/site-packages/user_agent/data;user_agent/data/" "C:/Users/Public/Documents/projects/python/vocab-to-anki/main.py"
# pyinstaller --noconfirm --name vocabtoanki --icon "C:/Users/Public/Documents/projects/python/vocab-to-anki/icons/vocabtoanki_512x512.png" --onedir --windowed --add-data "C:/Users/Standard User/miniconda3/envs/vocab-to-anki/Lib/site-packages/user_agent/data;user_agent/data/" "C:/Users/Public/Documents/projects/python/vocab-to-anki/main.py"
# --onefile --onedir --icon examples-path\demo\touchtracer\icon.ico --key='<16 chars>' --name vocabtoanki
# exe, Tree('C:\\Users\\Public\\Documents\\projects\\python\\vocab-to-anki\\'),
# python -m PyInstaller vocabtoanki.spec

# convert -background transparent "vocabtoanki_512x512.png" -define icon:auto-resize=16,24,32,48,64,72,96,128,256 "vocabtoanki.ico"

import os
from glob import glob
Expand Down
Binary file modified src/__pycache__/app.cpython-38.pyc
Binary file not shown.
44 changes: 22 additions & 22 deletions src/app.kv
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,6 @@ ScreenManager:
# pos_hint: {'center_x': .8, 'center_y': .9}
# on_release: root.open_apkg()
# # on_press: root.manager.current = 'meanings_screen'
MDRaisedButton:
id: dict_dropdown
text: get_text("browse_button")
font_style: 'Button'
pos_hint: {"center_x": 0.5, 'center_y': 0.9}
on_release: root.open_dictionary_dropdown()
MDTextField:
id: word_input
# text: get_text("sample_url")[4:]
padding: "10dp"
multiline: False
hint_text: get_text("paste_here")
helper_text: get_text('sample_url')
helper_text_mode: "on_focus"
size_hint: (.75, .1)
pos_hint: {'center_x': 0.45, 'center_y': 0.72}
MDIconButton:
icon: get_text('paste_icon')
pos_hint: {"center_x": .9, "center_y": .72}
on_release: word_input.text = Clipboard.paste()
# MDLabel:
# text: get_text("chose_accent")
# theme_text_color: 'Primary'
Expand All @@ -88,7 +68,7 @@ ScreenManager:
helper_text: get_text('sample_decks')
helper_text_mode: "on_focus"
size_hint: (.75, .1)
pos_hint: {'center_x': 0.45, 'center_y': 0.56}
pos_hint: {'center_x': 0.45, 'center_y': 0.84}
on_focus: root.deck_input_focus_mode(self.focus)
MDTextField:
id: tags_input
Expand All @@ -99,8 +79,28 @@ ScreenManager:
helper_text_mode: "on_focus"
# icon_left_color: 'red'
size_hint: (.75, .1)
pos_hint: {'center_x': 0.45, 'center_y': 0.4}
pos_hint: {'center_x': 0.45, 'center_y': 0.68}
on_focus: root.tags_input_focus_mode(self.focus)
MDRaisedButton:
id: dict_dropdown
text: get_text("browse_button")
font_style: 'Button'
pos_hint: {"center_x": 0.5, 'center_y': 0.52}
on_release: root.open_dictionary_dropdown()
MDTextField:
id: word_input
# text: get_text("sample_url")[4:]
padding: "10dp"
multiline: False
hint_text: get_text("paste_here")
helper_text: get_text('sample_url')
helper_text_mode: "on_focus"
size_hint: (.75, .1)
pos_hint: {'center_x': 0.45, 'center_y': 0.38}
MDIconButton:
icon: get_text('paste_icon')
pos_hint: {"center_x": .9, "center_y": .38}
on_release: word_input.text = Clipboard.paste()
MDRectangleFlatButton:
text: get_text("generate_flashcards")
font_style: 'Button'
Expand Down
5 changes: 3 additions & 2 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def select_all(self):
home_screen_instance = MDApp.get_running_app().home_screen_instance
# md_bg_color = self.theme_cls.primary_color
# left_action_items = [["arrow-left", lambda x: self.get_running_app().soft_restart()]]
right_action_items = [[get_text("export_icon"), lambda x: home_screen_instance.confirm_generation()],
right_action_items = [[get_text("export_icon"), lambda x: home_screen_instance.confirm_generation(), "Export"],
[get_text("select_none_icon"), lambda x: self.deselect_all()]]
self.ids.toolbar.right_action_items = right_action_items
# meanings_screen.ids.toolbar.title = get_text("app_title")
Expand Down Expand Up @@ -780,6 +780,7 @@ def __init__(self, **kwargs):
self.db_connection = None

def build(self):
self.icon = "images/icon/vocabtoanki_1024x1024.png"
Window.bind(on_keyboard=self._on_keyboard_handler)
Window.bind(on_request_close=self.on_request_close)
# sm.add_widget(HomeScreen(name='home_screen'))
Expand Down Expand Up @@ -1067,7 +1068,7 @@ def set_deck(self, deck):
def on_selected(self):
meanings_screen = self.root.get_screen("meanings_screen")
export_button = \
[get_text("export_icon"), lambda x: self.get_running_app().home_screen_instance.confirm_generation()]
[get_text("export_icon"), lambda x: self.get_running_app().home_screen_instance.confirm_generation(), "Export"]
if CONTAINER['m_checkboxes_selected'] == 0:
meanings_screen.ids.toolbar.title = get_text("app_title")
meanings_screen.ids.toolbar.anchor_title = 'center'
Expand Down
2 changes: 0 additions & 2 deletions src/lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def is_platform(os_name) -> bool:

def get_root_path(db=False, media=False) -> str:
print("Home DIR:", user_home_dir)
print(db, media)
if is_platform('android'): # if 'ANDROID_STORAGE' in os.environ:
from android.storage import app_storage_path
# path = f'{app_storage_path()}/'
Expand All @@ -52,7 +51,6 @@ def get_root_path(db=False, media=False) -> str:
base_path = os.path.join(user_home_dir, get_text("app_title"))
if not os.path.exists(base_path):
os.makedirs(base_path)
print(base_path)
return base_path


Expand Down
2 changes: 1 addition & 1 deletion strings/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"generate_flashcards": "Generate Anki Flashcards",
"finding_meanings": "Finding meanings...",

"cambridge": "Cambridge",
"cambridge": "Cambridge English",
"dictionary_com": "Dictionary.com",
"merriam_webster": "Merriam-Webster",
"oxford": "Oxford",
Expand Down
53 changes: 53 additions & 0 deletions vocabtoanki.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# -*- mode: python ; coding: utf-8 -*-

import sys
import os

from kivy_deps import sdl2, glew

from kivymd import hooks_path as kivymd_hooks_path

path = os.path.abspath(".")

block_cipher = None


a = Analysis(['C:/Users/Public/Documents/projects/python/vocab-to-anki/main.py'],
pathex=[path],
binaries=[],
datas=[('C:/Users/Standard User/miniconda3/envs/vocab-to-anki/Lib/site-packages/user_agent/data', 'user_agent/data/')],
hiddenimports=[],
hookspath=[kivymd_hooks_path],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)

exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='vocabtoanki',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None , icon='C:\\Users\\Public\\Documents\\projects\\python\\vocab-to-anki\\icons\\vocabtoanki.ico')
coll = COLLECT(exe, Tree('C:\\Users\\Public\\Documents\\projects\\python\\vocab-to-anki\\'),
a.binaries,
a.zipfiles,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
strip=False,
upx=True,
upx_exclude=[],
name='vocabtoanki')

0 comments on commit a9c0e48

Please sign in to comment.