bir takım __doc__
This commit is contained in:
+93
-18
@@ -1,3 +1,5 @@
|
|||||||
|
# -*- coding:utf-8 -*-
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
import pisi
|
import pisi
|
||||||
@@ -13,7 +15,7 @@ def cmdObject(cmd, fail=False):
|
|||||||
"info": Info,
|
"info": Info,
|
||||||
"install": Install,
|
"install": Install,
|
||||||
"list-installed": ListInstalled,
|
"list-installed": ListInstalled,
|
||||||
"list-available": ListAvailable,
|
# "list-available": ListAvailable,
|
||||||
"search-available": SearchAvailable,
|
"search-available": SearchAvailable,
|
||||||
"remove": Remove,
|
"remove": Remove,
|
||||||
"index": Index,
|
"index": Index,
|
||||||
@@ -83,7 +85,16 @@ class Command(object):
|
|||||||
print getattr(self, "__doc__")
|
print getattr(self, "__doc__")
|
||||||
|
|
||||||
class Help(Command):
|
class Help(Command):
|
||||||
"""prints usage"""
|
"""Prints usage
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
help [command-name]
|
||||||
|
|
||||||
|
If run without parameters will print the general usage documentation.
|
||||||
|
|
||||||
|
If run with a command name as the parameter will print the documentation
|
||||||
|
for that command.
|
||||||
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Help, self).__init__()
|
super(Help, self).__init__()
|
||||||
|
|
||||||
@@ -99,7 +110,14 @@ class Help(Command):
|
|||||||
# print "\n",self.parser.format_option_help()
|
# print "\n",self.parser.format_option_help()
|
||||||
|
|
||||||
class Build(Command):
|
class Build(Command):
|
||||||
"""build: compile PISI package using a pspec.xml file"""
|
"""Build a PISI package using a pspec.xml file
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
build pspec.xml
|
||||||
|
|
||||||
|
You can give an URI of the pspec.xml file. PISI will
|
||||||
|
fetch all necessary files and build the package for you.
|
||||||
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Build, self).__init__()
|
super(Build, self).__init__()
|
||||||
|
|
||||||
@@ -112,7 +130,15 @@ class Build(Command):
|
|||||||
pisi.toplevel.build(arg, self.authInfo)
|
pisi.toplevel.build(arg, self.authInfo)
|
||||||
|
|
||||||
class Install(Command):
|
class Install(Command):
|
||||||
"""install: install PISI packages"""
|
"""Install PISI packages
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
install package
|
||||||
|
|
||||||
|
You can give an URI of the pisi package. Or you can just give a
|
||||||
|
package name and choose to install a package from the defined
|
||||||
|
repositories (with add-repo).
|
||||||
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Install, self).__init__()
|
super(Install, self).__init__()
|
||||||
|
|
||||||
@@ -129,7 +155,13 @@ class Install(Command):
|
|||||||
pisi.toplevel.install(self.args)
|
pisi.toplevel.install(self.args)
|
||||||
|
|
||||||
class Remove(Command):
|
class Remove(Command):
|
||||||
"""remove: remove PISI packages"""
|
"""Remove PISI packages
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
remove package-name
|
||||||
|
|
||||||
|
Remove a package from your system. Just give the package name to remove.
|
||||||
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Remove, self).__init__()
|
super(Remove, self).__init__()
|
||||||
|
|
||||||
@@ -146,8 +178,13 @@ class Remove(Command):
|
|||||||
pisi.toplevel.remove(self.args)
|
pisi.toplevel.remove(self.args)
|
||||||
|
|
||||||
class Info(Command):
|
class Info(Command):
|
||||||
"""info: display information about a package
|
"""Display information about a package
|
||||||
usage: info <package> ..."""
|
|
||||||
|
Usage:
|
||||||
|
info <package>
|
||||||
|
|
||||||
|
TODO: Some description...
|
||||||
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Info, self).__init__()
|
super(Info, self).__init__()
|
||||||
|
|
||||||
@@ -167,7 +204,13 @@ class Info(Command):
|
|||||||
print metadata.package
|
print metadata.package
|
||||||
|
|
||||||
class Index(Command):
|
class Index(Command):
|
||||||
"""index: Index PISI files in a given directory"""
|
"""Index PISI files in a given directory
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
index directory
|
||||||
|
|
||||||
|
TODO: Some description...
|
||||||
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Index, self).__init__()
|
super(Index, self).__init__()
|
||||||
|
|
||||||
@@ -186,8 +229,13 @@ class Index(Command):
|
|||||||
return
|
return
|
||||||
|
|
||||||
class ListInstalled(Command):
|
class ListInstalled(Command):
|
||||||
"""list-installed: print a list of all installed packages
|
"""Print the list of all installed packages
|
||||||
usage: list-installed """
|
|
||||||
|
Usage:
|
||||||
|
list-installed
|
||||||
|
|
||||||
|
TODO: Some description...
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(ListInstalled, self).__init__()
|
super(ListInstalled, self).__init__()
|
||||||
@@ -207,8 +255,13 @@ class ListInstalled(Command):
|
|||||||
print package
|
print package
|
||||||
|
|
||||||
class UpdateRepo(Command):
|
class UpdateRepo(Command):
|
||||||
"""update-repo: update the databases of a repository
|
"""Update the databases of a repository
|
||||||
usage: update-repo <repo1> <repo2> ...."""
|
|
||||||
|
Usage:
|
||||||
|
update-repo <repo1> <repo2>
|
||||||
|
|
||||||
|
TODO: Some description...
|
||||||
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(UpdateRepo, self).__init__()
|
super(UpdateRepo, self).__init__()
|
||||||
|
|
||||||
@@ -218,8 +271,13 @@ class UpdateRepo(Command):
|
|||||||
pisi.toplevel.update_repo(repo)
|
pisi.toplevel.update_repo(repo)
|
||||||
|
|
||||||
class AddRepo(Command):
|
class AddRepo(Command):
|
||||||
"""add-repo: add a repository
|
"""Add a repository
|
||||||
usage: add-repo <repo> <indexuri>"""
|
|
||||||
|
Usage:
|
||||||
|
add-repo <repo> <indexuri>
|
||||||
|
|
||||||
|
TODO: Some description...
|
||||||
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(AddRepo, self).__init__()
|
super(AddRepo, self).__init__()
|
||||||
|
|
||||||
@@ -234,8 +292,13 @@ class AddRepo(Command):
|
|||||||
return
|
return
|
||||||
|
|
||||||
class RemoveRepo(Command):
|
class RemoveRepo(Command):
|
||||||
"""remove-repo: remove a repository
|
"""Remove a repository
|
||||||
usage: remove-repo <repo>"""
|
|
||||||
|
Usage:
|
||||||
|
remove-repo <repo>
|
||||||
|
|
||||||
|
TODO: Some description...
|
||||||
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(RemoveRepo, self).__init__()
|
super(RemoveRepo, self).__init__()
|
||||||
|
|
||||||
@@ -249,7 +312,13 @@ class RemoveRepo(Command):
|
|||||||
return
|
return
|
||||||
|
|
||||||
class ListRepo(Command):
|
class ListRepo(Command):
|
||||||
"""list-repo: list repositories"""
|
"""List repositories
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
list-repo
|
||||||
|
|
||||||
|
TODO: Some description...
|
||||||
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(ListRepo, self).__init__()
|
super(ListRepo, self).__init__()
|
||||||
|
|
||||||
@@ -286,7 +355,13 @@ class ListRepo(Command):
|
|||||||
# print util.package_name(name, version, release)
|
# print util.package_name(name, version, release)
|
||||||
|
|
||||||
class SearchAvailable(Command):
|
class SearchAvailable(Command):
|
||||||
"search-available: search in available packages"
|
"Search in available packages
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
search-available <search pattern>
|
||||||
|
|
||||||
|
TODO: Some description...
|
||||||
|
"
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user