diff --git a/scripts/twblue.nsi b/scripts/twblue.nsi index 1844e8bc..1cbee372 100644 --- a/scripts/twblue.nsi +++ b/scripts/twblue.nsi @@ -24,7 +24,7 @@ var StartMenuFolder !insertmacro MUI_PAGE_STARTMENU startmenu $StartMenuFolder !insertmacro MUI_PAGE_INSTFILES !define MUI_FINISHPAGE_LINK "Visit TW Blue website" -!define MUI_FINISHPAGE_LINK_LOCATION "http://twblue.com.mx" +!define MUI_FINISHPAGE_LINK_LOCATION "http://twblue.es" !define MUI_FINISHPAGE_RUN "$INSTDIR\TWBlue.exe" !define MUI_FINISHPAGE_RUN_PARAMETERS "-i" !insertmacro MUI_PAGE_FINISH @@ -58,7 +58,7 @@ CreateShortCut "$DESKTOP\TW Blue.lnk" "$INSTDIR\TWBlue.exe" "-i" !insertmacro MUI_STARTMENU_WRITE_BEGIN startmenu CreateDirectory "$SMPROGRAMS\$StartMenuFolder" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\TW Blue.lnk" "$INSTDIR\TWBlue.exe" "-i" -CreateShortCut "$SMPROGRAMS\$StartMenuFolder\TW Blue on the web.lnk" "http://twblue.com.mx" +CreateShortCut "$SMPROGRAMS\$StartMenuFolder\TW Blue on the web.lnk" "http://twblue.es" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" !insertmacro MUI_STARTMENU_WRITE_END WriteUninstaller "$INSTDIR\Uninstall.exe" diff --git a/src/application.py b/src/application.py index 0343373c..82cb9f64 100644 --- a/src/application.py +++ b/src/application.py @@ -2,7 +2,7 @@ name = 'TWBlue' snapshot = False if snapshot == False: - version = "0.52" + version = "0.51" update_url = 'http://twblue.es/updates/tw_blue.json' else: version = "7" diff --git a/src/main.py b/src/main.py index fd3af644..0d69a785 100644 --- a/src/main.py +++ b/src/main.py @@ -20,15 +20,13 @@ A twitter accessible, easy of use and cross platform application.""" # ############################################################ import sys -from StringIO import StringIO -#redirect the original stdout and stderr -#stdout=sys.stdout -#stderr=sys.stderr -# Set a StringIO object as stdout and stderr to avoid problems using the installed version. -#sys.stdout = StringIO() -#sys.stderr = StringIO() -import wx import os +#redirect the original stdout and stderr +stdout=sys.stdout +stderr=sys.stderr +sys.stdout = open(os.path.join(os.getenv("temp"), "stdout.log"), "w") +sys.stderr = open(os.path.join(os.getenv("temp"), "stderr.log"), "w") +import wx ssmg = None import gui import wxLangs @@ -44,17 +42,22 @@ import config import output import sound import languageHandler -#close the memory buffers for stdout and stderr -#sys.stdout.close() -#sys.stderr.close() +#extra variables to control the temporal stdout and stderr, while the final files are opened. We understand that some errors could happen while all outputs are closed, so let's try to avoid it. +stdout_temp=sys.stdout +stderr_temp=sys.stderr #if it's a binary version -#if hasattr(sys, 'frozen'): -# sys.stderr = open(paths.logs_path("stderr.log"), 'w') -# sys.stdout = open(paths.logs_path("stdout.log"), 'w') -#else: -# sys.stdout=stdout -# sys.stderr=stderr - +if hasattr(sys, 'frozen'): + sys.stderr = open(paths.logs_path("stderr.log"), 'w') + sys.stdout = open(paths.logs_path("stdout.log"), 'w') +else: + sys.stdout=stdout + sys.stderr=stderr +#the final log files have been opened succesfully, let's close the temporal files +stdout_temp.close() +stderr_temp.close() +#finally, remove the temporal files. TW Blue doesn't need them anymore, and we will get more free space on the harddrive +os.remove(stdout_temp.name) +os.remove(stderr_temp.name) #app = wx.App() app = wx.App(redirect=True, useBestVisual=True, filename=paths.logs_path('tracebacks.log')) configured = False