[Pkg-privacy-commits] [onionshare] 26/55: Pass helpers into strings.load_strings instead of importing it, so fix issue with cx_Freeze in Windows

Ulrike Uhlig u-guest at moszumanska.debian.org
Thu Sep 8 10:26:49 UTC 2016


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to branch debian
in repository onionshare.

commit dbf4af02ac0f73a8fcea39216e20830bf68a4134
Author: Micah Lee <micah at micahflee.com>
Date:   Sun Sep 4 20:09:18 2016 -0700

    Pass helpers into strings.load_strings instead of importing it, so fix issue with cx_Freeze in Windows
---
 onionshare/onionshare.py         | 2 +-
 onionshare/strings.py            | 5 +----
 onionshare_gui/onionshare_gui.py | 2 +-
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py
index f9c0786..b1b402e 100644
--- a/onionshare/onionshare.py
+++ b/onionshare/onionshare.py
@@ -102,7 +102,7 @@ def main(cwd=None):
     The main() function implements all of the logic that the command-line version of
     onionshare uses.
     """
-    strings.load_strings()
+    strings.load_strings(helpers)
     print(strings._('version_string').format(helpers.get_version()))
 
     # onionshare CLI in OSX needs to change current working directory (#132)
diff --git a/onionshare/strings.py b/onionshare/strings.py
index 116f115..94739ef 100644
--- a/onionshare/strings.py
+++ b/onionshare/strings.py
@@ -19,12 +19,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 """
 import json, locale, os
 
-from . import helpers
-
 strings = {}
 
-
-def load_strings(default="en"):
+def load_strings(helpers, default="en"):
     """
     Loads translated strings and fallback to English
     if the translation does not exist.
diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py
index 1eb508b..825fa8b 100644
--- a/onionshare_gui/onionshare_gui.py
+++ b/onionshare_gui/onionshare_gui.py
@@ -284,7 +284,7 @@ def main():
     """
     The main() function implements all of the logic that the GUI version of onionshare uses.
     """
-    strings.load_strings()
+    strings.load_strings(helpers)
     print(strings._('version_string').format(helpers.get_version()))
 
     # start the Qt app

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionshare.git



More information about the Pkg-privacy-commits mailing list