import PySimpleGUI as sg
# код
main = [[sg.T("Select project folder: ", font='16'), sg.FolderBrowse("Browse", target='folder', font='12')],
[sg.Input(s.project_floder, size=(40,1), key="folder")],
[sg.T("Important!\nThis folder should contain the __init__.py file!\n", text_color="red", font='Courier 12')],
[sg.T("Load to:", font='16')],
[sg.Radio("Pypi", 0, default=load_to_PyPi, key="pypi", font='Segoe 12'), sg.Radio("Test Pypi", 0, default=load_to_Test_PyPi, key="test_pypi", font='Segoe 12')],
[sg.T("")],
[sg.T("Package name: ", font='12'), sg.Input(s.package_name, size=(26,1), key="package_name")],
[sg.T("Version: ", font='12'), sg.Input("", size=(15,1), key="version")],
[sg.T("Description: ", font='12'), sg.Input(s.description, size=(26,1), key="description")],
[sg.T("")],
[sg.T("Select README.md file: ", font='12')],
[sg.Input(s.README, size=(37,1), key="readme"), sg.FileBrowse("Browse", file_types=(("Markdown File", "*.md"),), target='readme', font='12'), sg.T("(Optional)", text_color="yellow", font='Arial 12')],
[sg.T("")],
[sg.T("Your username: ", font='12'), sg.Input(s.username, size=(26,1), key="username")],
[sg.T("Your password: ", font='12'), sg.Input("", size=(26,1), key="password", password_char='*'),sg.I("", size=(26,1),visible=False, key="pass_show"), sg.B("Show", key="Show")],
[sg.T("Your email: ",font='12'), sg.Input(s.email, size=(26,1), key="email")],
[sg.T("Github repository: ", font='12'), sg.Input(s.Github, size=(26,1), key="github"), sg.T("(Optional)", text_color="yellow", font='Arial 12')],
[sg.T("")],
[sg.T("Delete all created files, folders and archives after upload?", font='Segoe 14')],
[sg.Radio("Yes", 2, default=delete_files_1, key="delete_yes", font='Segoe 12'), sg.Radio("No", 2, default=delete_files_2, key="delete_no", font='Segoe 12')],
[sg.T("")],
[sg.Checkbox('Save new values', default=True, key='save'), sg.OK("Upload", font='12')]]
layout = [[sg.Column(main, size=(500,600), scrollable=True, vertical_scroll_only=True)]]
window = sg.Window(window_title, layout)
showing = False
while True:
event, values = window.read()
if event == sg.WIN_CLOSED:
sys.exit()
if event == "Show":
showing = not showing
if showing == True:
window['pass_show'].update(values["password"], visible=True)
window['password'].update(visible=False)
window["Show"].update("Hide")
else:
window['pass_show'].update(visible=False)
window['password'].update(values["pass_show"], visible=True)
window["Show"].update("Show")
# код