FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
plotdevice/plotdevice/run/__init__.py at main · plotdevice/plotdevice · GitHub
plotdevice
plotdevice
Repository navigation
Code
Issues
10
(10)
Pull requests
4
(4)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
plotdevice
/
plotdevice
/
run
/
__init__.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (29 loc) · 1.15 KB
Breadcrumbs
plotdevice
/
plotdevice
/
run
/
__init__.py
Copy path
File metadata and controls
33 lines (29 loc) · 1.15 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
sys
,
site
from
os
.
path
import
abspath
,
dirname
,
exists
,
join
from
subprocess
import
call
try
:
# test the sys.path by attempting to load a PyObjC submodule...
from
Foundation
import
*
import
objc
except
ImportError
:
# detect whether we're being run from the repository and set up a local env if so
repo
=
abspath
(
join
(
dirname
(
__file__
),
'../..'
))
setup_py
=
'%s/setup.py'
%
repo
if
exists
(
setup_py
):
from
platform
import
python_version
from
sysconfig
import
get_config_var
local_libs
=
'%s/deps/local/%s/lib/python%s/site-packages'
%
(
repo
,
python_version
(),
get_config_var
(
'py_version_short'
))
if
not
exists
(
local_libs
):
call
([
sys
.
executable
,
setup_py
,
'dev'
])
site
.
addsitedir
(
local_libs
)
from
Foundation
import
*
import
objc
else
:
from
pprint
import
pformat
missing
=
"Searched for PyObjC libraries in:
\n
%s
\n
to no avail..."
%
pformat
(
sys
.
path
)
raise
RuntimeError
(
missing
)
# pull in the encoding-pragma detector
from
.
common
import
encoded
# expose the script-runner object
from
.
sandbox
import
Sandbox
__all__
=
(
'objc'
,
'encoded'
,
'Sandbox'
)
Back
|
FazBrowse Home
|
New Git URL