mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-22 13:34:23 -04:00
pep8: too long lines, reformat lines to < 120 chars. removed redundancy from long_description in setup.py.
note: pep8 usually recommends 80 chars, but I find that impractical and unnecessary - it's not 1980 any more when code was edited on 80x25 terminals. i was a bit wondering about onionshare-launcher.py - it does a lot of imports, but does not use the imported names.
This commit is contained in:
parent
f5889d96dd
commit
087102bde4
5 changed files with 27 additions and 8 deletions
|
@ -212,7 +212,8 @@ def tails_root():
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
# open hole in firewall
|
# open hole in firewall
|
||||||
subprocess.call(['/sbin/iptables', '-I', 'OUTPUT', '-o', 'lo', '-p', 'tcp', '--dport', str(port), '-j', 'ACCEPT'])
|
subprocess.call(['/sbin/iptables', '-I', 'OUTPUT', '-o', 'lo',
|
||||||
|
'-p', 'tcp', '--dport', str(port), '-j', 'ACCEPT'])
|
||||||
|
|
||||||
# start hidden service
|
# start hidden service
|
||||||
app = OnionShare()
|
app = OnionShare()
|
||||||
|
@ -226,7 +227,8 @@ def tails_root():
|
||||||
import signal
|
import signal
|
||||||
|
|
||||||
def handler(signum=None, frame=None):
|
def handler(signum=None, frame=None):
|
||||||
subprocess.call(['/sbin/iptables', '-D', 'OUTPUT', '-o', 'lo', '-p', 'tcp', '--dport', str(port), '-j', 'ACCEPT'])
|
subprocess.call(['/sbin/iptables', '-D', 'OUTPUT', '-o', 'lo',
|
||||||
|
'-p', 'tcp', '--dport', str(port), '-j', 'ACCEPT'])
|
||||||
sys.exit()
|
sys.exit()
|
||||||
for sig in [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT]:
|
for sig in [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT]:
|
||||||
signal.signal(sig, handler)
|
signal.signal(sig, handler)
|
||||||
|
|
|
@ -188,14 +188,16 @@ class FileSelection(QtGui.QVBoxLayout):
|
||||||
self.file_list.update()
|
self.file_list.update()
|
||||||
|
|
||||||
def add_files(self):
|
def add_files(self):
|
||||||
filenames = QtGui.QFileDialog.getOpenFileNames(caption=strings._('gui_choose_files', True), options=QtGui.QFileDialog.ReadOnly)
|
filenames = QtGui.QFileDialog.getOpenFileNames(
|
||||||
|
caption=strings._('gui_choose_files', True), options=QtGui.QFileDialog.ReadOnly)
|
||||||
if filenames:
|
if filenames:
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
self.file_list.add_file(str(filename))
|
self.file_list.add_file(str(filename))
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
def add_dir(self):
|
def add_dir(self):
|
||||||
filename = QtGui.QFileDialog.getExistingDirectory(caption=strings._('gui_choose_folder', True), options=QtGui.QFileDialog.ReadOnly)
|
filename = QtGui.QFileDialog.getExistingDirectory(
|
||||||
|
caption=strings._('gui_choose_folder', True), options=QtGui.QFileDialog.ReadOnly)
|
||||||
if filename:
|
if filename:
|
||||||
self.file_list.add_file(str(filename))
|
self.file_list.add_file(str(filename))
|
||||||
self.update()
|
self.update()
|
||||||
|
|
16
setup.py
16
setup.py
|
@ -38,11 +38,23 @@ def file_list(path):
|
||||||
|
|
||||||
version = open('version').read().strip()
|
version = open('version').read().strip()
|
||||||
|
|
||||||
|
description = (
|
||||||
|
"""OnionShare lets you securely and anonymously share a file of any size with someone. """
|
||||||
|
"""It works by starting a web server, making it accessible as a Tor hidden service, """
|
||||||
|
"""and generating an unguessable URL to access and download the file.""")
|
||||||
|
|
||||||
|
long_description = description + " " + (
|
||||||
|
"""It doesn't require setting up a server on the internet somewhere or using a third """
|
||||||
|
"""party filesharing service. You host the file on your own computer and use a Tor """
|
||||||
|
"""hidden service to make it temporarily accessible over the internet. The other user """
|
||||||
|
"""just needs to use Tor Browser to download the file from you."""
|
||||||
|
)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='onionshare',
|
name='onionshare',
|
||||||
version=version,
|
version=version,
|
||||||
description='OnionShare lets you securely and anonymously share a file of any size with someone. It works by starting a web server, making it accessible as a Tor hidden service, and generating an unguessable URL to access and download the file.',
|
description=description,
|
||||||
long_description="""OnionShare lets you securely and anonymously share a file of any size with someone. It works by starting a web server, making it accessible as a Tor hidden service, and generating an unguessable URL to access and download the file. It doesn't require setting up a server on the internet somewhere or using a third party filesharing service. You host the file on your own computer and use a Tor hidden service to make it temporarily accessible over the internet. The other user just needs to use Tor Browser to download the file from you.""",
|
long_description=long_description,
|
||||||
author='Micah Lee',
|
author='Micah Lee',
|
||||||
author_email='micah@micahflee.com',
|
author_email='micah@micahflee.com',
|
||||||
url='https://github.com/micahflee/onionshare',
|
url='https://github.com/micahflee/onionshare',
|
||||||
|
|
|
@ -18,7 +18,9 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
import os, sys, subprocess, time, hashlib, platform, json, locale, socket, argparse, Queue, inspect, base64, random, functools, logging, ctypes, hmac, shutil
|
import os, sys, subprocess, time, hashlib, platform, json, locale, socket
|
||||||
|
import argparse, Queue, inspect, base64, random, functools, logging, ctypes
|
||||||
|
import hmac, shutil
|
||||||
from itertools import izip
|
from itertools import izip
|
||||||
import stem, stem.control, flask
|
import stem, stem.control, flask
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
|
@ -24,7 +24,8 @@ import test_helpers
|
||||||
|
|
||||||
def test_get_platform_on_tails():
|
def test_get_platform_on_tails():
|
||||||
"""get_platform() returns 'Tails' when hostname is 'amnesia'"""
|
"""get_platform() returns 'Tails' when hostname is 'amnesia'"""
|
||||||
helpers.platform.uname = lambda: ('Linux', 'amnesia', '3.14-1-amd64', '#1 SMP Debian 3.14.4-1 (2014-05-13)', 'x86_64', '')
|
helpers.platform.uname = lambda: ('Linux', 'amnesia', '3.14-1-amd64',
|
||||||
|
'#1 SMP Debian 3.14.4-1 (2014-05-13)', 'x86_64', '')
|
||||||
assert helpers.get_platform() == 'Tails'
|
assert helpers.get_platform() == 'Tails'
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue