Skip to content

Commit

Permalink
func update & exe-release
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffy-melli committed Dec 25, 2024
1 parent 4eddd9b commit 31b436d
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 6 deletions.
Binary file added exe-release/asset/NanumBarunpenB.ttf
Binary file not shown.
Binary file added exe-release/asset/sclatIcon.ico
Binary file not shown.
Binary file added exe-release/asset/sclatIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exe-release/asset/sclatLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exe-release/sclat.exe
Binary file not shown.
4 changes: 4 additions & 0 deletions exe-release/setting/server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"max-client": 5,
"last-server": ""
}
6 changes: 6 additions & 0 deletions exe-release/setting/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"discord_RPC": true,
"volume": 40,
"file-save-dir": "./asset/storage",
"Subtitle-Lang": "ko"
}
Binary file added exe-release/update.exe
Binary file not shown.
6 changes: 1 addition & 5 deletions sclat.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ a = Analysis(
['sclat\\sclat.py'],
pathex=[],
binaries=[],
datas=[
('asset/*', 'asset'),
('setting/*', 'setting')
],
hiddenimports=[],
hookspath=[],
hooksconfig={},
Expand All @@ -32,7 +28,7 @@ exe = EXE(
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
Expand Down
2 changes: 1 addition & 1 deletion sclat/gui/gui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import chardet, cv2, time, sys, re, os

sys.stdout = open(os.devnull, 'w')
#sys.stdout = open(os.devnull, 'w')
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'
from pyvidplayer2 import Video
from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions scripts/-build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ echo "install modules..."
pip install -r requirements.txt
echo "pyinstaller start..."
pyinstaller ./sclat.spec
pyinstaller ./update.spec
deactivate
39 changes: 39 additions & 0 deletions update.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- mode: python ; coding: utf-8 -*-

a = Analysis(
['update\\update.py'],
pathex=[],
binaries=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)

pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='update',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='./asset/sclatIcon.ico',
onefile=True
)
43 changes: 43 additions & 0 deletions update/download/github.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import os
import zipfile
import requests

def download():
try:
response = requests.get('https://github.com/fluffy-melli/sclat/archive/refs/heads/main.zip')
response.raise_for_status()
except requests.exceptions.RequestException as e:
print(f"HTTP GET Fail: {e}")
return
try:
with open('-install.zip', 'wb') as out_file:
out_file.write(response.content)
except IOError as e:
print(f"File Creation Fail: {e}")
return
if not unzip('-install.zip'):
return

def unzip(filename):
dest_dir = os.path.join(".install")
try:
with zipfile.ZipFile(filename, 'r') as zip_ref:
zip_ref.extractall(dest_dir)
except zipfile.BadZipFile as e:
print(f"Can't open zip file: {e}")
return False
except Exception as e:
print(f"Error extracting zip file: {e}")
return False
return True

def extract_file(zip_ref, file_info, dest_path):
try:
with zip_ref.open(file_info) as source_file:
with open(dest_path, 'wb') as dest_file:
dest_file.write(source_file.read())
os.chmod(dest_path, file_info.external_attr >> 16)
except Exception as e:
print(f"Can't extract file: {e}")
return False
return True
3 changes: 3 additions & 0 deletions update/update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from download import github

github.download()

0 comments on commit 31b436d

Please sign in to comment.