Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
telescope
Commits
5b77f664
Commit
5b77f664
authored
Oct 03, 2017
by
Tammo Jan Dijkema
Browse files
Raise error when could not connect
parent
4ab96dbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
__init__.py
View file @
5b77f664
...
...
@@ -46,17 +46,26 @@ class telescope():
self
.
_outsocket
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
if
self
.
setmode
==
'J2000'
:
self
.
_outsocket
.
connect
((
consoleHost
,
try
:
self
.
_outsocket
.
connect
((
consoleHost
,
config
.
getint
(
'Console'
,
'Port_Write_J2000'
)))
except
socket
.
gaierror
as
e
:
raise
IOError
(
"Could not connect to DT J2000 port: "
+
str
(
e
))
elif
self
.
setmode
==
'AZEL'
:
self
.
_outsocket
.
connect
((
consoleHost
,
try
:
self
.
_outsocket
.
connect
((
consoleHost
,
config
.
getint
(
'Console'
,
'Port_Write_AzEl'
)))
except
socket
.
gaierror
as
e
:
raise
IOError
(
"Could not connect to DT AZEL port: "
+
str
(
e
))
# Initialize offset socket for all modes where output is desired
if
self
.
setmode
is
not
None
:
self
.
_offsetsocket
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
_offsetsocket
.
connect
((
consoleHost
,
try
:
self
.
_offsetsocket
.
connect
((
consoleHost
,
config
.
getint
(
'Console'
,
'Port_Write_Offset'
)))
except
socket
.
gaierror
as
e
:
raise
IOError
(
"Could not connect to DT Offset port: "
+
str
(
e
))
self
.
_event_j2000
=
threading
.
Event
()
thread_read_j2000
=
threading
.
Thread
(
target
=
self
.
_readj2000
,
args
=
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment