├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── codeql-analysis.yml ├── ACPL_Icon.ico ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── about_az.txt ├── about_de.txt ├── about_en.txt ├── about_fr.txt ├── about_it.txt ├── about_nl.txt ├── about_tr.txt ├── acpl_libs ├── doc_GUI.md ├── doc_clipboard.md ├── doc_colors.md ├── doc_files.md ├── doc_math.md ├── doc_quit.md ├── doc_swap.md ├── doc_wait_until_user_input.md ├── fx_GUI.py ├── fx_clipboard.py ├── fx_colors.py ├── fx_files.py ├── fx_math.py ├── fx_quit.py ├── fx_swap.py ├── fx_wait_until_user_input.py └── lib_list.md ├── ascii-art.txt ├── changelog.md ├── code.acpl ├── code_sample.acpl ├── code_sample2.acpl ├── compiler.py ├── console.py ├── ide.py ├── main.py ├── recurrent_classes.py ├── requirements.txt ├── setup.py ├── startup.acpl-ini ├── trad_az.json ├── trad_de.json ├── trad_en.json ├── trad_fr.json ├── trad_it.json ├── trad_nl.json ├── trad_tr.json ├── updater_main.py └── updater_others.py /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ master ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ master ] 20 | schedule: 21 | - cron: '31 3 * * 3' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | 28 | strategy: 29 | fail-fast: false 30 | matrix: 31 | language: [ 'python' ] 32 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] 33 | # Learn more: 34 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed 35 | 36 | steps: 37 | - name: Checkout repository 38 | uses: actions/checkout@v2 39 | 40 | # Initializes the CodeQL tools for scanning. 41 | - name: Initialize CodeQL 42 | uses: github/codeql-action/init@v1 43 | with: 44 | languages: ${{ matrix.language }} 45 | # If you wish to specify custom queries, you can do so here or in a config file. 46 | # By default, queries listed here will override any specified in a config file. 47 | # Prefix the list here with "+" to use these queries and those in the config file. 48 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 49 | 50 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 51 | # If this step fails, then you should remove it and run the build manually (see below) 52 | - name: Autobuild 53 | uses: github/codeql-action/autobuild@v1 54 | 55 | # ℹ️ Command-line programs to run using the OS shell. 56 | # 📚 https://git.io/JvXDl 57 | 58 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 59 | # and modify them (or add more) to build your code if your project 60 | # uses a compiled language 61 | 62 | #- run: | 63 | # make bootstrap 64 | # make release 65 | 66 | - name: Perform CodeQL Analysis 67 | uses: github/codeql-action/analyze@v1 68 | -------------------------------------------------------------------------------- /ACPL_Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megat69/ACPL/e86ec6cf5baee955e3f9ee4bec94545fdbb846d9/ACPL_Icon.ico -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## How to contribute ? 2 | Just join our [Discord](https://discord.gg/MBuKcUn) ! 3 | -------------------------------------------------------------------------------- /about_az.txt: -------------------------------------------------------------------------------- 1 | ACPL balaca bir proqramlaşdırma dilidir, hansı ki cavan bir fransalî şagird tərəfindən düzəldilib : TheAssassin 2 | 3 | Bu dilin məqsədi sadədir, lakim başda olaraq, bu sadəcə mənim bacarıqlarımı test etdirmək üçündür, ona görə də çox şey gözləməyin ;) ! 4 | 5 | Texniki hissə : 6 | Bu dilin sintaksisi hər yerdən gəlir, pythona-bənzər hissələri ilə, Javascriptə-bənzər hissələr, C-bənzər hissələr, və daha çoxu. 7 | Təfsir etmək üçün Pythonda tərcümə olunur. 8 | 9 | PROS və CONS : 10 | Pros : 11 | - Sadə 12 | - İşlənməsi gözəl 13 | - Buna bir şey etsəniz təşəkkür edirəm xD 14 | 15 | Cons : 16 | - Çoxlu özəlliklər 17 | - Həqiqətən az çalıştırma zamanı 18 | - İcma 19 | 20 | Və oxuduğunuz üçün çox sağolun :) ! -------------------------------------------------------------------------------- /about_de.txt: -------------------------------------------------------------------------------- 1 | ACPL is a little programming language created by a young french student : TheAssassin. 2 | 3 | The goal of this language is to be simple, but mainly, it is just a project to test my skills and learn, so don't expect too much about it ;) ! 4 | 5 | Technical part : 6 | The language have its syntax coming from everywhere, with python-like parts, JavaScript-like parts, C-like parts, and a lot more. 7 | It is transpiled in Python to be interpreted. 8 | 9 | PROS and CONS : 10 | Pros : 11 | - Simple 12 | - Nice to use 13 | - It please me if you do something with it so thank you xD 14 | 15 | Cons : 16 | - Too few features 17 | - Really slow execution time 18 | - Community 19 | 20 | And thanks for reading :) ! -------------------------------------------------------------------------------- /about_en.txt: -------------------------------------------------------------------------------- 1 | ACPL is a little programming language created by a young french student : TheAssassin. 2 | 3 | The goal of this language is to be simple, but mainly, it is just a project to test my skills and learn, so don't expect too much about it ;) ! 4 | 5 | Technical part : 6 | The language have its syntax coming from everywhere, with python-like parts, JavaScript-like parts, C-like parts, and a lot more. 7 | It is transpiled in Python to be interpreted. 8 | 9 | PROS and CONS : 10 | Pros : 11 | - Simple 12 | - Nice to use 13 | - It please me if you do something with it so thank you xD 14 | 15 | Cons : 16 | - Too few features 17 | - Really slow execution time 18 | - Community 19 | 20 | And thanks for reading :) ! -------------------------------------------------------------------------------- /about_fr.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megat69/ACPL/e86ec6cf5baee955e3f9ee4bec94545fdbb846d9/about_fr.txt -------------------------------------------------------------------------------- /about_it.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megat69/ACPL/e86ec6cf5baee955e3f9ee4bec94545fdbb846d9/about_it.txt -------------------------------------------------------------------------------- /about_nl.txt: -------------------------------------------------------------------------------- 1 | ACPl is een kleine programmeer taal gemaakt door een jonge franse student: TheAssasin. 2 | 3 | Het doel van deze taal is om simple te zijn, maar vooral is het gewoon een project om mijn vaardigheden te testen en te leren, dus verwacht er niet te veel van;) ! 4 | 5 | Technisch deel : 6 | De taal heeft zijn syntax van overal, met dingen die op python lijken, javascript en C, en veel meer. 7 | 8 | The language have its syntax coming from everywhere, with python-like parts, JavaScript-like parts, C-like parts, and a lot more. 9 | Het is gemaakt in Python om geïnterpreteerd te worden. 10 | 11 | VOORDELEN en NADELEN : 12 | Voordelen : 13 | - Gemakkelijk 14 | - Fijn om te gebruiken 15 | - Ik zou het fijn vinden als je er iets mee maakt dus bedankt xD 16 | 17 | Nadelen : 18 | - Te weinig onderdelen 19 | - Erg langzame uitvoer tijd. 20 | - Gemeenschap 21 | 22 | En bedankt voor het lezen :) ! -------------------------------------------------------------------------------- /about_tr.txt: -------------------------------------------------------------------------------- 1 | ACPL, genç bir Fransız öğrenci olan TheAssassin tarafından oluşturulan küçük bir programlama dilidir. 2 | 3 | Bu dilin amacı basit olmaktır, ancak temel olarak, sadece becerilerimi test etmek ve öğrenmek için bir proje, bu yüzden çok fazla şey beklemeyin ;) ! 4 | 5 | Teknik Kısım: 6 | Dilin sözdizimi her yerden geliyor, Python benzeri parçalar, JavaScript benzeri parçalar, C benzeri parçalar ve çok daha fazlası. 7 | Yorumlanması için Python'a aktarılır. 8 | 9 | ARTILARI ve EKSİLERİ : 10 | Artıları: 11 | - Basit 12 | - Kullanımı güzel 13 | - Onunla bir şey yaparsan lütfen çok teşekkür ederim xD 14 | 15 | Eksileri : 16 | - Çok az özellik var 17 | - Gerçekten yavaş yürütme süresi 18 | - Topluluk 19 | 20 | Ve okuduğunuz için teşekkürler :) ! -------------------------------------------------------------------------------- /acpl_libs/doc_GUI.md: -------------------------------------------------------------------------------- 1 | ## GUI ACPL lib 2 | 3 | ### Overview 4 | The GUI lib lets you create simple windows and GUI with ACPL. 5 | 6 | Full documentation in the *Usage* section. 7 | 8 | ### Install 9 | Go on your ACPL console and type `lib install GUI`. 10 | 11 | ### Usage 12 | #### Window creation 13 | Create a window with the following syntax : `lib GUI create window [param1=value1]...` 14 | 15 | Also available as var method : `var = lib GUI create window [param1=value1]...` 16 | 17 | **AVAILABLE PARAMETERS :** 18 | - *size* : 19 | - Value : string 20 | - Using the following syntax : `x` 21 | - *title* : 22 | - String containing the title 23 | - *icon* : 24 | - Path to the `.ico` file for the icon 25 | - ~~*background* :~~ 26 | - ~~String with the name of one of the Python Tkinter colors~~ 27 | - ***Support dropped at the moment.*** 28 | 29 | 30 | #### Windows displaying 31 | **This instruction has to go last, and is a blocking instruction !** 32 | 33 | Type `lib GUI display ` 34 | 35 | #### Text creation 36 | Create bits of text using the following syntax : `lib GUI create text [--param1:value1]...` 37 | 38 | Let's explain this last parameter, that will make the other parameters depend. 39 | 40 | If you choose the option `pack`, then the text will just be appended under the last text you created, and at the center of the window. 41 | 42 | If you instead want to align more and have more control over the style, use the ` ` coordinates. 43 | These will create a grid, and your text will be placed at row n°`` and column n°``. 44 | 45 | **You cannot use both at once ! You can either use the grid OR the packing, but not both at the same time !** 46 | 47 | **Optional parameters :** 48 | - *Globals* 49 | - `align` 50 | - Defines the text alignment (in the whole window for the packing, in the cell for the grid) 51 | - String 52 | - Contains `top`, `left`, `right`, `bottom`, a combination of two of them, or `center` 53 | - `background` and `color` 54 | - One of the Python Tkinter supported colors. 55 | - *GRID ONLY* 56 | - `columnspan` 57 | - Defines the number of columns that will be used for this cell. 58 | - Integer, cannot be zero or negative. 59 | - Default : 1 60 | 61 | Also available as var action, with syntax `var = lib GUI create text [--param1:value1]` 62 | 63 | ### Example 64 | Example 1, creation of a window containing "Hello World !", without optional colors. 65 | ``` 66 | $use: GUI 67 | var window = lib GUI create window 68 | lib GUI create text my_text window pack Hello World ! 69 | lib GUI display window 70 | ``` 71 | 72 | Example 2, creation of a window containing some sample text, with optional colors and parameters. 73 | 74 | Run it to see a demo of the ACPL GUI lib. 75 | ``` 76 | $use: GUI 77 | var window = lib GUI create window size=400x500 title=ACPL GUI lib demo ! icon=ACPL_Icon.ico 78 | var my_text = lib GUI create text window 0 0 Top-left text. --align:top-left --background:green --color:white 79 | var my_text = lib GUI create text window 0 1 Top-right text. --align:top-right --background:yellow --color:grey60 80 | var my_text = lib GUI create text window 1 0 Bottom-left text. --align:bottom-left --background:OliveDrab2 --color:wheat1 81 | var my_text = lib GUI create text window 1 1 Bottom-right text. --align:bottom-right --background:DodgerBlue2 --color:chartreuse2 82 | lib GUI display window 83 | ``` 84 | -------------------------------------------------------------------------------- /acpl_libs/doc_clipboard.md: -------------------------------------------------------------------------------- 1 | ## Clipboard ACPL lib 2 | This lib allows you to copy a string to the clipboard, or to get what is in the clipboard at the moment. 3 | 4 | ### Install 5 | Go on your ACPL console and type `lib install clipboard`. 6 | 7 | ### Usage 8 | #### Copy 9 | To copy a string to the clipboard, use the function `lib clipboard copy ` 10 | 11 | #### Get 12 | To get the content of the clipboard, use the function `lib clipboard get ` where `` is a variable name. This variable will take the value of the clipboard content. 13 | 14 | Also available as var method : 15 | - Syntax : `var = lib clipboard get` 16 | - After this line, you can change type if wanted : 17 | - Syntax : `: = {}` 18 | 19 | ### Example 20 | ``` 21 | $use: clipboard 22 | var:str string_to_copy = input Input a string to copy to the clipboard : 23 | lib clipboard copy {string_to_copy} 24 | var:str return_var = lib clipboard get 25 | print {return_var} 26 | ``` 27 | -------------------------------------------------------------------------------- /acpl_libs/doc_colors.md: -------------------------------------------------------------------------------- 1 | ## Colors ACPL lib 2 | This lib adds 9 new variables to your disposal, each of them making color in `print`s possible ! 3 | 4 | ### Install 5 | Go on your ACPL console and type `lib install colors`. 6 | 7 | ### Usage 8 | #### Import 9 | To use the color variables, you need to import the lib first. 10 | 11 | Therefore, type `$use: colors` at the beginning of your code. 12 | 13 | Then, you will need to import them. 14 | 15 | To do so, type `lib colors import` at the beginning of your code. 16 | 17 | #### Variable names 18 | You get access to : 19 | - Colors : 20 | - `colors_BLUE` 21 | - `colors_PINK` 22 | - `colors_GREEN` 23 | - `colors_YELLOW` 24 | - `colors_RED` 25 | - Formatting : 26 | - `colors_UNDERLINE` 27 | - `colors_BOLD` 28 | - `colors_ITALICS` 29 | 30 | Also, you will need to end **EVERY OF THEM** using `colors_END`. 31 | 32 | Otherwise, your code will bug as hell. 33 | 34 | ### Example 35 | ``` 36 | $use: colors 37 | lib colors import 38 | print {colors_GREEN}My text in green with {colors_ITALICS}italics{colors_END}{colors_GREEN} !{colors_END} 39 | ``` 40 | -------------------------------------------------------------------------------- /acpl_libs/doc_files.md: -------------------------------------------------------------------------------- 1 | ## Files ACPL lib 2 | 3 | ### Overview 4 | The files lib lets you read and write in files using ACPL. 5 | 6 | Full documentation in the *Usage* section. 7 | 8 | ### Install 9 | Go on your ACPL console and type `lib install files`. 10 | 11 | ### Usage 12 | #### Reading from files 13 | To read from a file, you need to use the `read` instruction. 14 | 15 | Syntax : `lib files read [optional parameters]` 16 | 17 | - The `file` argument corresponds to the file you want to read from. 18 | - The `return_var` argument corresponds to the NAME of the variable that will take the value of the text contained in the file. 19 | - The returned value is a list of strings. 20 | - The optional parameters : 21 | - `--remove_newlines` : If used, all the `\n` at the end of each list element will be removed. 22 | 23 | This method can also be used as var method, and in that case, the `return_var` parameter does not exist. 24 | 25 | Syntax : `var = lib files read [optional parameters]` 26 | 27 | #### Writing in a file 28 | To write in a file, you need to use the `write` instruction. 29 | 30 | Syntax : `lib files write [optional parameters]` 31 | 32 | - The `file` argument corresponds to the file you want to write into. 33 | - The `var_from` argument corresponds to the NAME of the variable that contains the text you want to write. 34 | - This variable can be : 35 | - A string ; in that case, only one line will be written into the file. 36 | - A list ; in that case, each element of the list ending with `\n` will be written into the file. 37 | - The optional parameters : 38 | - `--write_mode:a` : If this parameter is used, the text will be appended at the end of the file, instead of replacing the old one. 39 | 40 | ### Example 41 | ``` 42 | $use: files 43 | # Importing the lib 44 | 45 | lib files read file_to_read.txt old_text 46 | # It just reads the text in the file 'file_to_read.txt' 47 | # and stores it in the variable 'old_text'. 48 | 49 | print Old text in file_to_read.txt : {old_text} 50 | # Prints the old text in file_to_read 51 | 52 | var:str text_to_paste = It just works. 53 | # Creates a string variable 54 | lib files write file_to_read.txt text_to_paste 55 | # Replaces the old text in 'file_to_read.txt' with the 56 | # content of 'text_to_paste'. 57 | ``` -------------------------------------------------------------------------------- /acpl_libs/doc_math.md: -------------------------------------------------------------------------------- 1 | ## Math ACPL lib 2 | 3 | ### Overview 4 | The math lib gives you access to a few math functions. 5 | 6 | See them all in the *Usage* section. 7 | 8 | ### Install 9 | Go on your ACPL console and type `lib install math`. 10 | 11 | ### Usage 12 | The `math` library gives access to four functions. 13 | All of them follow the syntax `lib math `. 14 | `return_variable` corresponds to the variable that will get the value returned by the function. 15 | `value` is the value that will be given to the function. 16 | `function` is one of the following : 17 | - `sqrt` : Returns the square root of the given value. 18 | - If the value is negative, the function will return an error and stop the code execution. 19 | - `fabs` : Returns the absolute value of the given value. 20 | - `factorial` : Returns the factorial of the given value. 21 | - If the value is negative, the function will return an error and stop the code execution. 22 | - `floor` : Returns the integer part of the given value. 23 | 24 | ### Example : 25 | ``` 26 | $use: math 27 | var:int number = 9 28 | lib math sqrt number {number} 29 | print The square root of the number is {number}. 30 | ``` 31 | Will print '3.0'. 32 | -------------------------------------------------------------------------------- /acpl_libs/doc_quit.md: -------------------------------------------------------------------------------- 1 | ## Quit ACPL lib 2 | 3 | ### Install 4 | Go on your ACPL console and type `lib install quit`. 5 | 6 | ### Usage 7 | Type `lib quit` to exit the program. 8 | That's as simple as this. 9 | 10 | ### Example 11 | ``` 12 | print I wanna leave. 13 | lib quit 14 | print I left 15 | ``` 16 | Output : 17 | ``` 18 | I wanna leave. 19 | ``` 20 | -------------------------------------------------------------------------------- /acpl_libs/doc_swap.md: -------------------------------------------------------------------------------- 1 | ## Swap ACPL lib 2 | 3 | ### Overview 4 | This lib lets you swap two variable's values with just one line. 5 | 6 | ### Install 7 | Go on your ACPL console and type `lib install swap`. 8 | 9 | ### Usage 10 | Syntax : `lib swap ` 11 | 12 | ### Example 13 | ``` 14 | $use: swap 15 | var:int var1 = 0 16 | var:int var2 = 1 17 | 18 | print {var1}, {var2} 19 | lib swap var1 var2 20 | print {var1}, {var2} 21 | ``` 22 | -------------------------------------------------------------------------------- /acpl_libs/doc_wait_until_user_input.md: -------------------------------------------------------------------------------- 1 | ## ACPL lib 'Wait_until_user_input' 2 | Waits until user presses 'Enter' 3 | 4 | ### Install 5 | Go on your ACPL console and type `lib install wait_until_user_input`. 6 | 7 | ### Usage 8 | Type `lib wait_until_user_input [method:bool/string]` 9 | If `method` is not defined or equals `False`, it will wait for the user to press 'Enter'. 10 | If `method` equals `True`, it will display "Press enter to continue..." and wait for the user to press 'Enter'. 11 | If `method` is a string, it will display that string and wait for the user to press 'Enter'. 12 | 13 | ### Example 14 | ``` 15 | lib wait_until_user_input true 16 | ``` 17 | -------------------------------------------------------------------------------- /acpl_libs/fx_clipboard.py: -------------------------------------------------------------------------------- 1 | from recurrent_classes import * 2 | import pyperclip 3 | 4 | def libs_to_import(): 5 | return ("pyperclip",), tuple() 6 | 7 | def requirements(file): 8 | if file == "compiler_var_methods": 9 | return ("line_numbers", "is_lib") 10 | else: 11 | return ("line_numbers",) 12 | 13 | def main(line, variables_container, other_args): 14 | """ 15 | Main function for clipboard ACPL lib. 16 | """ 17 | line_numbers = other_args[0] 18 | 19 | if line.startswith("clipboard"): 20 | line = line.replace("clipboard ", "", 1) 21 | if line.startswith("copy"): 22 | # lib clipboard copy 23 | line = line.replace("copy ", "", 1) 24 | line = remove_suffix(line, line.endswith("\n")) 25 | pyperclip.copy(line) 26 | 27 | elif line.startswith("get"): 28 | # lib clipboard get 29 | line = line.replace("get ", "", 1) 30 | line = remove_suffix(line, line.endswith("\n")) 31 | variables_container[line] = pyperclip.paste() 32 | 33 | else: 34 | error(line_numbers, "ArgumentError", f"Function '{line.split(' ')[0]}' does not exist in clipboard lib !") 35 | 36 | return line, variables_container 37 | 38 | def pytranslation(line, other_args): 39 | line_numbers = other_args[0] 40 | 41 | if line.startswith("clipboard"): 42 | line = line.replace("clipboard ", "", 1) 43 | if line.startswith("copy"): 44 | # lib clipboard copy 45 | line = line.replace("copy ", "", 1) 46 | line = remove_suffix(line, line.endswith("\n")) 47 | line = line.replace("\"", "\\\"") 48 | line = f"pyperclip.copy(f\"{line}\")" 49 | 50 | elif line.startswith("get"): 51 | # lib clipboard get 52 | line = line.replace("get ", "", 1) 53 | line = remove_suffix(line, line.endswith("\n")) 54 | line = f"{line} = pyperclip.paste()" 55 | 56 | else: 57 | error(line_numbers, "ArgumentError", f"Function '{line.split(' ')[0]}' does not exist in clipboard lib !") 58 | 59 | return (line,) 60 | 61 | def var_methods(line, variables_container, other_args): 62 | line_numbers = other_args[0] 63 | method = line[2] 64 | if method.startswith("clipboard "): 65 | method = method.replace("clipboard ", "", 1) 66 | if method.startswith("get"): 67 | method = method.replace("get", "", 1) 68 | method = pyperclip.paste() 69 | else: 70 | error(line_numbers, "ArgumentError", f"Function '{line.split(' ')[0]}' does not exist in clipboard lib !") 71 | 72 | line[2] = method 73 | 74 | return line, variables_container 75 | 76 | def compiler_var_methods(line, other_args): 77 | line_numbers = other_args[0] 78 | is_lib = other_args[1] 79 | method = line[2] 80 | 81 | if method.startswith("clipboard "): 82 | method = method.replace("clipboard ", "", 1) 83 | if method.startswith("get"): 84 | method = method.replace("get", "", 1) 85 | line = f"{line[0]} {line[1]} pyperclip.paste()" 86 | is_lib = True 87 | else: 88 | error(line_numbers, "ArgumentError", f"Function '{line.split(' ')[0]}' does not exist in clipboard lib !") 89 | 90 | return line, ("is_lib", is_lib) -------------------------------------------------------------------------------- /acpl_libs/fx_colors.py: -------------------------------------------------------------------------------- 1 | from recurrent_classes import * 2 | 3 | def libs_to_import(): 4 | # Returning all the basic imports (import ) and the from imports (from import ) 5 | # as tuple of strings 6 | return (tuple(), tuple()) 7 | 8 | def requirements(file): 9 | if "var_methods" in file: 10 | return ("line_numbers",) 11 | else: 12 | return tuple() 13 | 14 | def main(line, variables_container, *args): 15 | """ 16 | Allows to introduce colors to ACPL. 17 | """ 18 | if line.startswith("colors"): 19 | line = line.replace("colors ", "", 1) 20 | if line.startswith("import"): 21 | variables_container["colors_BLUE"] = bcolors.OKBLUE 22 | variables_container["colors_PINK"] = bcolors.HEADER 23 | variables_container["colors_GREEN"] = bcolors.OKGREEN 24 | variables_container["colors_YELLOW"] = bcolors.WARNING 25 | variables_container["colors_RED"] = bcolors.FAIL 26 | variables_container["colors_UNDERLINE"] = bcolors.UNDERLINE 27 | variables_container["colors_BOLD"] = bcolors.BOLD 28 | variables_container["colors_ITALICS"] = bcolors.ITALICS 29 | variables_container["colors_END"] = bcolors.ENDC 30 | return line, variables_container 31 | 32 | def pytranslation(line, *args): 33 | if line.startswith("colors"): 34 | line = line.replace("colors ", "", 1) 35 | if line.startswith("import"): 36 | line = f"colors_BLUE = '{bcolors.OKBLUE}'\ncolors_PINK = '{bcolors.HEADER}'\ncolors_GREEN = '{bcolors.OKGREEN}'\n" 37 | line += f"colors_YELLOW = '{bcolors.WARNING}'\ncolors_RED = '{bcolors.FAIL}'\ncolors_UNDERLINE = '{bcolors.UNDERLINE}'\n" 38 | line += f"colors_BOLD = '{bcolors.BOLD}'\ncolors_ITALICS = '{bcolors.ITALICS}'\ncolors_END = '{bcolors.ENDC}'" 39 | return (line,) 40 | 41 | def var_methods(line:list, variables_container, other_args): 42 | """ 43 | Var method transformation of the ACPL colors lib. 44 | """ 45 | line_numbers = other_args[0] 46 | 47 | if line[2].startswith("colors"): 48 | line[2] = line[2].replace("colors ", "", 1) 49 | if line[2].lower().startswith("blue"): 50 | line[2] = bcolors.OKBLUE 51 | elif line[2].lower().startswith("pink"): 52 | line[2] = bcolors.HEADER 53 | elif line[2].lower().startswith("green"): 54 | line[2] = bcolors.OKGREEN 55 | elif line[2].lower().startswith("yellow"): 56 | line[2] = bcolors.WARNING 57 | elif line[2].lower().startswith("red"): 58 | line[2] = bcolors.FAIL 59 | elif line[2].lower().startswith("underline"): 60 | line[2] = bcolors.UNDERLINE 61 | elif line[2].lower().startswith("bold"): 62 | line[2] = bcolors.BOLD 63 | elif line[2].lower().startswith("italics"): 64 | line[2] = bcolors.ITALICS 65 | elif line[2].lower().startswith("end"): 66 | line[2] = bcolors.ENDC 67 | else: 68 | error(line_numbers, "UnknownColorError", f"Unknown color '{line[2]}'.") 69 | 70 | return line, variables_container 71 | 72 | def compiler_var_methods(line, other_args): 73 | """ 74 | Var method transformation of the ACPL colors lib for compiler. 75 | """ 76 | line_numbers = other_args[0] 77 | 78 | if line[2].startswith("colors"): 79 | line[2] = line[2].replace("colors ", "", 1) 80 | if line[2].lower().startswith("blue"): 81 | line[2] = bcolors.OKBLUE 82 | elif line[2].lower().startswith("pink"): 83 | line[2] = bcolors.HEADER 84 | elif line[2].lower().startswith("green"): 85 | line[2] = bcolors.OKGREEN 86 | elif line[2].lower().startswith("yellow"): 87 | line[2] = bcolors.WARNING 88 | elif line[2].lower().startswith("red"): 89 | line[2] = bcolors.FAIL 90 | elif line[2].lower().startswith("underline"): 91 | line[2] = bcolors.UNDERLINE 92 | elif line[2].lower().startswith("bold"): 93 | line[2] = bcolors.BOLD 94 | elif line[2].lower().startswith("italics"): 95 | line[2] = bcolors.ITALICS 96 | elif line[2].lower().startswith("end"): 97 | line[2] = bcolors.ENDC 98 | else: 99 | error(line_numbers, "UnknownColorError", f"Unknown color '{line[2]}'.") 100 | 101 | return (line,) 102 | -------------------------------------------------------------------------------- /acpl_libs/fx_files.py: -------------------------------------------------------------------------------- 1 | from recurrent_classes import * 2 | 3 | def libs_to_import(): 4 | # Returning all the basic imports (import ) and the from imports (from import ) 5 | # as tuple of strings 6 | return (tuple(), tuple()) 7 | 8 | def requirements(file): 9 | if file == "var_methods": 10 | return ("line_numbers", "var_type") 11 | elif file == "compiler_var_methods": 12 | return ("line_numbers", "var_type", "is_lib") 13 | else: 14 | return ("line_numbers",) 15 | 16 | def main(line, variables_container, other_args): 17 | """ 18 | This library adds file support to ACPL. 19 | """ 20 | 21 | line_numbers = other_args[0] 22 | 23 | if str(line).startswith("files"): 24 | line = line.replace("files ", "", 1) 25 | line = remove_suffix(line, line.endswith("\n")) 26 | if line.startswith("read"): # lib files read 27 | line = line.replace("read ", "", 1) 28 | line = line.split(" ") 29 | # READING FILE 30 | 31 | # Too few arguments ? 32 | if len(line) < 2: 33 | error(line_numbers, "ArgumentError", texts.errors['FunctionArgumentError'].format(args_required=2, args_nbr=len(line))) 34 | 35 | encoding = "--encoding:" in line 36 | if encoding is True: 37 | encoding = line.split("--encoding:")[1] 38 | try: 39 | encoding = encoding.split(" ")[0] 40 | except IndexError: 41 | pass 42 | line = line.replace(f" --encoding:{encoding}", "", 1) 43 | else: 44 | encoding = "utf-8" 45 | 46 | try: 47 | file = open(line[0], "r", encoding=encoding) 48 | except FileNotFoundError: 49 | error(line_numbers, "FileNotFoundError", f"The file '{line[0]}' doesn't exist.") 50 | file_contents = file.readlines() 51 | file.close() 52 | 53 | if "--remove_newlines" in line: 54 | for i in range(len(file_contents)): 55 | file_contents[i] = remove_suffix(file_contents[i], file_contents[i].endswith("\n")) 56 | 57 | variables_container[line[1]] = file_contents 58 | 59 | elif line.startswith("write"): # lib files write 60 | line = line.replace("write ", "", 1) 61 | line = line.split(" ") 62 | # WRITING FILE 63 | 64 | # Too few arguments ? 65 | if len(line) < 2: 66 | error(line_numbers, "ArgumentError", texts.errors['FunctionArgumentError'].format(args_required=2, args_nbr=len(line))) 67 | 68 | text_to_paste = variables_container[line[1]] 69 | # If it is just a string, then a single line, we convert it to a 1 element list. 70 | if isinstance(text_to_paste, str): 71 | text_to_paste = [text_to_paste] 72 | 73 | try: 74 | if "--write_mode:a" in line: 75 | file_to_write = open(line[0], "a") 76 | else: 77 | file_to_write = open(line[0], "w") 78 | except FileNotFoundError: 79 | error(line_numbers, "FileNotFoundError", f"The file '{line[0]}' doesn't exist.") 80 | 81 | file_to_write.writelines(text_to_paste) 82 | file_to_write.close() 83 | 84 | return line, variables_container, ("line_numbers", line_numbers) 85 | 86 | def pytranslation(line, other_args): 87 | """ 88 | Translation to Python of the files ACPL lib. 89 | """ 90 | 91 | line_numbers = other_args[0] 92 | 93 | if line.startswith("files"): 94 | line = line.replace("files ", "", 1) 95 | line = remove_suffix(line, line.endswith("\n")) 96 | if line.startswith("read"): # lib files read 97 | line = line.replace("read ", "", 1) 98 | line = line.split(" ") 99 | 100 | # Too few arguments ? 101 | if len(line) < 2: 102 | error(line_numbers, "ArgumentError", texts.errors['FunctionArgumentError'].format(args_required=2, args_nbr=len(line))) 103 | 104 | line[0] = f"'{line[0]}'" 105 | 106 | if "--remove_newlines" not in line: 107 | temp_line = f"temp_file = open({line[0]}, 'r')\n" \ 108 | f"{line[1]} = temp_file.readlines()\n" \ 109 | f"temp_file.close()" 110 | else: 111 | temp_line = f"temp_file = open({line[0]}, 'r')\n" \ 112 | f"{line[1]} = temp_file.readlines()\n" \ 113 | f"for i in range(len({line[1]})):\n" \ 114 | f"\tif {line[1]}[i].endswith(\\n):\n" \ 115 | f"\t\t{line[1]}[i] = {line[1]}[i][:-1]\n" \ 116 | f"temp_file.close()" 117 | 118 | line = temp_line 119 | 120 | elif line.startswith("write"): # lib files write 121 | line = line.replace("write ", "", 1) 122 | line = line.split(" ") 123 | 124 | # Too few arguments ? 125 | if len(line) < 2: 126 | error(line_numbers, "ArgumentError", texts.errors['FunctionArgumentError'].format(args_required=2, args_nbr=len(line))) 127 | 128 | line[0] = f"'{line[0]}'" 129 | 130 | temp_line = f"if isinstance(text_to_paste, str):\n" \ 131 | f"\ttext_to_paste = [text_to_paste]\n" 132 | 133 | if "--write_mode:a" in line: 134 | temp_line += f"temp_file = open({line[0]}, 'a')\n" \ 135 | f"temp_file.writelines({line[1]})\n" \ 136 | f"temp_file.close()" 137 | else: 138 | temp_line += f"temp_file = open({line[0]}, 'w')\n" \ 139 | f"temp_file.writelines({line[1]})\n" \ 140 | f"temp_file.close()" 141 | 142 | line = temp_line 143 | 144 | return line, ("line_numbers", line_numbers) 145 | 146 | def var_methods(line:list, variables_container, other_args): 147 | """ 148 | File reading/writing as variable method. 149 | """ 150 | line_numbers = other_args[0] 151 | var_type = other_args[1] 152 | method = line[2] 153 | 154 | if str(method).startswith("files"): 155 | method = method.replace("files ", "", 1) 156 | if method.startswith("read"): # lib files read 157 | method = method.replace("read ", "", 1) 158 | remove_newlines = "--remove_newlines" in method 159 | encoding = "--encoding:" in method 160 | if encoding is True: 161 | encoding = method.split("--encoding:")[1] 162 | try: 163 | encoding = encoding.split(" ")[0] 164 | except IndexError: 165 | pass 166 | method = method.replace(f" --encoding:{encoding}", "", 1) 167 | else: 168 | encoding = "utf-8" 169 | method = method.replace(" --remove_newlines", "", 1) 170 | method = remove_suffix(method, method.endswith('\n')) 171 | try: 172 | temp_file = open(method, "r", encoding=encoding) 173 | except FileNotFoundError: 174 | error(line_numbers, "FileNotFoundError", f"The file '{method}' doesn't exist.") 175 | method = temp_file.readlines() 176 | if remove_newlines is True: 177 | for i in range(len(method)): 178 | method[i] = remove_suffix(method[i], method[i].endswith("\n")) 179 | temp_file.close() 180 | var_type = "list" 181 | 182 | line[2] = method 183 | 184 | return line, variables_container, ("line_numbers", line_numbers, "var_type", var_type) 185 | 186 | def compiler_var_methods(line:list, other_args): 187 | """ 188 | File reading/writing as variable method for ACPL compiler. 189 | """ 190 | line_numbers = other_args[0] 191 | var_type = other_args[1] 192 | method = line[2] 193 | 194 | if method.startswith("files"): 195 | method = method.replace("files ", "", 1) 196 | if method.startswith("read"): # lib files read 197 | method = method.replace("read ", "", 1) 198 | remove_newlines = "--remove_newlines" in method 199 | method = method.replace(" --remove_newlines", "", 1) 200 | temp_method = f"temp_file = open('{method[:-2]}', 'r')\n" \ 201 | f"{line[0]} = temp_file.readlines()\n" \ 202 | f"temp_file.close()" 203 | if remove_newlines is True: 204 | temp_method += f"\nfor i in range(len({line[0]})):\n" \ 205 | f"\tif {line[0]}[i].endswith('\\n'):\n" \ 206 | f"\t\t{line[0]}[i] = {line[0]}[i][:-1]" 207 | method = temp_method 208 | del temp_method 209 | line = method 210 | else: 211 | line[2] = method 212 | 213 | return line, ("line_numbers", line_numbers, "is_lib", True) -------------------------------------------------------------------------------- /acpl_libs/fx_math.py: -------------------------------------------------------------------------------- 1 | from recurrent_classes import * 2 | import math 3 | 4 | def libs_to_import(): 5 | # Returning all the basic imports (import ) and the from imports (from import ) 6 | # as tuple of strings 7 | return (("math",), tuple()) 8 | 9 | def requirements(file): 10 | return ("line_numbers",) 11 | 12 | def main(line, variables_container, *args): 13 | """ 14 | Allows for math functions through ACPL. 15 | """ 16 | line_numbers = args[0][0] 17 | 18 | if line.startswith('math'): 19 | line = line.replace("math ", "", 1) 20 | line = remove_suffix(line, line.endswith("\n")) 21 | if line.startswith("sqrt"): # Syntax : math sqrt var_name value 22 | line = line.replace("sqrt ", "", 1) 23 | line = line.split(" ") 24 | if len(line) != 2: 25 | # Arguments missing ! 26 | error(line_numbers, "ArgumentError", texts.errors["ArgumentMissing"]) 27 | if float(line[1]) < 0: 28 | error(line_numbers, "NegativeNumberError", "Cannot do the square root of a negative number.") 29 | sys.exit() 30 | try: 31 | variables_container[line[0]] = math.sqrt(int(line[1])) 32 | except ValueError: 33 | try: 34 | variables_container[line[0]] = math.sqrt(float(line[1])) 35 | except ValueError: 36 | error(line_numbers, "ArgumentError", "Argument 'value' has to be 'int' or 'float' !\nCurrent type : "+type(line[1])) 37 | elif line.startswith("fabs"): # math fabs variable value 38 | line = line.replace("fabs ", "", 1) 39 | line = line.split(" ") 40 | try: 41 | line[1] = int(line[1]) 42 | except ValueError: 43 | try: 44 | line[1] = float(line[1]) 45 | except ValueError: 46 | error(line_numbers, "ArgumentError", "Argument 'value' has to be 'int' or 'float' !\nCurrent type : " + str(type(line[1]))) 47 | variables_container[line[0]] = math.fabs(line[1]) 48 | elif line.startswith("factorial"): # math factorial variable value 49 | line = line.replace("factorial ", "", 1) 50 | line = line.split(" ") 51 | try: 52 | line[1] = int(line[1]) 53 | except ValueError: 54 | try: 55 | line[1] = float(line[1]) 56 | except ValueError: 57 | error(line_numbers, "ArgumentError", "Argument 'value' has to be 'int' or 'float' !\nCurrent type : " + str(type(line[1]))) 58 | sys.exit() 59 | if line[1] < 0: 60 | error(line_numbers, "NegativeNumberError", "The value to factorial should not be negative.") 61 | sys.exit() 62 | elif line[1] == 0: 63 | variables_container[line[0]] = 0 64 | else: 65 | variables_container[line[0]] = math.factorial(line[1]) 66 | elif line.startswith("floor"): # math floor variable value 67 | line = line.replace("floor ", "", 1) 68 | line = line.split(" ") 69 | try: 70 | line[1] = float(line[1]) 71 | except ValueError: 72 | error(line_numbers, "ArgumentError", "Argument 'value' has to be 'int' or 'float' !\nCurrent type : " + str(type(line[1]))) 73 | variables_container[line[0]] = math.floor(line[1]) 74 | 75 | return (line, variables_container) 76 | 77 | def pytranslation(line, *args): 78 | """ 79 | Allows for math functions through ACPL, transpiled in Python. 80 | """ 81 | line_numbers = args[0][0] 82 | 83 | if line.startswith("math"): 84 | line = line.replace("math ", "", 1) 85 | line = remove_suffix(line, line.endswith("\n")) 86 | line = line.replace("{", "") 87 | line = line.replace("}", "") 88 | if line.startswith("sqrt"): 89 | line = line.replace("sqrt ", "", 1) 90 | line = line.split(" ") 91 | if len(line) != 2: 92 | error(line_numbers, "ArgumentError", "Arguments missing.") 93 | sys.exit() 94 | line = f"{line[0]} = sqrt({line[1]})" 95 | elif line.startswith("fabs"): 96 | line = line.replace("fabs ", "", 1) 97 | line = line.split(" ") 98 | line = f"{line[0]} = fabs({line[1]})" 99 | elif line.startswith("factorial"): 100 | line = line.replace("factorial ", "", 1) 101 | line = line.split(" ") 102 | line = f"{line[0]} = factorial({line[1]})" 103 | elif line.startswith("floor"): 104 | line = line.replace("floor ", "", 1) 105 | line = line.split(" ") 106 | line = f"{line[0]} = floor({line[1]})" 107 | return (line,) 108 | 109 | def var_methods(line, variables_container, other_args): 110 | """ 111 | Var methods for ACPL math library. 112 | """ 113 | line_numbers = other_args[0] 114 | if line[2].startswith("math"): 115 | line[2] = line[2].replace("math ", "", 1) 116 | if line[2].startswith("sqrt"): # Syntax : math sqrt value 117 | line[2] = line[2].replace("sqrt ", "", 1) 118 | if float(line[2]) < 0: 119 | error(line_numbers, "NegativeNumberError", "Cannot do the square root of a negative number.") 120 | try: 121 | line[2] = math.sqrt(int(line[2])) 122 | except ValueError: 123 | try: 124 | line[2] = math.sqrt(float(line[2])) 125 | except ValueError: 126 | error(line_numbers, "ArgumentError", "Argument 'value' has to be 'int' or 'float' !\nCurrent type : "+type(line[1])) 127 | 128 | elif line[2].startswith("fabs"): 129 | line[2] = line[2].replace("fabs ", "", 1) 130 | try: 131 | line[2] = math.fabs(int(line[2])) 132 | except ValueError: 133 | try: 134 | line[2] = math.fabs(float(line[2])) 135 | except ValueError: 136 | error(line_numbers, "ArgumentError", "Argument 'value' has to be 'int' or 'float' !\nCurrent type : " + str(type(line[2]))) 137 | 138 | elif line[2].startswith("factorial"): 139 | line[2] = line[2].replace("factorial ", "", 1) 140 | try: 141 | line[2] = int(line[2]) 142 | except ValueError: 143 | try: 144 | line[2] = float(line[2]) 145 | except ValueError: 146 | error(line_numbers, "ArgumentError", "Argument 'value' has to be 'int' or 'float' !\nCurrent type : " + str(type(line[1]))) 147 | 148 | if line[2] < 0: 149 | error(line_numbers, "NegativeNumberError", "The value to factorial should not be negative.") 150 | elif line[2] == 0: 151 | line[2] = 0 152 | else: 153 | line[2] = math.factorial(line[2]) 154 | 155 | elif line[2].startswith("floor"): 156 | line[2] = line[2].replace("floor ", "", 1) 157 | try: 158 | line[2] = float(line[2]) 159 | except ValueError: 160 | error(line_numbers, "ArgumentError", "Argument 'value' has to be 'int' or 'float' !\nCurrent type : " + str(type(line[1]))) 161 | line[2] = math.floor(line[2]) 162 | 163 | return line, variables_container 164 | 165 | def compiler_var_methods(line, other_args): 166 | """ 167 | Var methods for ACPL math library. Designed for compiler. 168 | """ 169 | line_numbers = other_args[0] 170 | if line[2].startswith("math"): 171 | line[2] = line[2].replace("math ", "", 1) 172 | line[2] = line[2][:-2] 173 | line[2] = line[2].split(" ") 174 | try: 175 | line[2] = f"math.{line[2][0]}({line[2][1]})" 176 | except IndexError: 177 | error(line_numbers, "ArgumentError", texts.errors["FunctionArgumentError"].format(args_required=1, args_nbr=0)) 178 | 179 | return line, ("no_string", True) -------------------------------------------------------------------------------- /acpl_libs/fx_quit.py: -------------------------------------------------------------------------------- 1 | from recurrent_classes import * 2 | 3 | def libs_to_import(): 4 | # Returning all the basic imports (import ) and the from imports (from import ) 5 | # as tuple of strings 6 | return (("sys",), tuple()) 7 | 8 | def requirements(file): 9 | if file == "main": 10 | return ("code_lines", "line_numbers") 11 | else: 12 | return tuple() 13 | 14 | def main(line, variables_container, other_args): 15 | """ 16 | Allows to leave an ACPL program. 17 | """ 18 | code_lines = other_args[0] 19 | line_numbers = other_args[1] 20 | if line.startswith("quit"): 21 | code_lines.append("") 22 | line_numbers = len(code_lines)-1 23 | return line, variables_container, ("code_lines", code_lines, "line_numbers", line_numbers) 24 | 25 | def pytranslation(line, *args): 26 | """ 27 | Allows to quit an ACPL program. 28 | """ 29 | if line.startswith("quit"): 30 | line = "sys.exit()" 31 | return (line,) 32 | 33 | def var_methods(line, variables_container, other_args): 34 | return line, variables_container 35 | 36 | def compiler_var_methods(line, other_args): 37 | return (line,) 38 | -------------------------------------------------------------------------------- /acpl_libs/fx_swap.py: -------------------------------------------------------------------------------- 1 | """ 2 | ACPL Swap lib. 3 | Swaps two variables' contents. 4 | """ 5 | from recurrent_classes import * 6 | 7 | def libs_to_import(): 8 | return tuple(), tuple() 9 | 10 | def requirements(file): 11 | if file == "main": 12 | return ("line_numbers",) 13 | elif file == "compiler": 14 | return "line_numbers", "variables" 15 | else: 16 | return tuple() 17 | 18 | def main(line, variables_container, other_args): 19 | line_numbers = other_args[0] 20 | 21 | if line.startswith("swap"): 22 | line = line.replace("swap ", "", 1) 23 | line = remove_suffix(line, line.endswith("\n")) 24 | line = line.split(" ") # [var1, var2] 25 | 26 | if len(line) != 2: 27 | error(line_numbers, "ArgumentError", texts.errors["FunctionArgumentError"].format(args_required=3, args_nbr=len(line))) 28 | 29 | if line[0] not in variables_container.keys(): 30 | error(line_numbers, "VarNotFoundError", texts.errors["VarNotFoundError"].format(variable=line[0])) 31 | elif line[1] not in variables_container.keys(): 32 | error(line_numbers, "VarNotFoundError", texts.errors["VarNotFoundError"].format(variable=line[1])) 33 | 34 | variables_container[line[0]], variables_container[line[1]] = variables_container[line[1]], variables_container[line[0]] 35 | 36 | return line, variables_container 37 | 38 | def pytranslation(line, other_args): 39 | line_numbers = other_args[0] 40 | variables = other_args[1] 41 | 42 | if line.startswith("swap"): 43 | line = line.replace("swap ", "", 1) 44 | line = remove_suffix(line, line.endswith("\n")) 45 | line = line.split(" ") # [var1, var2] 46 | 47 | if len(line) != 2: 48 | error(line_numbers, "ArgumentError", texts.errors["FunctionArgumentError"].format(args_required=3, args_nbr=len(line))) 49 | 50 | if line[0] not in variables.keys(): 51 | error(line_numbers, "VarNotFoundError", texts.errors["VarNotFoundError"].format(variable=line[0])) 52 | elif line[1] not in variables.keys(): 53 | error(line_numbers, "VarNotFoundError", texts.errors["VarNotFoundError"].format(variable=line[1])) 54 | 55 | line = f"{line[0]}, {line[1]} = {line[1]}, {line[0]}" 56 | 57 | return (line,) 58 | 59 | def var_methods(line, variables_container, other_args): 60 | return line, variables_container 61 | 62 | def compiler_var_methods(line, other_args): 63 | return (line,) 64 | -------------------------------------------------------------------------------- /acpl_libs/fx_wait_until_user_input.py: -------------------------------------------------------------------------------- 1 | from recurrent_classes import * 2 | 3 | def libs_to_import(): 4 | # Returning all the basic imports (import ) and the from imports (from import ) 5 | # as tuple of strings 6 | return (tuple(), tuple()) 7 | 8 | def requirements(file): 9 | return tuple() 10 | 11 | def main(line, variables_container, other_args): 12 | """ 13 | Allows the user to wait. 14 | """ 15 | if str(line).startswith("wait_until_user_input"): 16 | line = line.replace("wait_until_user_input ", "", 1) 17 | line = remove_suffix(line, line.endswith("\n")) 18 | if line != "": 19 | if line.lower() == "true": 20 | input("Press enter to continue...") 21 | elif line.lower() == "false": 22 | input("") 23 | else: 24 | input(line) 25 | else: 26 | input("") 27 | return line, variables_container, other_args 28 | 29 | def pytranslation(line, *args): 30 | if line.startswith("wait_until_user_input"): 31 | line = line.replace("wait_until_user_input ", "", 1) 32 | line = remove_suffix(line, line.endswith("\n")) 33 | if line != "": 34 | if line.lower() == "true": 35 | line = "input(\"Press enter to continue...\")" 36 | elif line.lower() == "false": 37 | line = "input(\"\")" 38 | else: 39 | line = f"input(\"{line}\")" 40 | else: 41 | line = "input(\"\")" 42 | return (line,) 43 | 44 | def var_methods(line, variables_container, other_args): 45 | return line, variables_container 46 | 47 | def compiler_var_methods(line, other_args): 48 | return (line,) 49 | -------------------------------------------------------------------------------- /acpl_libs/lib_list.md: -------------------------------------------------------------------------------- 1 | ## Available libs 2 | 3 | clipboard 4 | colors 5 | files 6 | math 7 | quit 8 | wait_until_user_input 9 | GUI 10 | swap 11 | -------------------------------------------------------------------------------- /ascii-art.txt: -------------------------------------------------------------------------------- 1 | (* / *# 2 | . * ( ( 3 | ,. 4 | * ,. 5 | 6 | 7 | 8 | #. *(/#((./* 9 | ##.#*(/ # (.*(( #* 10 | #*/, . 11 | . . 12 | , . #./(#*(#, 13 | (( / (#./(#(((* 14 | (# (, ( ((##(#(( ,*,/##/(./ . . . 15 | # ( , / ( (((#/##( .##(/((( . /. 16 | , . . , *(,##(#, 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | .* ( ,((# 29 | ,. # ( * (( 30 | ,( #(, (((#((*(,# ( . , * 31 | *# ( (((#((* (( ( / , 32 | (#(#(#*#, .* 33 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | ### 3.11.1 2 | - New console commands 3 | - Added two new subcommands to `lib` command 4 | - `lib list ` 5 | - Will, depending on whether you chose as parameter `available` or `installed`, show all the libs installed on your computer, or the ones available online. 6 | - `lib update ` 7 | - As the name suggests, this command will update the lib of your choice. 8 | - With the recent 3.11 update, this command will come in handy. 9 | - **COMPILER OPTIMIZATION** 10 | - New setting : `optimize-compiled-file`, as a boolean. 11 | - Default : True 12 | - Decides whether or not the transpiled Python file should be optimized. 13 | - Optimiaztion takes longer to build the Python file, but the final code runs faster and is simpler to read. 14 | 15 | ### 3.11 16 | - Translation files are ready, just waiting for the translators. 17 | - Language 98% translated in French. 18 | - Files library 19 | - Can read files 20 | - Can write in files 21 | - Lib access to variables 22 | - You can now use libs as variables 23 | - `var = lib ` 24 | - Example : `var file_content = lib files my_file.txt` 25 | - Deletevar tweak 26 | - You can now delete multiple vars at once 27 | - Just separate the variables names by commas 28 | - Syntax : `deletevar , [var2], etc...` 29 | - Var actions aliases 30 | - You can now use the var actions inline, by specifying it after the equal sign 31 | - Syntax : `var[:type] = var_action [var_action_parameters] ` 32 | - Some var actions used this way might require a different syntax, see the documentation for more info. 33 | - Variable length 34 | - You can now use the variable 'length' 35 | - Syntax : `{length[]}` 36 | - New `ls`/`dir` command 37 | - Will build a file tree of the specified folder 38 | - Syntax : `dir [folder=./] **[extension=*]` 39 | - Example : `dir ./ py acpl` will diplay all acpl and Pytho files in the current folder 40 | - Command aliases 41 | - Define aliases using the `$alias` instruction 42 | - Allows to use other names for functions 43 | - Example : 44 | - You want to call `print` bu using the C++ like `std::cout` function 45 | - You have to type `$alias print std::cout`. 46 | - Equations have been disabled for `if` and `while` statements. 47 | - Who cares ? They are not needed there. 48 | - Might return in 3.11.1 or in 3.12 49 | - **Full boolean implementation** 50 | - New *bool* type 51 | - Defined with new var type `:bool` 52 | - Value : either `True` or `False`. 53 | - New built-in variables : `true` and `false`, with the respective boolean values. 54 | - **Var modifications, without re-assigment** 55 | - You can now just type a variable's name to redifine it once it has been defined, instead of typing the old-fashion `var[:type] = ` again ! 56 | - Now, you just need to type that once, and then a single `[:type] = ` will be understood ! 57 | + If the parameter `type` is not given, the type will be the type of the last variable's value. 58 | + E.g., if you had a variable named `test` which was an integer, if you don't specify a new type, the variable will remain an integer. 59 | - **Compiler/Transpiler** 60 | - Command `compile` has been renamed to `transpile`, which corresponds more to what it actually does. 61 | - **A NEW COMPILER HAS BEEN INTRODUCED !** 62 | - Your code can now be compiled into an auto-executable file ! 63 | + If your program does not use any library, then the compiler function is supported. 64 | + If not, it might work, but is untested, and not supported either. 65 | - Syntax : `compile [Exe file filename=ACPL file filename] [--end-message: = True] [--disable-icon: = False]` 66 | + `ACPL file` is the file you want to compile. **THIS FILE HAS TO BE PLACED AT THE ACPL ROOT FOLDER !** 67 | + `Exe file filename` is the filename of the compiled exe file. If not specified, the default name will be the name of the original script. 68 | + `[--end-message: = True]` is a boolean that will define whether or not the file will have an end message (litterally : *`Press enter to continue..`* at the end of the script). Default : True. 69 | + `[--disable-icon: = False]` is a boolean that will define if you want to disable the ACPL icon as the exe file icon. Default : False. **ICONS CANNOT BE CREATED ON LINUX DEVICES !** 70 | -------------------------------------------------------------------------------- /code.acpl: -------------------------------------------------------------------------------- 1 | var variable1 = input 0 ou 1 ? 2 | var variable2 = input 0 ou 1 ? 3 | if {variable1} == 0 or {variable2} == 0 4 | print Dedans ! 5 | endif 6 | else 7 | print Autre condition 8 | endif 9 | print En dehors du if ! -------------------------------------------------------------------------------- /code_sample.acpl: -------------------------------------------------------------------------------- 1 | print(Hiii !) # Print 2 | 3 | # Asking 4 | float TimeToWait = input(How much time do you want to wait ? (In seconds)\n) 5 | str Reminder = input(And for what purpose ? Give me your reminder.\n) 6 | 7 | # Main 8 | pause({float TimeToWait}) 9 | print(You asked me to remind you this thing : {str Reminder}) 10 | -------------------------------------------------------------------------------- /code_sample2.acpl: -------------------------------------------------------------------------------- 1 | print(Hiii !) # Print 2 | 3 | # Asking 4 | var TimeToWait = input(How much time do you want to wait ? (In seconds)\n) 5 | var Reminder = input(And for what purpose ? Give me your reminder.\n) 6 | 7 | # Main 8 | pause({TimeToWait}) 9 | print(You asked me to remind you this thing : {Reminder}) 10 | -------------------------------------------------------------------------------- /ide.py: -------------------------------------------------------------------------------- 1 | import os 2 | from time import sleep 3 | import sys 4 | import json 5 | from recurrent_classes import * 6 | import requests 7 | import platform 8 | import shlex 9 | from pynput.keyboard import Key, Listener 10 | 11 | 12 | def on_press(key): 13 | global pressed_key 14 | global debug_state 15 | global Key 16 | 17 | if debug_state > 0: 18 | print('{0} pressed'.format(key)) 19 | pressed_key = key 20 | try: 21 | is_char = True 22 | pressed_key = pressed_key.char 23 | except AttributeError: 24 | is_char = False 25 | 26 | if pressed_key == Key.space: 27 | pressed_key = " " 28 | is_char = True 29 | elif pressed_key == Key.enter: 30 | if trigger_autocomplete() is False: 31 | pressed_key = "\n" 32 | is_char = True 33 | else: 34 | pressed_key = "NOINTERPRETATION" 35 | elif pressed_key == Key.esc or pressed_key == Key.down or pressed_key == Key.left or pressed_key == Key.right or pressed_key == Key.up or pressed_key == Key.backspace or pressed_key == Key.delete: 36 | is_char = True 37 | elif pressed_key == Key.tab: 38 | pressed_key = "\t" 39 | is_char = True 40 | 41 | if is_char is True: 42 | return False 43 | 44 | 45 | def on_release(key): 46 | global debug_state 47 | global Key 48 | if debug_state > 0: 49 | print('{0} release'.format(key)) 50 | if key == Key.esc: 51 | # Stop listener 52 | return False 53 | 54 | 55 | def trigger_autocomplete(): 56 | global lines 57 | global current_line 58 | global current_cursor_position 59 | global pressed_key 60 | 61 | if lines[current_line] == "pr" or lines[current_line] == "pri" or lines[current_line] == "prin": 62 | lines[current_line] = "print " 63 | current_cursor_position = 6 64 | return True 65 | elif lines[current_line] == "va": 66 | lines[current_line] = "var " 67 | current_cursor_position = 4 68 | return True 69 | elif lines[current_line] == "el" or lines[current_line] == "els": 70 | lines[current_line] = "else" 71 | current_cursor_position = 4 72 | return True 73 | elif lines[current_line] == "fo": 74 | lines[current_line] = "for " 75 | current_cursor_position = 4 76 | return True 77 | elif lines[current_line] == "wh" or lines[current_line] == "whi" or lines[current_line] == "whil": 78 | lines[current_line] = "while " 79 | current_cursor_position = 7 80 | return True 81 | else: 82 | return False 83 | 84 | # ACPL IDE successfully opened. 85 | print(bcolors.OKBLUE + texts.ide["IDE_SuccessfullyOpened"] + bcolors.ENDC) 86 | 87 | # Part removed on 29/11/2020 88 | # Action : File opening in command line. 89 | # Replaced by dialog box. 90 | """ 91 | code_file_filename = input(f"{bcolors.OKBLUE}Enter code file filename : {bcolors.ENDC}") 92 | if not code_file_filename.endswith(".acpl") and "." not in code_file_filename: 93 | code_file_filename += ".acpl" 94 | 95 | if code_file_filename.startswith("ACPL_IDE_NEW "): 96 | user_input = code_file_filename.replace("ACPL_IDE_NEW ", "", 1) 97 | if os.path.exists(user_input): 98 | confirm = input(f"{bcolors.FAIL}This file ({user_input}) already exists. Are you sure you want to replace it ? (Yes/No) {bcolors.ENDC}") 99 | while confirm.lower() != "yes" and confirm.lower() != "no": 100 | confirm = input(f"{bcolors.FAIL}This file ({user_input}) already exists. Are you sure you want to replace it ? (Yes/No) {bcolors.ENDC}") 101 | if confirm.lower() == "yes": 102 | new_file = open(user_input, "w", encoding="utf-8") 103 | new_file.writelines(["\n"]) 104 | new_file.close() 105 | code_file_filename = user_input 106 | confirm = None 107 | else: 108 | new_file = open(user_input, "w", encoding="utf-8") 109 | new_file.write("\n") 110 | new_file.close() 111 | code_file_filename = user_input 112 | user_input = None 113 | while not os.path.exists(code_file_filename) or code_file_filename in ide_forbidden_files: 114 | code_file_filename = input(f"{bcolors.FAIL}Sorry, this file ({code_file_filename}) doesn't exist. Can you retry ?\nEnter the code file filename : {bcolors.ENDC}") 115 | if not code_file_filename.endswith(".acpl"): 116 | code_file_filename += ".acpl" 117 | """ 118 | 119 | try: 120 | config_file = open("startup.acpl-ini", "r") 121 | except FileNotFoundError: 122 | print(texts.critic_errors["ImpossibleLoad_StartupIni"]) 123 | sys.exit() 124 | 125 | for config_line in config_file.readlines(): 126 | if config_line.startswith("debug-state: "): # debug 127 | config_line = config_line.replace("debug-state: ", "") 128 | debug_state = int(config_line) 129 | 130 | config_file.close() 131 | 132 | code_file_filename = open_file_dialog() 133 | current_folder = os.path.dirname(code_file_filename) 134 | current_filename = os.path.basename(code_file_filename) 135 | 136 | acpl_ide_metadata = {} 137 | if not os.path.exists(current_folder+"/.acpl_ide"): 138 | acpl_ide_metadata_file = open(current_folder+"/.acpl_ide", "w") 139 | acpl_ide_metadata_file.writelines(json.dumps(acpl_ide_metadata)) 140 | acpl_ide_metadata_file.close() 141 | 142 | with open(current_folder+"/.acpl_ide", "r") as f: 143 | acpl_ide_metadata = json.load(f) 144 | f.close() 145 | 146 | print("\n\n") 147 | 148 | # VARIABLES 149 | running = True 150 | try: 151 | current_line = acpl_ide_metadata[current_filename]["line"] 152 | except KeyError: 153 | current_line = 0 154 | 155 | try: 156 | current_cursor_position = acpl_ide_metadata[current_filename]["cursor_position"] 157 | except KeyError: 158 | current_cursor_position = 0 159 | 160 | # UNDEFINED VARIABLES 161 | pressed_key = None 162 | 163 | while running is True: 164 | # Read lines again 165 | code_file = open(code_file_filename, "r", encoding="utf-8") 166 | lines = code_file.readlines() 167 | code_file.close() 168 | 169 | # Setting up the displayed lines 170 | code_file = open(code_file_filename, "r", encoding="utf-8") 171 | displayed_lines = code_file.readlines() 172 | code_file.close() 173 | 174 | if len(lines) <= 10: 175 | loop_times = [0, len(lines)] 176 | else: 177 | if current_line < 5: 178 | loop_times = [0, 10] 179 | elif current_line > len(lines)-5: 180 | loop_times = [len(lines)-10, len(lines)] 181 | else: 182 | loop_times = [current_line-5, current_line+5] 183 | 184 | for i in range(loop_times[0], loop_times[1]): 185 | if lines[i].endswith("\n"): # Break removal 186 | lines[i] = remove_suffix(lines[i]) 187 | displayed_lines[i] = remove_suffix(displayed_lines[i]) 188 | 189 | if i < 10: 190 | actual_line = "0" + str(i) 191 | else: 192 | actual_line = str(i) 193 | 194 | if i == current_line: # Line to edit 195 | print(f"{bcolors.HEADER}({actual_line}) >>> {bcolors.ENDC}", end="") 196 | temp_line = split(displayed_lines[current_line]) 197 | temp_line.insert(current_cursor_position, f"{bcolors.HEADER}|{bcolors.ENDC}") 198 | displayed_lines[current_line] = "" 199 | for char in temp_line: 200 | displayed_lines[current_line] += char 201 | del temp_line 202 | else: 203 | print(f"({actual_line}) ", end="") 204 | del actual_line 205 | 206 | # SYNTAX HIGHLIGHTING 207 | if code_file_filename.endswith(".acpl"): 208 | # green 209 | displayed_lines[i] = displayed_lines[i].replace("print", f"{bcolors.OKGREEN}print{bcolors.ENDC}{bcolors.WARNING}", 1) 210 | displayed_lines[i] = displayed_lines[i].replace("input", f"{bcolors.OKGREEN}input{bcolors.ENDC}{bcolors.WARNING}", 1) 211 | displayed_lines[i] = displayed_lines[i].replace("var", f"{bcolors.OKGREEN}var{bcolors.ENDC}{bcolors.WARNING}", 1) 212 | displayed_lines[i] = displayed_lines[i].replace("deletevar", f"{bcolors.OKGREEN}deletevar{bcolors.ENDC}{bcolors.WARNING}", 1) 213 | displayed_lines[i] = displayed_lines[i].replace("if", f"{bcolors.OKGREEN}{bcolors.ITALICS}if{bcolors.ENDC}{bcolors.WARNING}", 1) 214 | displayed_lines[i] = displayed_lines[i].replace("for", f"{bcolors.OKGREEN}{bcolors.ITALICS}for{bcolors.ENDC}{bcolors.WARNING}", 1) 215 | displayed_lines[i] = displayed_lines[i].replace("while", f"{bcolors.OKGREEN}{bcolors.ITALICS}while{bcolors.ENDC}{bcolors.WARNING}", 1) 216 | displayed_lines[i] = displayed_lines[i].replace("endif", f"{bcolors.OKGREEN}{bcolors.ITALICS}endif{bcolors.ENDC}{bcolors.WARNING}", 1) 217 | displayed_lines[i] = displayed_lines[i].replace("endfor", f"{bcolors.OKGREEN}{bcolors.ITALICS}endfor{bcolors.ENDC}{bcolors.WARNING}", 1) 218 | displayed_lines[i] = displayed_lines[i].replace("endwhile", f"{bcolors.OKGREEN}{bcolors.ITALICS}endwhile{bcolors.ENDC}{bcolors.WARNING}", 1) 219 | displayed_lines[i] = displayed_lines[i].replace("end if", f"{bcolors.OKGREEN}{bcolors.ITALICS}end if{bcolors.ENDC}{bcolors.WARNING}", 1) 220 | displayed_lines[i] = displayed_lines[i].replace("end for", f"{bcolors.OKGREEN}{bcolors.ITALICS}end for{bcolors.ENDC}{bcolors.WARNING}", 1) 221 | displayed_lines[i] = displayed_lines[i].replace("end while", f"{bcolors.OKGREEN}{bcolors.ITALICS}end while{bcolors.ENDC}{bcolors.WARNING}", 1) 222 | if displayed_lines[i].startswith("function"): 223 | displayed_lines[i] = displayed_lines[i].split(" ") 224 | displayed_lines[i][0] = displayed_lines[i][0].replace("function", f"{bcolors.OKGREEN}{bcolors.ITALICS}function{bcolors.ENDC}", 1) 225 | displayed_lines[i][1] = bcolors.WARNING + displayed_lines[i][1] + bcolors.ENDC + bcolors.FAIL 226 | displayed_lines[i] = recreate_string(displayed_lines[i], " ") 227 | displayed_lines[i] += bcolors.ENDC 228 | if displayed_lines[i].startswith("use_function"): 229 | displayed_lines[i] = displayed_lines[i].split(" ") 230 | displayed_lines[i][0] = displayed_lines[i][0].replace("use_function", f"{bcolors.OKGREEN}{bcolors.ITALICS}use_function{bcolors.ENDC}",1) 231 | displayed_lines[i][1] = bcolors.WARNING + displayed_lines[i][1] + bcolors.ENDC + bcolors.FAIL 232 | displayed_lines[i] = recreate_string(displayed_lines[i], " ") 233 | displayed_lines[i] += bcolors.ENDC 234 | # red 235 | displayed_lines[i] = displayed_lines[i].replace("<", f"{bcolors.FAIL}<") 236 | displayed_lines[i] = displayed_lines[i].replace(">", f">{bcolors.ENDC}") 237 | displayed_lines[i] = displayed_lines[i].replace("{", bcolors.FAIL+"{") 238 | displayed_lines[i] = displayed_lines[i].replace("}", "}"+bcolors.ENDC) 239 | displayed_lines[i] = displayed_lines[i].replace(":int", f"{bcolors.FAIL}:int{bcolors.WARNING}") 240 | displayed_lines[i] = displayed_lines[i].replace(":float", f"{bcolors.FAIL}:float{bcolors.WARNING}") 241 | displayed_lines[i] = displayed_lines[i].replace(":str", f"{bcolors.FAIL}:str{bcolors.WARNING}") 242 | displayed_lines[i] = displayed_lines[i].replace(":list", f"{bcolors.FAIL}:str{bcolors.WARNING}") 243 | # italics 244 | displayed_lines[i] = displayed_lines[i].replace("//", f"{bcolors.ITALICS}//", 1) 245 | displayed_lines[i] = displayed_lines[i].replace("#", f"{bcolors.ITALICS}#") 246 | # uncoloured 247 | displayed_lines[i] = displayed_lines[i].replace("=", f"{bcolors.ENDC}={bcolors.WARNING}") 248 | 249 | # destroys color at the end 250 | displayed_lines[i] += bcolors.ENDC 251 | print(displayed_lines[i]) 252 | 253 | if loop_times[1] > 10: 254 | loop_times[1] = 10 255 | # {loop_times[1]} lines displayed out of {len(lines)}. 256 | print(bcolors.OKBLUE + texts.ide["DisplayedLines"].format(line1=loop_times[1], line2=len(lines)) + bcolors.ENDC) 257 | 258 | # Collect events until released 259 | with Listener(on_press=on_press, on_release=on_release) as listener: 260 | listener.join() 261 | 262 | # Just adding a newline 263 | print("\n") 264 | 265 | if pressed_key != "NOINTERPRETATION": 266 | try: 267 | try: 268 | temp_line = split(lines[current_line]) 269 | except IndexError: 270 | temp_line = [""] 271 | temp_line.insert(current_cursor_position, pressed_key) 272 | if pressed_key == "{": 273 | temp_line.insert(current_cursor_position+1, "}") 274 | elif pressed_key == "<": 275 | temp_line.insert(current_cursor_position+1, ">") 276 | elif pressed_key == "[": 277 | temp_line.insert(current_cursor_position + 1, "]") 278 | try: 279 | lines[current_line] = "" 280 | except IndexError: 281 | lines = [""] 282 | current_line = 0 283 | for char in temp_line: 284 | try: 285 | lines[current_line] += char 286 | except TypeError: 287 | pass 288 | del temp_line 289 | current_cursor_position += len(pressed_key) 290 | replace_line(code_file_filename, current_line, lines[current_line] + "\n") 291 | if pressed_key == "\n": 292 | current_line += 1 293 | current_cursor_position = 0 294 | except AttributeError: 295 | pass 296 | except TypeError: 297 | pass 298 | 299 | if pressed_key == Key.esc: 300 | user_input = input(f"{bcolors.OKBLUE}What do you want to do ?\nType 'quit' or 'end' to leave, 'new_file ' to create a new_file, or 'open_file' to open an existing file, 'run' to run if it is a Python or ACPL file, or 'compile' in case of an ACPL file.\n{bcolors.ENDC}") 301 | if user_input == "quit" or user_input == "end": 302 | acpl_ide_metadata[current_filename] = { 303 | "line": current_line, 304 | "cursor_position": current_cursor_position 305 | } 306 | with open(current_folder + "/.acpl_ide", "w") as f: 307 | json.dump(acpl_ide_metadata, f) 308 | f.close() 309 | break 310 | elif user_input.startswith("new_file"): 311 | user_input = user_input.replace("new_file ", "", 1) 312 | if user_input not in ide_forbidden_files: 313 | if os.path.exists(user_input): 314 | confirm = input(f"{bcolors.FAIL}This file ({user_input}) already exists. Are you sure you want to replace it ? (Yes/No) {bcolors.ENDC}") 315 | while confirm.lower() != "yes" and confirm.lower() != "no": 316 | confirm = input(f"{bcolors.FAIL}This file ({user_input}) already exists. Are you sure you want to replace it ? (Yes/No) {bcolors.ENDC}") 317 | if confirm.lower() == "yes": 318 | new_file = open(user_input, "w", encoding="utf-8") 319 | new_file.writelines([""]) 320 | new_file.close() 321 | code_file_filename = user_input 322 | del confirm 323 | else: 324 | new_file = open(user_input, "w", encoding="utf-8") 325 | new_file.write("") 326 | new_file.close() 327 | code_file_filename = user_input 328 | else: 329 | # This file is an ACPL system file, which means you cannot modify it. 330 | print(bcolors.FAIL + texts.ide["ACPL_SystemFile"] + bcolors.ENDC) 331 | user_input = None 332 | continue 333 | elif user_input == "open_file": 334 | launch_py_file("ide") 335 | sys.exit() 336 | elif user_input == "run": 337 | if code_file_filename.endswith(".acpl"): 338 | replace_line("startup.acpl-ini", 0, f"filename: {code_file_filename}\n") 339 | launch_py_file("main") 340 | sleep(2) 341 | elif code_file_filename.endswith(".py"): 342 | os.system(f"python {code_file_filename}") 343 | sleep(1) 344 | elif "." in code_file_filename: 345 | extension = code_file_filename.split(".")[len(code_file_filename.split(".")) - 1] 346 | # Unable to run that type of file (Extension : '{extension}'). 347 | print(bcolors.FAIL + texts.ide["UnableRunFile"].format(extension=extension) + bcolors.ENDC) 348 | extension = None 349 | else: 350 | print(bcolors.FAIL + texts.ide["UnableRunFile_NoExtension"] + bcolors.ENDC) 351 | 352 | print("\n\n") 353 | elif user_input == "compile": 354 | if code_file_filename.endswith(".acpl"): 355 | replace_line("startup.acpl-ini", 0, f"filename: {code_file_filename}\n") 356 | replace_line("startup.acpl-ini", 8, 357 | f"compiled-file-filename: {code_file_filename.replace('.acpl', '')}\n") 358 | launch_py_file("compiler") 359 | new_file = open(code_file_filename.replace('.acpl', '') + ".py", "r") 360 | for line in new_file.readlines(): 361 | print(line, end="") 362 | new_file.close() 363 | sleep(2) 364 | elif "." in code_file_filename: 365 | extension = code_file_filename.split(".")[len(code_file_filename.split(".")) - 1] 366 | # Unable to run that type of file (Extension : '{extension}'). 367 | print(bcolors.FAIL + texts.ide["UnableRunFile"].format(extension=extension) + bcolors.ENDC) 368 | extension = None 369 | else: 370 | print(bcolors.FAIL + texts.ide["UnableRunFile_NoExtension"] + bcolors.ENDC) 371 | elif pressed_key == Key.backspace: 372 | # Detecting if the cursor is a the beginning of the line or not 373 | if current_cursor_position == 0: 374 | # Append line to last line 375 | if current_line > 0: # Avoid IndexError 376 | # Remove '\n' from previous line and adding the current one at the end of the new 377 | lines[current_line-1] = remove_suffix(lines[current_line-1], lines[current_line-1].endswith("\n")) 378 | current_cursor_position = len(lines[current_line-1]) 379 | lines[current_line-1] += lines[current_line] 380 | lines[current_line] = "" 381 | 382 | current_line -= 1 383 | if current_cursor_position < 0: 384 | current_cursor_position = 0 385 | delete_line(code_file_filename, current_line+1) 386 | replace_line(code_file_filename, current_line, lines[current_line]+"\n") 387 | else: 388 | # Delete char on the left 389 | # Splits the line in a list of all its characters, then removes the one at the cursor position 390 | lines[current_line] = split(lines[current_line]) 391 | try: 392 | lines[current_line].pop(current_cursor_position-1) 393 | except IndexError: 394 | # Sorry, an unknown error occured.\nWe are unable to delete this character.\nPlease try again. 395 | print(bcolors.FAIL + texts.ide["UnableToDeleteCharacter"] + bcolors.ENDC) 396 | sleep(2) 397 | pass 398 | lines[current_line] = recreate_string(lines[current_line]) 399 | current_cursor_position -= 1 400 | if current_cursor_position < 0: 401 | current_cursor_position = 0 402 | 403 | # Adds the line back in the file 404 | replace_line(code_file_filename, current_line, remove_suffix(lines[current_line], lines[current_line].endswith("\n"))+"\n") 405 | """try: 406 | temp_line = split(lines[current_line]) 407 | except IndexError: 408 | temp_line = [""] 409 | try: 410 | temp_line.pop(current_cursor_position-1) 411 | except IndexError: 412 | lines.pop(current_line) 413 | replace_line(code_file_filename, current_line, "") 414 | continue 415 | try: 416 | lines[current_line] = "" 417 | except IndexError: 418 | lines = [""] 419 | current_line = 0 420 | for char in temp_line: 421 | try: 422 | lines[current_line] += char 423 | except TypeError: 424 | pass 425 | temp_line = None 426 | current_cursor_position -= 1 427 | replace_line(code_file_filename, current_line, lines[current_line] + "\n")""" 428 | elif pressed_key == Key.right: 429 | current_cursor_position += 1 430 | if current_cursor_position > len(lines[current_line]): 431 | current_cursor_position = len(lines[current_line]) 432 | elif pressed_key == Key.left: 433 | current_cursor_position -= 1 434 | if current_cursor_position < 0: 435 | current_cursor_position = 0 436 | elif pressed_key == Key.up: 437 | current_line -= 1 438 | if current_line < 0: 439 | current_line = 0 440 | current_cursor_position = len(lines[current_line]) 441 | if current_cursor_position < 0: 442 | current_cursor_position = 0 443 | elif pressed_key == Key.down: 444 | current_line += 1 445 | if current_line > len(lines) - 1: 446 | current_line = len(lines) - 1 447 | current_cursor_position = len(lines[current_line]) 448 | if current_cursor_position < 0: 449 | current_cursor_position = 0 450 | elif pressed_key == Key.delete: 451 | try: 452 | temp_line = split(lines[current_line]) 453 | except IndexError: 454 | temp_line = [""] 455 | try: 456 | temp_line.pop(current_cursor_position) 457 | except IndexError: 458 | replace_line(code_file_filename, current_line, lines[current_line]) 459 | continue 460 | try: 461 | lines[current_line] = "" 462 | except IndexError: 463 | lines = [""] 464 | current_line = 0 465 | for char in temp_line: 466 | try: 467 | lines[current_line] += char 468 | except TypeError: 469 | pass 470 | del temp_line 471 | replace_line(code_file_filename, current_line, lines[current_line] + "\n") 472 | -------------------------------------------------------------------------------- /recurrent_classes.py: -------------------------------------------------------------------------------- 1 | import inspect 2 | import os 3 | import sys 4 | import json 5 | import tkinter 6 | from tkinter import filedialog 7 | from datetime import datetime 8 | 9 | class bcolors: 10 | with open("startup.acpl-ini", "r", encoding="utf-8") as startup_file: 11 | for line in startup_file.readlines(): 12 | if line.startswith("use-colors: "): 13 | line = line.replace("use-colors: ", "") 14 | line = line.replace("\n", "") 15 | if line.lower() == "true": 16 | HEADER = '\033[95m' 17 | OKBLUE = '\033[94m' 18 | OKGREEN = '\033[92m' 19 | WARNING = '\033[93m' 20 | FAIL = '\033[91m' 21 | ENDC = '\033[0m' 22 | BOLD = '\033[1m' 23 | UNDERLINE = '\033[4m' 24 | ITALICS = '\x1B[3m' 25 | else: 26 | HEADER = '' 27 | OKBLUE = '' 28 | OKGREEN = '' 29 | WARNING = '' 30 | FAIL = '' 31 | ENDC = '' 32 | BOLD = '' 33 | UNDERLINE = '' 34 | ITALICS = '' 35 | startup_file.close() 36 | colors_used = HEADER != '' 37 | 38 | class Text(): 39 | def __init__(self, texts): 40 | self.texts = texts 41 | self.console = self.texts["console"] 42 | self.console_modify_ini = self.console["modify-ini"] 43 | self.console_help = self.console["help"] 44 | self.critic_errors = self.texts["critic-errors"] 45 | self.statement_errors = self.texts["statement-errors"] 46 | self.updates = self.texts["update-checker"] 47 | self.errors = self.texts["errors"] 48 | self.compiler = self.texts["compiler"] 49 | self.ide = self.texts["ide"] 50 | self.main = self.texts["main"] 51 | self.acpl_debugger = self.main["acpl_debugger"] 52 | 53 | def get(self, key): 54 | return self.texts.get(key) 55 | 56 | class CriticError(Exception): 57 | def __init__(self, *args): 58 | if args: 59 | self.message = args[0] 60 | else: 61 | self.message = None 62 | 63 | def __str__(self): 64 | if self.message: 65 | return "CriticError : {0}".format(self.message) 66 | else: 67 | return "CriticError error has been raised." 68 | 69 | def error(line_number, error_type, message=None, *args, quit=True): 70 | if args: 71 | for arg in args: 72 | message += arg 73 | if message != None: 74 | print(f"{bcolors.FAIL}{error_type} {texts.statement_errors['on-line']} {line_number+1} : {message}{bcolors.ENDC}") 75 | else: 76 | print(f"{bcolors.FAIL}{error_type} {texts.statement_errors['has-been-raised']} {line_number+1}{bcolors.ENDC}") 77 | 78 | if quit is True: 79 | sys.exit() 80 | 81 | def lineno(): 82 | """ 83 | Returns the current line number where the function is called. 84 | """ 85 | return inspect.currentframe().f_back.f_lineno 86 | 87 | def split(word:str): 88 | """ 89 | Splits a string into a list. 90 | Parameter 'word' (str) : The string to split. 91 | """ 92 | return list(word) 93 | 94 | def debug(entry_type, line, level, message, *args): 95 | """ 96 | Debug function. 97 | Parameter 'entry_type' (str) : in, out, or other. 98 | Parameter 'line' (int) : The line where the debug is placed. 99 | Parameter 'message' (str) and '*args' : The message to display. 100 | Parameter 'level' (int) : corresponds to the level of importance of the debug message 101 | """ 102 | global debug_const 103 | global date_format 104 | if debug_const >= level: 105 | if entry_type.lower() == "in": 106 | entry = "\n>>>" 107 | elif entry_type.lower() == "out": 108 | entry = "<<<" 109 | else: 110 | entry = "===" 111 | if args: 112 | for arg in args: 113 | message += str(arg) 114 | debug_msg_plain_text = entry + "\t" + "(" + str(line) + ")\t" + str(message) + "\n" 115 | debug_msg = bcolors.ITALICS + bcolors.OKBLUE + entry + "\t" + "(" + str(line) + ")\t" + str(message) + bcolors.ENDC + "\n" 116 | 117 | if not os.path.exists("/DEBUG/"): 118 | try: 119 | os.mkdir(os.getcwd()+"/DEBUG/") 120 | except FileExistsError: 121 | pass 122 | with open(f"DEBUG/debug_{date_format}.log", "a", encoding="utf-8") as debug_file: 123 | debug_file.write(debug_msg_plain_text) 124 | if entry == "<<<": 125 | debug_file.write("\n") 126 | debug_file.close() 127 | print(debug_msg) 128 | if len([name for name in os.listdir(os.getcwd()+"/DEBUG/")]) > 5: 129 | for file in os.listdir(os.getcwd()+"/DEBUG")[:5]: 130 | os.remove(os.getcwd()+'/DEBUG/'+file) 131 | 132 | 133 | class StatementError(Exception): 134 | def __init__(self, *args): 135 | if args: 136 | self.message = args[0] 137 | else: 138 | self.message = None 139 | 140 | def __str__(self): 141 | if self.message: 142 | return "StatementError : {0}".format(self.message) 143 | else: 144 | return "StatementError error has been raised." 145 | 146 | def replace_line(file_name:str, line_num:int, text:str): 147 | """ 148 | Replaces a line of a file with a given string. 149 | Parameter 'file_name' (str) : The path to the file. 150 | Parameter 'line_num' (int) : The line to replace. 151 | Parameter 'text' (str) : The text that will replace the current line. 152 | """ 153 | lines = open(file_name, 'r').readlines() 154 | try: 155 | lines[int(line_num)] = text 156 | except IndexError: 157 | lines = [text] 158 | out = open(file_name, 'w') 159 | out.writelines(lines) 160 | out.close() 161 | 162 | def delete_line(file_name:str, line_number:int, condition:bool=True): 163 | """ 164 | Deletes one line in a file. 165 | Parameter 'file_name' (str) : The path to the file. 166 | Parameter 'line_number' (int) : The line to delete. 167 | Parameter 'condition' (bool, Default : True) : Will only delete the file if the condition is True. 168 | """ 169 | if condition is True: # If the condition is verified 170 | file = open(file_name, "r", encoding="utf-8") # Opens the file once 171 | lines = file.readlines() # Reads its lines and stores them in a list 172 | file.close() # Closes the file 173 | 174 | lines.pop(line_number) # Removes the specified line from the list 175 | 176 | file = open(file_name, "w", encoding="utf-8") # Re-opens the file, and erases its content 177 | file.writelines(lines) # Rewrites the file with the new content (old + deleted line) 178 | file.close() # Closes the file 179 | 180 | def insert_line(path_to_file:str, index:int, value:str): 181 | """ 182 | Inserts a line in a specified file, at a specific index. 183 | Parameter 'path_to_file' (str) : The path to the file. 184 | Parameter 'index' (int) : The line number where the text has to be inserted. 185 | Parameter 'value' (str) : The text to insert. 186 | """ 187 | file = open(path_to_file, "r", encoding="utf-8") # Opens the file 188 | contents = file.readlines() # Stores the content in a list 189 | file.close() # Closes the file 190 | 191 | contents.insert(index, value) # Inserts the correct text at the index (creates a new line) 192 | 193 | file = open(path_to_file, "w", encoding="utf-8") # Re-opens the file, and erases its content 194 | file.writelines(contents) # Rewrites everything, with the modified line 195 | file.close() # Closes the file again 196 | 197 | def remove_suffix(variable:str, condition:bool=True, chars_amount:int=1): 198 | """ 199 | Removes the suffix of a string. 200 | Parameter 'variable' (str) : The text where the suffix has to be removed. 201 | Parameter 'chars_amount' (int) : Default : 1. Number of chars to remove. 202 | Parameter 'condition' (bool) : Default : True. Will only remove if the condition is True. 203 | """ 204 | if condition is True: # If the condition is respected 205 | return variable[:-chars_amount] # Suffix gets removed 206 | return variable 207 | 208 | def remove_prefix(variable:str, condition:bool=True, chars_amount:int=1): 209 | """ 210 | Removes the prefix of a string. 211 | Parameter 'variable' (str) : The text where the prefix has to be removed. 212 | Parameter 'chars_amount' (int) : Default : 1. Number of chars to remove. 213 | Parameter 'condition' (bool) : Default : True. Will only remove if the condition is True. 214 | """ 215 | if condition is True: # If the condition is respected 216 | return variable[chars_amount:len(variable)] # Prefix gets removed 217 | return variable 218 | 219 | def add_suffix(variable:str, suffix:str, condition:bool=True): 220 | """ 221 | Removes the suffix of a string. 222 | Parameter 'variable' (str) : The text where the suffix has to be added. 223 | Parameter 'suffix' (int) : Default : 1. The suffix to add. 224 | Parameter 'condition' (bool) : Default : True. Will only add if the condition is True. 225 | """ 226 | if condition is True: 227 | variable += suffix 228 | return variable 229 | 230 | def recreate_string(variable:list, char_in_between:str=""): 231 | """ 232 | Recreates a string from a list. 233 | Parameter 'variable' (list) : The list to put together to a string. 234 | Parameter 'char_in_between' (str) : The char to put between the elements to recompose. Nothing by default. 235 | """ 236 | temp_str = "" 237 | for element in variable: 238 | temp_str += str(element) + char_in_between 239 | return temp_str 240 | 241 | #def increment_variable(variable:(int, float), count:(int, float)=1, condition:bool=True, condition_is_false:function=None) 242 | 243 | def remove_from_string(variable:str, strs_to_remove:(list, tuple), condition:bool=True): 244 | """ 245 | Removes all the specified strings from a string. 246 | Parameter 'variable' (str) : The string in which to replace. 247 | Parameter 'str_sto_remove' (list, tuple) : The strings that will be removed. 248 | Parameter 'condition' (bool, Default : True) : Will only execute the function if this parameter is set to True. 249 | """ 250 | if condition is True: 251 | for element in strs_to_remove: 252 | variable = variable.replace(str(element), "") 253 | return variable 254 | 255 | def open_file_dialog(extensions:(list, tuple, str)=""): 256 | """ 257 | Opens a "open file dialog". 258 | :extensions: If left empty, any extensions are accepted. If not, if the extension is not in the list, 259 | the function will return None. 260 | :return: The filename. 261 | """ 262 | root = tkinter.Tk() 263 | root.geometry("1x1") 264 | root.title("Open") 265 | 266 | filename = filedialog.askopenfilename() 267 | 268 | root.withdraw() 269 | 270 | if extensions != "": 271 | if isinstance(extensions, str): 272 | if not filename.endswith("."+extensions): 273 | return None 274 | else: 275 | correct_extension = False 276 | for element in extensions: 277 | if filename.endswith("."+element): 278 | correct_extension = True 279 | break 280 | if correct_extension is False: 281 | return None 282 | return filename 283 | 284 | def md_format(lines:(str, list)): 285 | """ 286 | Formats markdown text or list. 287 | :param lines: The lines to format. 288 | :return: The formatted text, as string. 289 | """ 290 | 291 | if isinstance(lines, list): 292 | lines = recreate_string(lines) 293 | 294 | while "**" in lines: 295 | lines = lines.replace("**", bcolors.BOLD, 1) 296 | lines = lines.replace("**", bcolors.ENDC, 1) 297 | 298 | while "*" in lines: 299 | lines = lines.replace("*", bcolors.ITALICS, 1) 300 | lines = lines.replace("*", bcolors.ENDC, 1) 301 | 302 | while "```" in lines: 303 | lines = lines.replace("```", bcolors.WARNING, 1) 304 | lines = lines.replace("```", bcolors.ENDC, 1) 305 | 306 | while "`" in lines: 307 | lines = lines.replace("`", bcolors.WARNING, 1) 308 | lines = lines.replace("`", bcolors.ENDC, 1) 309 | 310 | """"while "####" in lines: 311 | header = lines[lines.find("####") + 1:lines.find("\n")] 312 | print(header) 313 | lines = lines.replace(f"#{header}\n", f"{bcolors.HEADER}{bcolors.ITALICS}{header.replace('#', '')}{bcolors.ENDC}\n") 314 | 315 | while "###" in lines: 316 | header = lines[lines.find("###") + 1:lines.find("\n")] 317 | print(header) 318 | lines = lines.replace(f"#{header}\n", f"{bcolors.HEADER}{bcolors.BOLD}{header.replace('#', '')}{bcolors.ENDC}\n") 319 | 320 | while "##" in lines: 321 | header = lines[lines.find("##") + 1:lines.find("\n")] 322 | print(header) 323 | lines = lines.replace(f"#{header}\n", f"{bcolors.HEADER}{bcolors.BOLD}{bcolors.UNDERLINE}{header.replace('#', '')}{bcolors.ENDC}\n") 324 | """ 325 | 326 | return lines 327 | 328 | def launch_py_file(filename:str): 329 | if not filename.endswith(".py"): 330 | filename += ".py" 331 | file_to_launch = open(filename, "r") 332 | exec(file_to_launch.read()) 333 | file_to_launch.close() 334 | 335 | def var_type_as_str(var): 336 | """ 337 | Returns a string containing the type of the inputted variable. 338 | :param var: A variable. 339 | :return: A string containing the type of the inputted variable. 340 | """ 341 | temp = str(type(var)) 342 | temp = temp.replace("", "") 344 | return temp 345 | 346 | def print_dir(extensions:(str, list, tuple)="*"): 347 | """ 348 | Prints a view of the whole directory. 349 | :param extensions: A list of extensions that can be displayed. Default : All 350 | """ 351 | import os 352 | from rich.tree import Tree 353 | from rich.console import Console 354 | console = Console() 355 | 356 | # If the extensions list is a string, turn it to list. 357 | if isinstance(extensions, str): 358 | extensions = [extensions] 359 | 360 | # Initialize tree 361 | tree = Tree(f":open_file_folder: [link file://{os.getcwd()}]{os.getcwd()}") 362 | 363 | # Get directory contents and sort it 364 | dir_contents = os.listdir() 365 | directories = [] 366 | files = [] 367 | for element in dir_contents: 368 | if os.path.isdir(element): 369 | directories.append(element) 370 | else: 371 | # Checking authorized extensions, appending only if wanted 372 | try: 373 | if extensions == ["*"] or element.split(".")[1] in extensions: 374 | files.append(element) 375 | except IndexError: 376 | # Ignoring files without extensions 377 | pass 378 | 379 | dir_contents = [] # Reset 'dir_contents' 380 | 381 | # Appending folders first, then files 382 | for element in directories: 383 | dir_contents.append(element) 384 | for element in files: 385 | dir_contents.append(element) 386 | 387 | # Deletion of 'directories' and 'files' 388 | del directories 389 | del files 390 | 391 | # Build tree 392 | for element in dir_contents: 393 | # Add little icons depending on extension 394 | if os.path.isdir(element): 395 | element = f":file_folder: {element}" 396 | else: 397 | element = f":page_facing_up: {element}" 398 | # Add element to tree 399 | tree.add(element) 400 | 401 | # Print tree 402 | console.print(tree) 403 | 404 | try: 405 | startup_file = open("startup.acpl-ini", "r+", encoding="utf-8") 406 | except FileNotFoundError: 407 | print("Unable to load startup.acpl-ini !") 408 | sys.exit() 409 | startup = startup_file.readlines() 410 | 411 | date_format = datetime.now().strftime("%Y_%m_%d__%H_%M_%S") 412 | 413 | for lines in startup: 414 | if lines.endswith("\n"): 415 | lines = lines.replace("\n", "") 416 | if lines.startswith("debug-state: "): 417 | lines = lines.replace("debug-state: ", "") 418 | debug_const = int(lines) 419 | 420 | if str(lines).startswith("lang: "): 421 | with open("startup.acpl-ini", "r", encoding="utf-8") as startup_file: 422 | lines = startup_file.readlines() 423 | lines = lines[1] 424 | lines = str(lines).replace("lang: ", "") 425 | lines = lines.replace("\n", "") 426 | language = lines 427 | try: 428 | with open("trad_" + language + ".json", "r", encoding="utf-8") as json_file: 429 | texts = json.load(json_file) 430 | json_file.close() 431 | texts = Text(texts) 432 | except NameError: 433 | raise CriticError(texts.critic_errors["NameError_LanguageFile"]) 434 | 435 | ide_forbidden_files = ["main.py", "console.py", "ide.py", "compiler.py", "setup.py", "updater_main.py", "updater_others.py"] 436 | with open("startup.acpl-ini", "r", encoding="utf-8") as startup_file: 437 | for line in startup_file.readlines(): 438 | if line.startswith("use-colors: "): 439 | line = line.replace("use-colors: ", "") 440 | line = line.replace("\n", "") 441 | use_colors = line.lower() != "false" 442 | elif line.startswith("process-time-round-numbers: "): 443 | line = line.replace("process-time-round-numbers: ", "") 444 | process_time_round_numbers = int(remove_suffix(line, line.endswith("\n"))) 445 | elif line.startswith("open-compiled-file: "): 446 | line = remove_suffix(line.replace("open-compiled-file: ", ""), line.endswith("\n")) 447 | open_compiled_file = line.lower() != "false" 448 | elif line.startswith("leave-comments-at-compiling: "): 449 | line = line.replace("leave-comments-at-compiling: ", "") 450 | line = remove_suffix(line, line.endswith("\n")) 451 | leave_comments_at_compiling = line.lower() == "true" 452 | elif line.startswith("startup-check-update: "): 453 | line = line.replace("startup-check-update: ", "") 454 | line = remove_suffix(line, line.endswith("\n")) 455 | startup_check_update = line.lower() != "false" 456 | elif line.startswith("compiling-style: "): 457 | line = line.replace("compiling-style: ", "") 458 | line = remove_suffix(line, line.endswith("\n")) 459 | compiling_style = line 460 | elif line.startswith("compile-ask-for-replace: "): 461 | line = line.replace("compile-ask-for-replace: ", "") 462 | line = remove_suffix(line, line.endswith("\n")) 463 | compile_ask_for_replace = line.lower() != "false" 464 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | psutil 3 | pynput 4 | packaging 5 | fonttools 6 | pyinstaller 7 | rich 8 | pyperclip 9 | psutil -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | from time import sleep 3 | from recurrent_classes import launch_py_file 4 | os.system("pip install -r --upgrade requirements.txt") 5 | 6 | startup_file = open("startup.acpl-ini", "r", encoding="utf-8") 7 | startup_options = startup_file.readlines() 8 | startup_file.close() 9 | 10 | print("\n\n\nHello !\nLet's begin with a quick setup of your settings.") 11 | language = input("What language do you speak, from this list ? Type in the country code between parentheses.\n" 12 | "- Azerbaijani (az)\n" 13 | "- German (de)\n" 14 | "- English (en)\n" 15 | "- French (fr)\n" 16 | "- Italian (it)\n" 17 | "- Dutch (nl)\n" 18 | "- Turkish (tr)\n" 19 | "Type here : ") 20 | if language not in ("az", "de", "en", "fr", "nl", "it", "tr"): 21 | language = "en" 22 | 23 | print(f"Ok, I configured your language to '{language}'.\nBut for now, the setup has to be in English (sorry).") 24 | 25 | sleep(1) 26 | 27 | use_colors = input("\033[93mDo you see weird characters at the beginning and the end of that sentence ? (yes/no) \033[0m") 28 | if use_colors.lower() == "yes": 29 | use_colors = "False" 30 | else: 31 | use_colors = "True" 32 | 33 | sleep(1) 34 | 35 | open_compiled_file = input("The ACPL has the ability to compile ACPL files into Python files.\nAt the end of a compilation, do you want the ACPL interpreter to automatically open the file in your favourite text editor ? (yes/no) ") 36 | open_compiled_file = f"{open_compiled_file.lower() == 'yes'}" 37 | 38 | sleep(1) 39 | 40 | leave_comments_at_compiling = input("During compilation, do you want the comments you wrote in the ACPL file to be transcripted in the Python file ? (yes/no) ") 41 | leave_comments_at_compiling = f"{leave_comments_at_compiling.lower() == 'yes'}" 42 | 43 | sleep(1) 44 | 45 | print("Okay, you completed the setup :)\n\nKeep in mind that you can modify any of them using the 'settings' console command.") 46 | 47 | for i in range(len(startup_options)): 48 | if startup_options[i].startswith("lang"): 49 | startup_options[i] = f"lang: {language}\n" 50 | elif startup_options[i].startswith("use-colors"): 51 | startup_options[i] = f"use-colors: {use_colors}\n" 52 | elif startup_options[i].startswith("open-compiled-file"): 53 | startup_options[i] = f"open-compiled-file: {open_compiled_file}\n" 54 | elif startup_options[i].startswith("leave-comments-at-compiling"): 55 | startup_options[i] = f"leave-comments-at-compiling: {leave_comments_at_compiling}\n" 56 | 57 | startup_file = open("startup.acpl-ini", "w", encoding="utf-8") 58 | startup_file.writelines(startup_options) 59 | startup_file.close() 60 | 61 | try: 62 | os.mkdir("acpl_libs") 63 | except FileExistsError: 64 | pass 65 | 66 | sleep(2) 67 | 68 | print("I open you the console :)") 69 | launch_py_file("console") 70 | -------------------------------------------------------------------------------- /startup.acpl-ini: -------------------------------------------------------------------------------- 1 | filename: code.acpl 2 | lang: en 3 | version: 3.11.1 4 | current-version: 3.11.1at 5 | debug-state: 0 6 | console-reloaded: False 7 | use-colors: True 8 | process-time-round-numbers: 6 9 | compiled-file-filename: code 10 | open-compiled-file: True 11 | leave-comments-at-compiling: False 12 | startup-check-update: True 13 | compiling-style: compacted 14 | compile-ask-for-replace: False 15 | debugger-enabled: False 16 | optimize-transpiled-file: True 17 | -------------------------------------------------------------------------------- /trad_az.json: -------------------------------------------------------------------------------- 1 | { 2 | "compiler": { 3 | "CompilingConfirmation": "This file, located at \"{compiled_file_filename}\" already exists.\nDo you want to replace it ?", 4 | "CompilingTime": "Compiling time", 5 | "FileCompiledWithStyle": "File compiled using style", 6 | "FileOpened": "File opened successfully", 7 | "OpeningFile": "File is being opened", 8 | "StartingCompilation": "Starting compilation.", 9 | "Stop_TooManyErrors": "Debug has chosen to stop this program due to too many errors. Sorry for the inconvenicence.", 10 | "WrongAnswer": "Wrong answer" 11 | }, 12 | "console": { 13 | "bootup-message": "ACPL Konsolu - Son sabit buraxılış{} - {} - CC-BY-SA", 14 | "CannotRunFile": "Cannot run this file.", 15 | "ClosedIDE": "IDE closed.", 16 | "console-correctly-reloaded": "Konsol düzgün olaraq başladıldı", 17 | "current-dev-build": "Hazırki development quruluşu", 18 | "EndOfFile": "End of the file.", 19 | "FileNotFound": "File not found.", 20 | "FileSuccessfullyOpened": "File opened successfully.", 21 | "help": { 22 | "about": "Dil haqqında müəllifdən xüsusi bir mesaj verir", 23 | "available-commands": "Mümkün Komandalar", 24 | "change-line": "Modifies a specific line in a plain text file.", 25 | "compile": "Compiles an ACPL file to a Python file", 26 | "display": "Prints the content of a specified file.", 27 | "end": "Konsol prosesini bitirir.", 28 | "ini-content": "Displays the content of the ini file.", 29 | "lib": "Respectively installs, delete, or gives the documentation of the specified lib.", 30 | "modify-ini": "Faylda spesifik ifadəni dəyişdirir. Ətraflı məlumat üçün 'modify-ini help all'.", 31 | "open": "Opens a specific file in its default program.", 32 | "pyrun": "Runs a specified python file", 33 | "redo": "Reuses the last command.", 34 | "run": "Spesifik faylı çalışdırar : 'run '.", 35 | "settings": "Opens up a dialog box which allows you to tweak your settings", 36 | "update": "Launches the update program.", 37 | "version": "Ən son sabit versiya və aktual dev quruluşu haqqında məlumat verir." 38 | }, 39 | "last-stable-release": "Son sabit buraxılış", 40 | "launch-code-file": " {} Başladılır..", 41 | "LaunchingPyFile": "Launching {file}.", 42 | "LibDeleted": "Deleted lib {user_input}.", 43 | "LibDoesNotExistError": "Error : Lib does not exist !", 44 | "LibInstalled": "Library {user_input} installed !", 45 | "LibNotInstalled": "Lib not installed, unable to uninstall.", 46 | "LineModified": "Line {line} modified in {user_input[0]} with value :\n{value}", 47 | "modify-ini": { 48 | "compile-code-file": "{} Tərtib edilir...", 49 | "debug-state-help": "Kömək : Əgər siz developer debugunu açmaq istəyirsinizsə, \"debug-state\" ifadəsi sizdən açmağı soruşacaq.\nTip : boolean.\nDefolt : False.\nAktual : {}.", 50 | "debug-state-modified": "Seçim ayılama vəziyyəti {} ilə startup.acpl-ini uğurla dəyişdirildi.", 51 | "else-help": "Mövcüd Seçimlər :\n\t- \"debug-state\"\n\t- \"lang\"\n\t- \"process-time-round-numbers\"\n\t- \"open-compiled-file\"\n\t- \"leave-comments-at-compiling\"\n\t- \"startup-check-update\"\n\nType \"modify-ini help \" çox yaxşı kömək üçün.", 52 | "lang-help": "Kömək : the \"dil\" ifadəsi sizdən hansı dili seçəcəyinizi soruşur .\nTip : string.\nMümkün Seçimlər : \"en\", \"fr\", or \"nl\".\nDefolt : en.\nAktual : {}.", 53 | "lang-modified": "Seçim dilinin vəziyyəti {} ilə startup.acpl-ini uğurla dəyişdirildi.", 54 | "leave-comments-at-compiling": "HELP : the \"leave-comments-at-compiling\" statement is used to know if you want to keep the comments in the compiled python file (readability), or not (processing time).\nType : Bool.\nDefault : False.\nActual : {}.", 55 | "open-compiled-file": "HELP : the \"open-compiled-file\" statement is used to know if the file just compiled has to be opened at the end or not.\nType : Bool.\nDefault : False.\nActual : {}.", 56 | "process-time-round-numbers": "HELP : the \"process-time-round-numbers\" statement is used to know how many numbers will be behind the dot for the processing time.\nType : integer.\nDefault : 6.\nActual : {}.", 57 | "startup-check-update": "HELP : the \"startup-check-update\" statement is used to know if the console has to check update at startup or not.\nType : Bool.\nDefault : True.\nActual : {}.", 58 | "unable-to-modify-option": "Bu seçimi dəyişdirmək mümkün deyil.", 59 | "use-colors-help": "Kömək : \"use-colors\" sizdən hər hansı bir rəngin istifadəsini və yaxud əksini soruşur. Bəzi sistemlər bunu dəstəkləmir.\nTip : boolean.\nMümkün Seçimlər : \"True\" or \"False\".\nDefolt : True.\nAktual: {}.", 60 | "use-colors-modified": "Seçim \"rəngləri-işlət\"vəziyyəti {} ilə startup.acpl-ini uğurla dəyişdirildi." 61 | }, 62 | "OpeningFile": "Opening {file}.", 63 | "OpeningIDE": "Opening ACPL IDE...", 64 | "output": "Çıxış", 65 | "process-ended": "Proses bitdi.", 66 | "reloading": "Konsol təzələnir..", 67 | "Rerun": "Running last file again...", 68 | "settings": { 69 | "ClosedAndSaved": "Settings closed and saved.", 70 | "DebugState_NotInt": "Debug state has to be an integer.", 71 | "DebugState_Over3": "Cannot set debug state over 3.", 72 | "DebugState_Under0": "Cannot set debug state under 0.", 73 | "ProcessTime_NotInt": "Process time round numbers has to be an integer.", 74 | "UnknownLanguage": "Unknown language. Language set back to 'en'." 75 | }, 76 | "StartingDebug": "Starting to debug {file}...", 77 | "unable-load-startup": "'startup.acpl-ini'ni Başlatmaq mümkün deyil!", 78 | "UnableToInstall": "Unable to compile that kind of file (extension '.{extension}').", 79 | "unknown-command": "Bilinməyən komanda.", 80 | "update_ProcessInvocationNotSupported": "{FAIL}Your system does not support the invocation of new Python processes.\nPlease run the {ITALICS}{OKGREEN}updater_main.py{ENDC}{FAIL} script manually.{ENDC}" 81 | }, 82 | "critic-errors": { 83 | "ImpossibleLoad_StartupIni": "'startul.acpl-ini'ni başlatmaq mümkün deyil !", 84 | "NameError_LanguageFile": "Dil faylını yükləmək mümkün deyil !" 85 | }, 86 | "errors": { 87 | "ArgumentMissing": "Arguments missing !", 88 | "ArgumentNotInt": "Argument should be integer !", 89 | "FunctionArgumentError": "{args_required} arguments required, got {args_nbr}.", 90 | "ImpossibleCast_Float": "Variable {var} cannot be casted as float.", 91 | "ImpossibleCast_Int": "Variable {var} cannot be casted as integer.", 92 | "IndexError": "The index is not existing.", 93 | "ListParsingError": "An error occurred while trying to parse the list \"{}\".", 94 | "TypeErrorBool": "List element no{i} '{list_element}' cannot be casted as boolan.", 95 | "TypeErrorFloat": "List element no{i} '{list_element}' cannot be casted as float.", 96 | "TypeErrorInt": "List element no{i} '{list_element}' cannot be casted as integer.", 97 | "UnexistingIndexError": "The index '{}' seems not to exist.", 98 | "VariableNotFound": "The variable \"{variable}\" is not existing or has been declared later in the code.", 99 | "VarNotFoundError": "The variable \"{variable}\" seems not to exist." 100 | }, 101 | "ide": { 102 | "ACPL_SystemFile": "This file is an ACPL system file, which means you cannot modify it.", 103 | "DisplayedLines": "{line1} lines displayed out of {line2}.", 104 | "IDE_SuccessfullyOpened": "ACPL IDE successfully opened", 105 | "UnableRunFile": "Unable to run that type of file (Extension : '{extension}').", 106 | "UnableRunFile_NoExtension": "Unable to run that type of file (No extension).", 107 | "UnableToDeleteCharacter": "Sorry, an unknown error occured.\nWe are unable to delete this character.\nPlease try again." 108 | }, 109 | "main": { 110 | "acpl_debugger": { 111 | "break": "Breaking loop.", 112 | "ConditionFalse": "Condition '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {FAIL}False", 113 | "ConditionTrue": "Condition '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {OKGREEN}True", 114 | "continue": "Going to next loop.", 115 | "CreatedFunction": "Created function '{WARNING}{function_name}{OKBLUE}' with arguments : {OKGREEN}{recreate_string}{OKBLUE} on line {line_numbers}.", 116 | "DeletedVariable": "Deleted variable '{OKGREEN}{var}{OKBLUE}' on line {line_numbers}.", 117 | "ExecutionStopped": "Execution stopped.", 118 | "ForLoop": "Looping {times} times using variable {OKGREEN}{line}", 119 | "StopOrContinue": "Press Enter to continue or type 'stop'/'end' to quit.", 120 | "variable": "Created variable '{OKGREEN}{line0}{OKBLUE}' with content {OKGREEN}{line2}{OKBLUE} on line {line_numbers}", 121 | "VariablesAtLineNO": "Variables for line {line_numbers} :", 122 | "WhileFalse": "Condition for while loop '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {FAIL}False{OKBLUE}\nSkipping loop.", 123 | "WhileTrue": "Condition for while loop '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {OKGREEN}True" 124 | }, 125 | "ProcessTime": "Process time", 126 | "ProgramStopped_Errors": "Debug has chosen to stop this program due to too many errors. Sorry for the inconvenience." 127 | }, 128 | "program-ended": "Proqram uğurla dayandırıldı.", 129 | "statement-errors": { 130 | "has-been-raised": "Xətt üçün qaldırıldı.", 131 | "on-line": "Xətdə" 132 | }, 133 | "update-checker": { 134 | "ask-install": "Endirmək istəyirsən?", 135 | "console-restart": "Konsol yenidən başladılır..", 136 | "CouldNotRewriteElement": "Couldn't rewrite {element} !", 137 | "DownloadingUpdate": "Downloading update...", 138 | "ElementRewritten": "{element} successfully rewritten !", 139 | "extracting-all-files": "Bütün fayllar çıxarılır..", 140 | "ExtractingUpdate": "Extracting update...", 141 | "files-successfully-extracted": "Fayllar uğurla çıxardıldı.", 142 | "ImpossibleDownloadError": "Error : Unable to download the update !", 143 | "NewVersionFound": "A new version has been found !\nYour version : {local_version}\nGitHub version : {github_version}\n", 144 | "old-files-deletion": "Köhnə fayllar silinir..", 145 | "old-files-deletion-complete": " {} Uğurla silindi.", 146 | "removing-temp-files": "Lazımsız fayllar silinir..", 147 | "RewritingElement": "Rewriting {element}...", 148 | "SeeChangelog": "Do you want to see the changelog ?", 149 | "temp-files-removed": "Lazımsız fayllar silindi!", 150 | "unable-to-install": "Bu versiya update_checker faylında dəyişikliklər edəcək. Çünki bizim bunu avtomatik endirməmiz mümkün deyil(sənin hər şeyin silinməsini istəmədiyin vaxta qədər).\nBizim etdiyimiz şey isə ACPL-nin olduğu yerə yeni versiya fayllarını endirmək və çıxartmaqdır.\nİndi :\n\t- \"ACPL-master\" faylını yoxla, hansı ki ACPL faylında yerləşdirilib.\n\t- \"end\" Konsolda bunu yaz.\n\t- \"ACPL-master\" Faylının içindəki kontentləri PƏNCƏRƏNİ QAPADANDAN SONRA və bütün köhnə faylları yerləştirəndən sonra kopyala və yapışdır et.", 151 | "update-applied": "Güncəlləmə qəbul edildi!", 152 | "update-disponible-message": "Yeni güncəlləmə ({}) Mövcuddur!", 153 | "UpdateApplied": "Update successfully applied !", 154 | "UpdateCancelled": "Update cancelled.\n{WARNING}If you want to update later, type 'update' in the console.", 155 | "UpdateSuccessfullyDownloaded": "Update successfully downloaded !", 156 | "UpdateSuccessfullyExtracted": "Update successfully extracted !", 157 | "WiFi_Off": "Unable to find version number.\nUpdate cancelled." 158 | } 159 | } -------------------------------------------------------------------------------- /trad_de.json: -------------------------------------------------------------------------------- 1 | { 2 | "compiler": { 3 | "CompilingConfirmation": "This file, located at \"{compiled_file_filename}\" already exists.\nDo you want to replace it ?", 4 | "CompilingTime": "Compiling time", 5 | "FileCompiledWithStyle": "File compiled using style", 6 | "FileOpened": "File opened successfully", 7 | "OpeningFile": "File is being opened", 8 | "StartingCompilation": "Starting compilation.", 9 | "Stop_TooManyErrors": "Debug has chosen to stop this program due to too many errors. Sorry for the inconvenicence.", 10 | "WrongAnswer": "Wrong answer" 11 | }, 12 | "console": { 13 | "bootup-message": "ACPL Console - last stable release {} - {} - CC-BY-SA", 14 | "CannotRunFile": "Cannot run this file.", 15 | "ClosedIDE": "IDE closed.", 16 | "compile-code-file": "Compiling {}...", 17 | "compiling-successfull": "Compiling successfull !", 18 | "console-correctly-reloaded": "Console correctly reloaded.", 19 | "current-dev-build": "Current dev build", 20 | "EndOfFile": "End of the file.", 21 | "FileNotFound": "File not found.", 22 | "FileSuccessfullyOpened": "File opened successfully.", 23 | "help": { 24 | "about": "Gives a special message from the author concerning the language ;)", 25 | "available-commands": "Available commands", 26 | "change-line": "Modifies a specific line in a plain text file.", 27 | "compile": "Compiles an ACPL file to a Python file", 28 | "display": "Prints the content of a specified file.", 29 | "end": "Ends the console process.", 30 | "ini-content": "Displays the content of the ini file.", 31 | "lib": "Respectively installs, delete, or gives the documentation of the specified lib.", 32 | "modify-ini": "Modifies a specific statement in the ini file. Better help with 'modify-ini help all'.", 33 | "open": "Opens a specific file in its default program.", 34 | "pyrun": "Runs a specified python file", 35 | "redo": "Reuses the last command.", 36 | "run": "runs a specific file. Syntax : 'run '.", 37 | "settings": "Opens up a dialog box which allows you to tweak your settings", 38 | "update": "Launches the update program.", 39 | "version": "Gives the last stable version and the actual dev build." 40 | }, 41 | "last-stable-release": "Last stable release", 42 | "launch-code-file": "Launching {}...", 43 | "LaunchingPyFile": "Launching {file}.", 44 | "LibDeleted": "Deleted lib {user_input}.", 45 | "LibDoesNotExistError": "Error : Lib does not exist !", 46 | "LibInstalled": "Library {user_input} installed !", 47 | "LibNotInstalled": "Lib not installed, unable to uninstall.", 48 | "LineModified": "Line {line} modified in {user_input[0]} with value :\n{value}", 49 | "modify-ini": { 50 | "compile-code-file": "Compiling {}...", 51 | "debug-state-help": "HELP : the \"debug-state\" statement asks if you want to enable or disable devlopper debug.\nType : boolean.\nDefault : False.\nActual : {}.", 52 | "debug-state-modified": "Option debug-state modified correctly in startup.acpl-ini with value {}.", 53 | "else-help": "Available values :\n\t- \"debug-state\"\n\t- \"lang\"\n\t- \"process-time-round-numbers\"\n\t- \"open-compiled-file\"\n\t- \"leave-comments-at-compiling\"\n\t- \"startup-check-update\"\n\nType \"modify-ini help \" for better help.", 54 | "lang-help": "HELP : the \"lang\" statement is used to know in which language the system is displayed.\nType : string.\nPossible options : \"en\", \"fr\", or \"nl\".\nDefault : en.\nActual : {}.", 55 | "lang-modified": "Option lang modified correctly in startup.acpl-ini with value {}.", 56 | "leave-comments-at-compiling": "HELP : the \"leave-comments-at-compiling\" statement is used to know if you want to keep the comments in the compiled python file (readability), or not (processing time).\nType : Bool.\nDefault : False.\nActual : {}.", 57 | "open-compiled-file": "HELP : the \"open-compiled-file\" statement is used to know if the file just compiled has to be opened at the end or not.\nType : Bool.\nDefault : False.\nActual : {}.", 58 | "process-time-round-numbers": "HELP : the \"process-time-round-numbers\" statement is used to know how many numbers will be behind the dot for the processing time.\nType : integer.\nDefault : 6.\nActual : {}.", 59 | "startup-check-update": "HELP : the \"startup-check-update\" statement is used to know if the console has to check update at startup or not.\nType : Bool.\nDefault : True.\nActual : {}.", 60 | "unable-to-modify-option": "Unable to modify this option.", 61 | "use-colors-help": "HELP : the \"use-colors\" statement is used to know if you prefer to use colors or not. Some OS or softwares does not allow it.\nType : booléen.\nPossible options : \"True\" or \"False\".\nDefaut : True.\nActual : {}.", 62 | "use-colors-modified": "Option \"use-colors\" modified correctly in startup.acpl-ini with value {}" 63 | }, 64 | "OpeningFile": "Opening {file}.", 65 | "OpeningIDE": "Opening ACPL IDE...", 66 | "output": "Output", 67 | "process-ended": "Process ended.", 68 | "reloading": "Reloading console...", 69 | "Rerun": "Running last file again...", 70 | "settings": { 71 | "ClosedAndSaved": "Settings closed and saved.", 72 | "DebugState_NotInt": "Debug state has to be an integer.", 73 | "DebugState_Over3": "Cannot set debug state over 3.", 74 | "DebugState_Under0": "Cannot set debug state under 0.", 75 | "ProcessTime_NotInt": "Process time round numbers has to be an integer.", 76 | "UnknownLanguage": "Unknown language. Language set back to 'en'." 77 | }, 78 | "StartingDebug": "Starting to debug {file}...", 79 | "unable-load-startup": "Unable to load startup.acpl-ini !", 80 | "UnableToInstall": "Unable to compile that kind of file (extension '.{extension}').", 81 | "unknown-command": "Unknown command.", 82 | "update_ProcessInvocationNotSupported": "{FAIL}Your system does not support the invocation of new Python processes.\nPlease run the {ITALICS}{OKGREEN}updater_main.py{ENDC}{FAIL} script manually.{ENDC}" 83 | }, 84 | "critic-errors": { 85 | "ImpossibleLoad_StartupIni": "Unable to load startup.acpl-ini !", 86 | "NameError_LanguageFile": "Unable to load the language file !" 87 | }, 88 | "errors": { 89 | "ArgumentMissing": "Arguments missing !", 90 | "ArgumentNotInt": "Argument should be integer !", 91 | "FunctionArgumentError": "{args_required} arguments required, got {args_nbr}.", 92 | "ImpossibleCast_Float": "Variable {var} cannot be casted as float.", 93 | "ImpossibleCast_Int": "Variable {var} cannot be casted as integer.", 94 | "IndexError": "The index is not existing.", 95 | "ListParsingError": "An error occurred while trying to parse the list \"{}\".", 96 | "TypeErrorBool": "List element no{i} '{list_element}' cannot be casted as boolan.", 97 | "TypeErrorFloat": "List element no{i} '{list_element}' cannot be casted as float.", 98 | "TypeErrorInt": "List element no{i} '{list_element}' cannot be casted as integer.", 99 | "UnexistingIndexError": "The index '{}' seems not to exist.", 100 | "VariableNotFound": "The variable \"{variable}\" is not existing or has been declared later in the code.", 101 | "VarNotFoundError": "The variable \"{variable}\" seems not to exist." 102 | }, 103 | "ide": { 104 | "ACPL_SystemFile": "This file is an ACPL system file, which means you cannot modify it.", 105 | "DisplayedLines": "{line1} lines displayed out of {line2}.", 106 | "IDE_SuccessfullyOpened": "ACPL IDE successfully opened", 107 | "UnableRunFile": "Unable to run that type of file (Extension : '{extension}').", 108 | "UnableRunFile_NoExtension": "Unable to run that type of file (No extension).", 109 | "UnableToDeleteCharacter": "Sorry, an unknown error occured.\nWe are unable to delete this character.\nPlease try again." 110 | }, 111 | "main": { 112 | "acpl_debugger": { 113 | "break": "Breaking loop.", 114 | "ConditionFalse": "Condition '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {FAIL}False", 115 | "ConditionTrue": "Condition '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {OKGREEN}True", 116 | "continue": "Going to next loop.", 117 | "CreatedFunction": "Created function '{WARNING}{function_name}{OKBLUE}' with arguments : {OKGREEN}{recreate_string}{OKBLUE} on line {line_numbers}.", 118 | "DeletedVariable": "Deleted variable '{OKGREEN}{var}{OKBLUE}' on line {line_numbers}.", 119 | "ExecutionStopped": "Execution stopped.", 120 | "ForLoop": "Looping {times} times using variable {OKGREEN}{line}", 121 | "StopOrContinue": "Press Enter to continue or type 'stop'/'end' to quit.", 122 | "variable": "Created variable '{OKGREEN}{line0}{OKBLUE}' with content {OKGREEN}{line2}{OKBLUE} on line {line_numbers}", 123 | "VariablesAtLineNO": "Variables for line {line_numbers} :", 124 | "WhileFalse": "Condition for while loop '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {FAIL}False{OKBLUE}\nSkipping loop.", 125 | "WhileTrue": "Condition for while loop '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {OKGREEN}True" 126 | }, 127 | "ProcessTime": "Process time", 128 | "ProgramStopped_Errors": "Debug has chosen to stop this program due to too many errors. Sorry for the inconvenience." 129 | }, 130 | "program-ended": "Program successfully stopped.", 131 | "statement-errors": { 132 | "has-been-raised": "has been raised for line", 133 | "on-line": "on line" 134 | }, 135 | "update-checker": { 136 | "ask-install": "Do you want to install it ?", 137 | "console-restart": "Restarting console...", 138 | "CouldNotRewriteElement": "Couldn't rewrite {element} !", 139 | "DownloadingUpdate": "Downloading update...", 140 | "ElementRewritten": "{element} successfully rewritten !", 141 | "extracting-all-files": "Extracting all the files...", 142 | "ExtractingUpdate": "Extracting update...", 143 | "files-successfully-extracted": "Files successfully extracted.", 144 | "ImpossibleDownloadError": "Error : Unable to download the update !", 145 | "NewVersionFound": "A new version has been found !\nYour version : {local_version}\nGitHub version {github_version}\n", 146 | "no-internet-connection": "Keine Internet Verbindung da.", 147 | "old-files-deletion": "Deleting old files...", 148 | "old-files-deletion-complete": "Successfully deleted {}.", 149 | "removing-temp-files": "Removing temp files...", 150 | "RewritingElement": "Rewriting {element}...", 151 | "SeeChangelog": "Do you want to see the changelog ?", 152 | "temp-files-removed": "Temp files removed !", 153 | "unable-to-install": "This version makes changes to the update_checker file. Because of that, we are unable to install it automatically (unless you want everything to be deleted).\nWhat we can do is downloading and extracting the new version in the folder where ACPL is installed.\nSo :\n\t- Go check the \"ACPL-master\" folder in the folder where ACPL is installed.\n\t- Type \"end\" in the console.\n\t- Copy-paste the content of \"ACPL-master\" AFTER CLOSING THIS WINDOW and replace all old files.", 154 | "update-applied": "Update applied !", 155 | "update-disponible-message": "A new update ({}) is available !", 156 | "UpdateApplied": "Update successfully applied !", 157 | "UpdateCancelled": "Update cancelled.\n{WARNING}If you want to update later, type 'update' in the console.", 158 | "UpdateSuccessfullyDownloaded": "Update successfully downloaded !", 159 | "UpdateSuccessfullyExtracted": "Update successfully extracted !", 160 | "WiFi_Off": "Unable to find version number.\nUpdate cancelled." 161 | } 162 | } -------------------------------------------------------------------------------- /trad_en.json: -------------------------------------------------------------------------------- 1 | { 2 | "compiler": { 3 | "CompilingConfirmation": "This file, located at \"{compiled_file_filename}\" already exists.\nDo you want to replace it ?", 4 | "CompilingTime": "Compiling time", 5 | "FileCompiledWithStyle": "File compiled using style", 6 | "FileOpened": "File opened successfully", 7 | "OpeningFile": "File is being opened", 8 | "StartingCompilation": "Starting compilation.", 9 | "Stop_TooManyErrors": "Debug has chosen to stop this program due to too many errors. Sorry for the inconvenicence.", 10 | "WrongAnswer": "Wrong answer" 11 | }, 12 | "console": { 13 | "bootup-message": "ACPL Console - last stable release {} - {} - CC-BY-SA", 14 | "CannotRunFile": "Cannot run this file.", 15 | "ClosedIDE": "IDE closed.", 16 | "console-correctly-reloaded": "Console correctly reloaded.", 17 | "current-dev-build": "Current dev build", 18 | "EndOfFile": "End of the file.", 19 | "FileNotFound": "File not found.", 20 | "FileSuccessfullyOpened": "File opened successfully.", 21 | "help": { 22 | "about": "Gives a special message from the author concerning the language ;)", 23 | "available-commands": "Available commands", 24 | "change-line": "Modifies a specific line in a plain text file.", 25 | "compile": "Compiles an ACPL file to a Python file", 26 | "display": "Prints the content of a specified file.", 27 | "end": "Ends the console process.", 28 | "ini-content": "Displays the content of the ini file.", 29 | "lib": "Respectively installs, delete, or gives the documentation of the specified lib.", 30 | "modify-ini": "Modifies a specific statement in the ini file. Better help with 'modify-ini help all'.", 31 | "open": "Opens a specific file in its default program.", 32 | "pyrun": "Runs a specified python file", 33 | "redo": "Reuses the last command.", 34 | "run": "runs a specific file. Syntax : 'run '.", 35 | "settings": "Opens up a dialog box which allows you to tweak your settings", 36 | "update": "Launches the update program.", 37 | "version": "Gives the last stable version and the actual dev build." 38 | }, 39 | "last-stable-release": "Last stable release", 40 | "launch-code-file": "Launching {}...", 41 | "LaunchingPyFile": "Launching {file}.", 42 | "LibDeleted": "Deleted lib {user_input}.", 43 | "LibDoesNotExistError": "Error : Lib does not exist !", 44 | "LibInstalled": "Library {user_input} installed !", 45 | "LibNotInstalled": "Lib not installed, unable to uninstall.", 46 | "LineModified": "Line {line} modified in {user_input[0]} with value :\n{value}", 47 | "modify-ini": { 48 | "compile-code-file": "Compiling {}...", 49 | "debug-state-help": "HELP : the \"debug-state\" statement asks if you want to enable or disable devlopper debug.\nType : boolean.\nDefault : False.\nActual : {}.", 50 | "debug-state-modified": "Option debug-state modified correctly in startup.acpl-ini with value {}.", 51 | "else-help": "Available values :\n\t- \"debug-state\"\n\t- \"lang\"\n\t- \"process-time-round-numbers\"\n\t- \"open-compiled-file\"\n\t- \"leave-comments-at-compiling\"\n\t- \"startup-check-update\"\n\nType \"modify-ini help \" for better help.", 52 | "lang-help": "HELP : the \"lang\" statement is used to know in which language the system is displayed.\nType : string.\nPossible options : \"en\", \"fr\", or \"nl\".\nDefault : en.\nActual : {}.", 53 | "lang-modified": "Option lang modified correctly in startup.acpl-ini with value {}.", 54 | "leave-comments-at-compiling": "HELP : the \"leave-comments-at-compiling\" statement is used to know if you want to keep the comments in the compiled python file (readability), or not (processing time).\nType : Bool.\nDefault : False.\nActual : {}.", 55 | "open-compiled-file": "HELP : the \"open-compiled-file\" statement is used to know if the file just compiled has to be opened at the end or not.\nType : Bool.\nDefault : False.\nActual : {}.", 56 | "process-time-round-numbers": "HELP : the \"process-time-round-numbers\" statement is used to know how many numbers will be behind the dot for the processing time.\nType : integer.\nDefault : 6.\nActual : {}.", 57 | "startup-check-update": "HELP : the \"startup-check-update\" statement is used to know if the console has to check update at startup or not.\nType : Bool.\nDefault : True.\nActual : {}.", 58 | "unable-to-modify-option": "Unable to modify this option.", 59 | "use-colors-help": "HELP : the \"use-colors\" statement is used to know if you prefer to use colors or not. Some OS or softwares does not allow it.\nType : booléen.\nPossible options : \"True\" or \"False\".\nDefaut : True.\nActual : {}.", 60 | "use-colors-modified": "Option \"use-colors\" modified correctly in startup.acpl-ini with value {}" 61 | }, 62 | "OpeningFile": "Opening {file}.", 63 | "OpeningIDE": "Opening ACPL IDE...", 64 | "output": "Output", 65 | "process-ended": "Process ended.", 66 | "reloading": "Reloading console...", 67 | "Rerun": "Running last file again...", 68 | "settings": { 69 | "ClosedAndSaved": "Settings closed and saved.", 70 | "DebugState_NotInt": "Debug state has to be an integer.", 71 | "DebugState_Over3": "Cannot set debug state over 3.", 72 | "DebugState_Under0": "Cannot set debug state under 0.", 73 | "ProcessTime_NotInt": "Process time round numbers has to be an integer.", 74 | "UnknownLanguage": "Unknown language. Language set back to 'en'." 75 | }, 76 | "StartingDebug": "Starting to debug {file}...", 77 | "unable-load-startup": "Unable to load startup.acpl-ini !", 78 | "UnableToInstall": "Unable to compile that kind of file (extension '.{extension}').", 79 | "unknown-command": "Unknown command.", 80 | "update_ProcessInvocationNotSupported": "{FAIL}Your system does not support the invocation of new Python processes.\nPlease run the {ITALICS}{OKGREEN}updater_main.py{ENDC}{FAIL} script manually.{ENDC}" 81 | }, 82 | "critic-errors": { 83 | "ImpossibleLoad_StartupIni": "Unable to load startup.acpl-ini !", 84 | "NameError_LanguageFile": "Unable to load the language file !" 85 | }, 86 | "errors": { 87 | "ArgumentMissing": "Arguments missing !", 88 | "ArgumentNotInt": "Argument should be integer !", 89 | "FunctionArgumentError": "{args_required} arguments required, got {args_nbr}.", 90 | "ImpossibleCast_Float": "Variable {var} cannot be casted as float.", 91 | "ImpossibleCast_Int": "Variable {var} cannot be casted as integer.", 92 | "IndexError": "The index is not existing.", 93 | "ListParsingError": "An error occurred while trying to parse the list \"{}\".", 94 | "TypeErrorBool": "List element no{i} '{list_element}' cannot be casted as boolan.", 95 | "TypeErrorFloat": "List element no{i} '{list_element}' cannot be casted as float.", 96 | "TypeErrorInt": "List element no{i} '{list_element}' cannot be casted as integer.", 97 | "UnexistingIndexError": "The index '{}' seems not to exist.", 98 | "VariableNotFound": "The variable \"{variable}\" is not existing or has been declared later in the code.", 99 | "VarNotFoundError": "The variable \"{variable}\" seems not to exist." 100 | }, 101 | "ide": { 102 | "ACPL_SystemFile": "This file is an ACPL system file, which means you cannot modify it.", 103 | "DisplayedLines": "{line1} lines displayed out of {line2}.", 104 | "IDE_SuccessfullyOpened": "ACPL IDE successfully opened", 105 | "UnableRunFile": "Unable to run that type of file (Extension : '{extension}').", 106 | "UnableRunFile_NoExtension": "Unable to run that type of file (No extension).", 107 | "UnableToDeleteCharacter": "Sorry, an unknown error occured.\nWe are unable to delete this character.\nPlease try again." 108 | }, 109 | "main": { 110 | "acpl_debugger": { 111 | "break": "Breaking loop.", 112 | "ConditionFalse": "Condition '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {FAIL}False", 113 | "ConditionTrue": "Condition '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {OKGREEN}True", 114 | "continue": "Going to next loop.", 115 | "CreatedFunction": "Created function '{WARNING}{function_name}{OKBLUE}' with arguments : {OKGREEN}{recreate_string}{OKBLUE} on line {line_numbers}.", 116 | "DeletedVariable": "Deleted variable '{OKGREEN}{var}{OKBLUE}' on line {line_numbers}.", 117 | "ExecutionStopped": "Execution stopped.", 118 | "ForLoop": "Looping {times} times using variable {OKGREEN}{line}", 119 | "StopOrContinue": "Press Enter to continue or type 'stop'/'end' to quit.", 120 | "variable": "Created variable '{OKGREEN}{line0}{OKBLUE}' with content {OKGREEN}{line2}{OKBLUE} on line {line_numbers}", 121 | "VariablesAtLineNO": "Variables for line {line_numbers} :", 122 | "WhileFalse": "Condition for while loop '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {FAIL}False{OKBLUE}\nSkipping loop.", 123 | "WhileTrue": "Condition for while loop '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {OKGREEN}True" 124 | }, 125 | "ProcessTime": "Process time", 126 | "ProgramStopped_Errors": "Debug has chosen to stop this program due to too many errors. Sorry for the inconvenience." 127 | }, 128 | "program-ended": "Program successfully stopped.", 129 | "statement-errors": { 130 | "has-been-raised": "has been raised for line", 131 | "on-line": "on line" 132 | }, 133 | "update-checker": { 134 | "CouldNotRewriteElement": "Couldn't rewrite {element} !", 135 | "DownloadingUpdate": "Downloading update...", 136 | "ElementRewritten": "{element} successfully rewritten !", 137 | "ExtractingUpdate": "Extracting update...", 138 | "ImpossibleDownloadError": "Error : Unable to download the update !", 139 | "NewVersionFound": "A new version has been found !\nYour version : {local_version}\nGitHub version : {github_version}\n", 140 | "RewritingElement": "Rewriting {element}...", 141 | "SeeChangelog": "Do you want to see the changelog ?", 142 | "UpdateApplied": "Update successfully applied !", 143 | "UpdateCancelled": "Update cancelled.\n{WARNING}If you want to update later, type 'update' in the console.", 144 | "UpdateSuccessfullyDownloaded": "Update successfully downloaded !", 145 | "UpdateSuccessfullyExtracted": "Update successfully extracted !", 146 | "WiFi_Off": "Unable to find version number.\nUpdate cancelled." 147 | } 148 | } -------------------------------------------------------------------------------- /trad_fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "compiler": { 3 | "CompilingConfirmation": "Ce fichier, à l'adresse \"{compiled_file_filename}\", existe déjà.\nÊtes vous sûr de vouloir le remplacer ?", 4 | "CompilingTime": "Temps de compilation", 5 | "FileCompiledWithStyle": "Fichier compilé avec le style ", 6 | "FileOpened": "Fichier ouvert avec succès.", 7 | "OpeningFile": "Fichier en cours d'ouverture...", 8 | "StartingCompilation": "Lancement de la compilation.", 9 | "Stop_TooManyErrors": "Le debug a choisi de stopper ce programme à cause de trop d'erreurs. Désolé pour le dérangement.", 10 | "WrongAnswer": "Mauvaise réponse" 11 | }, 12 | "console": { 13 | "bootup-message": "Console ACPL - dernière version stable : {} - {} - CC-BY-SA", 14 | "CannotRunFile": "Impossible de lancer ce fichier.", 15 | "ClosedIDE": "IDE fermé.", 16 | "console-correctly-reloaded": "Console correctement redémarrée.", 17 | "current-dev-build": "Build de développement actuel", 18 | "EndOfFile": "Fin du fichier.", 19 | "FileNotFound": "Impossible de trouver le fichier.", 20 | "FileSuccessfullyOpened": "Fichier ouvert avec succès.", 21 | "help": { 22 | "about": "Donne un message spécial de l'auteur concernant le langage ;)", 23 | "available-commands": "Commandes disponibles", 24 | "change-line": "Modifie une ligne spécifique dans un fichier en texte brut.", 25 | "compile": "Transpile un fichier ACPL vers un fichier Python.", 26 | "display": "Affiche le contenu du fichier demandé.", 27 | "end": "Termine le processus de la console.", 28 | "ini-content": "Affiche le contenu du fichier d'initialisation.", 29 | "lib": "Va respectivement installer, supprimmer, ou donner la documentation de la librairie spécifiée.", 30 | "modify-ini": "Modifie une variable spécifique dans le fichier 'startup.acpl-ini'. Meilleure aide avec 'modify-ini help all'.", 31 | "open": "Ouvre le fichier demandé dans son programme par défaut.", 32 | "pyrun": "Lance le fichier Python demandé.", 33 | "redo": "Réutilise la dernière commande.", 34 | "run": "Lance un fichier ACPL spécifique. Syntaxe : 'run '.", 35 | "settings": "Ouvre une boite de dialogue permettant de modifier vos paramètres.", 36 | "update": "Lance le programme de mise à jour.", 37 | "version": "Donne la dernière version stable et le build de développement actuel." 38 | }, 39 | "last-stable-release": "Dernière version stable", 40 | "launch-code-file": "Lancement de {}...", 41 | "LaunchingPyFile": "Lancement de {file}.", 42 | "LibDeleted": "Librairie {user_input} supprimmée.", 43 | "LibDoesNotExistError": "Erreur : La librairie n'existe pas !", 44 | "LibInstalled": "Librarie {user_input} installée !", 45 | "LibNotInstalled": "La librairie n'est pas présente sur cet ordinateur, donc impossible à désinstaller.", 46 | "LineModified": "Ligne {line} modifiée dans {filename} avec la valeur :\n{value}", 47 | "modify-ini": { 48 | "compile-code-file": "Compilation de {}...", 49 | "debug-state-help": "AIDE : la variable \"debug-state\" demande si vous voulez activer ou non le débug de développeur.\nType : Booléen.\nDefaut : False.\nActuel : {}.", 50 | "debug-state-modified": "Option debug-state correctement modifiée dans le fichier startup.acpl-ini avec la valeur {}.", 51 | "else-help": "Valeurs disponibles :\n\t- \"debug-state\"\n\t- \"lang\"\n\t- \"process-time-round-numbers\"\n\t- \"open-compiled-file\"\n\t- \"leave-comments-at-compiling\"\n\t- \"startup-check-update\"\n\nTapez \"modify-ini help \" pour une meilleure aide.", 52 | "lang-help": "AIDE : la variable \"lang\" est utilisée pour savoir dans quel langage le système doit être affiché.\nType : string.\nOptions possibles : \"en\", \"fr\", ou \"nl\".\nDefaut : en.\nActuel : {}.", 53 | "lang-modified": "Option lang modifiée correctement dans le fichier startup.acpl-ini avec la valeur {}.", 54 | "leave-comments-at-compiling": "HELP : the \"leave-comments-at-compiling\" statement is used to know if you want to keep the comments in the compiled python file (readability), or not (processing time).\nType : Bool.\nDefault : False.\nActual : {}.", 55 | "open-compiled-file": "HELP : the \"open-compiled-file\" statement is used to know if the file just compiled has to be opened at the end or not.\nType : Bool.\nDefault : False.\nActual : {}.", 56 | "process-time-round-numbers": "HELP : the \"process-time-round-numbers\" statement is used to know how many numbers will be behind the dot for the processing time.\nType : integer.\nDefault : 6.\nActual : {}.", 57 | "startup-check-update": "HELP : the \"startup-check-update\" statement is used to know if the console has to check update at startup or not.\nType : Bool.\nDefault : True.\nActual : {}.", 58 | "unable-to-modify-option": "Impossible de modifier cette option.", 59 | "use-colors-help": "AIDE : la variable \"use-colors\" est utilisée pour savoir si vous préférez utiliser les couleurs ou non. Certains systèmes d'exploitation ou logiciel ne le permettent pas.\nType : booléen.\nOptions possibles : \"True\" ou \"False\".\nDefaut : True.\nActuel : {}.", 60 | "use-colors-modified": "Option \"use-colors\" modifiée correctement dans startup.acpl-ini avec la valeur {}" 61 | }, 62 | "OpeningFile": "Ouverture de {file}.", 63 | "OpeningIDE": "Ouverture de l'IDE ACPL...", 64 | "output": "Retour", 65 | "process-ended": "Processus terminé.", 66 | "reloading": "Redémarrage de la console...", 67 | "Rerun": "Lancement du dernier fichier à nouveau...", 68 | "settings": { 69 | "ClosedAndSaved": "Paramètres fermés et enregistrés.", 70 | "DebugState_NotInt": "Debug state doit être un nombre entier.", 71 | "DebugState_Over3": "Impossible de mettre debug state au-dessus de 3.", 72 | "DebugState_Under0": "Impossible de mettre debug state en dessous de 0.", 73 | "ProcessTime_NotInt": "Process time round numbers doit être un nombre entier.", 74 | "UnknownLanguage": "Langue inconnue. Langue remise à 'en'." 75 | }, 76 | "StartingDebug": "Commencement du débogage de {file}...", 77 | "unable-load-startup": "Impossible de charger startup.acpl-ini !", 78 | "UnableToInstall": "Impossible de compiler ce type d'extension (extension '.{extension}').", 79 | "unknown-command": "Commande inconnue.", 80 | "update_ProcessInvocationNotSupported": "{FAIL}Votre système de supporte pas l'invocation de nouveaux processus Python.\nVeuillez lancer le script {ITALICS}{OKGREEN}updater_main.py{ENDC}{FAIL} manuellement.{ENDC}" 81 | }, 82 | "critic-errors": { 83 | "ImpossibleLoad_StartupIni": "Impossible de charger startup.acpl-ini !", 84 | "NameError_LanguageFile": "Impossible de charger le fichier de langues !" 85 | }, 86 | "errors": { 87 | "ArgumentMissing": "Arguments manquants !", 88 | "ArgumentNotInt": "L'argument devrait être un entier !", 89 | "FunctionArgumentError": "{args_required} arguments demandés, reçu {args_nbr}.", 90 | "ImpossibleCast_Float": "La variable {var} ne peut pas être transformée en nombre décimal.", 91 | "ImpossibleCast_Int": "La variable {var} ne peut pas être transformée en nombre entier.", 92 | "IndexError": "Cet indice n'existe pas.", 93 | "ListParsingError": "Une erreur est survenue durant la compilation de la liste \"{}\".", 94 | "TypeErrorBool": "L'élément de liste no{i} '{list_element}' ne peut pas être transformé en booléen.", 95 | "TypeErrorFloat": "L'élément de liste no{i} '{list_element}' ne peut pas être transformé en nombre décimal.", 96 | "TypeErrorInt": "L'élément de liste no{i} '{list_element}' ne peut pas être transformé en nombre entier.", 97 | "UnexistingIndexError": "L'indice '{}' semble ne pas exister.", 98 | "VariableNotFound": "La variable \"{variable}\" n'existe pas ou a été déclarée plus tard dans le code.", 99 | "VarNotFoundError": "La variable \"{variable}\" semble ne pas exister." 100 | }, 101 | "ide": { 102 | "ACPL_SystemFile": "Ce fichier est un fichier système ACPL, ce qui signifie que vous ne pouvez pas le modifier.", 103 | "DisplayedLines": "{line1}/{line2} lignes affichées.", 104 | "IDE_SuccessfullyOpened": "IDE ACPL ouvert avec succès.", 105 | "UnableRunFile": "Impossible de lancer ce type de fichier (Extension : '{extension}').", 106 | "UnableRunFile_NoExtension": "Impossible de lancer ce type de fichier (Pas d'extension).", 107 | "UnableToDeleteCharacter": "Désolé, une erreur inconnue s'est produite.\nImpossible de supprimmer ce caractère.\nVeuillez réessayer." 108 | }, 109 | "main": { 110 | "acpl_debugger": { 111 | "break": "Cassage de la boucle.", 112 | "ConditionFalse": "Condition '{ENDC}{line}{OKBLUE}' sur la ligne {line_numbers} marquée comme {FAIL}False", 113 | "ConditionTrue": "Condition '{ENDC}{line}{OKBLUE}' sur la ligne {line_numbers} marquée comme {OKGREEN}True", 114 | "continue": "Saut vers le prochain tour de boucle.", 115 | "CreatedFunction": "Fonction '{WARNING}{function_name}{OKBLUE}' créée avec les arguments : {OKGREEN}{recreate_string}{OKBLUE} sur la ligne {line_numbers}.", 116 | "DeletedVariable": "Variable '{OKGREEN}{var}{OKBLUE}' supprimée sur la ligne {line_numbers}.", 117 | "ExecutionStopped": "Fin de l'éxécution.", 118 | "ForLoop": "Bouclage pour {times} itérations en utilisant la varibale {OKGREEN}{line}", 119 | "StopOrContinue": "Appuyez sur 'Entrée' pour continuer ou tapez 'stop'/'end' pour quitter.", 120 | "variable": "Variable '{OKGREEN}{line0}{OKBLUE}' créée avec contenu '{OKGREEN}{line2}{OKBLUE}' sur la ligne {line_numbers}", 121 | "VariablesAtLineNO": "Variables au niveau de la ligne {line_numbers} :", 122 | "WhileFalse": "Condition pour la boucle while '{ENDC}{line}{OKBLUE}' sur la ligne {line_numbers} marquée comme {FAIL}False{OKBLUE}\nSaut de la boucle.", 123 | "WhileTrue": "Condition pour la boucle while '{ENDC}{line}{OKBLUE}' sur la ligne {line_numbers} marquée comme {OKGREEN}True" 124 | }, 125 | "ProcessTime": "Temps d'exécution", 126 | "ProgramStopped_Errors": "Le debug a choisi de stopper ce programme à cause de trop d'erreurs. Désolé du dérangement." 127 | }, 128 | "program-ended": "Programme terminé.", 129 | "statement-errors": { 130 | "has-been-raised": "a été appelé pour la ligne", 131 | "on-line": "sur la ligne" 132 | }, 133 | "update-checker": { 134 | "ask-install": "Voulez-vous l'installer ?", 135 | "console-restart": "Redémarrage de la console...", 136 | "CouldNotRewriteElement": "Impossible de réécrire {element} !", 137 | "DownloadingUpdate": "Téléchargement de la mise à jour...", 138 | "ElementRewritten": "{element} réécrit avec succès !", 139 | "extracting-all-files": "Extraction de tous les fichiers...", 140 | "ExtractingUpdate": "Extraction des fichiers...", 141 | "files-successfully-extracted": "Fichiers extraits avec succès.", 142 | "ImpossibleDownloadError": "Erreur : Impossible de télécharger cette mise à jour !", 143 | "NewVersionFound": "Une nouvelle version a été trouvée\nVotre version : {local_version}\nVersion sur GitHub : {github_version}\n", 144 | "old-files-deletion": "Supression des anciens fichiers...", 145 | "old-files-deletion-complete": "{} a été correctement supprimmé.", 146 | "removing-temp-files": "Suppression des fichiers temporaires...", 147 | "RewritingElement": "Réécriture de {element}...", 148 | "SeeChangelog": "Voulez-vous voir les notes de mise-à-jour ?", 149 | "temp-files-removed": "Les fichiers temporaires ont été supprimmés !", 150 | "unable-to-install": "Cette version modifie le fichier de recherche de mises à jour. À cause de cela, nous sommes incapables de le modifier automatiquement (à moins que vous vouliez que tout soit supprimmé).\nCe que nous pouvons faire est télécharger et extraire la nouvelle version là où l'ACPL est installé.\nDonc :\n\t- Allez voir le dossier \"ACPL-master\" dans le répertoire où l'ACPL est installé.\n\t- Tapez \"end\" dans la console.\n\t- Copiez-collez le contenu du dossier \"ACPL-master\" APRÈS AVOIR FERMÉ CETTE FENÊTRE et remplacez les anciens fichiers.", 151 | "update-applied": "Mise à jour appliquée !", 152 | "update-disponible-message": "Une nouvelle mise à jour ({}) est disponible !", 153 | "UpdateApplied": "Mise à jour appliquée avec succès !", 154 | "UpdateCancelled": "Mise à jour annulée.\n{WARNING}Si vous voulez mettre à jour plus tard, tapez 'update' dans la console.", 155 | "UpdateSuccessfullyDownloaded": "Mise à jour téléchargée avec succès !", 156 | "UpdateSuccessfullyExtracted": "Mise à jour extraite avec succès !", 157 | "WiFi_Off": "Impossible de trouver le numéro de version.\nMise à jour annulée." 158 | } 159 | } -------------------------------------------------------------------------------- /trad_it.json: -------------------------------------------------------------------------------- 1 | { 2 | "compiler": { 3 | "CompilingConfirmation": "This file, located at \"{compiled_file_filename}\" already exists.\nDo you want to replace it ?", 4 | "CompilingTime": "Compiling time", 5 | "FileCompiledWithStyle": "File compiled using style", 6 | "FileOpened": "File opened successfully", 7 | "OpeningFile": "File is being opened", 8 | "StartingCompilation": "Starting compilation.", 9 | "Stop_TooManyErrors": "Debug has chosen to stop this program due to too many errors. Sorry for the inconvenicence.", 10 | "WrongAnswer": "Wrong answer" 11 | }, 12 | "console": { 13 | "bootup-message": "Console ACPL - ultima versione stabile : {} - {} - CC-BY-SA", 14 | "CannotRunFile": "Cannot run this file.", 15 | "ClosedIDE": "IDE closed.", 16 | "console-correctly-reloaded": "Console correttamente rivviata.", 17 | "current-dev-build": "Costruzione attuale del sviluppo", 18 | "EndOfFile": "End of the file.", 19 | "FileNotFound": "File not found.", 20 | "FileSuccessfullyOpened": "File opened successfully.", 21 | "help": { 22 | "about": "Manda un messaggio speciale dell'autore relativo al linguaggio ;)", 23 | "available-commands": "Comandi disponibili", 24 | "change-line": "Modifies a specific line in a plain text file.", 25 | "compile": "Compiles an ACPL file to a Python file", 26 | "display": "Prints the content of a specified file.", 27 | "end": "Finsce il processo della console.", 28 | "ini-content": "Displays the content of the ini file.", 29 | "lib": "Respectively installs, delete, or gives the documentation of the specified lib.", 30 | "modify-ini": "Modifica una variabile specifica nel file 'startup.acpl-ini'. Aiuto migliore con 'modify-ini help all'.", 31 | "open": "Opens a specific file in its default program.", 32 | "pyrun": "Runs a specified python file", 33 | "redo": "Reuses the last command.", 34 | "run": "Avvia un file specifico. Sintassi : 'run '.", 35 | "settings": "Opens up a dialog box which allows you to tweak your settings", 36 | "update": "Launches the update program.", 37 | "version": "Indica l'ultima versione stabile e la costruzione del sviluppo." 38 | }, 39 | "last-stable-release": "ultima versione stabile", 40 | "launch-code-file": "Lancio di {}...", 41 | "LaunchingPyFile": "Launching {file}.", 42 | "LibDeleted": "Deleted lib {user_input}.", 43 | "LibDoesNotExistError": "Error : Lib does not exist !", 44 | "LibInstalled": "Library {user_input} installed !", 45 | "LibNotInstalled": "Lib not installed, unable to uninstall.", 46 | "LineModified": "Line {line} modified in {user_input[0]} with value :\n{value}", 47 | "modify-ini": { 48 | "compile-code-file": "Compilazione {}...", 49 | "debug-state-help": "AIUTO : la variabile \"debug-state\" chiede se vuole attivare o no il debug di sviluppatore.\nTipo : Booleano.\nPredefinito : False.\nAttuale : {}.", 50 | "debug-state-modified": "Opzione stato di debug correttamente modificata nel file startup.acpl-ini con la valore {}.", 51 | "else-help": "Valori disponibili :\n\t- \"debug-state\"\n\t- \"lang\"\n\t- \"process-time-round-numbers\"\n\t- \"open-compiled-file\"\n\t- \"leave-comments-at-compiling\"\n\t- \"startup-check-update\"\n\nDigita \"modify-ini help \" per un aiuto migliore.", 52 | "lang-help": "AIUTO : la variabile \"lang\" è usata per sapere in che linguaggio il sistema deve essere visualizzato .\nTipo : string.\nOpzioni possibili : \"en\", \"fr\", o \"nl\".\nPredefinito : en.\nAttuale : {}.", 53 | "lang-modified": "Opzione lang modificata correttamente nel file startup.acpl-ini con la valore {}.", 54 | "leave-comments-at-compiling": "HELP : the \"leave-comments-at-compiling\" statement is used to know if you want to keep the comments in the compiled python file (readability), or not (processing time).\nType : Bool.\nDefault : False.\nActual : {}.", 55 | "open-compiled-file": "HELP : the \"open-compiled-file\" statement is used to know if the file just compiled has to be opened at the end or not.\nType : Bool.\nDefault : False.\nActual : {}.", 56 | "process-time-round-numbers": "HELP : the \"process-time-round-numbers\" statement is used to know how many numbers will be behind the dot for the processing time.\nType : integer.\nDefault : 6.\nActual : {}.", 57 | "startup-check-update": "HELP : the \"startup-check-update\" statement is used to know if the console has to check update at startup or not.\nType : Bool.\nDefault : True.\nActual : {}.", 58 | "unable-to-modify-option": "Impossibile modificare questa opzione.", 59 | "use-colors-help": "AIUTO : la variabile \"use-colors\" è usata per sapere se prefera utilizzare i colori o no. Alcuni sistemi operativi o software non lo permettono.\nTipo : booleano.\nOpzioni possibili : \"True\" o \"False\".\nPredefinito : True.\nAttuale : {}.", 60 | "use-colors-modified": "Opzione \"use-colors\" modificata correttamente in startup.acpl-ini con la valore {}" 61 | }, 62 | "OpeningFile": "Opening {file}.", 63 | "OpeningIDE": "Opening ACPL IDE...", 64 | "output": "Uscita", 65 | "process-ended": "Processo finito.", 66 | "reloading": "Rivviare della console", 67 | "Rerun": "Running last file again...", 68 | "settings": { 69 | "ClosedAndSaved": "Settings closed and saved.", 70 | "DebugState_NotInt": "Debug state has to be an integer.", 71 | "DebugState_Over3": "Cannot set debug state over 3.", 72 | "DebugState_Under0": "Cannot set debug state under 0.", 73 | "ProcessTime_NotInt": "Process time round numbers has to be an integer.", 74 | "UnknownLanguage": "Unknown language. Language set back to 'en'." 75 | }, 76 | "StartingDebug": "Starting to debug {file}...", 77 | "unable-load-startup": "Impossibile caricare startup.acpl-ini !", 78 | "UnableToInstall": "Unable to compile that kind of file (extension '.{extension}').", 79 | "unknown-command": "Comando sconosciuto.", 80 | "update_ProcessInvocationNotSupported": "{FAIL}Your system does not support the invocation of new Python processes.\nPlease run the {ITALICS}{OKGREEN}updater_main.py{ENDC}{FAIL} script manually.{ENDC}" 81 | }, 82 | "critic-errors": { 83 | "ImpossibleLoad_StartupIni": "Impossibile caricare startup.acpl-ini !", 84 | "NameError_LanguageFile": "Impossibile caricare la lingua !" 85 | }, 86 | "errors": { 87 | "ArgumentMissing": "Arguments missing !", 88 | "ArgumentNotInt": "Argument should be integer !", 89 | "FunctionArgumentError": "{args_required} arguments required, got {args_nbr}.", 90 | "ImpossibleCast_Float": "Variable {var} cannot be casted as float.", 91 | "ImpossibleCast_Int": "Variable {var} cannot be casted as integer.", 92 | "IndexError": "The index is not existing.", 93 | "ListParsingError": "An error occurred while trying to parse the list \"{}\".", 94 | "TypeErrorBool": "List element no{i} '{list_element}' cannot be casted as boolan.", 95 | "TypeErrorFloat": "List element no{i} '{list_element}' cannot be casted as float.", 96 | "TypeErrorInt": "List element no{i} '{list_element}' cannot be casted as integer.", 97 | "UnexistingIndexError": "The index '{}' seems not to exist.", 98 | "VariableNotFound": "The variable \"{variable}\" is not existing or has been declared later in the code.", 99 | "VarNotFoundError": "The variable \"{variable}\" seems not to exist." 100 | }, 101 | "ide": { 102 | "ACPL_SystemFile": "This file is an ACPL system file, which means you cannot modify it.", 103 | "DisplayedLines": "{line1} lines displayed out of {line2}.", 104 | "IDE_SuccessfullyOpened": "ACPL IDE successfully opened", 105 | "UnableRunFile": "Unable to run that type of file (Extension : '{extension}').", 106 | "UnableRunFile_NoExtension": "Unable to run that type of file (No extension).", 107 | "UnableToDeleteCharacter": "Sorry, an unknown error occured.\nWe are unable to delete this character.\nPlease try again." 108 | }, 109 | "main": { 110 | "acpl_debugger": { 111 | "break": "Breaking loop.", 112 | "ConditionFalse": "Condition '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {FAIL}False", 113 | "ConditionTrue": "Condition '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {OKGREEN}True", 114 | "continue": "Going to next loop.", 115 | "CreatedFunction": "Created function '{WARNING}{function_name}{OKBLUE}' with arguments : {OKGREEN}{recreate_string}{OKBLUE} on line {line_numbers}.", 116 | "DeletedVariable": "Deleted variable '{OKGREEN}{var}{OKBLUE}' on line {line_numbers}.", 117 | "ExecutionStopped": "Execution stopped.", 118 | "ForLoop": "Looping {times} times using variable {OKGREEN}{line}", 119 | "StopOrContinue": "Press Enter to continue or type 'stop'/'end' to quit.", 120 | "variable": "Created variable '{OKGREEN}{line0}{OKBLUE}' with content {OKGREEN}{line2}{OKBLUE} on line {line_numbers}", 121 | "VariablesAtLineNO": "Variables for line {line_numbers} :", 122 | "WhileFalse": "Condition for while loop '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {FAIL}False{OKBLUE}\nSkipping loop.", 123 | "WhileTrue": "Condition for while loop '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {OKGREEN}True" 124 | }, 125 | "ProcessTime": "Process time", 126 | "ProgramStopped_Errors": "Debug has chosen to stop this program due to too many errors. Sorry for the inconvenience." 127 | }, 128 | "program-ended": "Programma finito.", 129 | "statement-errors": { 130 | "has-been-raised": "è stato chiamato per la linea ", 131 | "on-line": "sulla linea" 132 | }, 133 | "update-checker": { 134 | "ask-install": "Volete installarlo ?", 135 | "console-restart": "Rivviare della console...", 136 | "CouldNotRewriteElement": "Couldn't rewrite {element} !", 137 | "DownloadingUpdate": "Downloading update...", 138 | "ElementRewritten": "{element} successfully rewritten !", 139 | "extracting-all-files": "Estrazione di tutti i file...", 140 | "ExtractingUpdate": "Extracting update...", 141 | "files-successfully-extracted": "File extratto con sucesso.", 142 | "ImpossibleDownloadError": "Error : Unable to download the update !", 143 | "NewVersionFound": "A new version has been found !\nYour version : {local_version}\nGitHub version {github_version}\n", 144 | "old-files-deletion": "Soppressione dei vecchi file...", 145 | "old-files-deletion-complete": "{} è stato correttamente eliminato.", 146 | "removing-temp-files": "Sopressione dei file temporanei...", 147 | "RewritingElement": "Rewriting {element}...", 148 | "SeeChangelog": "Do you want to see the changelog ?", 149 | "temp-files-removed": "I file temporanei sono stati eliminati !", 150 | "unable-to-install": "Questa versione modifica il file della ricerca di aggiornamento. A causa di questo, siamo incapaci di modificarlo automaticamente (a meno che vuole che tutto sia eliminato).\nPossiamo scaricare et estrarre la nuova versione ladovve ACPL è installato.\nQuindi :\n\t- Trova la cartella \"ACPL-master\" nello reportario dove ACPL è installato.\n\t- Scrive \"end\" nella console.\n\t- Copia e incolla il contenuto della cartella \"ACPL-master\" DOPPO AVERE APRIRE QUESTA FINESTRA e sostituisce i vecchi file.", 151 | "update-applied": "Aggiornamento applicato !", 152 | "update-disponible-message": "Un nuovo aggiornamento ({}) è disponibile !", 153 | "UpdateApplied": "Update successfully applied !", 154 | "UpdateCancelled": "Update cancelled.\n{WARNING}If you want to update later, type 'update' in the console.", 155 | "UpdateSuccessfullyDownloaded": "Update successfully downloaded !", 156 | "UpdateSuccessfullyExtracted": "Update successfully extracted !", 157 | "WiFi_Off": "Unable to find version number.\nUpdate cancelled." 158 | } 159 | } -------------------------------------------------------------------------------- /trad_nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "compiler": { 3 | "CompilingConfirmation": "This file, located at \"{compiled_file_filename}\" already exists.\nDo you want to replace it ?", 4 | "CompilingTime": "Compiling time", 5 | "FileCompiledWithStyle": "File compiled using style", 6 | "FileOpened": "File opened successfully", 7 | "OpeningFile": "File is being opened", 8 | "StartingCompilation": "Starting compilation.", 9 | "Stop_TooManyErrors": "Debug has chosen to stop this program due to too many errors. Sorry for the inconvenicence.", 10 | "WrongAnswer": "Wrong answer" 11 | }, 12 | "console": { 13 | "bootup-message": "ACPL Console - laatste stabiele versie {} - {} CC-BY-SA", 14 | "CannotRunFile": "Cannot run this file.", 15 | "ClosedIDE": "IDE closed.", 16 | "console-correctly-reloaded": "Console correct herladen.", 17 | "current-dev-build": "Actuele dev build", 18 | "EndOfFile": "End of the file.", 19 | "FileNotFound": "File not found.", 20 | "FileSuccessfullyOpened": "File opened successfully.", 21 | "help": { 22 | "about": "Geeft een speciaal bericht van de auteur gebruikmakend van de taal ;)", 23 | "available-commands": "Beschikbare commando's", 24 | "change-line": "Modifies a specific line in a plain text file.", 25 | "compile": "Compiles an ACPL file to a Python file", 26 | "display": "Prints the content of a specified file.", 27 | "end": "Beëindigd het console proces.", 28 | "ini-content": "Displays the content of the ini file.", 29 | "lib": "Respectively installs, delete, or gives the documentation of the specified lib.", 30 | "modify-ini": "Modificeerd een specifieke verklaring in het ini bestand. Betere hulp met 'modify-ini help all'.", 31 | "open": "Opens a specific file in its default program.", 32 | "pyrun": "Runs a specified python file", 33 | "redo": "Reuses the last command.", 34 | "run": "Voert een specifiek bestand uit. Syntax: 'run '.", 35 | "settings": "Opens up a dialog box which allows you to tweak your settings", 36 | "update": "Launches the update program.", 37 | "version": "Geeft de laatste stabiele versie en de actuele dev build." 38 | }, 39 | "last-stable-release": "Laatste stabiele versie", 40 | "launch-code-file": "Starten {}...", 41 | "LaunchingPyFile": "Launching {file}.", 42 | "LibDeleted": "Deleted lib {user_input}.", 43 | "LibDoesNotExistError": "Error : Lib does not exist !", 44 | "LibInstalled": "Library {user_input} installed !", 45 | "LibNotInstalled": "Lib not installed, unable to uninstall.", 46 | "LineModified": "Line {line} modified in {user_input[0]} with value :\n{value}", 47 | "modify-ini": { 48 | "compile-code-file": "{} Compileren...", 49 | "debug-state-help": "HULP : De \"debug-state\" verklaring vraagt of je de devlopper debug aan of uit wilt zetten.\nType: boolean.\nStandaard : False.\nMomenteel : {}.", 50 | "debug-state-modified": "Optie debug-state correct gemodificeerd in startup.acpl-ini met waarde {}.", 51 | "else-help": "Mogelijke waardes :\n\t- \"debug-state\"\n\t- \"lang\"\n\t- \"process-time-round-numbers\"\n\t- \"open-compiled-file\"\n\t- \"leave-comments-at-compiling\"\n\t- \"startup-check-update\"\n\nType \"modify-ini help \" voor betere hulp.", 52 | "lang-help": "HULP : De \"lang\" verklaring hoort te weten in welke taal het systeem wordt weergegeven.\nType : string.\nMogelijke opties : \"en\", \"fr\", or \"nl\".\nStandaard : en.\nMomenteel : {}.", 53 | "lang-modified": "Optie lang correct gemodificeerd in startup.acpl-ini met waarde {}.", 54 | "leave-comments-at-compiling": "HELP : the \"leave-comments-at-compiling\" statement is used to know if you want to keep the comments in the compiled python file (readability), or not (processing time).\nType : Bool.\nDefault : False.\nActual : {}.", 55 | "open-compiled-file": "HELP : the \"open-compiled-file\" statement is used to know if the file just compiled has to be opened at the end or not.\nType : Bool.\nDefault : False.\nActual : {}.", 56 | "process-time-round-numbers": "HELP : the \"process-time-round-numbers\" statement is used to know how many numbers will be behind the dot for the processing time.\nType : integer.\nDefault : 6.\nActual : {}.", 57 | "startup-check-update": "HELP : the \"startup-check-update\" statement is used to know if the console has to check update at startup or not.\nType : Bool.\nDefault : True.\nActual : {}.", 58 | "unable-to-modify-option": "Niet mogelijk om deze optie aan te passen.", 59 | "use-colors-help": "HULP: de \"use-colors\" verklaring hoort te weten of je kleuren er voor kiest kleuren te gebruiken of niet. Sommige OS software staat dat niet toe.\nType : boolean.\nMogelijke opties : \"True\" of \"False\".\nStandaard : True.\nDaadwerkelijk : {}.", 60 | "use-colors-modified": "Optie \"use-colors\" correct gemodificeerd in startup.acpl-ini met waarde {}" 61 | }, 62 | "OpeningFile": "Opening {file}.", 63 | "OpeningIDE": "Opening ACPL IDE...", 64 | "output": "Uitvoer", 65 | "process-ended": "Proces beëindigd.", 66 | "reloading": "Console herladen...", 67 | "Rerun": "Running last file again...", 68 | "settings": { 69 | "ClosedAndSaved": "Settings closed and saved.", 70 | "DebugState_NotInt": "Debug state has to be an integer.", 71 | "DebugState_Over3": "Cannot set debug state over 3.", 72 | "DebugState_Under0": "Cannot set debug state under 0.", 73 | "ProcessTime_NotInt": "Process time round numbers has to be an integer.", 74 | "UnknownLanguage": "Unknown language. Language set back to 'en'." 75 | }, 76 | "StartingDebug": "Starting to debug {file}...", 77 | "unable-load-startup": "Niet mogelijk om startup.acpl-ini te laden!", 78 | "UnableToInstall": "Unable to compile that kind of file (extension '.{extension}').", 79 | "unknown-command": "Onbekend commando.", 80 | "update_ProcessInvocationNotSupported": "{FAIL}Your system does not support the invocation of new Python processes.\nPlease run the {ITALICS}{OKGREEN}updater_main.py{ENDC}{FAIL} script manually.{ENDC}" 81 | }, 82 | "critic-errors": { 83 | "ImpossibleLoad_StartupIni": "Kan startup.acpl-ini niet laden!", 84 | "NameError_LanguageFile": "Kan taal bestand niet laden !" 85 | }, 86 | "errors": { 87 | "ArgumentMissing": "Arguments missing !", 88 | "ArgumentNotInt": "Argument should be integer !", 89 | "FunctionArgumentError": "{args_required} arguments required, got {args_nbr}.", 90 | "ImpossibleCast_Float": "Variable {var} cannot be casted as float.", 91 | "ImpossibleCast_Int": "Variable {var} cannot be casted as integer.", 92 | "IndexError": "The index is not existing.", 93 | "ListParsingError": "An error occurred while trying to parse the list \"{}\".", 94 | "TypeErrorBool": "List element no{i} '{list_element}' cannot be casted as boolan.", 95 | "TypeErrorFloat": "List element no{i} '{list_element}' cannot be casted as float.", 96 | "TypeErrorInt": "List element no{i} '{list_element}' cannot be casted as integer.", 97 | "UnexistingIndexError": "The index '{}' seems not to exist.", 98 | "VariableNotFound": "The variable \"{variable}\" is not existing or has been declared later in the code.", 99 | "VarNotFoundError": "The variable \"{variable}\" seems not to exist." 100 | }, 101 | "ide": { 102 | "ACPL_SystemFile": "This file is an ACPL system file, which means you cannot modify it.", 103 | "DisplayedLines": "{line1} lines displayed out of {line2}.", 104 | "IDE_SuccessfullyOpened": "ACPL IDE successfully opened", 105 | "UnableRunFile": "Unable to run that type of file (Extension : '{extension}').", 106 | "UnableRunFile_NoExtension": "Unable to run that type of file (No extension).", 107 | "UnableToDeleteCharacter": "Sorry, an unknown error occured.\nWe are unable to delete this character.\nPlease try again." 108 | }, 109 | "main": { 110 | "acpl_debugger": { 111 | "break": "Breaking loop.", 112 | "ConditionFalse": "Condition '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {FAIL}False", 113 | "ConditionTrue": "Condition '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {OKGREEN}True", 114 | "continue": "Going to next loop.", 115 | "CreatedFunction": "Created function '{WARNING}{function_name}{OKBLUE}' with arguments : {OKGREEN}{recreate_string}{OKBLUE} on line {line_numbers}.", 116 | "DeletedVariable": "Deleted variable '{OKGREEN}{var}{OKBLUE}' on line {line_numbers}.", 117 | "ExecutionStopped": "Execution stopped.", 118 | "ForLoop": "Looping {times} times using variable {OKGREEN}{line}", 119 | "StopOrContinue": "Press Enter to continue or type 'stop'/'end' to quit.", 120 | "variable": "Created variable '{OKGREEN}{line0}{OKBLUE}' with content {OKGREEN}{line2}{OKBLUE} on line {line_numbers}", 121 | "VariablesAtLineNO": "Variables for line {line_numbers} :", 122 | "WhileFalse": "Condition for while loop '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {FAIL}False{OKBLUE}\nSkipping loop.", 123 | "WhileTrue": "Condition for while loop '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {OKGREEN}True" 124 | }, 125 | "ProcessTime": "Process time", 126 | "ProgramStopped_Errors": "Debug has chosen to stop this program due to too many errors. Sorry for the inconvenience." 127 | }, 128 | "program-ended": "Programma succesvol gestopt.", 129 | "statement-errors": { 130 | "has-been-raised": "is opgeroepen voor lijn", 131 | "on-line": "op regel" 132 | }, 133 | "update-checker": { 134 | "ask-install": "Wil je het installeren?", 135 | "console-restart": "Console herstarten...", 136 | "CouldNotRewriteElement": "Couldn't rewrite {element} !", 137 | "DownloadingUpdate": "Downloading update...", 138 | "ElementRewritten": "{element} successfully rewritten !", 139 | "extracting-all-files": "Alle bestanden uitpakken...", 140 | "ExtractingUpdate": "Extracting update...", 141 | "files-successfully-extracted": "Bestanden succesvol uitgepakt.", 142 | "ImpossibleDownloadError": "Error : Unable to download the update !", 143 | "NewVersionFound": "A new version has been found !\nYour version : {local_version}\nGitHub version {github_version}\n", 144 | "old-files-deletion": "Oude bestanden verwijderen...", 145 | "old-files-deletion-complete": "Succesvol {} verwijderd", 146 | "removing-temp-files": "Temp bestanden verwijderen...", 147 | "RewritingElement": "Rewriting {element}...", 148 | "SeeChangelog": "Do you want to see the changelog ?", 149 | "temp-files-removed": "Temp bestanden verwiderd!", 150 | "unable-to-install": "Deze update maakt veranderingen aan het update_checker bestand. Daarom is het niet mogelijk om hem automatisch te installeren. (Behalve als je wilt dat alles wordt verwijderd).\nWat we kunnen doen is de nieuwe versie downloaden en uitpakken in de folder waar ACPL is geïnstalleerd. \nDus :\n\t- Ga de \"ACPL-master\" map checken in de map waar ACPL is geïnstalleerd.\n\t- Type \"end\" in de console.\n\t- Copy-paste de content van \"ACPL-master\" NA HET SLUITEN VAN DIT VENSTER en vervang alle oude bestanden.", 151 | "update-applied": "Update toegepast!", 152 | "update-disponible-message": "Een nieuwe update ({}) is verkrijgbaar!", 153 | "UpdateApplied": "Update successfully applied !", 154 | "UpdateCancelled": "Update cancelled.\n{WARNING}If you want to update later, type 'update' in the console.", 155 | "UpdateSuccessfullyDownloaded": "Update successfully downloaded !", 156 | "UpdateSuccessfullyExtracted": "Update successfully extracted !", 157 | "WiFi_Off": "Unable to find version number.\nUpdate cancelled." 158 | } 159 | } -------------------------------------------------------------------------------- /trad_tr.json: -------------------------------------------------------------------------------- 1 | { 2 | "compiler": { 3 | "CompilingConfirmation": "This file, located at \"{compiled_file_filename}\" already exists.\nDo you want to replace it ?", 4 | "CompilingTime": "Compiling time", 5 | "FileCompiledWithStyle": "File compiled using style", 6 | "FileOpened": "File opened successfully", 7 | "OpeningFile": "File is being opened", 8 | "StartingCompilation": "Starting compilation.", 9 | "Stop_TooManyErrors": "Debug has chosen to stop this program due to too many errors. Sorry for the inconvenicence.", 10 | "WrongAnswer": "Wrong answer" 11 | }, 12 | "console": { 13 | "bootup-message": "ACPL Konsolu - son kararlı sürüm {} - {} - CC-BY-SA", 14 | "CannotRunFile": "Cannot run this file.", 15 | "ClosedIDE": "IDE closed.", 16 | "console-correctly-reloaded": "Konsol doğru şekilde yeniden yüklendi.", 17 | "current-dev-build": "Mevcut geliştirme", 18 | "EndOfFile": "End of the file.", 19 | "FileNotFound": "File not found.", 20 | "FileSuccessfullyOpened": "File opened successfully.", 21 | "help": { 22 | "about": "Yazardan dil ile ilgili özel bir mesaj verir ;)", 23 | "available-commands": "Kullanılabilir komutlar", 24 | "change-line": "Modifies a specific line in a plain text file.", 25 | "compile": "Compiles an ACPL file to a Python file", 26 | "display": "Prints the content of a specified file.", 27 | "end": "Konsol işlemini sonlandırır.", 28 | "ini-content": "Displays the content of the ini file.", 29 | "lib": "Respectively installs, delete, or gives the documentation of the specified lib.", 30 | "modify-ini": "ini dosyasındaki belirli bir ifadeyi değiştirir. 'modify-ini help all' ile daha iyi yardım'.", 31 | "open": "Opens a specific file in its default program.", 32 | "pyrun": "Runs a specified python file", 33 | "redo": "Reuses the last command.", 34 | "run": "belirli bir dosyayı çalıştırır. Sözdizimi : 'run '.", 35 | "settings": "Opens up a dialog box which allows you to tweak your settings", 36 | "update": "Launches the update program.", 37 | "version": "Son kararlı sürümü ve gerçek geliştirmeyi sağlar." 38 | }, 39 | "last-stable-release": "Son kararlı sürüm", 40 | "launch-code-file": "Başlatılıyor {}...", 41 | "LaunchingPyFile": "Launching {file}.", 42 | "LibDeleted": "Deleted lib {user_input}.", 43 | "LibDoesNotExistError": "Error : Lib does not exist !", 44 | "LibInstalled": "Library {user_input} installed !", 45 | "LibNotInstalled": "Lib not installed, unable to uninstall.", 46 | "LineModified": "Line {line} modified in {user_input[0]} with value :\n{value}", 47 | "modify-ini": { 48 | "compile-code-file": "{} Derleniyor...", 49 | "debug-state-help": "YARDIM :\"debug-state\" ifadesi size geliştirici hata ayıklamasını etkinleştirmek veya devre dışı bırakmak isteyip istemediğinizi sorar.\nTip : boolean.\nVarsayılan : False.\nGerçek : {}.", 50 | "debug-state-modified": "Seçenek hata-ayıklama-durumu startup.acpl-ini içinde değerle doğru şekilde değiştirildi {}.", 51 | "else-help": "Kullanılabilir Değerler :\n\t- \"debug-state\"\n\t- \"lang\"\n\t- \"process-time-round-numbers\"\n\t- \"open-compiled-file\"\n\t- \"leave-comments-at-compiling\"\n\t- \"startup-check-update\"\n\nType \"modify-ini help \" ile daha iyi yardım.", 52 | "lang-help": "YARDIM : \"lang\" ifadesi sistemin hangi dilde görüntülendiğini bilmek için kullanılır.\nTür : string.\nOlası seçenekler : \"en\", \"fr\", or \"nl\".\nVarsayılan : en.\nGerçek : {}.", 53 | "lang-modified": "Option lang modified correctly in startup.acpl-ini with value {}.", 54 | "leave-comments-at-compiling": "HELP : the \"leave-comments-at-compiling\" statement is used to know if you want to keep the comments in the compiled python file (readability), or not (processing time).\nType : Bool.\nDefault : False.\nActual : {}.", 55 | "open-compiled-file": "HELP : the \"open-compiled-file\" statement is used to know if the file just compiled has to be opened at the end or not.\nType : Bool.\nDefault : False.\nActual : {}.", 56 | "process-time-round-numbers": "HELP : the \"process-time-round-numbers\" statement is used to know how many numbers will be behind the dot for the processing time.\nType : integer.\nDefault : 6.\nActual : {}.", 57 | "startup-check-update": "HELP : the \"startup-check-update\" statement is used to know if the console has to check update at startup or not.\nType : Bool.\nDefault : True.\nActual : {}.", 58 | "unable-to-modify-option": "Bu seçenek değiştirilemiyor.", 59 | "use-colors-help": "YARDIM : \"use-colors\" ifadesi renkleri kullanmayı tercih edip etmediğinizi bilmek için kullanılır. Bazı işletim sistemleri veya yazılımlar buna izin vermez.\nTür : booléen.\nOlası seçenekler : \"True\" veya \"False\".\nVarsayılan : True.\nGerçek : {}.", 60 | "use-colors-modified": "\"use-colors\" seçeneği, startup.acpl-ini'de değerle doğru şekilde değiştirildi {}" 61 | }, 62 | "OpeningFile": "Opening {file}.", 63 | "OpeningIDE": "Opening ACPL IDE...", 64 | "output": "Çıktı", 65 | "process-ended": "İşlem sona erdi.", 66 | "reloading": "Konsol yeniden yükleniyor...", 67 | "Rerun": "Running last file again...", 68 | "settings": { 69 | "ClosedAndSaved": "Settings closed and saved.", 70 | "DebugState_NotInt": "Debug state has to be an integer.", 71 | "DebugState_Over3": "Cannot set debug state over 3.", 72 | "DebugState_Under0": "Cannot set debug state under 0.", 73 | "ProcessTime_NotInt": "Process time round numbers has to be an integer.", 74 | "UnknownLanguage": "Unknown language. Language set back to 'en'." 75 | }, 76 | "StartingDebug": "Starting to debug {file}...", 77 | "unable-load-startup": "startup.acpl-ini yüklenemiyor !", 78 | "UnableToInstall": "Unable to compile that kind of file (extension '.{extension}').", 79 | "unknown-command": "Bilinmeyen komut.", 80 | "update_ProcessInvocationNotSupported": "{FAIL}Your system does not support the invocation of new Python processes.\nPlease run the {ITALICS}{OKGREEN}updater_main.py{ENDC}{FAIL} script manually.{ENDC}" 81 | }, 82 | "critic-errors": { 83 | "ImpossibleLoad_StartupIni": "startup.acpl-ini yüklenemiyor!", 84 | "NameError_LanguageFile": "Dil dosyası yüklenemiyor !" 85 | }, 86 | "errors": { 87 | "ArgumentMissing": "Arguments missing !", 88 | "ArgumentNotInt": "Argument should be integer !", 89 | "FunctionArgumentError": "{args_required} arguments required, got {args_nbr}.", 90 | "ImpossibleCast_Float": "Variable {var} cannot be casted as float.", 91 | "ImpossibleCast_Int": "Variable {var} cannot be casted as integer.", 92 | "IndexError": "The index is not existing.", 93 | "ListParsingError": "An error occurred while trying to parse the list \"{}\".", 94 | "TypeErrorBool": "List element no{i} '{list_element}' cannot be casted as boolan.", 95 | "TypeErrorFloat": "List element no{i} '{list_element}' cannot be casted as float.", 96 | "TypeErrorInt": "List element no{i} '{list_element}' cannot be casted as integer.", 97 | "UnexistingIndexError": "The index '{}' seems not to exist.", 98 | "VariableNotFound": "The variable \"{variable}\" is not existing or has been declared later in the code.", 99 | "VarNotFoundError": "The variable \"{variable}\" seems not to exist." 100 | }, 101 | "ide": { 102 | "ACPL_SystemFile": "This file is an ACPL system file, which means you cannot modify it.", 103 | "DisplayedLines": "{line1} lines displayed out of {line2}.", 104 | "IDE_SuccessfullyOpened": "ACPL IDE successfully opened", 105 | "UnableRunFile": "Unable to run that type of file (Extension : '{extension}').", 106 | "UnableRunFile_NoExtension": "Unable to run that type of file (No extension).", 107 | "UnableToDeleteCharacter": "Sorry, an unknown error occured.\nWe are unable to delete this character.\nPlease try again." 108 | }, 109 | "main": { 110 | "acpl_debugger": { 111 | "break": "Breaking loop.", 112 | "ConditionFalse": "Condition '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {FAIL}False", 113 | "ConditionTrue": "Condition '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {OKGREEN}True", 114 | "continue": "Going to next loop.", 115 | "CreatedFunction": "Created function '{WARNING}{function_name}{OKBLUE}' with arguments : {OKGREEN}{recreate_string}{OKBLUE} on line {line_numbers}.", 116 | "DeletedVariable": "Deleted variable '{OKGREEN}{var}{OKBLUE}' on line {line_numbers}.", 117 | "ExecutionStopped": "Execution stopped.", 118 | "ForLoop": "Looping {times} times using variable {OKGREEN}{line}", 119 | "StopOrContinue": "Press Enter to continue or type 'stop'/'end' to quit.", 120 | "variable": "Created variable '{OKGREEN}{line0}{OKBLUE}' with content {OKGREEN}{line2}{OKBLUE} on line {line_numbers}", 121 | "VariablesAtLineNO": "Variables for line {line_numbers} :", 122 | "WhileFalse": "Condition for while loop '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {FAIL}False{OKBLUE}\nSkipping loop.", 123 | "WhileTrue": "Condition for while loop '{ENDC}{line}{OKBLUE}' on line {line_numbers} marked as {OKGREEN}True" 124 | }, 125 | "ProcessTime": "Process time", 126 | "ProgramStopped_Errors": "Debug has chosen to stop this program due to too many errors. Sorry for the inconvenience." 127 | }, 128 | "program-ended": "Program başarıyla durduruldu.", 129 | "statement-errors": { 130 | "has-been-raised": "hat için yükseltildi", 131 | "on-line": "çevrimiçi" 132 | }, 133 | "update-checker": { 134 | "ask-install": "Do you want to install it ?", 135 | "console-restart": "Konsolu yeniden başlatır...", 136 | "CouldNotRewriteElement": "Couldn't rewrite {element} !", 137 | "DownloadingUpdate": "Downloading update...", 138 | "ElementRewritten": "{element} successfully rewritten !", 139 | "extracting-all-files": "Tüm dosyalar ayıklanıyor...", 140 | "ExtractingUpdate": "Extracting update...", 141 | "files-successfully-extracted": "Dosyalar başarıyla ayıklandı.", 142 | "ImpossibleDownloadError": "Error : Unable to download the update !", 143 | "NewVersionFound": "A new version has been found !\nYour version : {local_version}\nGitHub version {github_version}\n", 144 | "old-files-deletion": "Eski dosyalar siliniyor...", 145 | "old-files-deletion-complete": "Başarıyla silindi {}.", 146 | "removing-temp-files": "Geçici dosyalar kaldırılıyor...", 147 | "RewritingElement": "Rewriting {element}...", 148 | "SeeChangelog": "Do you want to see the changelog ?", 149 | "temp-files-removed": "Geçici dosyalar kaldırıldı !", 150 | "unable-to-install": "Bu sürüm update_checker dosyasında değişiklik yapıyor. Bu nedenle, otomatik olarak yükleyemiyoruz (her şeyin silinmesini istemiyorsanız).\nYapabileceğimiz, ACPL'in yüklü olduğu klasördeki yeni sürümü indirip ayıklamaktır.\nSo :\n\t-ACPL'in yüklü olduğu klasörde \"ACPL-master\" klasörünü kontrol edin.\n\t- Konsola \"end\" yazın. BU PENCEREYİ KAPATIP tüm eski dosyaları değiştirdikten sonra \n\t-\"ACPL-master\" içeriğini kopyalayıp yapıştırın.", 151 | "update-applied": "Güncelleme uygulandı !", 152 | "update-disponible-message": "Yeni bir güncelleme ({}) kullanılabilir !", 153 | "UpdateApplied": "Update successfully applied !", 154 | "UpdateCancelled": "Update cancelled.\n{WARNING}If you want to update later, type 'update' in the console.", 155 | "UpdateSuccessfullyDownloaded": "Update successfully downloaded !", 156 | "UpdateSuccessfullyExtracted": "Update successfully extracted !", 157 | "WiFi_Off": "Unable to find version number.\nUpdate cancelled." 158 | } 159 | } -------------------------------------------------------------------------------- /updater_main.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file implements auto-updates for the ACPL. 3 | This one will update all the necessary file, except this one and the startup file. 4 | """ 5 | import requests 6 | from recurrent_classes import * 7 | import sys 8 | import urllib.request 9 | from packaging import version 10 | import zipfile 11 | from time import sleep 12 | from random import randint 13 | 14 | stop = False 15 | 16 | # Test if internet is available 17 | try: 18 | urllib.request.urlopen('http://google.com') 19 | except: # If impossible 20 | stop = True 21 | 22 | if stop is False: 23 | # Import of startup file to get version 24 | startup_file = open("startup.acpl-ini", "r") 25 | 26 | # Defining of version as None 27 | local_version = None 28 | 29 | # Browse through startup file to get version 30 | for line in startup_file.readlines(): 31 | if line.startswith("version"): 32 | line = line.replace("version: ", "", 1) 33 | line = remove_suffix(line, line.endswith("\n")) 34 | local_version = line 35 | 36 | # If version hasn't been found 37 | if local_version is None: 38 | print(bcolors.FAIL + texts.updates["WiFi_Off"] + bcolors.ENDC) 39 | stop = True 40 | 41 | if stop is False: 42 | # Getting last github version. 43 | response = requests.get("https://api.github.com/repos/megat69/ACPL/releases/latest") 44 | zip_link = response.json()['assets'][0]["browser_download_url"] 45 | github_version = response.json()["tag_name"] 46 | 47 | # Decide if an update is available on GitHub 48 | update = version.parse(github_version) > version.parse(local_version) 49 | 50 | if update is False: 51 | stop = True 52 | 53 | if stop is False: 54 | # Ask the user if he wants to update 55 | # TEXT : A new version has been found ! 56 | # Your version : {local_version} 57 | # GitHub version {github_version} 58 | print(bcolors.OKGREEN + texts.updates["NewVersionFound"].format(local_version=local_version, 59 | github_version=github_version) + bcolors.ENDC) 60 | 61 | update = input(f"{bcolors.OKBLUE}Do you want to update ? (yes/no){bcolors.ENDC} ") 62 | if update[0].lower() != "y": 63 | # Update cancelled.\n{bcolors.WARNING}If you want to update later, type 'update' in the console. 64 | print(bcolors.FAIL + texts.updates["UpdateCancelled"].format(WARNING=bcolors.WARNING) + bcolors.ENDC) 65 | stop = True 66 | 67 | if stop is False: 68 | # Download the update as zip file 69 | r = requests.get(zip_link) 70 | existing = r.status_code == 200 71 | if not existing: 72 | print(bcolors.FAIL + texts.updates["ImpossibleDownloadError"] + bcolors.ENDC) 73 | stop = True 74 | if stop is False: 75 | print(bcolors.OKBLUE + texts.updates["DownloadingUpdate"] + bcolors.ENDC) 76 | with open("update.zip", "wb") as code: 77 | code.write(r.content) 78 | code.close() 79 | print(bcolors.OKGREEN + texts.updates["UpdateSuccessfullyDownloaded"] + bcolors.ENDC + "\n\n") 80 | 81 | # Creating a folder for the zip content 82 | if not os.path.exists("update"): 83 | os.mkdir("update") 84 | # Extracting the zip 85 | print(bcolors.OKBLUE + texts.updates["ExtractingUpdate"] + bcolors.ENDC) 86 | with zipfile.ZipFile("update.zip","r") as zip_ref: 87 | zip_ref.extractall("update") 88 | print(bcolors.OKGREEN + texts.updates["UpdateSuccessfullyExtracted"] + bcolors.ENDC) 89 | 90 | # Getting the list of the new files 91 | updated_files = os.listdir("update") 92 | 93 | # Rewriting the old files 94 | for element in updated_files: 95 | if element != "updater_main.py" and element != "startup.acpl-ini": 96 | print(bcolors.OKBLUE + texts.updates["RewritingElement"].format(element=element) + bcolors.ENDC) 97 | old_file = open(element, "w", encoding="utf-8") 98 | new_file = open("update/"+element, "r", encoding="utf-8") 99 | try: 100 | old_file.writelines(new_file.readlines()) 101 | except: 102 | pass 103 | old_file.close() 104 | new_file.close() 105 | # Random interval :P 106 | sleep(float(f"{randint(0, 1)}.{randint(0, 100)}")) 107 | print(bcolors.OKBLUE + texts.updates["ElementRewritten"].format(element=element) + bcolors.ENDC) 108 | 109 | launch_py_file("updater_others") 110 | -------------------------------------------------------------------------------- /updater_others.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file implements auto-updates for the ACPL. 3 | This file will update the other update file and the startup file. 4 | """ 5 | import os 6 | import shutil 7 | from recurrent_classes import * 8 | from time import sleep 9 | 10 | # Updating the main updater 11 | print(bcolors.OKBLUE + texts.updates["RewritingElement"].format(element="updater_main.py") + bcolors.ENDC) 12 | old_file = open("updater_main.py", "r", encoding="utf-8") 13 | old_lines = old_file.readlines() 14 | try: 15 | old_file = open("updater_main.py", "w", encoding="utf-8") 16 | new_file = open("update/updater_main.py", "r", encoding="utf-8") 17 | old_file.writelines(new_file.readlines()) 18 | old_file.close() 19 | new_file.close() 20 | print(bcolors.OKBLUE + texts.updates["ElementRewritten"].format(element="updater_main.py") + bcolors.ENDC) 21 | except: 22 | old_file.writelines(old_lines) 23 | old_file.close() 24 | print(bcolors.FAIL + texts.updates["CouldNotRewritElement"].format(element="updater_main") + bcolors.ENDC) 25 | del old_lines 26 | 27 | startup_file = open("startup.acpl-ini", "r") 28 | new_startup_file = open("update/startup.acpl-ini", "r") 29 | 30 | # Getting the old settings 31 | old_settings = {} 32 | for line in startup_file: 33 | line = remove_suffix(line, line.endswith("\n")) 34 | line = line.split(": ") 35 | old_settings[line[0]] = line[1] 36 | 37 | # Getting the new settings 38 | new_settings = {} 39 | for line in new_startup_file: 40 | line = remove_suffix(line, line.endswith("\n")) 41 | line = line.split(": ") 42 | new_settings[line[0]] = line[1] 43 | 44 | # Setting up final settings 45 | final_settings = {} 46 | for element in new_settings: 47 | if element != "version" and element in old_settings.keys(): 48 | final_settings[element] = old_settings[element] 49 | else: 50 | final_settings[element] = new_settings[element] 51 | 52 | # Putting final settings in startup.acpl-ini 53 | # Closing the old files first 54 | startup_file.close() 55 | new_startup_file.close() 56 | # Opening it in write mode 57 | startup_file = open("startup.acpl-ini", "w", encoding="utf-8") 58 | # Creating a list of its lines 59 | new_startup_lines = [] 60 | for element in final_settings: 61 | new_startup_lines.append(f"{element}: {final_settings[element]}\n") 62 | # Writing them inside and closing it 63 | startup_file.writelines(new_startup_lines) 64 | startup_file.close() 65 | 66 | # Removing the temp files and folders 67 | os.remove("update.zip") 68 | shutil.rmtree(os.getcwd()+"/update", ignore_errors=True) 69 | 70 | # Updating dependencies 71 | print(f"{bcolors.OKBLUE}Updating dependencies...{bcolors.ENDC}") 72 | os.system("pip install -r --upgrade requirements.txt") 73 | print(f"{bcolors.OKGREEN}Dependencies updated successfully !{bcolors.ENDC}") 74 | 75 | # Changelog 76 | print(f"\n\n{bcolors.BOLD}{bcolors.OKGREEN}{texts.updates['UpdateApplied']}{bcolors.ENDC}") 77 | sleep(2) 78 | user_input = input(f"{texts.updates['SeeChangelog']} (yes/no)\n") 79 | if user_input[0].lower() == "y": 80 | changelog_file = open("changelog.md", "r") 81 | changelog = changelog_file.readlines() 82 | changelog_file.close() 83 | changelog = md_format(changelog) 84 | print(changelog) 85 | --------------------------------------------------------------------------------