mirror of
https://github.com/c9moser/sgbackup.git
synced 2026-01-19 19:40:13 +00:00
2025.03.03 07:03:26 (desktop)
This commit is contained in:
parent
741c0d7ad2
commit
2fe13e7da3
@ -3,6 +3,10 @@
|
|||||||
|
|
||||||
SELF="$( realpath "$0" )"
|
SELF="$( realpath "$0" )"
|
||||||
PROJECT_DIR="$( dirname "$SELF")"
|
PROJECT_DIR="$( dirname "$SELF")"
|
||||||
|
: ${PYTHON_VENV_DIR:=$(cygpath "$USERPROFILE")/python-venv}
|
||||||
|
venv="${PYTHON_VENV_DIR}/sgbackup"
|
||||||
|
venv_bin="${venv}/bin"
|
||||||
|
wvenv_bin="$(cygpath -w "$venv_bin")"
|
||||||
|
|
||||||
PACKAGES="gtk4 gobject-introspection python-pip python-gobject python-rapidfuzz"
|
PACKAGES="gtk4 gobject-introspection python-pip python-gobject python-rapidfuzz"
|
||||||
|
|
||||||
@ -14,38 +18,59 @@ done
|
|||||||
pacman -Sy
|
pacman -Sy
|
||||||
pacman -S --noconfirm $_install_pkg
|
pacman -S --noconfirm $_install_pkg
|
||||||
|
|
||||||
cd $PROJECT_DIR
|
if [ ! -f "$venv/bin/activate" ]; then
|
||||||
pip install --break-system-packages --verbose --user .
|
python -m venv --system-site-packages "$venv"
|
||||||
|
|
||||||
bindir=$( realpath ~/bin )
|
|
||||||
wbindir=$( cygpath -w "$bindir" )
|
|
||||||
if [ ! -d "$bindir" ]; then
|
|
||||||
mkdir -p "$bindir"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pythonpath="$( python -c 'import sys; print(sys.executable)' )"
|
. "$venv/bin/activate"
|
||||||
pythonwpath="$( pythonw -c 'import sys; print(sys.executable)' )"
|
|
||||||
cat > "${bindir}/sgbackup" << EOF
|
cd $PROJECT_DIR
|
||||||
|
pip install --verbose --user .
|
||||||
|
|
||||||
|
bindir=$( realpath "$venv/bin" )
|
||||||
|
wbindir=$( cygpath -w "$bindir" )
|
||||||
|
|
||||||
|
pythonpath="$( python -c 'import sys; print(sys.executable.replace("/","\\"))' )"
|
||||||
|
pythonwpath="$( pythonw -c 'import sys; print(sys.executable.replace("/","\\"))' )"
|
||||||
|
cat > "${venv_bin}/sgbackup" << EOF
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
. "$venv_bin/activate"
|
||||||
|
|
||||||
python -m sgbackup "\$@"
|
python -m sgbackup "\$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > "${bindir}/sgbackup.cmd" << EOF
|
cat > "${venv_bin}/sgbackup.cmd" << EOF
|
||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
"$pythonpath" -m sgbackup %*
|
powershell -File "$wvenv_bin\\sgbackup.ps1" %*
|
||||||
EOF
|
EOF
|
||||||
unix2dos "${bindir}/sgbackup.cmd"
|
unix2dos "${venv_bin}/sgbackup.cmd"
|
||||||
|
|
||||||
cat > "${bindir}/gsgbackup" << EOF
|
cat > "${venv_bin}/sgbackup.ps1" << EOF
|
||||||
|
Set-ExecutionPolicy Unrestricted -Scope Process -Force
|
||||||
|
|
||||||
|
$wvenv_bin\\activate.ps1
|
||||||
|
|
||||||
|
$pythonpath -m sgbackup $args
|
||||||
|
EOF
|
||||||
|
unix2dos "$venv_bin/sgbackup.ps1"
|
||||||
|
|
||||||
|
cat > "${venv_bin}/gsgbackup.ps1" << EOF
|
||||||
|
$wvenv_bin\\activate.ps1
|
||||||
|
$pythonpath -m sgbackup.gui $args
|
||||||
|
EOF
|
||||||
|
unix2dos "$venv_bin/gsgbackup.ps1"
|
||||||
|
|
||||||
|
cat > "${venv_bin}/gsgbackup" << EOF
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
python -m sgbackup.gui "\$@"
|
python -m sgbackup.gui "\$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > "${bindir}/gsgbackup.cmd" << EOF
|
cat > "${venv_bin}/gsgbackup.cmd" << EOF
|
||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
"$pythonpath" -m sgbackup.gui %*
|
cd $Env:userprofile
|
||||||
|
"$wvenv_bin\\gsgbackup.ps1" %*
|
||||||
EOF
|
EOF
|
||||||
unix2dos "${bindir}/gsgbackup.cmd"
|
unix2dos "${bindir}/gsgbackup.cmd"
|
||||||
|
|
||||||
@ -64,8 +89,8 @@ Copy-Item -Path "$wproject_dir\\sgbackup\\icons\\sgbackup.ico" -Destination "\$p
|
|||||||
foreach (\$dir in \$desktop_dir,\$startmenu_dir) {
|
foreach (\$dir in \$desktop_dir,\$startmenu_dir) {
|
||||||
\$shell=New-Object -ComObject WScript.Shell
|
\$shell=New-Object -ComObject WScript.Shell
|
||||||
\$shortcut=\$shell.CreateShortcut("\$dir\\sgbackup.lnk")
|
\$shortcut=\$shell.CreateShortcut("\$dir\\sgbackup.lnk")
|
||||||
\$shortcut.TargetPath='$pythonpath'
|
\$shortcut.TargetPath='powershell'
|
||||||
\$shortcut.Arguments='-m sgbackup.gui'
|
\$shortcut.Arguments='-WindowStyle hidden -File "$wvenv_bin\\gsgbackup.ps1"'
|
||||||
\$shortcut.IconLocation="\$picture_dir\\sgbackup.ico"
|
\$shortcut.IconLocation="\$picture_dir\\sgbackup.ico"
|
||||||
\$shortcut.Save()
|
\$shortcut.Save()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -173,6 +173,7 @@ class ArchiverManager(GObject):
|
|||||||
game.savegame_name,
|
game.savegame_name,
|
||||||
game.savegame_type.value,
|
game.savegame_type.value,
|
||||||
game.savegame_subdir)
|
game.savegame_subdir)
|
||||||
|
if os.path.isdir(directory):
|
||||||
files=list(sorted(os.listdir(directory),reverse=True))
|
files=list(sorted(os.listdir(directory),reverse=True))
|
||||||
if len(files) > settings.backup_versions:
|
if len(files) > settings.backup_versions:
|
||||||
for backup_file in files[settings.backup_versions:]:
|
for backup_file in files[settings.backup_versions:]:
|
||||||
|
|||||||
@ -1129,7 +1129,7 @@ class GameDialog(Gtk.Dialog):
|
|||||||
if self.get_is_valid_savegame_type(SavegameType.STEAM_MACOS):
|
if self.get_is_valid_savegame_type(SavegameType.STEAM_MACOS):
|
||||||
data = get_steam_data(self.__steam.macos)
|
data = get_steam_data(self.__steam.macos)
|
||||||
if self.__game.steam.macos:
|
if self.__game.steam.macos:
|
||||||
g = self.__game.steam_macos
|
g = self.__game.steam.macos
|
||||||
g.savegame_root = data['sgroot']
|
g.savegame_root = data['sgroot']
|
||||||
g.savegame_dir = data['sgdir']
|
g.savegame_dir = data['sgdir']
|
||||||
g.variables = data['variables']
|
g.variables = data['variables']
|
||||||
|
|||||||
@ -2,25 +2,26 @@
|
|||||||
keys=root
|
keys=root
|
||||||
|
|
||||||
[handlers]
|
[handlers]
|
||||||
keys=consoleHandler,fileHandler
|
keys=consoleHandler
|
||||||
|
#keys=consoleHanlder,fileHandler
|
||||||
[formatters]
|
[formatters]
|
||||||
keys=consoleFormatter,fileFormatter
|
keys=consoleFormatter,fileFormatter
|
||||||
|
|
||||||
[logger_root]
|
[logger_root]
|
||||||
level=DEBUG
|
level=DEBUG
|
||||||
handlers=consoleHandler,fileHandler
|
handlers=consoleHandler
|
||||||
|
#handlers=consoleHandler,fileHandler
|
||||||
|
|
||||||
[handler_consoleHandler]
|
[handler_consoleHandler]
|
||||||
class=StreamHandler
|
class=StreamHandler
|
||||||
formatter=consoleFormatter
|
formatter=consoleFormatter
|
||||||
level=INFO
|
level=INFO
|
||||||
|
|
||||||
[handler_fileHandler]
|
#[handler_fileHandler]
|
||||||
class=handlers.RotatingFileHandler
|
#class=handlers.RotatingFileHandler
|
||||||
args=('sgbackup.log','a',10485760,10,'UTF-8',False,)
|
#args=('sgbackup.log','a',10485760,10,'UTF-8',False)
|
||||||
formatter=fileFormatter
|
#formatter=fileFormatter
|
||||||
level=DEBUG
|
#level=DEBUG
|
||||||
|
|
||||||
[formatter_consoleFormatter]
|
[formatter_consoleFormatter]
|
||||||
format=[%(levelname)s:%(name)s] %(message)s
|
format=[%(levelname)s:%(name)s] %(message)s
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user