Skip to content

Commit

Permalink
fix samedec check (again) (very dumb fix someone make it better soon) (
Browse files Browse the repository at this point in the history
…#39)

* Add Contribution Tutorial

* Fix Samedec Check (very dumb fix someone edit it later)

* fix the fatal mistake called a string is always true

* gitignore update

* make it less dumb
  • Loading branch information
reggietorres authored Mar 10, 2024
1 parent 7a8ee41 commit 2f7c2ef
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
qrcodes/
__pycache__
secret_key.txt
ssl_cert.pem
ssl_key.key
.log
.config
25 changes: 10 additions & 15 deletions asmara.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,28 +243,23 @@ def __decoder__(self):
sev=severity.trace,
)
try:
if not (
"samedec 0.1."
in Popen(["samedec", "-V"], stdout=PIPE)
.communicate()[0]
.decode("UTF-8")
.strip()
):
utilities.autoPrint(
text=f"SAMEDEC is not version 0.2 or higher! Recommended version is 0.2.3.",
classType="DECODER",
sev=severity.fatal,
)
AS_MAN.killAsmara()
exit(1)
else:
samedec_version = Popen(["samedec", "-V"], stdout=PIPE).communicate()[0].decode("UTF-8").strip()
if not samedec_version.startswith("samedec 0.1."):
self.__decode__ = Popen(
["samedec", "-r", "24000"],
stdout=PIPE,
stdin=PIPE,
stderr=PIPE,
bufsize=1,
)
else:
utilities.autoPrint(
text=f"SAMEDEC is not version 0.2 or higher! Recommended version is 0.2.3.",
classType="DECODER",
sev=severity.fatal,
)
AS_MAN.killAsmara()
exit(1)
except FileNotFoundError:
utilities.autoPrint(
text=f"Samedec is not installed on the computer. Please install SAMEDEC 0.2.3 or higher.",
Expand Down

0 comments on commit 2f7c2ef

Please sign in to comment.