mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-27 15:57:10 -04:00
Merge pull request #206 from lazlolazlolazlo/codestyle
Fix some small codestyle issues according to pep8.
This commit is contained in:
commit
2b1a3e927e
8 changed files with 35 additions and 33 deletions
|
@ -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':
|
||||||
|
|
|
@ -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':
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue