Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL RS485 - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL RS485 - Testing
Commits
4361896e
Commit
4361896e
authored
Sep 24, 2018
by
Denia Bouhired-Ferrag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Saves all logs in separate t485 folder
parent
cc4563c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
pts.py
pts-fm/python/pts.py
+13
-13
No files found.
pts-fm/python/pts.py
View file @
4361896e
...
...
@@ -186,14 +186,14 @@ if __name__ == '__main__':
subprocess
.
call
(
"grep PASS log/*.log"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
subprocess
.
call
(
"grep FAIL log/*.log"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
# Save results on
USB key
...
print
"
\n
Saving test results in /home/pts-administrator/pts/log"
# Save results on
local folder
...
print
"
\n
Saving test results in /home/pts-administrator/pts/log
/t485
"
try
:
subprocess
.
call
(
"mkdir -p /home/pts-administrator/pts/log"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
subprocess
.
call
(
"cp log/*.log /home/pts-administrator/pts/log"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
subprocess
.
call
(
"cp log/*.inf /home/pts-administrator/pts/log"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
subprocess
.
call
(
"mkdir -p /home/pts-administrator/pts/log
/t485
"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
subprocess
.
call
(
"cp log/*.log /home/pts-administrator/pts/log
/t485
"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
subprocess
.
call
(
"cp log/*.inf /home/pts-administrator/pts/log
/t485
"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
except
e
:
print
"ERROR: No access to directory /home/pts-administrator/pts"
print
"ERROR: No access to directory /home/pts-administrator/pts
/t485
"
print
e
#-------------------------------------------------------------------------------
# Reading board unique ID and storing to separate log file
...
...
@@ -216,22 +216,22 @@ if __name__ == '__main__':
# Generate output file named according to current time
fname
=
time
.
strftime
(
"serial-num-CTDA
H
-
%
Y-
%
m-
%
d"
,
time
.
localtime
())
+
".txt"
ret
=
subprocess
.
call
([
"ls /home/pts-administrator/pts/log | grep "
+
fname
],
shell
=
True
,
stdout
=
None
,
stderr
=
None
)
fname
=
time
.
strftime
(
"serial-num-CTDA
P
-
%
Y-
%
m-
%
d"
,
time
.
localtime
())
+
".txt"
ret
=
subprocess
.
call
([
"ls /home/pts-administrator/pts/log
/t485
| grep "
+
fname
],
shell
=
True
,
stdout
=
None
,
stderr
=
None
)
#print ("%d" % ret)
if
(
ret
!=
0
):
f
=
open
(
"/home/pts-administrator/pts/log"
+
fname
,
"w"
)
f
=
open
(
"/home/pts-administrator/pts/log
/t485/
"
+
fname
,
"w"
)
print
(
" File not found ... Create new one
\n
"
)
f
.
write
(
"
\n
"
)
f
.
write
(
"CONV-TTL-
BLO
Upgrade log created on
%
s
\n
"
%
time
.
strftime
(
"
%
Y-
%
m-
%
d-
%
Hh
%
Mm
%
Ss"
,
time
.
localtime
()))
f
.
write
(
"CONV-TTL-
RS485
Upgrade log created on
%
s
\n
"
%
time
.
strftime
(
"
%
Y-
%
m-
%
d-
%
Hh
%
Mm
%
Ss"
,
time
.
localtime
()))
f
.
write
(
"---------------------------------------------------------------------------------
\n
"
)
f
.
write
(
"Barcode 1 | Barcode 2 | PCB ID |
\n
"
)
f
.
write
(
"---------------------------------------------------------------------------------
\n
"
)
f
.
close
()
print
(
"Upgrade log can be found in /home/pts-administrator/pts/log/
%
s
\n
"
%
fname
)
print
(
"Upgrade log can be found in /home/pts-administrator/pts/log/
t485/
%
s
\n
"
%
fname
)
print
(
"Board unique ID can be found in /home/pts-administrator/pts/log/
%
s
\n
"
%
fname
)
f
=
open
(
"/home/pts-administrator/pts/log/"
+
fname
,
"a"
)
print
(
"Board unique ID can be found in /home/pts-administrator/pts/log/
t485/
%
s
\n
"
%
fname
)
f
=
open
(
"/home/pts-administrator/pts/log/
t485/
"
+
fname
,
"a"
)
f
.
write
(
"
%
s
\t
%
s
\t
%
x
%
x
\n
"
%
(
sn1
,
sn2
,
IDMS
,
IDLS
)
)
f
.
close
()
...
...
Write
Preview
Markdown
is supported
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