Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python-TaborDriver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
QuTech
python-TaborDriver
Commits
84e5ffa9
Commit
84e5ffa9
authored
7 years ago
by
Simon Sebastian Humpohl
Browse files
Options
Downloads
Patches
Plain Diff
Dynamic __version__ read
Rudimentary is simulator check
parent
1c40f0ec
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
setup.py
+19
-1
19 additions, 1 deletion
setup.py
teawg/__init__.py
+9
-0
9 additions, 0 deletions
teawg/__init__.py
with
28 additions
and
1 deletion
setup.py
+
19
−
1
View file @
84e5ffa9
from
setuptools
import
setup
from
setuptools
import
setup
import
os
import
re
def
get_version
():
dir_path
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
teawg_init
=
os
.
path
.
join
(
dir_path
,
'
teawg
'
,
'
__init__.py
'
)
with
open
(
teawg_init
,
'
r
'
)
as
version_file
:
# https://packaging.python.org/guides/single-sourcing-package-version/
version_match
=
re
.
search
(
r
"
^__version__\s+=\s+[
'
\"]([^
'
\"]*)[
'
\"]
"
,
version_file
.
read
(),
re
.
M
)
if
version_match
:
return
version_match
.
group
(
1
)
else
:
raise
RuntimeError
(
"
Unable to find version string.
"
)
setup
(
setup
(
name
=
'
pytabor
'
,
name
=
'
pytabor
'
,
version
=
'
0.0.1
'
,
version
=
get_version
()
,
packages
=
[
'
pytabor
'
,
'
teawg
'
],
packages
=
[
'
pytabor
'
,
'
teawg
'
],
package_dir
=
{
'
pytabor
'
:
'
pytabor
'
,
'
teawg
'
:
'
teawg
'
},
package_dir
=
{
'
pytabor
'
:
'
pytabor
'
,
'
teawg
'
:
'
teawg
'
},
url
=
''
,
url
=
''
,
...
...
This diff is collapsed.
Click to expand it.
teawg/__init__.py
+
9
−
0
View file @
84e5ffa9
...
@@ -37,6 +37,8 @@ import time
...
@@ -37,6 +37,8 @@ import time
import
posixpath
import
posixpath
from
pyvisa.errors
import
VisaIOError
,
VI_ERROR_TMO
from
pyvisa.errors
import
VisaIOError
,
VI_ERROR_TMO
from
pyvisa.resources
import
TCPIPSocket
from
pyvisa.constants
import
InterfaceType
import
pytabor
import
pytabor
...
@@ -438,6 +440,13 @@ class TEWXAwg(object):
...
@@ -438,6 +440,13 @@ class TEWXAwg(object):
'''
Get the firmware version
'''
'''
Get the firmware version
'''
return
self
.
_fw_ver
return
self
.
_fw_ver
@property
def
is_simulator
(
self
):
'''
True if IP address is localhost
'''
if
self
.
visa_inst
and
self
.
visa_inst
.
interface_type
==
InterfaceType
.
tcpip
:
return
'
127.0.0.1
'
in
self
.
visa_inst
.
resource_name
or
'
localhost
'
in
self
.
visa_inst
.
resource_name
return
False
@property
@property
def
paranoia_level
(
self
):
def
paranoia_level
(
self
):
'''
Get the (default) paranoia-level
'''
Get the (default) paranoia-level
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment