Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
advLigoRTS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CDS
software
advLigoRTS
Commits
89922aad
Commit
89922aad
authored
5 years ago
by
Jonathan Hanks
Browse files
Options
Downloads
Plain Diff
Merge branch 'python3' into 'master'
missed python2to3 See merge request cds/advligorts!6
parents
0e5f429a
1579f568
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6
missed python2to3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/epics/util/fe_load_burt
+9
-9
9 additions, 9 deletions
src/epics/util/fe_load_burt
with
9 additions
and
9 deletions
src/epics/util/fe_load_burt
+
9
−
9
View file @
89922aad
#!/usr/bin/
env
python
#!/usr/bin/python
3
import
os
import
sys
...
...
@@ -8,16 +8,16 @@ SDF_LOAD = 1
SDF_READONLY
=
2
def
select_burt_dialog
(
burtdir
,
model
):
import
T
kinter
import
tk
F
ile
D
ialog
import
t
kinter
import
tk
inter.f
ile
d
ialog
options
=
{}
options
[
'
title
'
]
=
'
Select BURT File to load on %s:
'
%
model
options
[
'
initialdir
'
]
=
burtdir
options
[
'
defaultextension
'
]
=
'
.snap
'
#options['filetypes'] = [('burt files', '.snap'), ('all files', '.*')]
options
[
'
filetypes
'
]
=
[(
'
burt files
'
,
'
.snap
'
)]
T
kinter
.
Tk
().
withdraw
()
return
tk
F
ile
D
ialog
.
askopenfilename
(
**
options
)
t
kinter
.
Tk
().
withdraw
()
return
tk
inter
.
f
ile
d
ialog
.
askopenfilename
(
**
options
)
def
get_model_dcuid
(
model
,
ifo
=
None
):
if
ifo
==
None
:
...
...
@@ -37,11 +37,11 @@ def fe_load_burt(model, burtfile, load=None, dcuid=None, ifo=os.getenv('IFO')):
prefix
=
'
%s:FEC-%s_SDF_
'
%
(
ifo
.
upper
(),
dcuid
)
channel
=
prefix
+
'
NAME
'
basefile
,
ext
=
os
.
path
.
splitext
(
burtfile
)
print
>>
sys
.
stderr
,
"
%s = %s
"
%
(
channel
,
basefile
)
print
(
"
%s = %s
"
%
(
channel
,
basefile
)
,
file
=
sys
.
stderr
)
epics
.
caput
(
channel
,
basefile
,
wait
=
True
)
if
load
:
channel
=
prefix
+
'
RELOAD
'
print
>>
sys
.
stderr
,
"
%s = %s
"
%
(
channel
,
load
)
print
(
"
%s = %s
"
%
(
channel
,
load
)
,
file
=
sys
.
stderr
)
epics
.
caput
(
channel
,
load
,
wait
=
True
)
##################################################
...
...
@@ -130,7 +130,7 @@ written to the <IFO>:FEC-<DCUID>_SDF_NAME channel, but not loaded.
fullpath
=
select_burt_dialog
(
burt_dir
,
args
.
model
)
if
fullpath
==
''
:
sys
.
exit
(
-
1
)
print
>>
sys
.
stderr
,
"
selected: %s
"
%
fullpath
print
(
"
selected: %s
"
%
fullpath
,
file
=
sys
.
stderr
)
basename
,
ext
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
fullpath
))
if
ext
!=
'
.snap
'
:
...
...
@@ -148,7 +148,7 @@ written to the <IFO>:FEC-<DCUID>_SDF_NAME channel, but not loaded.
if
not
os
.
path
.
samefile
(
fullpath
,
calcpath
):
sys
.
exit
(
"
File not in model burt directory: %s
"
%
burt_dir
)
print
>>
sys
.
stderr
,
"
loading file: %s
"
%
calcpath
print
(
"
loading file: %s
"
%
calcpath
,
file
=
sys
.
stderr
)
fe_load_burt
(
args
.
model
,
basename
,
load
=
args
.
load
,
dcuid
=
args
.
dcuid
,
ifo
=
args
.
ifo
)
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