Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hidra
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steinbac
hidra
Commits
425bc81a
Commit
425bc81a
authored
9 years ago
by
Manuela Kuhn
Browse files
Options
Downloads
Patches
Plain Diff
Removed unnecessary imports
parent
18172014
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/receiverLiveViewer/FileReceiver.py
+2
-15
2 additions, 15 deletions
src/receiverLiveViewer/FileReceiver.py
src/shared/LiveViewCommunicator.py
+1
-7
1 addition, 7 deletions
src/shared/LiveViewCommunicator.py
src/shared/RingBuffer.py
+1
-1
1 addition, 1 deletion
src/shared/RingBuffer.py
with
4 additions
and
23 deletions
src/receiverLiveViewer/FileReceiver.py
+
2
−
15
View file @
425bc81a
__author__
=
'
Manuela Kuhn <manuela.kuhn@desy.de>
'
,
'
Marco Strutz <marco.strutz@desy.de>
'
import
time
import
zmq
import
sys
import
json
import
logging
import
errno
import
os
import
traceback
import
socket
# needed to get hostname
BASE_PATH
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)
)
)
)
print
"
BASE_PATH
"
,
BASE_PATH
API_PATH
=
BASE_PATH
+
os
.
sep
+
"
APIs
"
print
"
API_PATH
"
,
API_PATH
if
not
API_PATH
in
sys
.
path
:
sys
.
path
.
append
(
API_PATH
)
...
...
@@ -43,9 +37,6 @@ class FileReceiver:
lvCommunicatorSocket
=
None
# socket to communicate with LiveViewCommunicator class
signalSocket
=
None
# socket to communicate with sender
hostname
=
socket
.
gethostname
()
# print socket.gethostbyname(socket.gethostname())
def
__init__
(
self
,
outputDir
,
signalIp
,
dataStreamPort
,
...
...
@@ -114,7 +105,6 @@ class FileReceiver:
break
except
:
self
.
log
.
error
(
"
receive message...failed.
"
)
self
.
log
.
error
(
sys
.
exc_info
())
continueReceiving
=
False
break
...
...
@@ -260,12 +250,10 @@ class FileReceiver:
self
.
log
.
error
(
"
Sending exit signal to LiveViewCommunicator...failed
"
)
self
.
log
.
debug
(
"
Error was:
"
+
str
(
e
))
# give signal time to arrive
time
.
sleep
(
0.2
)
try
:
self
.
log
.
debug
(
"
Closing communication socket...
"
)
self
.
lvCommunicatorSocket
.
close
(
0
)
# give signal time to arrive
self
.
lvCommunicatorSocket
.
close
(
0.2
)
self
.
lvCommunicatorSocket
=
None
self
.
log
.
debug
(
"
Closing communication socket...done
"
)
except
Exception
as
e
:
...
...
@@ -285,7 +273,6 @@ class FileReceiver:
except
:
self
.
log
.
error
(
"
Destroying ZMQ context...failed.
"
)
self
.
log
.
debug
(
"
Error was:
"
+
str
(
e
))
self
.
log
.
debug
(
sys
.
exc_info
())
def
__exit__
(
self
):
...
...
This diff is collapsed.
Click to expand it.
src/shared/LiveViewCommunicator.py
+
1
−
7
View file @
425bc81a
...
...
@@ -6,14 +6,8 @@ import sys
import
zmq
import
logging
import
traceback
from
RingBuffer
import
RingBuffer
SHARED_PATH
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)
)
)
+
os
.
sep
+
"
shared
"
if
not
SHARED_PATH
in
sys
.
path
:
sys
.
path
.
append
(
SHARED_PATH
)
del
SHARED_PATH
from
RingBuffer
import
RingBuffer
import
helperScript
#
# -------------------------- class: LiveViewCommunicator --------------------------------------
...
...
This diff is collapsed.
Click to expand it.
src/shared/RingBuffer.py
+
1
−
1
View file @
425bc81a
__author__
=
'
Manuela Kuhn <manuela.kuhn@desy.de>
'
import
time
import
logging
import
os
from
stat
import
S_ISREG
,
ST_MTIME
,
ST_MODE
...
...
@@ -179,6 +178,7 @@ class RingBuffer:
if
__name__
==
"
__main__
"
:
import
sys
import
time
BASE_PATH
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)
)))
SRC_PATH
=
BASE_PATH
+
os
.
sep
+
"
src
"
...
...
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