diff --git a/README.md b/README.md index e28d430..3dc19e9 100755 --- a/README.md +++ b/README.md @@ -1,14 +1,28 @@ -# RuGiVi - Adult media landscape browser + +![](img/rugivi_title_800.png) + +

RuGiVi - Adult media landscape browser

+ RuGiVi enables you to fly over your image and video collection and view thousands of images and video frames at once. Zoom in and out from one image to small thumbnails with your mousewheel in seconds. All images are grouped as you have them on your disk and arranged in a huge landscape. RuGiVi can work with hundred thousand of images at once. +
+ +[Install for Windows](#windows-installation)      [Install for Linux](#ubuntu-linux-installation) + +
+ +## Screenshots + +![](img/7.jpg) + RuGiVi integrates fully into the [Fapel-System](https://github.com/pronopython/fapel-system), so you can travel trough your collection and tag images as you fly over them! Fly over thumbnails and zoom in on any image anytime in an instant! > :eggplant: :sweat_drops: *Note: All sample images on this page are censored* -![](img/7.jpg) + Image Landscape generation from your directory structure: @@ -94,125 +108,59 @@ You can also export a world map: # Installation - ## Ubuntu Linux Installation -### 1. Clone this repository - -Download or clone the [latest release](https://github.com/pronopython/rugivi/releases/latest/) into a writeable directory. - -### 2. Install python tkinter and pillow - -`sudo apt-get install python3-tk python3-pil.imagetk` - -### 3. Install RuGiVi via pip - -In the repo's root run - -`chmod +x install_ubuntu.sh` +Install python tkinter and pillow -`./install_ubuntu.sh` + ```bash + sudo apt-get install python3-tk python3-pil.imagetk + ``` -It installs RuGiVi via Python's PIP and creates start menu entries. +install RuGiVi via pip, run -> :cherries: *Do not run the install_ubuntu.sh as root (sudo), as it would create config files for root user and not for you* + ```bash + pip install rugivi + ``` +and start RuGiVi -### 4. Configure RuGiVi + ```bash + rugivi + ``` -Proceed with [Configure RuGiVi](#configure-rugivi) (you need to do this!) - -## Ubuntu Linux Upgrade - -If you upgrade from a previous version of RuGiVi, follow these steps. - -Note that it is advised to backup your databases (see further below). - -### 1. Clone this repository - -Download or clone the [latest release](https://github.com/pronopython/rugivi/releases/latest/) into a writeable directory. - -### 2. Uninstall old version with pip - -Run - -`pip uninstall rugivi` - -to uninstall the old version, but leave config file and database intact. - -### 3. Install RuGiVi via pip - -Run - -`pip install .` - -in the repository root (the one containing the `setup.py` file) - -### 4. Configure RuGiVi - -Proceed with [Configure RuGiVi](#configure-rugivi) (you need to do this!) +RuGiVi will open up its configurator at the first start, see [Configure RuGiVi](#configure-rugivi). ## Windows Installation +Download and install Python 3: [https://www.python.org/downloads/windows/](https://www.python.org/downloads/windows/) -### 1. Clone or download this repo - -Download or clone the [latest release](https://github.com/pronopython/rugivi/releases/latest/) into a writeable directory. - -### 2. Install Python +Open a command window (press Windows+R then type cmd.exe and start it) -Download and install Python 3 +Type and run -[https://www.python.org/downloads/windows/](https://www.python.org/downloads/windows/) + ``` + pip install rugivi + ``` +after that start rugivi, in the command window run: -### 3. Install RuGiVi via pip + ``` + rugivi + ``` -Start (doubleclick) `install_windows.bat` - -It installs RuGiVi via Python's PIP and creates the start menu entries. - - -### 4. Configure RuGiVi - -Proceed with [Configure RuGiVi](#configure-rugivi) (you need to do this, because it migrates your config file!) - - -## Windows Upgrade - -If you upgrade from a previous version of RuGiVi, follow these steps. - -Note that it is advised to backup your databases (see further below). - -### 1. Clone this repository - -Download or clone the [latest release](https://github.com/pronopython/rugivi/releases/latest/) into a writeable directory. - -### 2. Run upgrade batch file - -Doubleclick - -`upgrade_windows_installation.bat` - -to uninstall the old version, but leave config file and database intact and then automatically install the new version. - -### 3. Configure RuGiVi - -Proceed with [Configure RuGiVi](#configure-rugivi) (you need to do this, because it migrates your config file!) +RuGiVi will open up its configurator at the first start, see [Configure RuGiVi](#configure-rugivi). +You can create start menu entries with the configurator. # Configure RuGiVi +After starting rugivi for the first time, you must configure the locations of various files. -Run `rugivi_configurator`: - -![](img/202401125.png) - -Change the entries to fit your setup. +If you want to get started and just run RuGiVi, just change the blue entries! -> :cherries: *You must save the settings on the first run of RuGiVi even if you change nothing here* +![](img/configurator.png) |Setting | Description | |-----------------|------------------------------------------------------------------------------------| -|Crawler root directory | This is the root directory of all the pictures you want to explore within RuGiVi | +|Images & videos root directory| This is the root directory of all the pictures and videos you want to explore within RuGiVi | |Crawler World DB File | This is the database file the "world" (the position of all files on the screen) is saved to| |Thumb DB File| The Database containing all thumbnails. *This can be several GB in size!*| |Enable video crawling|When "true", RuGiVi will also parse video files| @@ -222,19 +170,32 @@ Change the entries to fit your setup. | Status font size | Font size of the grey status area| | FapTable parent dirs | See FapTables | | FapTable single dirs | See FapTables | +| create start menu entries | Check if you want to have RuGiVi as icon in your start menu | > :cherries: *You must use a new World DB File or delete the old one when changing root directory* -> :cherries: *rugivi_configurator migrates your old config file when you upgrade from a previous version of RuGiVi. Make sure to press "save and exit" even when you do not change settings yourself!* +> :cherries: *rugivi_configurator migrates your old config file when you upgrade from a previous version of RuGiVi. Make sure to press "Apply and exit" even when you do not change settings yourself!* Make sure your database files are placed on a SSD drive! +To open the configurator again later, open a terminal / command window (under Windows press Windows+R then type cmd.exe and start it) and run + +``` +rugivi_configurator +``` + # Start RuGiVi You can start RuGiVi via the start menu entry. ![](img/2301.png) +or via console / command window, just run: + + ``` + rugivi + ``` + ![](img/2303.png) RuGiVi opens with an additional terminal window showing some log. @@ -751,6 +712,24 @@ Don't want to use GitHub? You can also contact me via email: pronopython@proton. # Release Notes +## v0.5.0-alpha + +### added + +- PyPi Support: RuGiVi can now be installed via pip (PyPi) directly + +### changed + +- rugivi starts rugivi_configurator if necessary (because of PyPi support) +- rugivi_configurator now creates a complete config file if necessary (because of PyPi support) +- rugivi_configurator creates start menu entries if desired (because of PyPi support) + +## v0.4.1-alpha + +### fixed + +- install now requires specific versions of modules + ## v0.4.0-alpha ### added diff --git a/img/202401125.png b/img/202401125.png deleted file mode 100755 index 66e213d..0000000 Binary files a/img/202401125.png and /dev/null differ diff --git a/img/configurator.png b/img/configurator.png new file mode 100644 index 0000000..3c9bb54 Binary files /dev/null and b/img/configurator.png differ diff --git a/img/rugivi_title_800.png b/img/rugivi_title_800.png new file mode 100644 index 0000000..c9d0655 Binary files /dev/null and b/img/rugivi_title_800.png differ diff --git a/install_ubuntu.sh b/install_ubuntu.sh deleted file mode 100755 index 993eb08..0000000 --- a/install_ubuntu.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/bash -# -############################################################################################## -# -# RuGiVi - Adult Media Landscape Browser -# -# For updates see git-repo at -# https://github.com/pronopython/rugivi -# -############################################################################################## -# -# Copyright (C) PronoPython -# -# Contact me at pronopython@proton.me -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################################################## -# - -CONFIGDIR=~/.config -INSTALLDIR="" - - - - -echo "RuGiVi installer" -echo "" -echo "The installer now creates the program dirs and config files." -echo "Sudo is needed for some actions." -echo "" - -#pip install . - - -if ! type "rugivi_printModuleDir" >/dev/null 2>&1; then - echo "Installing RuGiVi module via pip" - pip install . - echo "" -fi - - -INSTALLDIR="$(rugivi_printModuleDir)" - -echo "RuGiVi module installed in: ${INSTALLDIR}" -echo "" - -echo "Copying config file..." -cp -i $INSTALLDIR/rugivi.conf $CONFIGDIR/rugivi.conf - -echo "Creating Database dir..." - -mkdir ~/.local/share/rugivi - -echo "Changing permissions on installed module files" -sudo chmod 0755 $INSTALLDIR/*.py -#sudo chmod 0755 $INSTALLDIR/*.sh -sudo chmod 0644 $INSTALLDIR/*.conf - - -echo "" - -echo "Creating start menu entries..." - -DESKTOPFILE=~/.local/share/applications/RuGiVi.desktop - -touch $DESKTOPFILE - -echo "[Desktop Entry]" > $DESKTOPFILE -echo "Name=RuGiVi" >> $DESKTOPFILE -echo "Exec=rugivi" >> $DESKTOPFILE -echo "Terminal=false" >> $DESKTOPFILE -echo "Type=Application" >> $DESKTOPFILE -echo "Icon=${INSTALLDIR}/icon.png" >> $DESKTOPFILE - - -DESKTOPFILE=~/.local/share/applications/RuGiVi-Configurator.desktop - -touch $DESKTOPFILE - -echo "[Desktop Entry]" > $DESKTOPFILE -echo "Name=RuGiVi Configurator" >> $DESKTOPFILE -echo "Exec=rugivi_configurator" >> $DESKTOPFILE -echo "Terminal=false" >> $DESKTOPFILE -echo "Type=Application" >> $DESKTOPFILE -echo "Icon=${INSTALLDIR}/icon.png" >> $DESKTOPFILE - - - - - -echo "done" - -echo "" - -echo "You can configure RuGiVi by running 'rugivi_configurator'" -echo "Start rugivi with 'rugivi'" -echo "You also find both within the start menu." - diff --git a/install_windows.bat b/install_windows.bat deleted file mode 100755 index 441eac3..0000000 --- a/install_windows.bat +++ /dev/null @@ -1,65 +0,0 @@ -@echo off -REM ############################################################################################## -REM # -REM # RuGiVi - Adult Media Landscape Browser -REM # -REM # For updates see git-repo at -REM # https://github.com/pronopython/rugivi -REM # -REM ############################################################################################## -REM # -REM # Copyright (C) PronoPython -REM # -REM # Contact me at pronopython@proton.me -REM # -REM # This program is free software: you can redistribute it and/or modify it -REM # under the terms of the GNU General Public License as published by the -REM # Free Software Foundation, either version 3 of the License, or -REM # (at your option) any later version. -REM # -REM # This program is distributed in the hope that it will be useful, -REM # but WITHOUT ANY WARRANTY; without even the implied warranty of -REM # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -REM # GNU General Public License for more details. -REM # -REM # You should have received a copy of the GNU General Public License -REM # along with this program. If not, see . -REM # -REM ############################################################################################## - -REM pip install . - -WHERE rugivi_printModuleDir -IF %ERRORLEVEL% NEQ 0 ( - ECHO installing RuGiVi module via pip - REM ECHO pip install . - pip install . - REM pause - REM exit 0 -) - -for /f %%i in ('rugivi_printModuleDir') do set INSTALLDIR=%%i -echo RuGiVi module installed in: %INSTALLDIR% - -echo. -echo Installing config file... - - -set CONFIGDIR=%AppData%\RuGiVi -mkdir "%CONFIGDIR%" -copy /-Y "%INSTALLDIR%\rugivi_windows.conf" "%CONFIGDIR%\rugivi.conf" - -echo. -echo Installing Start Menu shortcut - -pyshortcut -n RuGiVi -i "%INSTALLDIR%\icon.ico" "%INSTALLDIR%\..\..\..\Scripts\rugivi.exe" -pyshortcut -n "RuGiVi Configurator" -i "%INSTALLDIR%\icon.ico" "%INSTALLDIR%\..\..\..\Scripts\rugivi_configurator.exe" - -echo done - - -echo You can configure RuGiVi by running 'rugivi_configurator' -echo Start rugivi with 'rugivi' -echo You also find both within the start menu. - -pause diff --git a/rugivi/config_file_handler.py b/rugivi/config_file_handler.py index 5d3bcbb..66c5cf3 100755 --- a/rugivi/config_file_handler.py +++ b/rugivi/config_file_handler.py @@ -32,18 +32,23 @@ import os from pathlib import Path import configparser +import pathlib import sys from tkinter import messagebox from . import dir_helper as dir_helper class ConfigFileHandler: - def __init__(self, configFilePath) -> None: + def __init__(self, configFilePath, create_if_missing=False) -> None: self.config_file_path = configFilePath self.homedir = dir_helper.get_home_dir() self.config_file_path = dir_helper.expand_home_dir(self.config_file_path) + if create_if_missing and not os.path.isfile(self.config_file_path): + pathlib.Path(os.path.dirname(self.config_file_path)).mkdir(parents=True, exist_ok=True) + open(self.config_file_path, 'a').close() + self.create_config_parser_and_load_config() self.config_changed = False diff --git a/rugivi/dir_helper.py b/rugivi/dir_helper.py index 6f31082..db48b98 100755 --- a/rugivi/dir_helper.py +++ b/rugivi/dir_helper.py @@ -65,6 +65,8 @@ def get_config_dir(subfolder_for_windows) -> str: config_dir = os.path.join(os.environ["APPDATA"], subfolder_for_windows) return config_dir +def is_config_file_present(subfolder_for_windows, config_file_name) -> bool: + return os.path.isfile(os.path.join(get_config_dir(subfolder_for_windows),config_file_name)) def get_install_dir() -> str: return os.path.dirname(os.path.realpath(__file__)) diff --git a/rugivi/rugivi.py b/rugivi/rugivi.py index 72dcea3..715278b 100755 --- a/rugivi/rugivi.py +++ b/rugivi/rugivi.py @@ -29,10 +29,13 @@ ############################################################################################## # +import configparser import os import pathlib import sys +from rugivi.rugivi_configurator import ConfigApp + # Import pygame, hide welcome message because it messes with # status output @@ -102,22 +105,39 @@ def __init__(self) -> None: self.tagDir = "" self.cache_base_dir = "./cache" - self.configDir = dir_helper.get_config_dir("RuGiVi") - self.configParser = config_file_handler.ConfigFileHandler( - os.path.join(self.configDir, "rugivi.conf") - ) + configurator_run = False - self.configured = self.configParser.get_boolean("configuration", "configured") + self.configured = False - if not self.configured: - root = tkinter.Tk() - root.withdraw() - messagebox.showinfo( - "Not configured", - "Please configure RuGiVi and save the settings with the RuGiVi Configurator before running it", - ) - sys.exit(0) + while not self.configured: + self.configured = dir_helper.is_config_file_present("RuGiVi","rugivi.conf") + + if self.configured: + self.configDir = dir_helper.get_config_dir("RuGiVi") + self.configParser = config_file_handler.ConfigFileHandler( + os.path.join(self.configDir, "rugivi.conf") + ) + + try: + self.configured = self.configured and self.configParser.get_boolean("configuration", "configured") + except configparser.NoSectionError: + self.configured = False + + if not self.configured and configurator_run: + sys.exit() # Cancel was pressed in configurator + + if not self.configured and not configurator_run: + #root = tkinter.Tk() + #root.withdraw() + #messagebox.showinfo( + # "Not configured", + # "Please configure RuGiVi and apply the settings in the following dialog.", + #) + + app = ConfigApp(apply_and_start=True) + app.run() + configurator_run = True self.worldDbFile = self.configParser.get_directory_path( diff --git a/rugivi/rugivi_configurator.py b/rugivi/rugivi_configurator.py index 020d4c3..37528eb 100755 --- a/rugivi/rugivi_configurator.py +++ b/rugivi/rugivi_configurator.py @@ -31,9 +31,11 @@ import abc import configparser +import pathlib import platform -from tkinter import Tk +import sys +from tkinter import Checkbutton, IntVar, Tk from tkinter import Label from tkinter import Frame from tkinter import Button @@ -60,6 +62,8 @@ from rugivi import config_file_handler as config_file_handler from rugivi import dir_helper as dir_helper +from pyshortcuts import make_shortcut + class SelectionSingleItem: __metaclass__ = abc.ABCMeta @@ -92,12 +96,13 @@ def __init__( description, configGroup, configItem, + fg="black", ) -> None: super().__init__(configParser, description, configGroup, configItem) self.frame = Frame(parent) self.frame.columnconfigure(1, weight=1) - Label(self.frame, text=description).grid(column=0, row=0, sticky=W) + Label(self.frame, text=description,fg=fg).grid(column=0, row=0, sticky=W) self.dirText = StringVar(self.frame, self.initValue) self.dirText.trace_add("write", self.valueChanged) Entry(self.frame, textvariable=self.dirText).grid(column=1, row=0, sticky=W + E) @@ -165,13 +170,13 @@ def getFrame(self) -> Frame: class SelectionBoolean(SelectionSingleItem): def __init__( - self, parent, configParser, description, configGroup, configItem + self, parent, configParser, description, configGroup, configItem, fg="black" ) -> None: super().__init__(configParser, description, configGroup, configItem) self.frame = Frame(parent) self.frame.columnconfigure(1, weight=1) - Label(self.frame, text=description).grid(column=0, row=0, ipadx=5, sticky=W) + Label(self.frame, text=description, fg=fg).grid(column=0, row=0, ipadx=5, sticky=W) self.button = Button( self.frame, text=str(self.initValue), command=self.buttonClicked ) @@ -294,17 +299,17 @@ def buttonClickedAdd(self) -> None: class ConfigApp: - def __init__(self) -> None: + def __init__(self, apply_and_start=False) -> None: print("RuGiVi Configurator") self.configDir = dir_helper.get_config_dir("RuGiVi") self.configParser: config_file_handler.ConfigFileHandler = ( config_file_handler.ConfigFileHandler( - os.path.join(self.configDir, "rugivi.conf") + os.path.join(self.configDir, "rugivi.conf"), create_if_missing=True ) ) - + self.config_migrated = False self.migrate_old_conf(self.configParser) @@ -323,7 +328,7 @@ def __init__(self) -> None: # ttk.Button(frm, text="Quit", command=root.destroy).grid(column=1, row=0) itfo = SelectionFolder( - frm, self.configParser, "Crawler root directory", "world", "crawlerRootDir" + frm, self.configParser, "Images & videos root directory", "world", "crawlerRootDir", fg="blue" ) itfo.getFrame().grid(column=0, row=row, ipadx=10, padx=10, sticky=W + E) row += 1 @@ -343,8 +348,8 @@ def __init__(self) -> None: Label( frm, text="You must use a new World DB File or delete the old one when changing root directory", - fg="red", - ).grid(column=0, row=row, sticky=W) + fg="black", + ).grid(column=0, row=row,ipadx=10, padx=10,sticky=W) row += 1 Label(frm, text="Thumb Database settings").grid(column=0, row=row, sticky=W) @@ -360,7 +365,7 @@ def __init__(self) -> None: row += 1 itfo = SelectionBoolean( - frm, self.configParser, "Enable video crawling", "world", "crawlvideos" + frm, self.configParser, "Enable video crawling", "world", "crawlvideos", fg="blue" ) itfo.getFrame().grid(column=0, row=row, ipadx=10, padx=10, sticky=W + E) row += 1 @@ -415,25 +420,49 @@ def __init__(self) -> None: itfo.getFrame().grid(column=0, row=row, ipadx=10, padx=10, sticky=W + E) row += 1 - if self.config_migrated: + Label( + frm, + text="Getting started? Just change the blue entries to fit your setup!", + fg="blue", + ).grid(column=0, row=row, sticky=E) + row += 1 + + if self.config_migrated and not apply_and_start: Label( frm, - text="Config migrated & new items added. Make sure to save the config!", + text="Config migrated & new items added. Make sure to apply the config!", fg="red", ).grid(column=0, row=row, sticky=E) row += 1 - bframe = Frame(frm) - Button(bframe, text="Save and exit", command=self.actionSaveAndExit).grid( - column=0, row=0, ipadx=5, sticky=E + + self.start_menu_entry = IntVar(bframe,value=1) + + Checkbutton( + bframe, text="create start menu entries", variable=self.start_menu_entry + ).grid(column=0, row=0, sticky=W) + + if apply_and_start: + text_apply_and="Apply and start" + else: + text_apply_and="Apply and exit" + Button(bframe, text=text_apply_and, command=self.actionSaveAndExit).grid( + column=1, row=0, ipadx=5, sticky=E + ) + Button(bframe, text="Cancel", command=self.actionExitWithoutSave).grid( + column=2, row=0, ipadx=5, sticky=E ) - Button( - bframe, text="Exit without save", command=self.actionExitWithoutSave - ).grid(column=1, row=0, ipadx=5, sticky=E) bframe.grid(column=0, row=row, sticky=E) row += 1 + Label( + frm, + text="'Apply' will also create necessary files and directories!", + fg="black", + ).grid(column=0, row=row, sticky=E) + row += 1 + frm.pack(expand=True, fill=BOTH) def run(self) -> None: @@ -442,11 +471,17 @@ def run(self) -> None: def actionSaveAndExit(self) -> NoReturn: self.configParser.change_config()["configuration"]["configured"] = "True" self.configParser.write_changed_config() - exit() + self.create_directories() + if self.start_menu_entry.get() == 1: + self._create_start_menu_entries() + self.root.quit() + self.root.destroy() + #exit() def actionExitWithoutSave(self) -> NoReturn: - exit() - + self.root.quit() + self.root.destroy() + #exit() def is_windows(self) -> bool: if platform.system() == "Windows": @@ -465,7 +500,14 @@ def _migrate_check_and_add_entry(self, configParser, group, key, initvalue): entry_present = False section_missing = True if not entry_present: - print("Migrate old config to new one: adding [",group,"]",key,"=",initvalue) + print( + "Migrate old config to new one: adding [", + group, + "]", + key, + "=", + initvalue, + ) if section_missing: self.configParser.change_config().add_section(group) self.configParser.change_config()[group][key] = initvalue @@ -473,43 +515,214 @@ def _migrate_check_and_add_entry(self, configParser, group, key, initvalue): def migrate_old_conf(self, configParser): - # older => v0.4.0 + # empty or older => v0.4.0 - self._migrate_check_and_add_entry(configParser, "world","crawlerExcludeDirList","") - self._migrate_check_and_add_entry(configParser, "world","crawlvideos","False") + if self.is_windows(): + self._migrate_check_and_add_entry( + configParser, "world", "crawlerRootDir", "~\\Pictures\\" + ) + else: + self._migrate_check_and_add_entry( + configParser, "world", "crawlerRootDir", "~" + ) - self._migrate_check_and_add_entry(configParser, "world","crossshapegrow","False") - self._migrate_check_and_add_entry(configParser, "world","nodiagonalgrow","True") - self._migrate_check_and_add_entry(configParser, "world","organicgrow","True") - self._migrate_check_and_add_entry(configParser, "world","reachoutantmode","True") + self._migrate_check_and_add_entry( + configParser, "world", "crawlerExcludeDirList", "" + ) if self.is_windows(): - self._migrate_check_and_add_entry(configParser, "cache","cacherootdir","~\\AppData\\Roaming\\RuGiVi\\cache") + self._migrate_check_and_add_entry( + configParser, + "world", + "worldDB", + "~\\AppData\\Roaming\\RuGiVi\\chunks.sqlite", + ) else: - self._migrate_check_and_add_entry(configParser, "cache","cacherootdir","~/.local/share/rugivi/cache") + self._migrate_check_and_add_entry( + configParser, "world", "worldDB", "~/.local/share/rugivi/chunks.sqlite" + ) + + self._migrate_check_and_add_entry(configParser, "world", "crawlvideos", "False") - self._migrate_check_and_add_entry(configParser, "videoframe","jpgquality","65") - self._migrate_check_and_add_entry(configParser, "videoframe","maxsizeenabled","False") - self._migrate_check_and_add_entry(configParser, "videoframe","maxsize","800") - self._migrate_check_and_add_entry(configParser, "videoframe","removeletterbox","True") + self._migrate_check_and_add_entry( + configParser, "world", "crossshapegrow", "False" + ) + self._migrate_check_and_add_entry( + configParser, "world", "nodiagonalgrow", "True" + ) + self._migrate_check_and_add_entry(configParser, "world", "organicgrow", "True") + self._migrate_check_and_add_entry( + configParser, "world", "reachoutantmode", "True" + ) if self.is_windows(): - self._migrate_check_and_add_entry(configParser, "videoplayback","vlcbinary","C:/Program Files/VideoLAN/VLC/vlc.exe") + self._migrate_check_and_add_entry( + configParser, + "thumbs", + "thumbDB", + "~\\AppData\\Roaming\\RuGiVi\\thumbs.sqlite", + ) else: - self._migrate_check_and_add_entry(configParser, "videoplayback","vlcbinary","vlc") + self._migrate_check_and_add_entry( + configParser, "thumbs", "thumbDB", "~/.local/share/rugivi/thumbs.sqlite" + ) - self._migrate_check_and_add_entry(configParser, "videoplayback","vlcenabled","False") - self._migrate_check_and_add_entry(configParser, "videoplayback","vlcseekposition","True") + if self.is_windows(): + self._migrate_check_and_add_entry( + configParser, + "cache", + "cacherootdir", + "~\\AppData\\Roaming\\RuGiVi\\cache", + ) + else: + self._migrate_check_and_add_entry( + configParser, "cache", "cacherootdir", "~/.local/share/rugivi/cache" + ) + + self._migrate_check_and_add_entry( + configParser, "videoframe", "jpgquality", "65" + ) + self._migrate_check_and_add_entry( + configParser, "videoframe", "maxsizeenabled", "False" + ) + self._migrate_check_and_add_entry(configParser, "videoframe", "maxsize", "800") + self._migrate_check_and_add_entry( + configParser, "videoframe", "removeletterbox", "True" + ) + + if self.is_windows(): + self._migrate_check_and_add_entry( + configParser, + "videoplayback", + "vlcbinary", + "C:/Program Files/VideoLAN/VLC/vlc.exe", + ) + else: + self._migrate_check_and_add_entry( + configParser, "videoplayback", "vlcbinary", "vlc" + ) + + self._migrate_check_and_add_entry( + configParser, "videoplayback", "vlcenabled", "False" + ) + self._migrate_check_and_add_entry( + configParser, "videoplayback", "vlcseekposition", "True" + ) + + self._migrate_check_and_add_entry( + configParser, "control", "reverseScrollWheelZoom", "False" + ) + + if self.is_windows(): + self._migrate_check_and_add_entry( + configParser, "control", "pythonexecutable", "python" + ) + else: + self._migrate_check_and_add_entry( + configParser, "control", "pythonexecutable", "python3" + ) + + self._migrate_check_and_add_entry(configParser, "control", "showinfo", "0") if self.is_windows(): - self._migrate_check_and_add_entry(configParser, "control","pythonexecutable","python") + self._migrate_check_and_add_entry( + configParser, + "fapTableParentDirs", + "dir1", + "~\\Documents\\fapelsystem\\Fapsets", + ) + self._migrate_check_and_add_entry( + configParser, + "fapTableSingleDirs", + "dir1", + "~\\Documents\\fapelsystem\\Notice", + ) else: - self._migrate_check_and_add_entry(configParser, "control","pythonexecutable","python3") + self._migrate_check_and_add_entry( + configParser, "fapTableParentDirs", "dir1", "~/fapelsystem/Fapsets" + ) + self._migrate_check_and_add_entry( + configParser, "fapTableSingleDirs", "dir1", "~/fapelsystem/Notice" + ) + + self._migrate_check_and_add_entry(configParser, "fonts", "statusFontSize", "24") + + self._migrate_check_and_add_entry( + configParser, "configuration", "configured", "False" + ) + + self._migrate_check_and_add_entry(configParser, "debug", "vlcverbose", "False") + self._migrate_check_and_add_entry(configParser, "debug", "cv2verbose", "False") + self._migrate_check_and_add_entry( + configParser, "debug", "mockupimages", "False" + ) + + def _createDirTree(self, dir): + dir = dir_helper.expand_home_dir(dir) + print("Creating directory:", dir) + pathlib.Path(dir).mkdir(parents=True, exist_ok=True) + + def create_directories(self): + self._createDirTree( + os.path.dirname( + self.configParser.get_directory_path("world", "worldDB", "") + ) + ) + self._createDirTree( + self.configParser.get_directory_path("cache", "cacherootdir", "") + ) + + def _create_start_menu_entries(self): + + if self.is_windows(): + print("Creating app shortcut...") + packagedir = os.path.dirname(os.path.realpath(__file__)) + sc_icon = os.path.join(packagedir, "icon.ico") + + # TODO future pyshortcuts versions > 1.9.0 might contain the feature that noexe=True can be used to directly call "rugivi" instead of rugivi.py + make_shortcut( + script=os.path.join(packagedir, "..\\..\\..\\Scripts\\rugivi.exe"), + name="RuGiVi", + icon=sc_icon, + terminal=False, + desktop=False, + working_dir=None, + ) - self._migrate_check_and_add_entry(configParser, "debug","vlcverbose","False") - self._migrate_check_and_add_entry(configParser, "debug","cv2verbose","False") - self._migrate_check_and_add_entry(configParser, "debug","mockupimages","False") + print("Creating configurator shortcut...") + make_shortcut( + script=os.path.join(packagedir, "..\\..\\..\\Scripts\\rugivi_configurator.exe"), + name="RuGiVi Configurator", + icon=sc_icon, + terminal=False, + desktop=False, + working_dir=None, + ) + else: + print("Creating app shortcut...") + packagedir = os.path.dirname(os.path.realpath(__file__)) + sc_icon = os.path.join(packagedir, "icon.png") + + # TODO future pyshortcuts versions > 1.9.0 might contain the feature that noexe=True can be used to directly call "rugivi" instead of rugivi.py + make_shortcut( + script=dir_helper.expand_home_dir("~/.local/bin/rugivi"), + name="RuGiVi", + icon=sc_icon, + terminal=False, + desktop=False, + working_dir=None, + ) + + print("Creating configurator shortcut...") + make_shortcut( + script=dir_helper.expand_home_dir("~/.local/bin/rugivi_configurator"), + name="RuGiVi Configurator", + icon=sc_icon, + terminal=False, + desktop=False, + working_dir=None, + ) def main() -> None: diff --git a/setup.py b/setup.py index 381a03b..034b404 100755 --- a/setup.py +++ b/setup.py @@ -29,8 +29,9 @@ from setuptools import setup setup(name='rugivi', - version='0.4.1-alpha', + version='0.5.0-alpha.post1', description='RuGiVi - Adult Media Landscape Browser', + long_description='RuGiVi enables you to fly over your image and video collection and view thousands of images and video frames at once. Zoom in and out from one image to small thumbnails with your mousewheel in seconds. All images are grouped as you have them on your disk and arranged in a huge landscape. RuGiVi can work with hundred thousand of images at once.', url='https://github.com/pronopython/rugivi', author='pronopython', author_email='pronopython@proton.me', diff --git a/upgrade_windows_installation.bat b/upgrade_windows_installation.bat deleted file mode 100755 index 6d152e9..0000000 --- a/upgrade_windows_installation.bat +++ /dev/null @@ -1,38 +0,0 @@ -@echo off -REM ############################################################################################## -REM # -REM # RuGiVi - Adult Media Landscape Browser -REM # -REM # For updates see git-repo at -REM # https://github.com/pronopython/rugivi -REM # -REM ############################################################################################## -REM # -REM # Copyright (C) PronoPython -REM # -REM # Contact me at pronopython@proton.me -REM # -REM # This program is free software: you can redistribute it and/or modify it -REM # under the terms of the GNU General Public License as published by the -REM # Free Software Foundation, either version 3 of the License, or -REM # (at your option) any later version. -REM # -REM # This program is distributed in the hope that it will be useful, -REM # but WITHOUT ANY WARRANTY; without even the implied warranty of -REM # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -REM # GNU General Public License for more details. -REM # -REM # You should have received a copy of the GNU General Public License -REM # along with this program. If not, see . -REM # -REM ############################################################################################## - -echo Uninstalling RuGiVi - -pip uninstall --yes rugivi - -echo Installing new version - -pip install . - -pause