Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package syncplay for openSUSE:Factory checked in at 2024-05-10 12:06:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/syncplay (Old) and /work/SRC/openSUSE:Factory/.syncplay.new.1880 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "syncplay" Fri May 10 12:06:02 2024 rev:6 rq:1173048 version:1.7.3 Changes: -------- --- /work/SRC/openSUSE:Factory/syncplay/syncplay.changes 2024-02-05 22:02:06.240973735 +0100 +++ /work/SRC/openSUSE:Factory/.syncplay.new.1880/syncplay.changes 2024-05-10 12:07:02.989659555 +0200 @@ -1,0 +2,21 @@ +Thu May 9 19:29:21 UTC 2024 - Andrea Manzini <[email protected]> + +- Update to version 1.7.3: + * Fix MPV socket getting created in CWD folder rand only create second pipe + if manually specified using input-ipc-server per player argument + * Add support for mpv installed from Microsoft store + * Fix invalid string escapes + +- Update to version 1.7.2: + * Add new per-user mpv.net path + * Pass input-ipc-server player argument to mpv + * Fix --no-gui PySide dependency issue on non-Windows OS + * Fixed German Translation and added more Translated Strings + * Remove adding executable permissions to .desktop files + * Allow player arguments with spaces/quotes + * Fixed MPC-HC hanging issue involving 'LRESULT' error + * Don't log all 32/64-bit cryptography 'frozen zipimport' errors + * Provide more information on PySide load failure + * Avoid error when closing Syncplay before loadDelayedPath is complete + +------------------------------------------------------------------- Old: ---- syncplay-1.7.1.tar.gz New: ---- syncplay-1.7.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ syncplay.spec ++++++ --- /var/tmp/diff_new_pack.hZG0I2/_old 2024-05-10 12:07:04.917729809 +0200 +++ /var/tmp/diff_new_pack.hZG0I2/_new 2024-05-10 12:07:04.937730538 +0200 @@ -17,7 +17,7 @@ Name: syncplay -Version: 1.7.1 +Version: 1.7.3 Release: 0 Summary: Client/server to synchronize media playback on mpv/VLC on multiple computers License: Apache-2.0 ++++++ syncplay-1.7.1.tar.gz -> syncplay-1.7.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/GNUmakefile new/syncplay-1.7.3/GNUmakefile --- old/syncplay-1.7.1/GNUmakefile 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/GNUmakefile 2024-04-29 20:15:42.000000000 +0200 @@ -63,10 +63,6 @@ cp syncplay/resources/syncplay.desktop $(APP_SHORTCUT_PATH)/ gzip docs/syncplay.1 --stdout > $(SHARE_PATH)/man/man1/syncplay.1.gz -ifeq ($(SINGLE_USER),false) - chmod 755 $(APP_SHORTCUT_PATH)/syncplay.desktop -endif - u-client: -rm $(BIN_PATH)/syncplay -rm $(LIB_PATH)/syncplay/syncplayClient.py @@ -84,10 +80,6 @@ cp syncplay/resources/syncplay-server.desktop $(APP_SHORTCUT_PATH)/ gzip docs/syncplay-server.1 --stdout > $(SHARE_PATH)/man/man1/syncplay-server.1.gz -ifeq ($(SINGLE_USER),false) - chmod 755 $(APP_SHORTCUT_PATH)/syncplay-server.desktop -endif - u-server: -rm $(BIN_PATH)/syncplay-server -rm $(LIB_PATH)/syncplay/syncplayServer.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/ci/deb-script.sh new/syncplay-1.7.3/ci/deb-script.sh --- old/syncplay-1.7.1/ci/deb-script.sh 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/ci/deb-script.sh 2024-04-29 20:15:42.000000000 +0200 @@ -16,7 +16,7 @@ )" Architecture: all Maintainer: <[email protected]> -Depends: python3 (>= 3.6), python3-pyside2.qtwidgets, python3-pyside2.qtcore, python3-twisted (>= 16.4.0), python3-certifi, mpv (>= 0.23) | vlc (>= 2.2.1) +Depends: python3 (>= 3.6), python3-pyside2.qtwidgets, python3-pyside2.qtcore, python3-twisted (>= 16.4.0), python3-certifi, python3-pem, mpv (>= 0.23) | vlc (>= 2.2.1) Homepage: https://syncplay.pl Section: web Priority: optional diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/__init__.py new/syncplay-1.7.3/syncplay/__init__.py --- old/syncplay-1.7.1/syncplay/__init__.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/__init__.py 2024-04-29 20:15:42.000000000 +0200 @@ -1,5 +1,5 @@ -version = '1.7.1' +version = '1.7.3' revision = '' milestone = 'Yoitsu' -release_number = '109' +release_number = '112' projectURL = 'https://syncplay.pl/' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/client.py new/syncplay-1.7.3/syncplay/client.py --- old/syncplay-1.7.1/syncplay/client.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/client.py 2024-04-29 20:15:42.000000000 +0200 @@ -1785,6 +1785,9 @@ def loadDelayedPath(self, changeToIndex): # Implementing the behaviour set out at https://github.com/Syncplay/syncplay/issues/315 + if not self._client: + return + if self._client.playerIsNotReady(): self._client.addPlayerReadyCallback(lambda x: self.loadDelayedPath(changeToIndex)) return diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/constants.py new/syncplay-1.7.3/syncplay/constants.py --- old/syncplay-1.7.1/syncplay/constants.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/constants.py 2024-04-29 20:15:42.000000000 +0200 @@ -29,7 +29,7 @@ UI_TIME_FORMAT = "[%X] " CONFIG_NAMES = [".syncplay", "syncplay.ini"] # Syncplay searches first to last DEFAULT_CONFIG_NAME = "syncplay.ini" -RECENT_CLIENT_THRESHOLD = "1.7.1" # This and higher considered 'recent' clients (no warnings) +RECENT_CLIENT_THRESHOLD = "1.7.3" # This and higher considered 'recent' clients (no warnings) MUSIC_FORMATS = [".mp3", ".m4a", ".m4p", ".wav", ".aiff", ".r", ".ogg", ".flac"] # ALL LOWER CASE! WARN_OLD_CLIENTS = True # Use MOTD to inform old clients to upgrade LIST_RELATIVE_CONFIGS = True # Print list of relative configs loaded @@ -112,9 +112,10 @@ # Usually there's no need to adjust these DOUBLE_CHECK_REWIND = False LAST_PAUSED_DIFF_THRESHOLD = 2 -FILENAME_STRIP_REGEX = "[-~_\.\[\](): ]" -CONTROL_PASSWORD_STRIP_REGEX = "[^a-zA-Z0-9\-]" -ROOM_NAME_STRIP_REGEX = "^(\+)(?P<roomnamebase>.*)(:)(\w{12})$" +FILENAME_STRIP_REGEX = r"[-~_\.\[\](): ]" +CONTROL_PASSWORD_STRIP_REGEX = r"[^a-zA-Z0-9\-]" +ROOM_NAME_STRIP_REGEX = r"^(\+)(?P<roomnamebase>.*)(:)(\w{12})$" +ARGUMENT_SPLIT_REGEX = r'(?:[^\s"]+|"[^"]*")+' COMMANDS_UNDO = ["u", "undo", "revert"] COMMANDS_CHAT = ["ch", "chat"] COMMANDS_LIST = ["l", "list", "users"] @@ -162,7 +163,7 @@ ] MPC_EXECUTABLES = ["mpc-hc.exe", "mpc-hc64.exe", "mpc-hcportable.exe", "mpc-hc_nvo.exe", "mpc-hc64_nvo.exe", "shoukaku.exe"] -MPC64_EXECUTABLES = ["mpc-hc64.exe", "mpc-hc64_nvo.exe", "x64\mpc-hc\shoukaku.exe"] +MPC64_EXECUTABLES = ["mpc-hc64.exe", "mpc-hc64_nvo.exe", r"x64\mpc-hc\shoukaku.exe"] MPC_BE_PATHS = [ r"c:\program files\mpc-be x64\mpc-be64.exe", @@ -178,6 +179,8 @@ try: import os MPVNET_PATHS.append(os.path.expandvars(r'%LOCALAPPDATA%\Microsoft\WindowsApps\mpvnet.exe')) + MPVNET_PATHS.append(os.path.expandvars(r'%LOCALAPPDATA%\Programs\mpv.net\mpvnet.exe')) + MPV_PATHS.append(os.path.expandvars(r'%LOCALAPPDATA%\Microsoft\WindowsApps\mpv.exe')) except: pass VLC_PATHS = [ @@ -300,7 +303,7 @@ OS_MACOS: ['--verbose=2', '--no-file-logging']}) MPV_SUPERSEDE_IF_DUPLICATE_COMMANDS = ["set_property time-pos ", "loadfile "] MPV_REMOVE_BOTH_IF_DUPLICATE_COMMANDS = ["cycle pause"] -MPLAYER_ANSWER_REGEX = "^ANS_([a-zA-Z_-]+)=(.+)$|^(Exiting)\.\.\. \((.+)\)$" +MPLAYER_ANSWER_REGEX = r"^ANS_([a-zA-Z_-]+)=(.+)$|^(Exiting)\.\.\. \((.+)\)$" VLC_ANSWER_REGEX = r"(?:^(?P<command>[a-zA-Z_-]+)(?:\: )?(?P<argument>.*))" UI_COMMAND_REGEX = r"^(?P<command>[^\ ]+)(?:\ (?P<parameter>.+))?" UI_OFFSET_REGEX = r"^(?:o|offset)\ ?(?P<sign>[/+-])?(?P<time>\d{1,9}(?:[^\d\.](?:\d{1,9})){0,2}(?:\.(?:\d{1,3}))?)$" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_de.py new/syncplay-1.7.3/syncplay/messages_de.py --- old/syncplay-1.7.1/syncplay/messages_de.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_de.py 2024-04-29 20:15:42.000000000 +0200 @@ -101,12 +101,12 @@ "commandlist-notification/create": "\tc [name] - erstelle zentral gesteuerten Raum mit dem aktuellen Raumnamen", "commandlist-notification/auth": "\ta [password] - authentifiziere als Raumleiter mit Passwort", "commandlist-notification/chat": "\tch [message] - Chatnachricht an einem Raum senden", - "commandList-notification/queue": "\tqa [file/url] - add file or url to bottom of playlist", # TO DO: Translate - "commandList-notification/queueandselect": "\tqas [file/url] - add file or url to bottom of playlist and select it", # TO DO: Translate - "commandList-notification/playlist": "\tql - show the current playlist", # TO DO: Translate - "commandList-notification/select": "\tqs [index] - select given entry in the playlist", # TO DO: Translate - "commandList-notification/next": "\tqn - select next entry in the playlist", # TODO: Translate - "commandList-notification/delete": "\tqd [index] - delete the given entry from the playlist", # TO DO: Translate + "commandList-notification/queue": "\tqa [file/url] - füge Datei oder URL ans Ende der Wiedergabeliste", + "commandList-notification/queueandselect": "\tqas [file/url] - füge Datei oder URL ans Ende der Wiedergabeliste und wähle diese aus", + "commandList-notification/playlist": "\tql - zeige aktuelle Wiedergabeliste", + "commandList-notification/select": "\tqs [index] - wähle den ausgewählten Eintrag in der Wiedergabeliste", + "commandList-notification/next": "\tqn - wähle den nächsten Eintrag in der Wiedergabeliste", + "commandList-notification/delete": "\tqd [index] - lösche den ausgewählten Eintrag in der Wiedergabeliste", "syncplay-version-notification": "Syncplay Version: {}", # syncplay.version "more-info-notification": "Weitere Informationen auf: {}", # projectURL @@ -127,13 +127,13 @@ "mpc-version-insufficient-error": "MPC-Version nicht ausreichend, bitte nutze `mpc-hc` >= `{}`", "mpc-be-version-insufficient-error": "MPC-Version nicht ausreichend, bitte nutze `mpc-be` >= `{}`", "mpv-version-error": "Syncplay ist nicht kompatibel mit dieser Version von mpv. Bitte benutze eine andere Version (z.B. Git HEAD).", - "mpv-failed-advice": "The reason mpv cannot start may be due to the use of unsupported command line arguments or an unsupported version of mpv.", # TODO: Translate + "mpv-failed-advice": "Der Grund dass mpv nicht gestartet werden kann, kann an der Verwendung nicht unterstützter Befehlszeilenargumente oder einer nicht unterstützten Version von mpv liegen.", "player-file-open-error": "Fehler beim Ãffnen der Datei durch den Player", "player-path-error": "Ungültiger Player-Pfad. Unterstützte Player sind: mpv, mpv.net, VLC, MPC-HC, MPC-BE, mplayer2 und IINA", "hostname-empty-error": "Hostname darf nicht leer sein", "empty-error": "{} darf nicht leer sein", # Configuration "media-player-error": "Player-Fehler: \"{}\"", # Error line - "unable-import-gui-error": "Konnte die GUI-Bibliotheken nicht importieren. PySide muss installiert sein, damit die grafische Oberfläche funktioniert.", + "unable-import-gui-error": "Konnte die GUI-Bibliotheken nicht importieren. PySide muss installiert sein, damit die grafische Oberfläche funktioniert. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work." "unable-import-twisted-error": "Twisted konnte nicht importiert werden. Bitte installiere Twisted v16.4.0 oder höher", "arguments-missing-error": "Notwendige Argumente fehlen, siehe --help", @@ -205,7 +205,7 @@ "name-label": "Benutzername (optional):", "password-label": "Server-Passwort (falls nötig):", "room-label": "Standard-Raum:", - "roomlist-msgbox-label": "Edit room list (one per line)", # TODO: Translate + "roomlist-msgbox-label": "Bearbeite Raum Liste (eins pro Linie)", "media-setting-title": "Media-Player Einstellungen", "executable-path-label": "Pfad zum Media-Player:", @@ -348,8 +348,8 @@ "startTLS-initiated": "Sichere Verbindung wird versucht", "startTLS-secure-connection-ok": "Sichere Verbindung hergestellt ({})", "startTLS-server-certificate-invalid": 'Sichere Verbindung fehlgeschlagen. Der Server benutzt ein ungültiges Sicherheitszertifikat. Der Kanal könnte von Dritten abgehört werden. Für weitere Details und Problemlösung siehe <a href="https://syncplay.pl/trouble">hier</a> [Englisch].', - "startTLS-server-certificate-invalid-DNS-ID": "Syncplay does not trust this server because it uses a certificate that is not valid for its hostname.", # TODO: Translate - "startTLS-not-supported-client": "Dieser Server unterstützt kein TLS", + "startTLS-server-certificate-invalid-DNS-ID": "Syncplay vertraut diesem Server nicht, da er ein Zertifikat verwendet, das für seinen Hostnamen ungültig ist.", + "startTLS-not-supported-client": "Dieser Client unterstützt kein TLS", "startTLS-not-supported-server": "Dieser Server unterstützt kein TLS", # TLS certificate dialog @@ -396,7 +396,7 @@ "password-tooltip": "Passwörter sind nur bei Verbindung zu privaten Servern nötig.", "room-tooltip": "Der Raum, der betreten werden soll, kann ein x-beliebiger sein. Allerdings werden nur Clients im selben Raum synchronisiert.", - "edit-rooms-tooltip": "Edit room list.", # TO DO: Translate + "edit-rooms-tooltip": "Bearbeite Raum Liste.", "executable-path-tooltip": "Pfad zum ausgewählten, unterstützten Mediaplayer (mpv, mpv.net, VLC, MPC-HC/BE, mplayer2, oder IINA).", "media-path-tooltip": "Pfad zum wiederzugebenden Video oder Stream. Notwendig für mplayer2.", @@ -540,6 +540,6 @@ "playlist-instruction-item-message": "Zieh eine Datei hierher, um sie zur geteilten Playlist hinzuzufügen.", "sharedplaylistenabled-tooltip": "Raumleiter können Dateien zu einer geteilten Playlist hinzufügen und es so erleichtern, gemeinsam das Gleiche zu gucken. Konfiguriere Medienverzeichnisse unter âDiverseâ", - "playlist-empty-error": "Playlist is currently empty.", # TO DO: Translate - "playlist-invalid-index-error": "Invalid playlist index", # TO DO: Translate + "playlist-empty-error": "Wiedergabeliste is aktuell leer.", + "playlist-invalid-index-error": "Ungültiger Wiedergabelisten-Index", } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_en.py new/syncplay-1.7.3/syncplay/messages_en.py --- old/syncplay-1.7.1/syncplay/messages_en.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_en.py 2024-04-29 20:15:42.000000000 +0200 @@ -133,7 +133,7 @@ "hostname-empty-error": "Hostname can't be empty", "empty-error": "{} can't be empty", # Configuration "media-player-error": "Media player error: \"{}\"", # Error line - "unable-import-gui-error": "Could not import GUI libraries. If you do not have PySide installed then you will need to install it for the GUI to work.", + "unable-import-gui-error": "Could not import GUI libraries. You need to have the correct version of PySide installed for the GUI to work. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", "unable-import-twisted-error": "Could not import Twisted. Please install Twisted v16.4.0 or later.", "arguments-missing-error": "Some necessary arguments are missing, refer to --help", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_eo.py new/syncplay-1.7.3/syncplay/messages_eo.py --- old/syncplay-1.7.1/syncplay/messages_eo.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_eo.py 2024-04-29 20:15:42.000000000 +0200 @@ -136,7 +136,7 @@ "hostname-empty-error": "Nomo de gastiga komputilo ne povas esti malplena", "empty-error": "{} ne povas esti malplena", # Configuration "media-player-error": "Eraro de vidaÅdaĵa ludilo: \"{}\"", # Error line - "unable-import-gui-error": "Ne povis enporti fasadajn bibliotekojn. Se PySide ne estas instalita, vi devos instali Äin, por ke la fasado funkciu.", + "unable-import-gui-error": "Ne povis enporti fasadajn bibliotekojn. Se PySide ne estas instalita, vi devos instali Äin, por ke la fasado funkciu. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work." "unable-import-twisted-error": "Ne povis enporti la bibliotekon Twisted. Bonvolu instali version 16.4.0 de Twisted, aÅ pli altan.", "arguments-missing-error": "Iuj bezonataj parametroj mankas; vidu al --help", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_es.py new/syncplay-1.7.3/syncplay/messages_es.py --- old/syncplay-1.7.1/syncplay/messages_es.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_es.py 2024-04-29 20:15:42.000000000 +0200 @@ -133,7 +133,7 @@ "hostname-empty-error": "El nombre del host no puede ser vacÃo", "empty-error": "{} no puede ser vacÃo", # Configuration "media-player-error": "Error del reproductor multimedia: \"{}\"", # Error line - "unable-import-gui-error": "No se lograron importar las librerÃas GUI. Si no tienes instalado PySide, entonces tendrás que instalarlo para que funcione el GUI.", + "unable-import-gui-error": "No se lograron importar las librerÃas GUI. Si no tienes instalado PySide, entonces tendrás que instalarlo para que funcione el GUI. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work." "unable-import-twisted-error": "No se logró importar Twisted. Por favor instala Twisted v16.4.0 o posterior.", "arguments-missing-error": "Están faltando algunos argumentos necesarios. Por favor revisa --help", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_fi.py new/syncplay-1.7.3/syncplay/messages_fi.py --- old/syncplay-1.7.1/syncplay/messages_fi.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_fi.py 2024-04-29 20:15:42.000000000 +0200 @@ -133,7 +133,7 @@ "hostname-empty-error": "Palvelinnimi ei voi olla tyhjä", "empty-error": "{} ei voi jättää tyhjäksi", # Configuration "media-player-error": "Mediasoitin kohtasi virheen: \"{}\"", # Error line - "unable-import-gui-error": "Käyttöliittymäkirjastoja ei saatu tuotua. Mikäli sinulla ei ole PySide asennettuna, tulee sinun asentaa se jotta käyttöliittymä toimisi.", + "unable-import-gui-error": "Käyttöliittymäkirjastoja ei saatu tuotua. Mikäli sinulla ei ole PySide asennettuna, tulee sinun asentaa se jotta käyttöliittymä toimisi. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work." "unable-import-twisted-error": "Twisted:iä ei onnistuttu tuomaan. Asenna Twisted v16.4.0 tai myöhäisempi.", "arguments-missing-error": "Joitakin vipuja uupuu, katso apua --help", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_fr.py new/syncplay-1.7.3/syncplay/messages_fr.py --- old/syncplay-1.7.1/syncplay/messages_fr.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_fr.py 2024-04-29 20:15:42.000000000 +0200 @@ -133,7 +133,7 @@ "hostname-empty-error": "Le nom d'hôte ne peut pas être vide", "empty-error": "{} ne peut pas être vide", # Configuration "media-player-error": "Media player error: \"{}\"", # Error line - "unable-import-gui-error": "Impossible d'importer les bibliothèques GUI. Si vous n'avez pas installé PySide, vous devrez l'installer pour que l'interface graphique fonctionne.", + "unable-import-gui-error": "Impossible d'importer les bibliothèques GUI. Si vous n'avez pas installé PySide, vous devrez l'installer pour que l'interface graphique fonctionne. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work." "unable-import-twisted-error": "Impossible d'importer Twisted. Veuillez installer Twisted v16.4.0 ou une version ultérieure.", "arguments-missing-error": "Certains arguments nécessaires sont manquants, reportez-vous à --help", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_it.py new/syncplay-1.7.3/syncplay/messages_it.py --- old/syncplay-1.7.1/syncplay/messages_it.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_it.py 2024-04-29 20:15:42.000000000 +0200 @@ -133,7 +133,7 @@ "hostname-empty-error": "Il campo hostname non può essere vuoto", "empty-error": "Il campo {} non può esssere vuoto", # Configuration "media-player-error": "Errore media player: \"{}\"", # Error line - "unable-import-gui-error": "Non è possibile importare le librerie di interfaccia grafica. Hai bisogno di PySide per poter utilizzare l'interfaccia grafica.", + "unable-import-gui-error": "Non è possibile importare le librerie di interfaccia grafica. Hai bisogno di PySide per poter utilizzare l'interfaccia grafica. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work." "unable-import-twisted-error": "Non è possibile importare Twisted. Si prega di installare Twisted v16.4.0 o superiore.", "arguments-missing-error": "Alcuni argomenti obbligatori non sono stati trovati. Fai riferimento a --help", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_ko.py new/syncplay-1.7.3/syncplay/messages_ko.py --- old/syncplay-1.7.1/syncplay/messages_ko.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_ko.py 2024-04-29 20:15:42.000000000 +0200 @@ -133,7 +133,7 @@ "hostname-empty-error": "í¸ì¤í¸ì´ë¦ì ë¹ìë ì ììµëë¤", "empty-error": "{}ì(ë) ë¹ì ë ì ììµëë¤", # Configuration "media-player-error": "미ëì´ íë ì´ì´ ì¤ë¥: \"{}\"", # Error line - "unable-import-gui-error": "GUI ë¼ì´ë¸ë¬ë¦¬ë¥¼ ê°ì ¸ì¬ ì ììµëë¤. PySideê° ì¤ì¹ëì´ ìì§ ìì ê²½ì° GUIê° ìëíë ¤ë©´ ì¤ì¹í´ì¼ í©ëë¤.", + "unable-import-gui-error": "GUI ë¼ì´ë¸ë¬ë¦¬ë¥¼ ê°ì ¸ì¬ ì ììµëë¤. PySideê° ì¤ì¹ëì´ ìì§ ìì ê²½ì° GUIê° ìëíë ¤ë©´ ì¤ì¹í´ì¼ í©ëë¤. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work." "unable-import-twisted-error": "Twisted를 ê°ì ¸ì¬ ì ììµëë¤. Twisted v16.4.0 ì´ìì ì¤ì¹íì¸ì.", "arguments-missing-error": "ì¼ë¶ íìí ì¸ìê° ëë½ëììµëë¤. --help를 참조íì¸ì.", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_pt_BR.py new/syncplay-1.7.3/syncplay/messages_pt_BR.py --- old/syncplay-1.7.1/syncplay/messages_pt_BR.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_pt_BR.py 2024-04-29 20:15:42.000000000 +0200 @@ -134,7 +134,7 @@ "hostname-empty-error": "O endereço do servidor não pode estar vazio", "empty-error": "{} não pode estar vazio", # Configuration "media-player-error": "Erro do reprodutor de mÃdia: \"{}\"", # Error line - "unable-import-gui-error": "Não foi possÃvel importar bibliotecas da GUI. Se você não possuir o PySide instalado, instale-o para que a GUI funcione.", + "unable-import-gui-error": "Não foi possÃvel importar bibliotecas da GUI. Se você não possuir o PySide instalado, instale-o para que a GUI funcione. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work." "unable-import-twisted-error": "Não foi possÃvel importar o Twisted. Por favor, instale o Twisted v16.4.0 ou superior.", "arguments-missing-error": "Alguns argumentos necessários estão faltando, por favor reveja --help", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_pt_PT.py new/syncplay-1.7.3/syncplay/messages_pt_PT.py --- old/syncplay-1.7.1/syncplay/messages_pt_PT.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_pt_PT.py 2024-04-29 20:15:42.000000000 +0200 @@ -133,7 +133,7 @@ "hostname-empty-error": "O endereço do servidor não pode ser vazio", "empty-error": "{} não pode ser vazio", # Configuration "media-player-error": "Erro do reprodutor de mÃdia: \"{}\"", # Error line - "unable-import-gui-error": "Não foi possÃvel importar bibliotecas da GUI. Se você não possuir o PySide instalado, instale-o para que a GUI funcione.", + "unable-import-gui-error": "Não foi possÃvel importar bibliotecas da GUI. Se você não possuir o PySide instalado, instale-o para que a GUI funcione. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work." "unable-import-twisted-error": "Não foi possÃvel importar o Twisted. Por favor, instale o Twisted v16.4.0 ou superior.", "arguments-missing-error": "Alguns argumentos necessários estão faltando, por favor reveja --help", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_ru.py new/syncplay-1.7.3/syncplay/messages_ru.py --- old/syncplay-1.7.1/syncplay/messages_ru.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_ru.py 2024-04-29 20:15:42.000000000 +0200 @@ -132,7 +132,7 @@ "hostname-empty-error": "ÐÐ¼Ñ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¿ÑÑÑÑм.", "empty-error": "{} не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¿ÑÑÑÑм.", # Configuration "media-player-error": "ÐÑибка пÑоигÑÑваÑелÑ: \"{}\"", # Error line - "unable-import-gui-error": "Ðевозможно импоÑÑиÑоваÑÑ Ð±Ð¸Ð±Ð»Ð¸Ð¾Ñеки гÑаÑиÑеÑкого инÑеÑÑейÑа. ÐÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ð¾ ÑÑÑановиÑÑ PySide, инаÑе гÑаÑиÑеÑкий инÑеÑÑÐµÐ¹Ñ Ð½Ðµ бÑÐ´ÐµÑ ÑабоÑаÑÑ.", + "unable-import-gui-error": "Ðевозможно импоÑÑиÑоваÑÑ Ð±Ð¸Ð±Ð»Ð¸Ð¾Ñеки гÑаÑиÑеÑкого инÑеÑÑейÑа. ÐÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ð¾ ÑÑÑановиÑÑ PySide, инаÑе гÑаÑиÑеÑкий инÑеÑÑÐµÐ¹Ñ Ð½Ðµ бÑÐ´ÐµÑ ÑабоÑаÑÑ. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work." "unable-import-twisted-error": "Ðевозможно импоÑÑиÑоваÑÑ Twisted. УÑÑановиÑе Twisted 16.4.0 или более позднÑÑ Ð²ÐµÑÑиÑ.", "arguments-missing-error": "ÐекоÑоÑÑе Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе аÑгÑменÑÑ Ð¾ÑÑÑÑÑÑвÑÑÑ, обÑаÑиÑеÑÑ Ðº --help", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_tr.py new/syncplay-1.7.3/syncplay/messages_tr.py --- old/syncplay-1.7.1/syncplay/messages_tr.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_tr.py 2024-04-29 20:15:42.000000000 +0200 @@ -133,7 +133,7 @@ "hostname-empty-error": "Ana bilgisayar adı boÅ olamaz", "empty-error": "{} boÅ olamaz", # Configuration "media-player-error": "Medaya oynatıcısı hatası: \"{}\"", # Error line - "unable-import-gui-error": "GUI kitaplıkları içe aktarılamadı. PySide kurulu deÄilse, GUI'nin çalıÅması için kurmanız gerekecektir.", + "unable-import-gui-error": "GUI kitaplıkları içe aktarılamadı. PySide kurulu deÄilse, GUI'nin çalıÅması için kurmanız gerekecektir. If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work." "unable-import-twisted-error": "Twisted içe aktarılamadı. Lütfen Twisted v16.4.0 veya sonraki sürümünü yükleyin.", "arguments-missing-error": "Bazı gerekli argümanlar eksik, bakınız --help", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/messages_zh_CN.py new/syncplay-1.7.3/syncplay/messages_zh_CN.py --- old/syncplay-1.7.1/syncplay/messages_zh_CN.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/messages_zh_CN.py 2024-04-29 20:15:42.000000000 +0200 @@ -133,7 +133,7 @@ "hostname-empty-error": "主æºåä¸è½æ¯ç©ºç", "empty-error": "{}ä¸è½æ¯ç©ºç", # Configuration "media-player-error": "åªä½ææ¾å¨é误ï¼\"{}\"", # Error line - "unable-import-gui-error": "æ æ³å¯¼å ¥GUIåºãå¦æä½ æ²¡æå®è£ PySideï¼GUIåæ æ³å·¥ä½ï¼è¯·å®è£ PySideã", + "unable-import-gui-error": "æ æ³å¯¼å ¥GUIåºãå¦æä½ æ²¡æå®è£ PySideï¼GUIåæ æ³å·¥ä½ï¼è¯·å®è£ PySideã If you want to run Syncplay in console mode then run it with the --no-gui command line switch. See https://syncplay.pl/guide/ for more details.", # TODO: Translate end of message and update second sentence to be a translation of "You need to have the correct version of PySide installed for the GUI to work." "unable-import-twisted-error": "æ æ³å¯¼å ¥Twistedã请å®è£ Twisted v16.4.0ææ´é«çæ¬ã", "arguments-missing-error": "缺å°ä¸äºå¿ è¦çåæ°ï¼ä½¿ç¨--helpå½ä»¤æ¥ç详ç»ä¿¡æ¯", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/players/mpc.py new/syncplay-1.7.3/syncplay/players/mpc.py --- old/syncplay-1.7.1/syncplay/players/mpc.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/players/mpc.py 2024-04-29 20:15:42.000000000 +0200 @@ -283,6 +283,7 @@ pCDS = ctypes.cast(lparam, self.__PCOPYDATASTRUCT) # print "API:\tin>\t 0x%X\t" % int(pCDS.contents.dwData), ctypes.wstring_at(pCDS.contents.lpData) self.__mpcApi.handleCommand(pCDS.contents.dwData, ctypes.wstring_at(pCDS.contents.lpData)) + return 0 def SendCommand(self, cmd, message=''): # print "API:\t<out\t 0x%X\t" % int(cmd), message @@ -406,7 +407,7 @@ def openFile(self, filePath, resetPosition=False): self._mpcApi.openFile(filePath) - if resetPosition: + if resetPosition and self._mpcApi.filePlaying: self.setPosition(0, resetPosition=True) def displayMessage( @@ -522,4 +523,4 @@ return path elif os.path.isfile(path + "\\" + mpc_executable_filename): path += "\\" + mpc_executable_filename - return path \ No newline at end of file + return path diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/players/mpv.py new/syncplay-1.7.3/syncplay/players/mpv.py --- old/syncplay-1.7.1/syncplay/players/mpv.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/players/mpv.py 2024-04-29 20:15:42.000000000 +0200 @@ -1,5 +1,6 @@ # coding:utf8 import os +import random import re import sys import time @@ -10,8 +11,9 @@ from syncplay import constants from syncplay.messages import getMessage from syncplay.players.basePlayer import BasePlayer -from syncplay.utils import isURL, findResourcePath +from syncplay.utils import getRuntimeDir, isURL, findResourcePath from syncplay.utils import isMacOS, isWindows, isASCII +from syncplay.utils import playerPathExists from syncplay.vendor.python_mpv_jsonipc.python_mpv_jsonipc import MPV class MpvPlayer(BasePlayer): @@ -90,11 +92,11 @@ @staticmethod def getExpandedPath(playerPath): - if not os.path.isfile(playerPath): - if os.path.isfile(playerPath + "mpv.exe"): + if not playerPathExists(playerPath): + if playerPathExists(playerPath + "mpv.exe"): playerPath += "mpv.exe" return playerPath - elif os.path.isfile(playerPath + "\\mpv.exe"): + elif playerPathExists(playerPath + "\\mpv.exe"): playerPath += "\\mpv.exe" return playerPath if os.access(playerPath, os.X_OK): @@ -375,7 +377,7 @@ self._listener.sendLine(['loadfile', filePath], notReadyAfterThis=True) def setFeatures(self, featureList): - self.sendMpvOptions() + self._sendMpvOptions() def setPosition(self, value): if value < constants.DO_NOT_RESET_POSITION_THRESHOLD and self._recentlyReset(): @@ -408,7 +410,7 @@ self._storePosition(0) # TO TRY: self._listener.setReadyToSend(False) - def sendMpvOptions(self): + def _sendMpvOptions(self): options = [] for option in constants.MPV_SYNCPLAYINTF_OPTIONS_TO_SEND: options.append("{}={}".format(option, self._client._config[option])) @@ -420,6 +422,9 @@ options_string = ", ".join(options) self._listener.sendLine(["script-message-to", "syncplayintf", "set_syncplayintf_options", options_string]) self._setOSDPosition() + socketPath = self._listener.mpv_arguments.get("input-ipc-server") + if socketPath is not None: + self._setProperty("input-ipc-server", socketPath) def _handleUnknownLine(self, line): self.mpvErrorCheck(line) @@ -447,7 +452,7 @@ #self._client.ui.showDebugMessage("{} = {} / {}".format(update_string, paused_update, position_update)) if "<get_syncplayintf_options>" in line: - self.sendMpvOptions() + self._sendMpvOptions() if line == "<SyncplayUpdateFile>" or "Playing:" in line: self._client.ui.showDebugMessage("Not ready to send due to <SyncplayUpdateFile>") @@ -618,8 +623,15 @@ env['PATH'] = python_executable + ':' + env['PATH'] env['PYTHONPATH'] = pythonPath try: - socket = self.mpv_arguments.get('input-ipc-server') - self.mpvpipe = self.playerIPCHandler(mpv_location=self.playerPath, ipc_socket=socket, loglevel="info", log_handler=self.__playerController.mpv_log_handler, quit_callback=self.stop_client, env=env, **self.mpv_arguments) + self.mpvpipe = self.playerIPCHandler( + loglevel="info", + ipc_socket=self._get_ipc_socket(), + mpv_location=self.playerPath, + log_handler=self.__playerController.mpv_log_handler, + quit_callback=self.stop_client, + env=env, + **self.mpv_arguments + ) except Exception as e: self.quitReason = getMessage("media-player-error").format(str(e)) + " " + getMessage("mpv-failed-advice") self.__playerController.reactor.callFromThread(self.__playerController._client.ui.showErrorMessage, self.quitReason, True) @@ -628,6 +640,12 @@ #self.mpvpipe.show_text("HELLO WORLD!", 1000) threading.Thread.__init__(self, name="MPV Listener") + def _get_ipc_socket(self): + if isWindows(): + # On Windows, mpv expects a named pipe identifier (not a path) + return "syncplay-mpv-{0}".format(random.randint(0, 2**48)) + return getRuntimeDir().joinpath("mpv-socket").as_posix() + def __getCwd(self, filePath, env): if not filePath: return None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/players/mpvnet.py new/syncplay-1.7.3/syncplay/players/mpvnet.py --- old/syncplay-1.7.1/syncplay/players/mpvnet.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/players/mpvnet.py 2024-04-29 20:15:42.000000000 +0200 @@ -50,3 +50,4 @@ def getIconPath(path): return constants.MPVNET_ICONPATH + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/players/vlc.py new/syncplay-1.7.3/syncplay/players/vlc.py --- old/syncplay-1.7.1/syncplay/players/vlc.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/players/vlc.py 2024-04-29 20:15:42.000000000 +0200 @@ -487,10 +487,14 @@ call.extend(self.__playerController.SLAVE_ARGS) if args: - call.extend(args) + for arg in args: + if "=" in arg and "\"" in arg: + (argName, argValue) = arg.split("=", 1) + if argValue.startswith("\"") and argValue.endswith("\""): + arg = argName + "=" + argValue[1:-1] + call.extend([arg]) self._vlcVersion = None - if isWindows() and getattr(sys, 'frozen', '') and getattr(sys, '_MEIPASS', '') is not None: # Needed for pyinstaller --onefile bundle self.__process = subprocess.Popen( call, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/ui/ConfigurationGetter.py new/syncplay-1.7.3/syncplay/ui/ConfigurationGetter.py --- old/syncplay-1.7.1/syncplay/ui/ConfigurationGetter.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/ui/ConfigurationGetter.py 2024-04-29 20:15:42.000000000 +0200 @@ -520,7 +520,7 @@ from syncplay.vendor.Qt.QtCore import QCoreApplication from syncplay.vendor import qt5reactor if not (IsPySide6 or IsPySide2 or IsPySide): - raise ImportError + raise ImportError("Failed to identify compatible version of PySide.") if QCoreApplication.instance() is None: self.app = QtWidgets.QApplication(sys.argv) self.app.setDesktopFileName("syncplay") @@ -537,13 +537,14 @@ if isMacOS(): import appnope appnope.nope() - except ImportError: + except ImportError as e: try: from twisted.trial import unittest - except Exception as e: - print(e) + except Exception as ee: + print(ee) print(getMessage("unable-import-twisted-error")) sys.exit() + print(e) print(getMessage("unable-import-gui-error")) self._config['noGui'] = True if self._config['file'] and self._config['file'][:2] == "--": diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/ui/GuiConfiguration.py new/syncplay-1.7.3/syncplay/ui/GuiConfiguration.py --- old/syncplay-1.7.1/syncplay/ui/GuiConfiguration.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/ui/GuiConfiguration.py 2024-04-29 20:15:42.000000000 +0200 @@ -279,7 +279,7 @@ currentplayerpath = self.executablepathCombobox.currentText() if currentplayerpath: - NewPlayerArgs = self.playerargsTextbox.text().split(" ") if self.playerargsTextbox.text() else "" + NewPlayerArgs = utils.parseCommandLineString(self.playerargsTextbox.text()) if self.playerargsTextbox.text() else "" self.perPlayerArgs[self.executablepathCombobox.currentText()] = NewPlayerArgs def languageChanged(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/ui/__init__.py new/syncplay-1.7.3/syncplay/ui/__init__.py --- old/syncplay-1.7.1/syncplay/ui/__init__.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/ui/__init__.py 2024-04-29 20:15:42.000000000 +0200 @@ -9,7 +9,7 @@ if not isWindowsConsole(): try: from syncplay.ui.gui import MainWindow as GraphicalUI - except ImportError: + except (ImportError, AttributeError) as e: pass from syncplay.ui.consoleUI import ConsoleUI diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syncplay-1.7.1/syncplay/utils.py new/syncplay-1.7.3/syncplay/utils.py --- old/syncplay-1.7.1/syncplay/utils.py 2023-11-24 01:30:23.000000000 +0100 +++ new/syncplay-1.7.3/syncplay/utils.py 2024-04-29 20:15:42.000000000 +0200 @@ -1,5 +1,5 @@ - import ast +import atexit import datetime import hashlib import itertools @@ -10,11 +10,13 @@ import string import subprocess import sys +import tempfile import time import traceback import urllib.error import urllib.parse import urllib.request +from pathlib import Path from syncplay import constants from syncplay.messages import getMessage @@ -37,9 +39,28 @@ def isBSD(): return constants.OS_BSD in sys.platform or sys.platform.startswith(constants.OS_DRAGONFLY) + def isWindowsConsole(): return os.path.basename(sys.executable) == "SyncplayConsole.exe" + +def getRuntimeDir(): + cachedPath = getattr(getRuntimeDir, "cachedPath", None) + if cachedPath is not None: + return cachedPath + + baseDir = None + if not isWindows() and not isMacOS(): + baseDir = os.getenv("XDG_RUNTIME_DIR", None) + + tmp = tempfile.TemporaryDirectory(prefix="syncplay-", dir=baseDir) + atexit.register(tmp.cleanup) + + o = Path(tmp.name) + setattr(getRuntimeDir, "cachedPath", o) + return o + + def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None): """Retry calling the decorated function using an exponential backoff. @@ -191,6 +212,10 @@ return itertools.chain.from_iterable(itertools.combinations(s, r) for r in range(len(s), minLength, -1)) +def parseCommandLineString(s): + arsToReturn = re.findall(constants.ARGUMENT_SPLIT_REGEX, s) + return arsToReturn + def blackholeStdoutForFrozenWindow(): if getattr(sys, 'frozen', '') == "windows_exe": class Stderr(object): @@ -207,7 +232,8 @@ self._file = open(path, 'a', encoding='utf-8') # TODO: Handle errors. if self._file is not None: - self._file.write(text) + if not (text.startswith("<frozen zipimport>") and "UserWarning:" in text): + self._file.write(text) self._file.flush() def flush(self): @@ -301,7 +327,7 @@ def stripRoomName(RoomName): if RoomName: try: - return re.sub(constants.ROOM_NAME_STRIP_REGEX, "\g<roomnamebase>", RoomName) + return re.sub(constants.ROOM_NAME_STRIP_REGEX, r"\g<roomnamebase>", RoomName) except IndexError: return RoomName else: @@ -479,8 +505,8 @@ class RoomPasswordProvider(object): - CONTROLLED_ROOM_REGEX = re.compile("^\+(.*):(\w{12})$") - PASSWORD_REGEX = re.compile("[A-Z]{2}-\d{3}-\d{3}") + CONTROLLED_ROOM_REGEX = re.compile(r"^\+(.*):(\w{12})$") + PASSWORD_REGEX = re.compile(r"[A-Z]{2}-\d{3}-\d{3}") @staticmethod def isControlledRoom(roomName):
