Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sjrpc
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
Mirror
sjrpc
Commits
e9d51f4e
Commit
e9d51f4e
authored
14 years ago
by
Seblu
Browse files
Options
Downloads
Patches
Plain Diff
server now report server version
parent
db02d260
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cccli/command/server.py
+16
-6
16 additions, 6 deletions
cccli/command/server.py
with
16 additions
and
6 deletions
cccli/command/server.py
+
16
−
6
View file @
e9d51f4e
...
...
@@ -19,23 +19,28 @@ class Command_server(OptionCommand):
help
=
"
show server cache
"
)
self
.
option
.
add_option
(
"
-l
"
,
action
=
"
store_true
"
,
dest
=
"
commands
"
,
help
=
"
list server commands
"
)
self
.
option
.
add_option
(
"
-v
"
,
action
=
"
store_true
"
,
dest
=
"
version
"
,
help
=
"
show server version
"
)
def
__call__
(
self
,
argv
):
try
:
(
options
,
args
)
=
self
.
option
.
parse_args
(
argv
[
1
:])
except
SystemExit
:
return
if
len
(
args
)
>
0
or
(
not
options
.
cache
and
not
options
.
commands
)
:
if
len
(
args
)
>
0
:
self
.
printer
.
out
(
self
.
usage
())
return
if
options
.
cache
:
elif
options
.
cache
:
self
.
show_cache
()
if
options
.
commands
:
el
if
options
.
commands
:
self
.
show_commands
()
elif
options
.
version
:
self
.
show_version
()
else
:
self
.
printer
.
out
(
self
.
usage
())
def
show_commands
(
self
):
try
:
self
.
printer
.
out
(
"
%sServer commands:%s
"
%
(
color
[
"
lblue
"
],
color
[
"
reset
"
]))
for
cmds
in
self
.
cli
.
rpc
.
call
(
"
list_commands
"
):
self
.
printer
.
out
(
"
%s
"
%
cmds
[
"
name
"
])
except
RpcError
as
e
:
...
...
@@ -43,9 +48,14 @@ class Command_server(OptionCommand):
def
show_cache
(
self
):
try
:
self
.
printer
.
out
(
"
%sServer cache:%s
"
%
(
color
[
"
lblue
"
],
color
[
"
reset
"
]))
d
=
self
.
cli
.
rpc
.
call
(
"
dbstats
"
)
for
i
,
v
in
d
.
items
():
self
.
printer
.
out
(
"
%s: %s
"
%
(
i
,
v
))
except
RpcError
as
e
:
raise
cmdError
(
"
RPCError: %s
"
%
str
(
e
))
def
show_version
(
self
):
try
:
self
.
printer
.
out
(
self
.
cli
.
rpc
.
call
(
"
version
"
))
except
RpcError
as
e
:
raise
cmdError
(
"
RPCError: %s
"
%
str
(
e
))
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