|
| 1 | +#!/usr/bin/python3 |
| 2 | +""" Copyright© 2023-2025 LinuxUsersLinuxMint |
| 3 | +PyAppDevKit Tüm Hakları GPL(Genel Kamu Lisansı) altında korunmaktadır. |
| 4 | +PyAppDevKit All Rights Reserved under the GPL(General Public License). |
| 5 | +Bu Yazılımın Bir Kopyası GitHub da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/PyAppDevKit |
| 6 | +A Copy of This Software is published on GitHub To view: https://github.com/LinuxUsersLinuxMint/PyAppDevKit""" |
| 7 | + |
| 8 | +from pyappdevkit.parameters import * |
| 9 | +import os |
| 10 | + |
| 11 | +""" |
| 12 | +TR: |
| 13 | +Uyarı: time() fonksiyonu gerçek bir zaman ölçümü yapmaz bunun yerine döngü oluşturarak bekleme süresi oluşturur bu yüzden bekleme süresi belirtilen süreden farklı olabilir. Eğer gerçek bir zaman ölçümü yapmak istiyorsanız bunun yerine Python programlama dilinde yerleşik olarak gelen time kütüphanesini kullanınız. |
| 14 | +
|
| 15 | +EN: |
| 16 | +Warning: the time() function does not measure actual time, instead it loops and creates a waiting time, so the waiting time may be different from the specified time. If you want to measure real time, use the time library built into the Python programming language instead. |
| 17 | +""" |
| 18 | + |
| 19 | +def time(number,unit): |
| 20 | + while number > 0: |
| 21 | + number -= 1 |
| 22 | + if unit == MS or unit == MILISECOND: |
| 23 | + for _ in range(100000): |
| 24 | + pass |
| 25 | + elif unit == S or unit == SECOND: |
| 26 | + for _ in range(100000000): |
| 27 | + pass |
| 28 | + elif unit == M or unit == MINUTE: |
| 29 | + for _ in range(100000000*60): |
| 30 | + pass |
| 31 | + elif unit == H or unit == HOUR: |
| 32 | + for _ in range(100000000*60*60): |
| 33 | + pass |
| 34 | + |
| 35 | +def file(file_name,file_mode,file_write): |
| 36 | + create_file = open(file_name, file_mode) |
| 37 | + if file_mode == "w" or file_mode == "a": |
| 38 | + create_file.write("{0}\n". format(file_write)) |
| 39 | + elif file_mode == "r": |
| 40 | + print(create_file.read()) |
| 41 | + |
| 42 | +def file_remove(file_name,file_path): |
| 43 | + if file_name != 0 or file_name != "": |
| 44 | + os.remove(file_name) |
| 45 | + else: |
| 46 | + os.remove(r"{0}". format(file_path)) |
| 47 | + |
| 48 | +def error_msg(error_dialog,error_code,support_link): |
| 49 | + print(error_dialog,error_code,support_link) |
| 50 | + |
| 51 | +def exit_program_dialog_time(exit_dialog_msg,userTime,unit): |
| 52 | + print(exit_dialog_msg) |
| 53 | + time(userTime,unit=unit) |
| 54 | + exit() |
| 55 | + |
| 56 | +def exit_program_time(userTime,unit): |
| 57 | + time(userTime,unit=unit) |
| 58 | + exit() |
| 59 | + |
| 60 | +def exit_program_dialog(exit_dialog_msg): |
| 61 | + print(exit_dialog_msg) |
| 62 | + exit() |
| 63 | + |
| 64 | +def all_exit(dialog_switch,lang,ExitSelectDialog,userTimeDialog,exitDialog,errormsgDialog,unit): |
| 65 | + if dialog_switch == ON: |
| 66 | + exit_select = int(input(ExitSelectDialog)) |
| 67 | + if exit_select == 0: |
| 68 | + userTime = int(input(userTimeDialog)) |
| 69 | + exit_program_dialog_time(exitDialog, userTime,unit=unit) |
| 70 | + elif exit_select == 1: |
| 71 | + userTime = int(input(userTimeDialog)) |
| 72 | + exit_program_time(userTime,unit=unit) |
| 73 | + elif exit_select == 2: |
| 74 | + exit_program_dialog(exitDialog) |
| 75 | + elif exit_select == 3: |
| 76 | + exit() |
| 77 | + else: |
| 78 | + error_msg(errormsgDialog,"","") |
| 79 | + elif dialog_switch == OFF: |
| 80 | + if lang == EN: |
| 81 | + exit_select = int(input("Select the method to exit the program (0: Dialogue and Time entry, 1: Time entry only, 2: Dialogue entry only, 3: Normal exit (old style)): ")) |
| 82 | + if exit_select == 0: |
| 83 | + userTime = int(input("After how many seconds should the program be closed?: ")) |
| 84 | + exit_program_dialog_time("Exit program...", userTime,unit=unit) |
| 85 | + elif exit_select == 1: |
| 86 | + userTime = int(input("After how many seconds should the program be closed?: ")) |
| 87 | + exit_program_time(userTime,unit=unit) |
| 88 | + elif exit_select == 2: |
| 89 | + exit_program_dialog("Exit program...") |
| 90 | + elif exit_select == 3: |
| 91 | + exit() |
| 92 | + else: |
| 93 | + error_msg("Invalid Command!","","") |
| 94 | + elif lang == TR: |
| 95 | + exit_select = int(input("Programdan çıkış yöntemini seçin (0: Diyalog ve Zaman girişi, 1: Yalnızca zaman girişi, 2: Yalnızca diyalog girişi, 3: Normal çıkış (eski stil)): ")) |
| 96 | + if exit_select == 0: |
| 97 | + userTime = int(input("Program kaç saniye sonra kapatılmalıdır?: ")) |
| 98 | + exit_program_dialog_time("Programdan çıkılıyor...", userTime,unit=unit) |
| 99 | + elif exit_select == 1: |
| 100 | + userTime = int(input("Program kaç saniye sonra kapatılmalıdır?: ")) |
| 101 | + exit_program_time(userTime,unit=unit) |
| 102 | + elif exit_select == 2: |
| 103 | + exit_program_dialog("Programdan çıkılıyor...") |
| 104 | + elif exit_select == 3: |
| 105 | + exit() |
| 106 | + else: |
| 107 | + error_msg("Geçersiz Komut!","","") |
| 108 | + |
| 109 | +def app_info(dialog_one,dialog_one_t,dialog_two,dialog_two_t,dialog_three,dialog_three_t,dialog_four,dialog_four_t,dialog_five,dialog_five_t,dialog_six,dialog_six_t,dialog_seven,dialog_seven_t,dialog_eigth,dialog_eight_t,dialog_nine,dialog_nine_t,dialog_ten,dialog_ten_t): |
| 110 | + print("{0} {1}". format(dialog_one,dialog_one_t)) |
| 111 | + print("{0} {1}". format(dialog_two,dialog_two_t)) |
| 112 | + print("{0} {1}". format(dialog_three,dialog_three_t)) |
| 113 | + print("{0} {1}". format(dialog_four,dialog_four_t)) |
| 114 | + print("{0} {1}". format(dialog_five,dialog_five_t)) |
| 115 | + print("{0} {1}". format(dialog_six,dialog_six_t)) |
| 116 | + print("{0} {1}". format(dialog_seven,dialog_seven_t)) |
| 117 | + print("{0} {1}". format(dialog_eigth,dialog_eight_t)) |
| 118 | + print("{0} {1}". format(dialog_nine,dialog_nine_t)) |
| 119 | + print("{0} {1}". format(dialog_ten,dialog_ten_t)) |
| 120 | + |
| 121 | +def program_welcome_msg(welcome_msg,cfg,cfg_,appname,libname,websitelink): |
| 122 | + print(welcome_msg) |
| 123 | + if cfg == 1: |
| 124 | + print(websitelink) |
| 125 | + elif cfg == 0: |
| 126 | + if cfg_ == "lib": |
| 127 | + app_info("Library Name: ",libname,"","","","","","","","","","","","","","","","","","") |
| 128 | + elif cfg_ == "app": |
| 129 | + app_info("Program Name: ",appname,"","","","","","","","","","","","","","","","","","") |
| 130 | + else: |
| 131 | + error_msg("Invalid definition!","","") |
0 commit comments