This is an automated email from the git hooks/post-receive script. bmarc pushed a commit to branch master in repository playonlinux.
commit 271d17112e8ce9b4ba38273e55c41ac980634a69 Author: Bertrand Marc <[email protected]> Date: Sun Jul 9 19:12:42 2017 +0200 New upstream version 3.7.7 --- CHANGELOG | 13 + bash/install | 3 +- etc/splash.png | Bin 110283 -> 0 bytes lib/applications | 10 - lib/interface_v3 | 120 +++++++++ lib/interface_v3~ | 673 ----------------------------------------------- lib/variables | 2 +- lib/wine | 6 +- python/install.py | 6 +- python/lib/Variables.pyc | Bin 640 -> 595 bytes python/lib/__init__.pyc | Bin 185 -> 140 bytes python/lib/lng.pyc | Bin 1418 -> 1283 bytes python/wine_versions.py | 34 ++- 13 files changed, 173 insertions(+), 694 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d760817..fad476e 100755 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,16 @@ +-> 3.7.7 +- Bug #4 corrected (wine version manager does not start) +- Bug #14 corrected (conflict with gtkrgba module) +- Bug #27 fully corrected (a more natural sort) +- Added POL_SetupWindow_auto_shortcut which will replace POL_SetupWindow_make_shortcut +- Added POL_SetupError function +- install.py is fully compatible with offline mode plugin +- Some bugs corrected in wine version management + +-> 3.7.6 +- Multiple wineversion bug fixed +- Lucid Lynx Compatiblity + -> 3.7.5 - Improvement on icon managing - Manual installation now supports .msi files diff --git a/bash/install b/bash/install index b315b75..8b88920 100755 --- a/bash/install +++ b/bash/install @@ -23,10 +23,9 @@ fi source "$PLAYONLINUX/lib/sources" -verifier_jeux if [ ! "$OFFLINE" == "1" ] then - menu=$($PYTHON "$PLAYONLINUX/python/install.py"); + menu=$($PYTHON "$PLAYONLINUX/python/install.py" | tail -n 1); fi if [ "$menu" = "ExecLiveInstall" -o "$OFFLINE" == "1" ] then diff --git a/etc/splash.png b/etc/splash.png deleted file mode 100755 index 8558001..0000000 Binary files a/etc/splash.png and /dev/null differ diff --git a/lib/applications b/lib/applications index 339f120..5c0d97b 100755 --- a/lib/applications +++ b/lib/applications @@ -38,16 +38,6 @@ lancer () fi #wait_wine_exit } -verifier_jeux () -{ - # Permet de vérifier qu'il y a au moins un jeu disponible # - cd "$REPERTOIRE/configurations/listes/" - if [ "$(cat *)" = "" ] - then - erreur "$LNG_GAME_GAMES_MISSING" - fi -} - verifier_installation () { diff --git a/lib/interface_v3 b/lib/interface_v3 index 6667883..bc01d94 100755 --- a/lib/interface_v3 +++ b/lib/interface_v3 @@ -529,6 +529,126 @@ POL_SetupWindow_make_shortcut() fi fi } +POL_SetupError() +{ + POL_SetupWindow_message "$1\n\nAborting." "Error" + POL_SetupWindow_Close + exit +} +POL_SetupWindow_auto_shortcut() +{ + # 1 = Wineprefix + # 2 = Binaire + # 3 = Nom du raccourics + # 4 = Icone + # 5 = Eventuel argument + + Binaire="$2" + SpecialArg="$5" + + if [ "$4" = "" ] + then + NOMICONE_="$1" + else + NOMICONE_="$4" + fi + + mkdir -p "$REPERTOIRE/icones/32" + mkdir -p "$REPERTOIRE/icones/full_size" + + ICON_WEB_NAME="$4" + ICON_OK=0 + + ## On chope le dossier du binaire + cd "$REPERTOIRE/wineprefix/$1" || POL_SetupError "Prefixe $1 does not exists" + cd drive_c || POL_SetupError "drive_c folder does not exists" + binary_path=$(find ./ -iname "$Binaire" | tail -n 1) + binary_dir=$(dirname "$binary_path") + Binaire=$(basename "$binary_path") + [ "$binary_dir" = "" ] && POL_SetupError "Can't find $Binaire" + + + # Création de l'icone. + + # Cas 1 : le nom de l'icone est donné. + if [ -n "$ICON_WEB_NAME" ]; then + if [ ! "$OFFLINE" = "1" ]; then # On peut le télécharger... + wget -q "$SITE/icones/$ICON_WEB_NAME" -O "$REPERTOIRE/icones/full_size/$NOMICONE_" # On prend l'icone full size + fi + + if [ -f "$REPERTOIRE/icones/full_size/$NOMICONE_" ]; then + convert -resize 32 "$REPERTOIRE/icones/full_size/$NOMICONE_" "$REPERTOIRE/icones/32/$NOMICONE_" # On fabrique l'icone 32*32 + ICON_OK=1 + fi + elif [ "$ICON_OK" -ne 1 ]; then # Pas d'incone sur le web => Création à partir de l'exe... + echo "No internet icon..." + + mkdir -p "$REPERTOIRE/tmp/win32Icon" + wrestool -x "$REPERTOIRE/wineprefix/$1/drive_c/$binary_dir/$Binaire" -o "$REPERTOIRE/tmp/win32Icon" -t14 + + cd "$REPERTOIRE/tmp/win32Icon" + win32IconName=$(ls -S *.ico | head -n 1) + if [ -f "$win32IconName" ]; then # L'ico est créé + convert ICO:"$win32IconName" -resize 32 PNG:"$REPERTOIRE/icones/32/$NOMICONE_" # On fabrique l'icone 32*32 + fi # Si non : icone play on linux. + + rm -r "$REPERTOIRE/tmp/win32Icon" + + # On ne crée pas d'icone "full_size", parce que les résolutions des icones windows ne sont pas suffisantes tout le temps. + # Pour verifier la taille des icones, il faudrait utiliser "identify", mais ce programme n'est pas toujours fournis. + fi + + + ## On génère le binaire + echo "#!/bin/bash" > "$REPERTOIRE/configurations/installed/$NOMICONE_" + echo "export WINEPREFIX=\"$REPERTOIRE/wineprefix/$1\"" >> "$REPERTOIRE/configurations/installed/$NOMICONE_" + echo "export WINEDEBUG=\"-all\"" >> "$REPERTOIRE/configurations/installed/$NOMICONE_" + echo "cd \"$REPERTOIRE/wineprefix/$1/drive_c/$binary_dir\"" >> "$REPERTOIRE/configurations/installed/$NOMICONE_" + echo "wine \"$Binaire\" $SpecialArg \$@" >> "$REPERTOIRE/configurations/installed/$NOMICONE_" + chmod +x "$REPERTOIRE/configurations/installed/$NOMICONE_" + + + ## On prévient l'utilisateur que l'icône est prête, on lui propose de creer divers raccorucis + echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" + echo "make_shortcut" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" + echo "$NOMICONE_" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" + + + ## Attente de la réponse + MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') + while [ ! "$MESSAGE" = "MsgOut" ] + do + MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') + sleep 0.1 + done + + ## Lecture de la réponse + MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') + + + if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] ## Si il annule, on quitte + then + rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" + exit + else ## Sinon + if [ -f "$REPERTOIRE/icones/full_size/$NOMICONE_" ]; then # L'icone existe... + iconPath="$REPERTOIRE/icones/full_size/$NOMICONE_" + else + iconPath="$REPERTOIRE/icones/full_size/playonlinux.png" + fi + + MESSAGE_MENU=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_MENU=') + MESSAGE_DESKTOP=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_DESKTOP=') + if [ "$MESSAGE_MENU" == "MSG_MENU=True" ] + then + generer_icone "$iconPath" "$NOMICONE_" "$HOME/.local/share/applications/" "$PLAYONLINUX/playonlinux --run \"$NOMICONE_\"" "$NOMICONE_" + fi + if [ "$MESSAGE_DESKTOP" == "MSG_DESKTOP=True" ] + then + generer_icone "$iconPath" "$NOMICONE_" "$DESKTOP" "$PLAYONLINUX/playonlinux --run \"$NOMICONE_\"" "$NOMICONE_" + fi + fi +} POL_SetupWindow_Close () { echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" diff --git a/lib/interface_v3~ b/lib/interface_v3~ deleted file mode 100644 index 0a513b1..0000000 --- a/lib/interface_v3~ +++ /dev/null @@ -1,673 +0,0 @@ -#!/bin/bash -# Copyright (C) 2007 Pâris Quentin -# Copyright (C) 2009 Łukasz Wojniłowicz - -# 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 2 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, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -GenId() # On génère un ID unique pour notre fenêtre -{ - N_LETTRES=50 - - if [ "$1" != "" ] - then - N_LETTRES=$1 - fi - ALPHA='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' - - MOT="" - i=0 - while ((i < $N_LETTRES)); - do - CHIFFRE=$(( $RANDOM % ${#ALPHA})); - printf ${ALPHA:$CHIFFRE:1}; - (( i=i+1 )) - done - exit 0 -} -export POL_SetupWindow_ID=$(GenId) - -POL_SetupWindow_presentation () -{ - TEXTE="$(eval_gettext 'This assistant will help you to install ')$1$(eval_gettext ' on your computer.')\n\n$(eval_gettext 'This program is made by ')$2\n($3)\n\n$(eval_gettext 'This installation program is provided by ')$4\n\n$1$(eval_gettext ' will be installed in ')$REPERTOIRE/wineprefix/$5\n\n$(eval_gettext 'PlayOnLinux is not responsible of your way to use these scripts')\n\n$(eval_gettext 'Click on next to start')" - POL_SetupWindow_free_presentation "$(eval_gettext 'Welcome in PlayOnLinux Installation Wizard')" "$TEXTE" - -} -POL_SetupWindow_free_presentation () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "free_presentation" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - fi -} -POL_SetupWindow_message () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "message" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - fi -} -POL_SetupWindow_missing () -{ - if [ "$MANQUE" = "true" ] - then - LNG_MISSING_ERROR=$(eval_gettext "One or more program(s) are missing. Please install them and run the script again.") - - POL_SetupWindow_message "$LNG_MISSING_ERROR\n\n$MISSING" "$(eval_gettext Error)" - POL_SetupWindow_Close - exit $EXIT_MISSING - fi -} -POL_SetupWindow_licence () -{ - if [ -f "$3" ] - then - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "licence" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$3" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - fi - fi -} -POL_SetupWindow_message_image () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "message_image" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$3" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - fi -} -POL_SetupWindow_wait_next_signal () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "attendre_signal" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - exit - fi -} -POL_SetupWindow_pulsebar () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "pulsebar" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - exit - fi -} -POL_SetupWindow_pulse () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "pulse" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" -} -POL_SetupWindow_set_text () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "set_text" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" -} -POL_SetupWindow_wait () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "attendre" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$3" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - fi -} -POL_SetupWindow_download () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "download" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$3" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$(pwd)/" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - DOWNLOADEDFILE=`cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | head -n5 | tail -n1` - DOWNLOADSERVER=`echo $DOWNLOADEDFILE | cut -d/ -f3` - DOWNLOADEDFILE=$(basename "$DOWNLOADEDFILE") - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - exit - fi - - MESSAGE_TER=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_VALUE=') - MESSAGE_TER=${MESSAGE_TER:10} - if [ ! "$MESSAGE_TER" = 0 ] - then - if [ $(echo "$DOWNLOADEDFILE" | grep -o 'PlayOnLinux-wine') = "PlayOnLinux-wine" ] - then - ERROR_MESSAGE="WineVersion server temporary unavailable.\nPlease try again later." - elif [ "$MESSAGE_TER" == 1 ] - then - ERROR_MESSAGE="Following server is no longer available:\n\n- $DOWNLOADSERVER" - elif [ "$MESSAGE_TER" == 2 ] - then - ERROR_MESSAGE="Following file is no longer available on server:\n\n- $DOWNLOADEDFILE" - fi - - POL_SetupWindow_message_image "$ERROR_MESSAGE" "Download failure" "$PLAYONLINUX/themes/tango/warning.png" - POL_SetupWindow_Close - exit $EXIT_DOWNLOADERROR - fi -} -POL_SetupWindow_detect_exit () -{ - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - fi -} -POL_SetupWindow_textbox () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "champ" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$3" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - else - MESSAGE_TER=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_VALUE=') - MESSAGE_TER=${MESSAGE_TER:10} - export APP_ANSWER="$MESSAGE_TER" - fi -} -POL_SetupWindow_browse () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "browse" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$3" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$PWD" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - else - MESSAGE_TER=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_VALUE=') - MESSAGE_TER=${MESSAGE_TER:10} - export APP_ANSWER="$MESSAGE_TER" - fi -} -POL_SetupWindow_question () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "question" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - else - MESSAGE_TER=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_QUESTION=') - MESSAGE_TER=${MESSAGE_TER:13} - export APP_ANSWER="$MESSAGE_TER" - fi -} -POL_SetupWindow_menu () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "menu" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$3" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$4" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - else - MESSAGE_TER=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_VALUE=') - MESSAGE_TER=${MESSAGE_TER:10} - export APP_ANSWER="$MESSAGE_TER" - fi -} -POL_SetupWindow_checkbox_list () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "checkbox_list" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$3" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$4" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - else - MESSAGE_TER=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_VALUE=') - MESSAGE_TER=${MESSAGE_TER:10} - export APP_ANSWER="$MESSAGE_TER" - fi -} -POL_SetupWindow_menu_num () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "menu_num" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$3" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$4" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - else - MESSAGE_TER=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_VALUE=') - MESSAGE_TER=${MESSAGE_TER:10} - export APP_ANSWER="$MESSAGE_TER" - fi -} -POL_SetupWindow_menu_list () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "menu_list" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$3" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$4" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$5" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - else - MESSAGE_TER=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_VALUE=') - MESSAGE_TER=${MESSAGE_TER:10} - export APP_ANSWER="$MESSAGE_TER" - fi -} -POL_SetupWindow_games () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "get_games" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$1" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$2" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$3" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$4" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - else - MESSAGE_TER=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_VALUE=') - MESSAGE_TER=${MESSAGE_TER:10} - export APP_ANSWER="$MESSAGE_TER" - fi -} -POL_SetupWindow_specialprefixcreate () -{ - POL_SetupWindow_wait_next_signal "$(eval_gettext 'Please wait while the wine prefix is created...')" "$(eval_gettext 'Wine prefix configuration')" - wine wineprefixcreate - sleep 2 - set_user_dir - set_programfile_dir - POL_SetupWindow_detect_exit -} -POL_SetupWindow_oldprefixcreate () -{ - POL_SetupWindow_wait_next_signal "$(eval_gettext 'Please wait while the wine prefix is created...')" "$(eval_gettext 'Wine prefix configuration')" - wine wineprefixcreate - POL_SetupWindow_detect_exit -} -POL_SetupWindow_prefixcreate () -{ - POL_SetupWindow_normalprefixcreate - POL_LoadVar_PROGRAMFILES -} -POL_SetupWindow_normalprefixcreate() -{ - POL_SetupWindow_wait_next_signal "$(eval_gettext 'Please wait while the wine prefix is created...')" "$(eval_gettext 'Wine prefix configuration')" - wine wineboot - POL_SetupWindow_detect_exit -} -POL_SetupWindow_make_shortcut() -{ - # 1 = Wineprefix - # 2 = Repertoire - # 3 = Binaire - # 4 = Icone (png ou xpm) - # 5 = Nom de l'icône - # 6 = Ignoré (question de compatibilité avec les versions < 2.0) - # 7 = Eventuel argument - - creer_lanceur_base "$@" - - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "make_shortcut" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "$NOMICONE_" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - while [ ! "$MESSAGE" = "MsgOut" ] - do - MESSAGE=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MsgOut$') - sleep 0.1 - done - MESSAGE_BIS=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_RECEIVED=') - if [ "$MESSAGE_BIS" = "MSG_RECEIVED=Cancel" ] - then - rm "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - exit - else - if [ -f "$REPERTOIRE/icones/full_size/$NOMICONE_" ]; then # L'icone existe... - iconPath="$REPERTOIRE/icones/full_size/$NOMICONE_" - else - iconPath="$REPERTOIRE/icones/full_size/playonlinux.png" - fi - - MESSAGE_MENU=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_MENU=') - MESSAGE_DESKTOP=$(cat "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" | grep '^MSG_DESKTOP=') - if [ "$MESSAGE_MENU" == "MSG_MENU=True" ] - then - generer_icone "$iconPath" "$NOMICONE_" "$HOME/.local/share/applications/" "$PLAYONLINUX/playonlinux --run \"$NOMICONE_\"" "$NOMICONE_" - fi - if [ "$MESSAGE_DESKTOP" == "MSG_DESKTOP=True" ] - then - generer_icone "$iconPath" "$NOMICONE_" "$DESKTOP" "$PLAYONLINUX/playonlinux --run \"$NOMICONE_\"" "$NOMICONE_" - fi - fi -} -POL_SetupWindow_Close () -{ - echo "MsgIn" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - echo "exit" >> "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" -} -POL_SetupWindow_Quit () -{ - POL_SetupWindow_Close "$@" -} -POL_SetupWindow_Init () -{ - if [ "$1" = "" ] - then - arg1="None" - else - arg1="$1" - fi - if [ "$2" = "" ] - then - arg2="None" - else - arg2="$2" - fi - - mkdir -p "$REPERTOIRE/configurations/guis/" - echo "Wait" > "$REPERTOIRE/configurations/guis/$POL_SetupWindow_ID" - if [ "$POL_DEBUG" == "TRUE" ] - then - $PYTHON "$PLAYONLINUX/python/guiv3.py" "$arg1" "$arg2" & - else - $PYTHON "$PLAYONLINUX/python/guiv3.py" "$arg1" "$arg2" > /dev/null 2> /dev/null & - fi -} -POL_SetupWindow_Open () -{ - POL_SetupWindow_Init "$@" -} -POL_SetupWindow_reboot () -{ - POL_SetupWindow_wait_next_signal "$(eval_gettext 'Please wait while PlayOnLinux is simulating a Windows reboot')" "Wine" - wineboot - POL_SetupWindow_detect_exit -} -POL_SetupWindow_cdrom () -{ - # 1 = Numéro du CD - LIST_DEVICES_="" - cd /media - for device in * - do - if [ ! "$device" = "$LNG_OTHER" ] - then - fstab1=`cat '/etc/fstab' | grep "$device"` - fstab2=`cat '/etc/fstab' | grep "$device" | grep iso9660` - if [ "$fstab1" = "" -o "$fstab2" != "" ] - then - LIST_DEVICES_+="$device~" - fi - fi - done - - LNG_WINE_ASKFORCDROM=$(eval_gettext "Where is your CD-ROM mounted?") - LNG_OTHER=$(eval_gettext "Other") - POL_SetupWindow_menu "$LNG_WINE_ASKFORCDROM" "CD-ROM" "$LIST_DEVICES_$LNG_OTHER" "~" - CDROM="$APP_ANSWER" - if [ "$CDROM" = "$LNG_OTHER" ] - then - POL_SetupWindow_textbox "$LNG_WINE_ASKFORCDROM" "CD-ROM" "/media/cdrom" - CDROM="$APP_ANSWER" - else - CDROM="/media/$CDROM" - fi - - - if [ "$CDROM" = "" ] - then - CDROM="/media/cdrom" - fi -} -POL_SetupWindow_check_cdrom () -{ - #message "$LNG_MOUNT_CDROM" - LNG_WINE_ERRORCDROM=$(eval_gettext "Error : Unable to find the CD-ROM !") - if [ ! "$CDROM" = "" ] - then - while [ ! -e "$CDROM/$1" ] - do - POL_SetupWindow_message "$LNG_WINE_ERRORCDROM" "CD-ROM" - POL_SetupWindow_cdrom - done - fi -} -POL_SetupWindow_install_wine () -{ - rm "$REPERTOIRE/WineVersions/installed" 2> /dev/null - ARCHITECTURE="i386" - VERSIONENTRER="$1" - - if [ "$VERSIONENTRER" = "" ] - then - exit - fi - if [ ! -e "$REPERTOIRE/WineVersions/$VERSIONENTRER" ] - then - VERSION="$VERSIONENTRER" - ADRESSEDUDEB=$(wget "http://mulx.playonlinux.com/wine/linux-i386/LIST" -O- | grep ";$VERSION;" | tail -n 1 | cut -d ";" -f1) - if [ "$ADRESSEDUDEB" = "" ] - then - LNG_ERROR_WINE="$(eval_gettext 'Unable to find the version :')" - POL_SetupWindow_message "$LNG_ERROR_WINE $VERSIONENTRER" "Wine $1" - POL_SetupWindow_Close - exit - fi - - #ADRESSE_HTTP=$(expr index "$ADRESSEDUDEB" '.http://') - #ADRESSEDUDEB=${ADRESSEDUDEB:$ADRESSE_HTTP} - - LNG_WINEVERSIONS_DOWNLOADING="$(eval_gettext 'Downloading wine')" - cd "$REPERTOIRE/tmp" - POL_SetupWindow_download "$LNG_WINEVERSIONS_DOWNLOADING $VERSIONENTRER" "Wine" "http://mulx.playonlinux.com/wine/linux-i386/$ADRESSEDUDEB" - POL_SetupWindow_wait_next_signal "$LNG_WINEVERSIONS_DOWNLOADING $VERSIONENTRER" "Wine" - sleep 1 - sha1=$(wget "http://mulx.playonlinux.com/wine/linux-i386/$ADRESSEDUDEB.sha1" -O-) - sha1_file=$(sha1sum "./$ADRESSEDUDEB") - echo "Server sha1 : $sha1" - echo "Client sha1 : $sha1_file" - - POL_SetupWindow_detect_exit - LNG_WINEVERSIONS_DOWNLOADFAILED="$(eval_gettext 'The download seems to have failed')" - if [ ! "$sha1" = "$sha1_file" ] - then - POL_SetupWindow_message "$LNG_WINEVERSIONS_DOWNLOADFAILED" "Wine $1" - else - #message "$LNG_WINEVERSIONS_INSTALL" - POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting wine ...')" "Wine $1" - "$PLAYONLINUX/playonlinux-pkg" -i "$ADRESSEDUDEB" - POL_SetupWindow_detect_exit - fi - rm "$ADRESSEDUDEB" - fi - touch "$REPERTOIRE/WineVersions/installed" -} diff --git a/lib/variables b/lib/variables index 979e364..0c16f8b 100755 --- a/lib/variables +++ b/lib/variables @@ -19,7 +19,7 @@ export URL="http://www.playonlinux.com" export SITE="http://repository.playonlinux.com/" export SITE2="http://files.playonlinux.com/" export REPERTOIRE="$HOME/.PlayOnLinux" -export VERSION="3.7.6" +export VERSION="3.7.7" export LAST_VERSION=$(cat "$REPERTOIRE/configurations/last_version" 2> /dev/null) export PYTHON="python" if [ "$VRAIPATH" = "" ] diff --git a/lib/wine b/lib/wine index 0f66ea1..6ffbaf0 100755 --- a/lib/wine +++ b/lib/wine @@ -55,7 +55,7 @@ creer_prefixe () N2="$2" fi LNG_WINE_PREFIXCREATE="$(eval_gettext 'Creating Wine prefix')" - attendre "$LNG_WINE_PREFIXCREATE" "wineprefixcreate" "" "$N1" "$N2" "1" "" 0 "$LNG_FINISHED" + attendre "$LNG_WINE_PREFIXCREATE" "wine wineprefixcreate" "" "$N1" "$N2" "1" "" 0 "$LNG_FINISHED" set_user_dir set_programfile_dir fonts_to_prefixe @@ -174,7 +174,7 @@ REGEDIT4 "Common Templates"="%ALLUSERSPROFILE%\\\\Templates" "Favorites"="%ALLUSERSPROFILE%\\\\Favorites" EOF -regedit /tmp/pol_user.reg +wine regedit /tmp/pol_user.reg } set_programfile_dir() @@ -207,7 +207,7 @@ set_programfile_dir() EOF wine regedit "$REG" rm -f "$REG" - wineprefixcreate + wine wineprefixcreate #fi #rm -rf $REG diff --git a/python/install.py b/python/install.py index f18d134..df35ff3 100755 --- a/python/install.py +++ b/python/install.py @@ -64,7 +64,7 @@ class getDescription(threading.Thread): else: # Miniatures try : - url = 'http://repository.playonlinux.com/V2_data/miniatures/'+self.getDescription.replace(" ","%20") + url = Variables.site+'/V2_data/miniatures/'+self.getDescription.replace(" ","%20") req = urllib2.Request(url) handle = urllib2.urlopen(req) open(Variables.playonlinux_rep+"/tmp/min","w").write(handle.read()) @@ -74,7 +74,7 @@ class getDescription(threading.Thread): # Description try : - url = 'http://repository.playonlinux.com/V3_data/repository/get_description.php?id='+self.getDescription.replace(" ","%20") + url = Variables.site+'/V3_data/repository/get_description.php?id='+self.getDescription.replace(" ","%20") req = urllib2.Request(url) handle = urllib2.urlopen(req) self.htmlContent = handle.read() @@ -86,7 +86,7 @@ class getDescription(threading.Thread): # Stars try : - url = 'http://repository.playonlinux.com/V3_data/repository/stars.php?n='+self.getDescription.replace(" ","%20") + url = Variables.site+'/V3_data/repository/stars.php?n='+self.getDescription.replace(" ","%20") req = urllib2.Request(url) handle = urllib2.urlopen(req) self.stars = handle.read() diff --git a/python/lib/Variables.pyc b/python/lib/Variables.pyc old mode 100755 new mode 100644 index 423d9d8..e427057 Binary files a/python/lib/Variables.pyc and b/python/lib/Variables.pyc differ diff --git a/python/lib/__init__.pyc b/python/lib/__init__.pyc old mode 100755 new mode 100644 index fa07a11..462eb4a Binary files a/python/lib/__init__.pyc and b/python/lib/__init__.pyc differ diff --git a/python/lib/lng.pyc b/python/lib/lng.pyc old mode 100755 new mode 100644 index 68892ef..d470a7c Binary files a/python/lib/lng.pyc and b/python/lib/lng.pyc differ diff --git a/python/wine_versions.py b/python/wine_versions.py index 35b978f..042b03c 100755 --- a/python/wine_versions.py +++ b/python/wine_versions.py @@ -27,6 +27,36 @@ lib.lng.Lang() timeout = 2 socket.setdefaulttimeout(timeout) +def keynat(string): + r'''A natural sort helper function for sort() and sorted() + without using regular expressions or exceptions. + + >>> items = ('Z', 'a', '10th', '1st', '9') + >>> sorted(items) + ['10th', '1st', '9', 'Z', 'a'] + >>> sorted(items, key=keynat) + ['1st', '9', '10th', 'a', 'Z'] + + Borrowed from http://code.activestate.com/recipes/285264/#c6 + by paul clinch. + + License is the PSF Python License, http://www.python.org/psf/license/ (GPL compatible) + ''' + it = type(1) + r = [] + for c in string: + if c.isdigit(): + d = int(c) + if r and type( r[-1] ) == it: + r[-1] = r[-1] * 10 + d + else: + r.append(d) + else: + r.append(c.lower()) + return r + + + class getVersions(threading.Thread): def __init__(self): threading.Thread.__init__(self) @@ -251,7 +281,7 @@ class MainWindow(wx.Frame): root = self.onglets.list_game.AddRoot("") self.i = 0 for game in self.games: - self.file = Variables.playonlinux_rep+"configurations/installed/"+game.encode("utf-8") + self.file = Variables.playonlinux_rep+"configurations/installed/"+game if(not os.path.isdir(self.file)): fichier = open(self.file,"r").read() @@ -316,7 +346,7 @@ class MainWindow(wx.Frame): root2 = self.onglets.list_ver_installed.AddRoot("") installed_versions = os.listdir(Variables.playonlinux_rep+"/WineVersions/") - installed_versions.sort() + installed_versions.sort(key=keynat) installed_versions.reverse() self.i = 0 self.j = 0 -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/playonlinux.git _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

