FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
OMPython/setup.py at master · adeas31/OMPython · GitHub
adeas31
/
OMPython
Public
forked from
OpenModelica/OMPython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
OMPython
/
setup.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
57 lines (50 loc) · 1.78 KB
Breadcrumbs
OMPython
/
setup.py
Copy path
File metadata and controls
executable file
·
57 lines (50 loc) · 1.78 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
try
:
from
setuptools
import
setup
except
ImportError
:
from
distutils
.
core
import
setup
from
subprocess
import
call
import
sys
import
os
# Python 3.3 offers shutil.which()
from
distutils
import
spawn
def
warningOrError
(
errorOnFailure
,
msg
):
if
errorOnFailure
:
raise
Exception
(
msg
)
else
:
print
(
msg
)
def
generateIDL
():
errorOnFailure
=
not
os
.
path
.
exists
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'OMPythonIDL'
,
'__init__.py'
))
try
:
omhome
=
os
.
path
.
split
(
os
.
path
.
split
(
os
.
path
.
realpath
(
spawn
.
find_executable
(
"omc"
)))[
0
])[
0
]
except
:
omhome
=
None
omhome
=
omhome
or
os
.
environ
.
get
(
'OPENMODELICAHOME'
)
if
omhome
is
None
:
warningOrError
(
errorOnFailure
,
"Failed to find OPENMODELICAHOME (searched for environment variable as well as the omc executable)"
)
return
idl
=
os
.
path
.
join
(
omhome
,
"share"
,
"omc"
,
"omc_communication.idl"
)
if
not
os
.
path
.
exists
(
idl
):
warningOrError
(
errorOnFailure
,
"Path not found: %s"
%
idl
)
return
if
0
!=
call
([
"omniidl"
,
"-bpython"
,
"-Wbglobal=_OMCIDL"
,
"-Wbpackage=OMPythonIDL"
,
idl
]):
warningOrError
(
errorOnFailure
,
"omniidl command failed"
)
return
print
(
"Generated OMPythonIDL files"
)
if
sys
.
platform
!=
'win32'
:
generateIDL
()
setup
(
name
=
'OMPython'
,
version
=
'2.0.7'
,
description
=
'OpenModelica-Python API Interface'
,
author
=
'Anand Kalaiarasi Ganeson'
,
author_email
=
'ganan642@student.liu.se'
,
maintainer
=
'Adeel Asghar'
,
maintainer_email
=
'adeel.asghar@liu.se'
,
license
=
"BSD, OSMC-PL 1.2, GPL (user's choice)"
,
url
=
'http://openmodelica.org/'
,
packages
=
[
'OMPython'
,
'OMPython.OMParser'
,
'OMPythonIDL'
,
'OMPythonIDL._OMCIDL'
,
'OMPythonIDL._OMCIDL__POA'
],
install_requires
=
[
# 'omniORB', # Required, but not part of pypi
'pyparsing'
,
'numpy'
]
)
Back
|
FazBrowse Home
|
New Git URL