Skip to content

Commit

Permalink
added media
Browse files Browse the repository at this point in the history
  • Loading branch information
diStyApps committed Apr 18, 2023
1 parent 670606c commit 8643d46
Show file tree
Hide file tree
Showing 21 changed files with 71 additions and 27 deletions.
3 changes: 2 additions & 1 deletion data/localizations/ar_AR.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "تعيين المسار",
"activate": "تفعيل",
"activated": "تم التفعيل",
"check_python_path": "مهم! تأكد من تحديد 'أضف Python 3.10 إلى PATH' قبل التثبيت."
"check_python_path": "مهم! تأكد من تحديد 'أضف Python 3.10 إلى PATH' قبل التثبيت.",
"add_project_name_folder_to_path": "أضف اسم مجلد المشروع إلى المسار"
}
3 changes: 2 additions & 1 deletion data/localizations/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "Pfad festlegen",
"activate": "Aktivieren",
"activated": "Aktiviert",
"check_python_path": "WICHTIG! Stellen Sie sicher, dass Sie vor der Installation 'Python 3.10 zum PATH hinzufügen' auswählen."
"check_python_path": "WICHTIG! Stellen Sie sicher, dass Sie vor der Installation 'Python 3.10 zum PATH hinzufügen' auswählen.",
"add_project_name_folder_to_path": "Projektordnername zum PATH hinzufügen"
}
3 changes: 2 additions & 1 deletion data/localizations/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "Set Path",
"activate": "Activate",
"activated": "Activated",
"check_python_path": "IMPORTANT! Ensure that you check 'Add Python 3.10 to PATH' before installing."
"check_python_path": "IMPORTANT! Ensure that you check 'Add Python 3.10 to PATH' before installing.",
"add_project_name_folder_to_path": "Add Project Folder Name to Path"
}
3 changes: 2 additions & 1 deletion data/localizations/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "Establecer ruta",
"activate": "Activar",
"activated": "Activado",
"check_python_path": "¡IMPORTANTE! Asegúrate de marcar 'Añadir Python 3.10 al PATH' antes de instalar."
"check_python_path": "¡IMPORTANTE! Asegúrate de marcar 'Añadir Python 3.10 al PATH' antes de instalar.",
"add_project_name_folder_to_path": "Agregar el nombre de la carpeta del proyecto al PATH"
}
3 changes: 2 additions & 1 deletion data/localizations/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "Définir le chemin",
"activate": "Activer",
"activated": "Activé",
"check_python_path": "IMPORTANT ! Assurez-vous de cocher 'Ajouter Python 3.10 au PATH' avant l'installation."
"check_python_path": "IMPORTANT ! Assurez-vous de cocher 'Ajouter Python 3.10 au PATH' avant l'installation.",
"add_project_name_folder_to_path": "Ajouter le nom du dossier de projet au PATH"
}
3 changes: 2 additions & 1 deletion data/localizations/he_IL.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "קביעת נתיב",
"activate": "הפעלה",
"activated": "מופעל",
"check_python_path": "חשוב! ודאו שסימנתם את הוספת Python 3.10 ל- PATH לפני ההתקנה."
"check_python_path": "חשוב! ודאו שסימנתם את הוספת Python 3.10 ל- PATH לפני ההתקנה.",
"add_project_name_folder_to_path": "הוספת שם תיקיית הפרוייקט לנתיב"
}
3 changes: 2 additions & 1 deletion data/localizations/hi_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "पथ सेट करें",
"activate": "सक्रिय करें",
"activated": "सक्रिय किया गया",
"check_python_path": "महत्वपूर्ण! सुनिश्चित करें कि आप 'एड पायथन 3.10 टू पाथ' को इंस्टॉल करने से पहले जांच लें।"
"check_python_path": "महत्वपूर्ण! सुनिश्चित करें कि आप 'एड पायथन 3.10 टू पाथ' को इंस्टॉल करने से पहले जांच लें।",
"add_project_name_folder_to_path": "पाठ में परियोजना फ़ोल्डर का नाम जोड़ें"
}
3 changes: 2 additions & 1 deletion data/localizations/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "Imposta percorso",
"activate": "Attiva",
"activated": "Attivato",
"check_python_path": "IMPORTANTE! Assicurati di selezionare 'Aggiungi Python 3.10 al PATH' prima di procedere con l'installazione."
"check_python_path": "IMPORTANTE! Assicurati di selezionare 'Aggiungi Python 3.10 al PATH' prima di procedere con l'installazione.",
"add_project_name_folder_to_path": "Aggiungi il nome della cartella del progetto al PATH"
}
3 changes: 2 additions & 1 deletion data/localizations/ja_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "パスの設定",
"activate": "アクティブ化",
"activated": "アクティブ化されました",
"check_python_path": "重要!インストール前に「Python 3.10をPATHに追加する」を確認してください。"
"check_python_path": "重要!インストール前に「Python 3.10をPATHに追加する」を確認してください。",
"add_project_name_folder_to_path": "プロジェクトフォルダ名をPATHに追加する"
}
3 changes: 2 additions & 1 deletion data/localizations/ko_KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "경로 설정",
"activate": "활성화",
"activated": "활성화됨",
"check_python_path": "중요! 설치하기 전에 'Python 3.10을 PATH에 추가' 옵션을 체크해주세요."
"check_python_path": "중요! 설치하기 전에 'Python 3.10을 PATH에 추가' 옵션을 체크해주세요.",
"add_project_name_folder_to_path": "프로젝트 폴더 이름을 PATH에 추가"
}
3 changes: 2 additions & 1 deletion data/localizations/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "Definir caminho",
"activate": "Ativar",
"activated": "Ativado",
"check_python_path": "IMPORTANTE! Certifique-se de marcar 'Adicionar Python 3.10 ao PATH' antes de instalar."
"check_python_path": "IMPORTANTE! Certifique-se de marcar 'Adicionar Python 3.10 ao PATH' antes de instalar.",
"add_project_name_folder_to_path": "Adicionar o nome da pasta do projeto ao PATH"
}
3 changes: 2 additions & 1 deletion data/localizations/ru_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "Установить путь",
"activate": "Активировать",
"activated": "Активировано",
"check_python_path": "ВАЖНО! Обязательно отметьте опцию 'Добавить Python 3.10 в PATH' перед установкой."
"check_python_path": "ВАЖНО! Обязательно отметьте опцию 'Добавить Python 3.10 в PATH' перед установкой.",
"add_project_name_folder_to_path": "Добавить имя папки проекта в PATH"
}
3 changes: 2 additions & 1 deletion data/localizations/tr_TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "Yolu Ayarla",
"activate": "Aktif Et",
"activated": "Aktifleştirildi",
"check_python_path": "ÖNEMLİ! Kurulumdan önce 'Python 3.10'u PATH'e ekle' seçeneğini işaretlediğinizden emin olun."
"check_python_path": "ÖNEMLİ! Kurulumdan önce 'Python 3.10'u PATH'e ekle' seçeneğini işaretlediğinizden emin olun.",
"add_project_name_folder_to_path": "Proje Klasör Adını PATH'e Ekle"
}
3 changes: 2 additions & 1 deletion data/localizations/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "设置路径",
"activate": "激活",
"activated": "已激活",
"check_python_path": "重要!在安装前,请确保勾选'将Python 3.10添加到PATH'。"
"check_python_path": "重要!在安装前,请确保勾选'将Python 3.10添加到PATH'。",
"add_project_name_folder_to_path": "将项目文件夹名称添加到路径中"
}
3 changes: 2 additions & 1 deletion data/localizations/zh_TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"set_path": "設定路徑",
"activate": "啟用",
"activated": "已啟用",
"check_python_path": "重要!在安裝前,請務必勾選 '將 Python 3.10 加入 PATH'。"
"check_python_path": "重要!在安裝前,請務必勾選 '將 Python 3.10 加入 PATH'。",
"add_project_name_folder_to_path": "將專案資料夾名稱加入 PATH"
}
11 changes: 9 additions & 2 deletions layout/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,21 @@ def create_layout(project,lang_data):
),
],
[
sg.Button(
sg.Button(
button_text=lang_data[LOCAL_ADD_PROJECT_NAME_FOLDER_TO_PATH],
button_color=(color.DIM_BLUE, color.GRAY),
key=f"{main_key}{project['id']}_project_path_add_folder_name_btn-",
expand_x=True,
mouseover_colors=(color.GRAY_9900, color.DIM_BLUE),
# size=(None,2)
) ,
sg.Button(
lang_data[LOCAL_SET_PATH],
button_color=(color.DIM_BLUE, color.GRAY),
key=f"{main_key}{project['id']}_project_path_set_btn-",
expand_x=True,
mouseover_colors=(color.GRAY_9900, color.DIM_BLUE),
# size=(None,2)

) ,
sg.Button(
lang_data[LOCAL_ACTIVATED] if project_pref and project_pref_isSet else lang_data[LOCAL_ACTIVATE],
Expand Down
Binary file added media/preview/0.0.8/1_0.0.8.jpg
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 media/preview/0.0.8/2_0.0.8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 27 additions & 8 deletions seait.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
import layout.requirements as requirements_layout
import layout.dialog as dialog_layout
import layout.projects as projects_layout


import os
def contains_spaces(file_path):
return ' ' in file_path
def main():
jt.create_preferences_init()
languages = localizations.get_language_by_codes()
Expand Down Expand Up @@ -75,7 +76,7 @@ def main():

flatten_ui_elements(window)
window.size = (window_width,800)

#endregion nav

def default_launcher_buttons(project_args, id_number):
Expand Down Expand Up @@ -163,6 +164,10 @@ def run_project_func(project,method,args=None):
# print("project_activate",event)
window.write_event_value(ACTIVATE_PROJECT_PATH,id_number)

if event.endswith("_project_path_add_folder_name_btn-"):
# print("project_add_folder_name",event)
window.write_event_value(ADD_PROJECT_FOLDER_NAME,id_number)

if event == RUN_APP_FUNC:
event_value = values['-run_app_func-']
id_number, method = project_util.get_function_and_project_id(event_value)
Expand Down Expand Up @@ -215,15 +220,29 @@ def run_project_func(project,method,args=None):
window.write_event_value(f"-select_app_{id_number}_btn-",'')
# window.write_event_value(f"refresh_menu_list",'')

if event == ADD_PROJECT_FOLDER_NAME:
id_number = values[ADD_PROJECT_FOLDER_NAME]
input_project_path = values[f'-selected_app_{id_number}_project_path_in-']
project = project_util.get_project_by_id(projects_data, id_number)
project_name = project['repo_name']

if not input_project_path.endswith(project_name):
window[f'-selected_app_{id_number}_project_path_in-'].update(f"{input_project_path}/{project_name}")
# print("project",input_project_path,project_name)
else:
print("Can only add project folder to path if it is not already in the path, you can add it manually if you want to.")

if event == SET_PROJECT_PATH:
id_number = values[SET_PROJECT_PATH]
input_project_path = values[f'-selected_app_{id_number}_project_path_in-']
if input_project_path:
# print("project",input_project_path)
# print(get_pref_project_data(id_number))
project_pref = get_pref_project_data(id_number)
add_project(id_number, input_project_path,False)
window.write_event_value(f"-select_app_{id_number}_btn-",'')
if not contains_spaces(input_project_path):
project_pref = get_pref_project_data(id_number)
add_project(id_number, input_project_path,False)
print("Path has been set.")
window.write_event_value(f"-select_app_{id_number}_btn-",'')
else:
print("Path cannot contain spaces.")

if event == CHECK_UPDATE_BTN_KEY:
if not update_check.check_update_available():
Expand Down
5 changes: 4 additions & 1 deletion util/CONSTANTS.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
RUN_APP_FUNC = "-run_app_func-"
SET_PROJECT_PATH = "-set_project_path-"
ACTIVATE_PROJECT_PATH = "-activate_project_path-"
ADD_PROJECT_FOLDER_NAME = "-add_project_folder_name-"

SELECT_APP = "-select_app_"
SELECTED_APP = "-selected_app_"
Expand Down Expand Up @@ -181,12 +182,14 @@

LOCAL_BROWSE= "browse"
LOCAL_SET_PATH = "set_path"
LOCAL_SET_FOLDER_PROJECT_NAME = "set_folder_project_name"
LOCAL_ACTIVATE= "activate"
LOCAL_ACTIVATED= "activated"
LOCAL_ACTIVATED= "activated"
LOCAL_CHECK_PYTHON_PATH = "check_python_path"
LOCAL_CHECK_PYTHON_PATH_LBL= "-check_python_path_lbl-"

#'Add Project Name Folder to Path'
LOCAL_ADD_PROJECT_NAME_FOLDER_TO_PATH = "add_project_name_folder_to_path"

#prefs
PREF_SELECTED_LANG = 'selected_lang'
2 changes: 1 addition & 1 deletion util/projects_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def launch(project_data, args=[]):
project_path = get_project_path(project_data)
venv_path = get_venv_path(project_data)
launch_path = get_entry_point(project_data, 'launch')
print(f"launching {project_data['repo_name']}")
print(f"launching {project_data['repo_name']} at {project_path}")
installation_status_venv = installation_status.check_project_venv(project_data)
installation_status_project = installation_status.check_project(project_data)

Expand Down

0 comments on commit 8643d46

Please sign in to comment.