[Pkg-privacy-commits] [torbrowser-launcher] 96/476: fixes most of #17
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:21:26 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository torbrowser-launcher.
commit bee3e0ed4614300bca0d0a60181ea18298245515
Author: Micah Lee <micahflee at riseup.net>
Date: Mon Apr 8 10:56:06 2013 -0700
fixes most of #17
---
README | 2 +-
torbrowser-launcher | 23 ++++++++++++++++++++++-
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/README b/README
index 0ce83f7..30d0c98 100644
--- a/README
+++ b/README
@@ -29,7 +29,7 @@ install it like this:
Also install the torbrowser-launcher dependencies:
- apt-get install tor python-gtk2 gnupg python-twisted
+ apt-get install tor python-gtk2 python-psutil gnupg python-twisted
Building
--------
diff --git a/torbrowser-launcher b/torbrowser-launcher
index 0e65e91..502a92c 100755
--- a/torbrowser-launcher
+++ b/torbrowser-launcher
@@ -11,7 +11,7 @@ import pygtk
pygtk.require('2.0')
import gtk
-import os, sys, subprocess, locale, urllib2, gobject, time, pickle, json, tarfile
+import os, sys, subprocess, locale, urllib2, gobject, time, pickle, json, tarfile, psutil
from twisted.web.client import Agent, ResponseDone
from twisted.web.http_headers import Headers
@@ -61,6 +61,24 @@ class TorBrowserLauncher:
if self.load_settings():
self.build_paths(self.settings['latest_version'])
+ # is tbb already running and we just need to open a new firefox?
+ if self.settings['installed_version']:
+ vidalia_pid = None
+ firefox_pid = None
+ for p in psutil.process_iter():
+ try:
+ if p.exe == self.paths['file']['vidalia_bin']:
+ vidalia_pid = p.exe
+ if p.exe == self.paths['file']['firefox_bin']:
+ firefox_pid = p.exe
+ except:
+ pass
+
+ if vidalia_pid and not firefox_pid:
+ print _('Vidalia is already open, but firefox is closed. Launching new firefox.')
+ subprocess.Popen([self.paths['file']['firefox_bin'], '-no-remote', '-profile', self.paths['file']['firefox_profile']])
+ return
+
# how long was it since the last update check?
# 86400 seconds = 24 hours
current_timestamp = int(time.time())
@@ -190,6 +208,9 @@ class TorBrowserLauncher:
'settings': tbb_data+'/settings',
'version': tbb_data+'/version',
'start': tbb_data+'/tbb/'+self.architecture+'/tor-browser_'+self.language+'/start-tor-browser',
+ 'vidalia_bin': tbb_data+'/tbb/'+self.architecture+'/tor-browser_'+self.language+'/App/vidalia',
+ 'firefox_bin': tbb_data+'/tbb/'+self.architecture+'/tor-browser_'+self.language+'/App/Firefox/firefox',
+ 'firefox_profile': tbb_data+'/tbb/'+self.architecture+'/tor-browser_'+self.language+'/Data/profile',
'update_check': tbb_data+'/download/RecommendedTBBVersions',
'icon': '/usr/share/pixmaps/torbrowser80.xpm',
'torproject_pem': '/usr/share/torbrowser-launcher/torproject.pem',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git
More information about the Pkg-privacy-commits
mailing list