mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-17 13:02:42 -05:00
Merge pull request #206 from lazlolazlolazlo/codestyle
Fix some small codestyle issues according to pep8.
This commit is contained in:
commit
2b1a3e927e
@ -40,6 +40,7 @@ if get_platform() == 'Darwin':
|
||||
else:
|
||||
osx_resources_dir = None
|
||||
|
||||
|
||||
def get_onionshare_dir():
|
||||
if get_platform() == 'Darwin':
|
||||
onionshare_dir = os.path.dirname(__file__)
|
||||
@ -47,6 +48,7 @@ def get_onionshare_dir():
|
||||
onionshare_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
|
||||
return onionshare_dir
|
||||
|
||||
|
||||
def get_html_path(filename):
|
||||
p = platform.system()
|
||||
if p == 'Darwin':
|
||||
|
@ -112,7 +112,7 @@ class OnionShare(object):
|
||||
args = ['/usr/bin/sudo', '--', '/usr/bin/onionshare']
|
||||
print "Executing: {0:s}".format(args+[str(self.port)])
|
||||
p = subprocess.Popen(args+[str(self.port)], stderr=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
stdout = p.stdout.read(22) # .onion URLs are 22 chars long
|
||||
stdout = p.stdout.read(22) # .onion URLs are 22 chars long
|
||||
|
||||
if stdout:
|
||||
self.onion_host = stdout
|
||||
@ -227,7 +227,7 @@ class OnionShare(object):
|
||||
except urllib2.HTTPError: # Tails error
|
||||
sys.stdout.write('{0:s}\n'.format(strings._('wait_for_hs_nope')))
|
||||
sys.stdout.flush()
|
||||
except httplib.BadStatusLine: # Tails (with bridge) error
|
||||
except httplib.BadStatusLine: # Tails (with bridge) error
|
||||
sys.stdout.write('{0:s}\n'.format(strings._('wait_for_hs_nope')))
|
||||
sys.stdout.flush()
|
||||
except KeyboardInterrupt:
|
||||
|
@ -146,7 +146,7 @@ def download(slug_candidate):
|
||||
basename = os.path.basename(zip_filename)
|
||||
|
||||
def generate():
|
||||
chunk_size = 102400 # 100kb
|
||||
chunk_size = 102400 # 100kb
|
||||
|
||||
fp = open(zip_filename, 'rb')
|
||||
done = False
|
||||
|
@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import os, sys, inspect, platform
|
||||
from onionshare import helpers
|
||||
|
||||
|
||||
def get_onionshare_gui_dir():
|
||||
p = helpers.get_platform()
|
||||
if p == 'Darwin':
|
||||
|
@ -26,7 +26,7 @@ import common
|
||||
try:
|
||||
import onionshare
|
||||
except ImportError:
|
||||
sys.path.append(os.path.abspath(common.onionshare_gui_dir+"/.."))
|
||||
sys.path.append(os.path.abspath(common.onionshare_gui_dir + "/.."))
|
||||
import onionshare
|
||||
from onionshare import strings, helpers, web
|
||||
|
||||
|
@ -46,4 +46,3 @@ class Options(QtGui.QHBoxLayout):
|
||||
self.web.set_stay_open(False)
|
||||
else:
|
||||
self.web.set_stay_open(True)
|
||||
|
||||
|
@ -144,7 +144,7 @@ class ServerStatus(QtGui.QVBoxLayout):
|
||||
GMEM_DDESHARE = 0x2000
|
||||
ctypes.windll.user32.OpenClipboard(None)
|
||||
ctypes.windll.user32.EmptyClipboard()
|
||||
hcd = ctypes.windll.kernel32.GlobalAlloc(GMEM_DDESHARE, len(bytes(url))+1)
|
||||
hcd = ctypes.windll.kernel32.GlobalAlloc(GMEM_DDESHARE, len(bytes(url)) + 1)
|
||||
pch_data = ctypes.windll.kernel32.GlobalLock(hcd)
|
||||
ctypes.cdll.msvcrt.strcpy(ctypes.c_char_p(pch_data), bytes(url))
|
||||
ctypes.windll.kernel32.GlobalUnlock(hcd)
|
||||
|
Loading…
x
Reference in New Issue
Block a user