Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iexcode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
29id
iexcode
Commits
1d3ceac5
Commit
1d3ceac5
authored
2 years ago
by
rodolakis
Browse files
Options
Downloads
Patches
Plain Diff
log_update fixed
parent
39c040c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
iexcode/instruments/Logfile.py
+12
-12
12 additions, 12 deletions
iexcode/instruments/Logfile.py
iexcode/instruments/electron_analyzer.py
+1
-2
1 addition, 2 deletions
iexcode/instruments/electron_analyzer.py
with
13 additions
and
14 deletions
iexcode/instruments/Logfile.py
+
12
−
12
View file @
1d3ceac5
...
...
@@ -25,14 +25,11 @@ def log_update(d=None):
updates the log file with the last scan info
d = dictionary of {header:[data,format]}
"""
try
:
if
d
==
None
:
d
=
iex
.
BL
.
mda
.
log
.
log_dictionary
()
iex
.
BL
.
mda
.
log
.
update
(
d
)
#try:
iex
.
BL
.
mda
.
log
.
update
(
d
)
except
:
print
(
'
No logfile written
'
)
#
except:
#
print('No logfile written')
def
log_name_set
(
file_name
):
try
:
...
...
@@ -193,13 +190,13 @@ class Logfile:
entry
+=
item
+
"
,
"
f
.
write
(
entry
[:
-
1
]
+
'
\n\n
'
)
def
write_entry
(
self
,
data_list
,
format_list
):
def
write_entry
(
self
,
head_list
,
data_list
,
format_list
):
"""
writes an entry to the logfile
"""
if
not
isfile
(
self
.
filepath
):
self
.
write_header
()
self
.
write_header
(
head_list
)
with
open
(
self
.
filepath
,
"
a+
"
)
as
f
:
for
i
in
range
(
len
(
format_list
)):
...
...
@@ -209,19 +206,22 @@ class Logfile:
pv_format
=
"
{0:
"
+
format_list
[
last_entry
]
+
"
}
\n
"
f
.
write
(
pv_format
.
format
(
data_list
[
last_entry
]))
def
update
(
self
):
def
update
(
self
,
d
=
None
):
"""
To be used for scanlog and scanEA functions.
Update SaveFile_Header version number when changing the structure of the file (indexing).
Previously: SaveFile
"""
header_list
,
data_list
,
format_list
=
self
.
log_entries
()
if
d
==
None
:
d
=
iex
.
BL
.
mda
.
log
.
log_dictionary
()
header_list
,
data_list
,
format_list
=
self
.
log_entries
(
d
)
if
not
isfile
(
self
.
filepath
):
self
.
_intit_log
(
header_list
)
self
.
write_entry
(
self
,
data_list
,
format_list
)
self
.
write_entry
(
header_list
,
data_list
,
format_list
)
This diff is collapsed.
Click to expand it.
iexcode/instruments/electron_analyzer.py
+
1
−
2
View file @
1d3ceac5
...
...
@@ -166,8 +166,7 @@ def EAlog_update():
"""
d
=
EA_log_dictionary
()
try
:
header_list
,
data_list
,
format_list
=
iex
.
BL
.
mda
.
log
.
log_entries
(
d
)
iex
.
BL
.
mda
.
log
.
write_entry
(
data_list
,
format_list
)
log_update
(
d
)
except
:
print
(
"
EAlog did not write to file, check for errors.
"
)
...
...
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