Skip to content

Commit

Permalink
2.4 is out !
Browse files Browse the repository at this point in the history
  • Loading branch information
megat69 authored Jun 9, 2020
1 parent 461e8db commit 27f6e7c
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 14 deletions.
54 changes: 54 additions & 0 deletions az.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"console": {
"bootup-message": "ACPL Konsolu - Son sabit buraxılış{} - {} - CC-BY-SA",
"process-ended": "Proses bitdi.",
"launch-code-file": " {} Başladılır..",
"last-stable-release": "Son sabit buraxılış",
"current-dev-build": "Hazırki development quruluşu",
"modify-ini": {
"debug-state-modified": "Seçim ayılama vəziyyəti {} ilə startup.acpl-ini uğurla dəyişdirildi.",
"lang-modified": "Seçim dilinin vəziyyəti {} ilə startup.acpl-ini uğurla dəyişdirildi.",
"use-colors-modified": "Seçim \"rəngləri-işlət\"vəziyyəti {} ilə startup.acpl-ini uğurla dəyişdirildi.",
"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 : {}.",
"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 : {}.",
"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: {}.",
"else-help": "Mövcüd Seçimlər :\n\t- \"debug-state\"\n\t- \"lang\"\n\nType \"modify-ini help <statement>\" çox yaxşı kömək üçün.",
"unable-to-modify-option": "Bu seçimi dəyişdirmək mümkün deyil."
},
"help": {
"available-commands": "Mümkün Komandalar",
"end": "Konsol prosesini bitirir.",
"run": "Spesifik faylı çalışdırar : 'run <fayl>'.",
"about": "Dil haqqında müəllifdən xüsusi bir mesaj verir",
"version": "Ən son sabit versiya və aktual dev quruluşu haqqında məlumat verir.",
"modify-ini": "Faylda spesifik ifadəni dəyişdirir. Ətraflı məlumat üçün 'modify-ini help all'."
},
"output": "Çıxış",
"reloading": "Konsol təzələnir..",
"unknown-command": "Bilinməyən komanda.",
"unable-load-startup": "'startup.acpl-ini'ni Başlatmaq mümkün deyil!",
"console-correctly-reloaded": "Konsol düzgün olaraq başladıldı"
},
"critic-errors": {
"NameError_LanguageFile": "Dil faylını yükləmək mümkün deyil !",
"ImpossibleLoad_StartupIni": "'startul.acpl-ini'ni başlatmaq mümkün deyil !"
},
"statement-errors": {
"on-line": "Xətdə",
"has-been-raised": "Xətt üçün qaldırıldı."
},
"update-checker": {
"update-disponible-message":"Yeni güncəlləmə ({}) Mövcuddur!",
"ask-install": "Endirmək istəyirsən?",
"old-files-deletion": "Köhnə fayllar silinir..",
"old-files-deletion-complete": " {} Uğurla silindi.",
"extracting-all-files": "Bütün fayllar çıxarılır..",
"files-successfully-extracted": "Fayllar uğurla çıxardıldı.",
"removing-temp-files": "Lazımsız fayllar silinir..",
"temp-files-removed": "Lazımsız fayllar silindi!",
"update-applied": "Güncəlləmə qəbul edildi!",
"console-restart": "Konsol yenidən başladılır..",
"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."
},
"program-ended": "Proqram uğurla dayandırıldı."
}
32 changes: 28 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import json
from recurrent_classes import *
import os

import msvcrt

# Files opening
try:
Expand Down Expand Up @@ -41,6 +41,7 @@

if lines.startswith("lang: "):
lines = lines.replace("lang: ", "")
lines = lines.replace("\n", "")
language = lines

try:
Expand Down Expand Up @@ -97,6 +98,8 @@

# Instructions
for line in code_lines:
if msvcrt.kbhit() and msvcrt.getch() == chr(27).encode():
sys.exit()
was_if = False
line_numbers += 1
if "/*" in line:
Expand Down Expand Up @@ -179,7 +182,7 @@
error(line_numbers, "StatementError", "Statement missing.")
break
elif line.startswith("var "):
line = line.replace("var ", "")
line = line.replace("var ", "", 1)
if line.endswith("\n"):
line = split(line)
line.pop()
Expand All @@ -202,7 +205,7 @@
line = line.replace(name, "", 1)
break
actual_state = "var"
line = line.replace("=", "")
line = line.replace("=", "", 1)
while line.startswith(" "):
line = split(line)
line.pop(0)
Expand Down Expand Up @@ -304,12 +307,33 @@
else:
error(line_numbers, "UnexistingLibError", "Lib is not existing or has not been installed.")
break
elif line.startswith("lib"):
line = line.replace("lib ", "", 1)
for lib in used_libs:
if lib in line:
with open(f"libs/lib_{lib}.py", "r") as lib_content:
lib_content = lib_content.readlines()
with open("temp.py", "w+") as executable:
for i in range(len(lib_content)):
if "var_line" in lib_content[i]:
line = line.replace("\n", "")
lib_content[i] = lib_content[i].replace("var_line", f'"{line}"')
lib_content[i] = lib_content[i].replace("VARIABLES_CONTAINER", str(variables_container))
executable.writelines(lib_content)
#print(variables_container)
if "variables" in lib_content[1]:
with open("var_transfer.json", "r+", encoding="utf-8") as transfer_file:
variables_container = json.load(transfer_file)
transfer_file.close()
os.remove(f"{os.getcwd()}/var_transfer.json")
#print(variables_container)
executable.close()
os.system("python temp.py")
elif line != "" and line != " " and line != "\n" and was_if == False:
error(line_numbers, "Error", "Unknown function or method !")

debug("other", lineno(), variables_container)

print(f"\n{bcolors.OKBLUE}{texts.texts['program-ended']}{bcolors.ENDC}")

code_file.close()
debug_file.close()
Expand Down
4 changes: 2 additions & 2 deletions startup.acpl-ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
filename: code
filename: compiler_test1
lang: en
version: 2.3.1-
version: 2.4
current-version: Pre2.3f_H12
debug-state: False
console-reloaded: False
Expand Down
3 changes: 2 additions & 1 deletion trad_az.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"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 : {}.",
"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: {}.",
"else-help": "Mövcüd Seçimlər :\n\t- \"debug-state\"\n\t- \"lang\"\n\nType \"modify-ini help <statement>\" çox yaxşı kömək üçün.",
"unable-to-modify-option": "Bu seçimi dəyişdirmək mümkün deyil."
"unable-to-modify-option": "Bu seçimi dəyişdirmək mümkün deyil.",
"compile-code-file":"{} Tərtib edilir..."
},
"help": {
"available-commands": "Mümkün Komandalar",
Expand Down
3 changes: 2 additions & 1 deletion trad_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"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 : {}.",
"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 : {}.",
"else-help": "Available values :\n\t- \"debug-state\"\n\t- \"lang\"\n\nType \"modify-ini help <statement>\" for better help.",
"unable-to-modify-option": "Unable to modify this option."
"unable-to-modify-option": "Unable to modify this option.",
"compile-code-file": "Compiling {}..."
},
"help": {
"available-commands": "Available commands",
Expand Down
3 changes: 2 additions & 1 deletion trad_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"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 : {}.",
"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 : {}.",
"else-help": "Valeurs disponibles :\n\t- \"debug-state\"\n\t- \"lang\"\n\t- \"use-colors\"\nTapez \"modify-ini help <variable>\" pour une meilleure aide.",
"unable-to-modify-option": "Impossible de modifier cette option."
"unable-to-modify-option": "Impossible de modifier cette option.",
"compile-code-file": "Compilation de {}..."
},
"help": {
"available-commands": "Available commands",
Expand Down
3 changes: 2 additions & 1 deletion trad_it.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"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 : {}.",
"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 : {}.",
"else-help": "Valori disponibili :\n\t- \"debug-state\"\n\t- \"lang\"\n\t- \"use-colors\"\nDigita \"modify-ini help <variabile>\" per un aiuto migliore.",
"unable-to-modify-option": "Impossibile modificare questa opzione."
"unable-to-modify-option": "Impossibile modificare questa opzione.",
"compile-code-file": "Compilazione {}..."
},
"help": {
"available-commands": "Comandi disponibili",
Expand Down
3 changes: 2 additions & 1 deletion trad_nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"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 : {}.",
"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 : {}.",
"else-help": "Mogelijke waardes :\n\t- \"debug-state\"\n\t- \"lang\"\n\nType \"modify-ini help <verklaring>\" voor betere hulp.",
"unable-to-modify-option": "Niet mogelijk om deze optie aan te passen."
"unable-to-modify-option": "Niet mogelijk om deze optie aan te passen.",
"compile-code-file": "{} Compileren..."
},
"help": {
"available-commands": "Beschikbare commando's",
Expand Down
3 changes: 2 additions & 1 deletion trad_tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"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 : {}.",
"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 : {}.",
"else-help": "Kullanılabilir Değerler :\n\t- \"debug-state\"\n\t- \"lang\"\n\nType \"modify-ini help <statement>\" ile daha iyi yardım.",
"unable-to-modify-option": "Bu seçenek değiştirilemiyor."
"unable-to-modify-option": "Bu seçenek değiştirilemiyor.",
"compile-code-file": "{} Derleniyor..."
},
"help": {
"available-commands": "Kullanılabilir komutlar",
Expand Down
9 changes: 7 additions & 2 deletions update_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ def ask_update_program(url):

if "-" in current_version:
current_version = str(current_version.replace("-", ""))
current_version = int(current_version)

current_version = current_version.split(".") # Version currently installed
last_version = line.split(".") # Version disponible online
Expand All @@ -175,7 +174,13 @@ def ask_update_program(url):
if len(current_version) < 3:
current_version.append("0")

if "-" not in last_version:
for i in last_version:
if "-" in i:
cannot_update = True
break
else:
cannot_update = False
if cannot_update is False:
if int(current_version[0]) < int(last_version[0]):
ask_update_program('https://github.com/megat69/ACPL/archive/master.zip')
elif int(current_version[1]) < int(last_version[1]):
Expand Down

0 comments on commit 27f6e7c

Please sign in to comment.