[Pkg-privacy-commits] [onionshare] 38/55: Renamed hs to onion
Ulrike Uhlig
u-guest at moszumanska.debian.org
Thu Sep 8 10:27:18 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 1372239ed7007d96a97a30a359224666b6ad16e2
Author: Micah Lee <micah at micahflee.com>
Date: Mon Sep 5 11:16:54 2016 -0700
Renamed hs to onion
---
onionshare/{hs.py => onion.py} | 6 +++---
onionshare/onionshare.py | 22 +++++++++++-----------
onionshare_gui/onionshare_gui.py | 4 ++--
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/onionshare/hs.py b/onionshare/onion.py
similarity index 98%
rename from onionshare/hs.py
rename to onionshare/onion.py
index d82ad35..7ccf7b0 100644
--- a/onionshare/hs.py
+++ b/onionshare/onion.py
@@ -40,10 +40,10 @@ class HSDirError(Exception):
"""
pass
-class HS(object):
+class Onion(object):
"""
- HS is an abstraction layer for connecting to the Tor control port and
- creating onion services. Onionshare supports creating onion services
+ Onion is an abstraction layer for connecting to the Tor control port and
+ creating onion services. OnionShare supports creating onion services
using two methods:
- Modifying the Tor configuration through the control port is the old
diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py
index 13b4585..4190ddb 100644
--- a/onionshare/onionshare.py
+++ b/onionshare/onionshare.py
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import os, sys, time, argparse, shutil, socket, threading
-from . import strings, helpers, web, hs
+from . import strings, helpers, web, onion
class OnionShare(object):
"""
@@ -29,7 +29,7 @@ class OnionShare(object):
"""
def __init__(self, debug=False, local_only=False, stay_open=False, transparent_torification=False):
self.port = None
- self.hs = None
+ self.onion = None
self.hidserv_dir = None
self.onion_host = None
@@ -75,10 +75,10 @@ class OnionShare(object):
self.onion_host = '127.0.0.1:{0:d}'.format(self.port)
return
- if not self.hs:
- self.hs = hs.HS(self.transparent_torification)
+ if not self.onion:
+ self.onion = onion.Onion(self.transparent_torification)
- self.onion_host = self.hs.start(self.port)
+ self.onion_host = self.onion.start(self.port)
def cleanup(self):
"""
@@ -92,9 +92,9 @@ class OnionShare(object):
shutil.rmtree(filename)
self.cleanup_filenames = []
- # call hs's cleanup
- if self.hs:
- self.hs.cleanup()
+ # cleanup the onion
+ if self.onion:
+ self.onion.cleanup()
def main(cwd=None):
@@ -142,9 +142,9 @@ def main(cwd=None):
app = OnionShare(debug, local_only, stay_open, transparent_torification)
app.choose_port()
app.start_onion_service()
- except hs.NoTor as e:
+ except onion.NoTor as e:
sys.exit(e.args[0])
- except hs.HSDirError as e:
+ except onion.HSDirError as e:
sys.exit(e.args[0])
# prepare files to share
@@ -166,7 +166,7 @@ def main(cwd=None):
try: # Trap Ctrl-C
# wait for hs, only if using old version of tor
if not app.local_only:
- ready = app.hs.wait_for_hs(app.onion_host)
+ ready = app.onion.wait_for_hs(app.onion_host)
if not ready:
sys.exit()
else:
diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py
index fff4838..abb8639 100644
--- a/onionshare_gui/onionshare_gui.py
+++ b/onionshare_gui/onionshare_gui.py
@@ -151,7 +151,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.app.choose_port()
try:
self.app.start_onion_service(gui=True)
- except onionshare.hs.NoTor as e:
+ except onionshare.onion.NoTor as e:
alert(e.args[0], QtWidgets.QMessageBox.Warning)
self.server_status.stop_server()
self.status_bar.clearMessage()
@@ -172,7 +172,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
# wait for hs
if not self.app.local_only:
self.status_bar.showMessage(strings._('gui_starting_server3', True))
- self.app.hs.wait_for_hs(self.app.onion_host)
+ self.app.onion.wait_for_hs(self.app.onion_host)
# done
self.start_server_finished.emit()
--
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