forked from dbharris/repoman
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
from repoman_client.subcommand import SubCommand | ||
from repoman_client.client import RepomanClient | ||
from repoman_client.config import config | ||
from repoman_client import display | ||
from repoman_client.__version__ import version | ||
from argparse import ArgumentParser | ||
|
||
class Whoami(SubCommand): | ||
command_group = 'advanced' | ||
command = 'whoami' | ||
alias = None | ||
description = 'Display information about the current user (ie, you)' | ||
|
||
def get_parser(self): | ||
p = ArgumentParser(self.description) | ||
return p | ||
|
||
def __call__(self, args, extra_args=None): | ||
repo = RepomanClient(config.host, config.port, config.proxy) | ||
me = repo.whoami() | ||
display.display_user(me) | ||
|
||
|
||
|
||
class About(SubCommand): | ||
validate_config = False | ||
command_group = 'advanced' | ||
command = 'about' | ||
alias = None | ||
description = 'Display information about this program.' | ||
|
||
def get_parser(self): | ||
p = ArgumentParser(self.description) | ||
return p | ||
|
||
def __call__(self, args, extra_args=None): | ||
keys = {'config_file':config.config_file, | ||
'host':config.repository_host, | ||
'port':config.repository_port, | ||
'proxy':config.user_proxy_cert, | ||
'snapshot':config.snapshot, | ||
'mountpoint':config.mountpoint, | ||
'exclude':config.exclude_dirs, | ||
'version':version} | ||
print """\ | ||
version: %(version)s | ||
configuration: | ||
config_file in use: %(config_file)s | ||
repository_host: %(host)s | ||
repository_port: %(port)s | ||
user_proxy_cert: %(proxy)s | ||
snapshot: %(snapshot)s | ||
mountpoint: %(mountpoint)s | ||
exclude_dirs: %(exclude)s | ||
""" % keys | ||
|