Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dcpman
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
dcp
dcpman
Commits
726efa60
Commit
726efa60
authored
10 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Added output to log file on every verification.
parent
f5a02552
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/manager.py
+13
-0
13 additions, 0 deletions
source/manager.py
with
13 additions
and
0 deletions
source/manager.py
+
13
−
0
View file @
726efa60
...
...
@@ -6,6 +6,7 @@ from PyQt4 import QtCore
from
dcp
import
DCP
import
ui
import
sys
import
os
class
verifyThread
(
QtCore
.
QThread
):
'''
A seperate thread to verify the DCP (IO intensive).
...
...
@@ -18,10 +19,14 @@ class verifyThread(QtCore.QThread):
result
=
dcp
.
verify
()
try
:
result
=
dcp
.
verify
()
logfile
=
open
(
os
.
path
.
expanduser
(
'
~
'
)
+
'
/dcpman.log
'
,
'
a
'
)
if
result
:
window
.
verifyLine
.
setText
(
'
OK
'
)
print
(
'
DCP verification succeeded for
'
+
dcp
.
name
,
file
=
logfile
)
else
:
window
.
verifyLine
.
setText
(
'
Corrupted!
'
)
print
(
'
DCP verification failed for
'
+
dcp
.
name
,
file
=
logfile
)
logfile
.
f
()
except
BaseException
as
exception
:
window
.
verifyLine
.
setText
(
str
(
exception
))
...
...
@@ -38,6 +43,7 @@ def verify_in_thread():
if
__name__
==
'
__main__
'
:
logfile
=
open
(
os
.
path
.
expanduser
(
'
~
'
)
+
'
/dcpman.log
'
,
'
a
'
)
app
=
QtGui
.
QApplication
(
sys
.
argv
)
icon
=
QtGui
.
QIcon
(
'
/usr/share/icons/oxygen/16x16/apps/kmplayer.png
'
)
app
.
setWindowIcon
(
icon
)
...
...
@@ -49,10 +55,17 @@ if __name__ == '__main__':
thread
=
verifyThread
()
try
:
dcp
=
DCP
(
directory
)
print
(
'
Opened DCP in directory
'
+
directory
,
file
=
logfile
)
try
:
window
.
nameLine
.
setText
(
dcp
.
name
)
print
(
'
DCP name is
'
+
dcp
.
name
,
file
=
logfile
)
except
AttributeError
:
window
.
nameLine
.
setText
(
directory
.
split
(
'
/
'
)[
-
1
])
if
dcp
.
signed
:
print
(
'
DCP is signed
'
,
file
=
logfile
)
else
:
print
(
'
DCP is not signed
'
,
file
=
logfile
)
print
(
'
DCP duration is
'
+
dcp
.
duration
,
file
=
logfile
)
if
dcp
.
signed
and
dcp
.
duration
==
0
:
window
.
encryptedLine
.
setText
(
'
Most likely
'
)
elif
dcp
.
signed
or
dcp
.
duration
==
0
:
...
...
This diff is collapsed.
Click to expand it.
nimrod
@nimrod
mentioned in commit
234ffe5b
·
4 years ago
mentioned in commit
234ffe5b
mentioned in commit 234ffe5b8acdf1dd7620f9d384b2c90f12473e49
Toggle commit list
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