Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
installsystems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Show more breadcrumbs
Seblu
installsystems
Commits
61d093f8
Commit
61d093f8
authored
13 years ago
by
Aurélien Dunand
Committed by
Seblu
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Cosmetics changes for list command
Signed-off-by:
Seblu
<
sebastien.luttringer@smartjog.com
>
parent
e289669e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/is
+15
-14
15 additions, 14 deletions
bin/is
installsystems/repository.py
+9
-9
9 additions, 9 deletions
installsystems/repository.py
with
24 additions
and
23 deletions
bin/is
+
15
−
14
View file @
61d093f8
...
...
@@ -143,37 +143,37 @@ def c_list(parser, args):
List images in repository or image content
'''
# List available repositories
if
len
(
args
.
list_arg
s
)
==
0
:
if
len
(
args
.
value
s
)
==
0
:
repoman
=
load_repositories
(
args
)
arrow
(
"
Repositories
"
)
repoman
.
show
(
verbose
=
args
.
detail
)
return
# list direct image or reposity content
elif
len
(
args
.
list_arg
s
)
==
1
:
elif
len
(
args
.
value
s
)
==
1
:
# list image file content
if
(
istools
.
pathtype
(
args
.
list_arg
s
[
0
])
==
"
file
"
and
os
.
path
.
isfile
(
args
.
list_arg
s
[
0
])):
pkg
=
PackageImage
(
args
.
list_arg
s
[
0
])
if
(
istools
.
pathtype
(
args
.
value
s
[
0
])
==
"
file
"
and
os
.
path
.
isfile
(
args
.
value
s
[
0
])):
pkg
=
PackageImage
(
args
.
value
s
[
0
])
arrow
(
"
Image %s v%s
"
%
(
pkg
.
name
,
pkg
.
version
))
pkg
.
show
(
verbose
=
args
.
detail
)
# list repository content
else
:
args
.
repo_filter
=
args
.
list_arg
s
[
0
]
args
.
repo_filter
=
args
.
value
s
[
0
]
repoman
=
load_repositories
(
args
)
for
repo
in
repoman
:
arrow
(
"
Image in %s
"
%
repo
.
config
.
name
)
repo
.
show
(
args
.
detail
)
return
# list last image version
elif
len
(
args
.
list_arg
s
)
==
2
:
args
.
repo_filter
=
args
.
list_arg
s
[
0
]
args
.
image
=
args
.
list_arg
s
[
1
]
elif
len
(
args
.
value
s
)
==
2
:
args
.
repo_filter
=
args
.
value
s
[
0
]
args
.
image
=
args
.
value
s
[
1
]
args
.
image_version
=
None
# list specific image version
elif
len
(
args
.
list_arg
s
)
==
3
:
args
.
repo_filter
=
args
.
list_arg
s
[
0
]
args
.
image
=
args
.
list_arg
s
[
1
]
args
.
image_version
=
args
.
list_arg
s
[
2
]
elif
len
(
args
.
value
s
)
==
3
:
args
.
repo_filter
=
args
.
value
s
[
0
]
args
.
image
=
args
.
value
s
[
1
]
args
.
image_version
=
args
.
value
s
[
2
]
else
:
args
.
subparser
.
print_usage
()
exit
(
1
)
...
...
@@ -330,7 +330,8 @@ p_install.set_defaults(func=c_install, subparser=p_install)
p_list
=
subparsers
.
add_parser
(
"
list
"
,
help
=
c_list
.
__doc__
.
lower
())
p_list
.
add_argument
(
"
-l
"
,
action
=
"
store_true
"
,
dest
=
"
detail
"
,
default
=
False
,
help
=
"
detailled list output
"
)
p_list
.
add_argument
(
"
list_args
"
,
nargs
=
"
*
"
,
help
=
"
list content of image or repositories
"
)
p_list
.
add_argument
(
"
values
"
,
nargs
=
"
*
"
,
help
=
"
image or repositories to list
"
)
p_list
.
set_defaults
(
func
=
c_list
,
subparser
=
p_list
)
# update command parser
...
...
This diff is collapsed.
Click to expand it.
installsystems/repository.py
+
9
−
9
View file @
61d093f8
...
...
@@ -188,18 +188,18 @@ class Repository(object):
for
(
image_md5
,
image_name
,
image_version
,
image_date
,
image_author
,
image_description
,
image_size
)
in
images
:
out
(
'
#light##yellow#%s #reset#v%s
'
%
(
image_name
,
image_version
))
out
(
"
#light##yellow#%s #reset#v%s
"
%
(
image_name
,
image_version
))
if
verbose
:
out
(
'
#yellow#Date:#reset# %s
'
%
time
.
asctime
(
time
.
gmtime
(
image_date
)))
out
(
'
#yellow#Description:#reset# %s
'
%
image_description
)
out
(
'
#yellow#Author:#reset# %s
'
%
image_author
)
out
(
'
#yellow#MD5:#reset# %s
'
%
image_md5
)
out
(
"
#yellow#Date:#reset# %s
"
%
time
.
asctime
(
time
.
gmtime
(
image_date
)))
out
(
"
#yellow#Description:#reset# %s
"
%
image_description
)
out
(
"
#yellow#Author:#reset# %s
"
%
image_author
)
out
(
"
#yellow#MD5:#reset# %s
"
%
image_md5
)
payloads
=
self
.
db
.
ask
(
"
SELECT md5, name, size FROM payload
\
WHERE image_md5 = ?
"
,
(
image_md5
,)).
fetchall
()
for
payload_md5
,
payload_name
,
payload_size
in
payloads
:
out
(
'
#light##yellow#Payload:#reset# %s
'
%
payload_name
)
out
(
'
#yellow#Size:#reset# %s
'
%
(
istools
.
human_size
(
payload_size
)))
out
(
'
#yellow#MD5:#reset# %s
'
%
payload_md5
)
out
(
"
#light##yellow#Payload:#reset# %s
"
%
payload_name
)
out
(
"
#yellow#Size:#reset# %s
"
%
(
istools
.
human_size
(
payload_size
)))
out
(
"
#yellow#MD5:#reset# %s
"
%
payload_md5
)
out
()
def
search
(
self
,
pattern
):
...
...
@@ -555,5 +555,5 @@ class RepositoryManager(object):
repo
.
config
.
name
s
=
"
#light##blue#%s#reset#
"
%
repo
.
config
.
name
if
verbose
:
s
+=
'
(%s)
'
%
repo
.
config
.
path
s
+=
"
(%s)
"
%
repo
.
config
.
path
out
(
s
)
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