-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlaunch_startup.py
More file actions
48 lines (36 loc) · 1.38 KB
/
Copy pathlaunch_startup.py
File metadata and controls
48 lines (36 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# coding: utf-8
import os, sys, console
import clipboard as cl
clset, clget = cl.set, cl.get
h = help
PYFW = os.path.join(sys.executable.rpartition("/")[0], "Frameworks/PythonistaKit.framework")
PYLIB = os.path.join(PYFW, "pylib")
HOME1 = os.path.expanduser("~")
HOME2 = DOCS = os.path.join(HOME1, "Documents")
PYBTC = os.path.join(HOME2, "pybitcointools-master") # os.path.expanduser("~/Documents/pybitcointools-master")
# PYBTC_source = os.path.expanduser("~/Documents/pybitcointools-master/bitcoin")
# PYBTC_dest = os.path.expanduser("~/Documents/site-packages/bitcoin")
#from pythonista_startup
sys.path.insert(0, PYBTC)
# try:
# from bitcoin import *
# console.hud_alert("pybitcointools successfully imported!".title(), "success", 1.42)
# except ImportError:
# console.hud_alert("Unable to import... pybitcointools".title(), "error", 1.42)
def to_bytes(x):
if sys.version_info.major > 2 and isinstance(x, str):
x = bytes(x, 'utf-8')
return x
s2b = str2bytes = to_bytes
def from_bytes(x):
if sys.version_info.major > 2 and isinstance(x, bytes):
x = str(x, 'utf-8')
return x
b2s = bytes2str = from_bytes
try:
import cd_ls_pwd # import the three functions
cd = cd_ls_pwd.cd # send up a top-level alias
ls = cd_ls_pwd.ls # send up a top-level alias
pwd = cd_ls_pwd.pwd # send up a top-level alias
except ImportError:
pass