Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenPCDet
Commits
5de3373d
Commit
5de3373d
authored
Jul 06, 2020
by
Shaoshuai Shi
Browse files
bugfixed: support pcdet.__version__ for recording
parent
6f80c436
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
pcdet/__init__.py
pcdet/__init__.py
+25
-0
No files found.
pcdet/__init__.py
0 → 100644
View file @
5de3373d
from
pathlib
import
Path
import
subprocess
from
.version
import
__version__
__all__
=
[
'__version__'
]
def
get_git_commit_number
():
if
not
(
Path
(
__file__
).
parent
/
'../.git'
).
exists
():
return
'0000000'
cmd_out
=
subprocess
.
run
([
'git'
,
'rev-parse'
,
'HEAD'
],
stdout
=
subprocess
.
PIPE
)
git_commit_number
=
cmd_out
.
stdout
.
decode
(
'utf-8'
)[:
7
]
return
git_commit_number
script_version
=
get_git_commit_number
()
if
script_version
not
in
__version__
:
__version__
=
__version__
+
'+py%s'
%
script_version
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