Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
5738ae54
Commit
5738ae54
authored
Jul 25, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write files size to package .json
parent
78afc508
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
debomatic-modules/JSONLogger.py
debomatic-modules/JSONLogger.py
+14
-2
No files found.
debomatic-modules/JSONLogger.py
View file @
5738ae54
...
@@ -119,6 +119,12 @@ class DebomaticModule_JSONLogger:
...
@@ -119,6 +119,12 @@ class DebomaticModule_JSONLogger:
json
=
toJSON
(
info
,
indent
=
4
,
sort_keys
=
True
)
json
=
toJSON
(
info
,
indent
=
4
,
sort_keys
=
True
)
infofd
.
write
(
json
+
'
\
n
'
)
infofd
.
write
(
json
+
'
\
n
'
)
def
_get_human_size
(
self
,
num
):
for
x
in
[
'b'
,
'KB'
,
'MB'
,
'GB'
,
'TB'
]:
if
num
<
1024.0
:
return
"%3.1f %s"
%
(
num
,
x
)
num
/=
1024.0
def
pre_chroot
(
self
,
args
):
def
pre_chroot
(
self
,
args
):
distribution
=
self
.
_get_distribution_status
(
args
)
distribution
=
self
.
_get_distribution_status
(
args
)
self
.
_append_json_logfile
(
args
,
distribution
)
self
.
_append_json_logfile
(
args
,
distribution
)
...
@@ -140,14 +146,20 @@ class DebomaticModule_JSONLogger:
...
@@ -140,14 +146,20 @@ class DebomaticModule_JSONLogger:
status
=
self
.
_get_package_status
(
args
)
status
=
self
.
_get_package_status
(
args
)
status
[
'status'
]
=
'build'
status
[
'status'
]
=
'build'
status
[
'success'
]
=
args
[
'success'
]
status
[
'success'
]
=
args
[
'success'
]
status
[
'
tag
s'
]
=
{}
status
[
'
file
s'
]
=
{}
resultdir
=
os
.
path
.
join
(
args
[
'directory'
],
'pool'
,
args
[
'package'
])
resultdir
=
os
.
path
.
join
(
args
[
'directory'
],
'pool'
,
args
[
'package'
])
for
filename
in
os
.
listdir
(
resultdir
):
for
filename
in
os
.
listdir
(
resultdir
):
if
filename
.
endswith
(
'.json'
):
continue
full_path
=
os
.
path
.
join
(
resultdir
,
filename
)
full_path
=
os
.
path
.
join
(
resultdir
,
filename
)
info
=
{}
info
[
'size'
]
=
self
.
_get_human_size
(
os
.
path
.
getsize
(
full_path
))
tag
=
LogParser
(
full_path
).
parse
()
tag
=
LogParser
(
full_path
).
parse
()
if
tag
:
if
tag
:
status
[
'tags'
][
filename
]
=
tag
info
[
'tags'
]
=
tag
status
[
'files'
][
filename
]
=
info
self
.
_write_package_json
(
args
,
status
)
self
.
_write_package_json
(
args
,
status
)
status
.
pop
(
'files'
,
None
)
self
.
_append_json_logfile
(
args
,
status
)
self
.
_append_json_logfile
(
args
,
status
)
...
...
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