Merge pull request #206 from lazlolazlolazlo/codestyle

Fix some small codestyle issues according to pep8.
This commit is contained in:
Micah Lee 2015-11-08 12:43:42 -08:00
commit 2b1a3e927e
8 changed files with 35 additions and 33 deletions

View file

@ -40,6 +40,7 @@ if get_platform() == 'Darwin':
else: else:
osx_resources_dir = None osx_resources_dir = None
def get_onionshare_dir(): def get_onionshare_dir():
if get_platform() == 'Darwin': if get_platform() == 'Darwin':
onionshare_dir = os.path.dirname(__file__) 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()))) onionshare_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
return onionshare_dir return onionshare_dir
def get_html_path(filename): def get_html_path(filename):
p = platform.system() p = platform.system()
if p == 'Darwin': if p == 'Darwin':

View file

@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import os, sys, inspect, platform import os, sys, inspect, platform
from onionshare import helpers from onionshare import helpers
def get_onionshare_gui_dir(): def get_onionshare_gui_dir():
p = helpers.get_platform() p = helpers.get_platform()
if p == 'Darwin': if p == 'Darwin':

View file

@ -26,7 +26,7 @@ import common
try: try:
import onionshare import onionshare
except ImportError: except ImportError:
sys.path.append(os.path.abspath(common.onionshare_gui_dir+"/..")) sys.path.append(os.path.abspath(common.onionshare_gui_dir + "/.."))
import onionshare import onionshare
from onionshare import strings, helpers, web from onionshare import strings, helpers, web

View file

@ -46,4 +46,3 @@ class Options(QtGui.QHBoxLayout):
self.web.set_stay_open(False) self.web.set_stay_open(False)
else: else:
self.web.set_stay_open(True) self.web.set_stay_open(True)

View file

@ -144,7 +144,7 @@ class ServerStatus(QtGui.QVBoxLayout):
GMEM_DDESHARE = 0x2000 GMEM_DDESHARE = 0x2000
ctypes.windll.user32.OpenClipboard(None) ctypes.windll.user32.OpenClipboard(None)
ctypes.windll.user32.EmptyClipboard() 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) pch_data = ctypes.windll.kernel32.GlobalLock(hcd)
ctypes.cdll.msvcrt.strcpy(ctypes.c_char_p(pch_data), bytes(url)) ctypes.cdll.msvcrt.strcpy(ctypes.c_char_p(pch_data), bytes(url))
ctypes.windll.kernel32.GlobalUnlock(hcd) ctypes.windll.kernel32.GlobalUnlock(hcd)