Home | Trees | Index | Help |
---|
Package pybaz :: Class NameParser |
|
object
--+ |basestring
--+ |str
--+ | NameParser
Parser for names in Arch archive namespace.
Implements name parsing natively for performance reasons. It should behave exactly as tla, any discrepancy is to be considered a bug, unless tla is obviously buggy.
Bare names of archives, category, branch, versions ids, and unqualified patchlevel names are not part of the archive namespace. They can be validated using static methods.
Method Summary | |
---|---|
Create a parser object for the given string. | |
Create the Category, Branch, Version or Revision object | |
Specificity level | |
bool |
Is this a category name? |
bool |
Is this a package name (category or branch name)? |
bool |
Is this a version name? |
Presence name components | |
bool |
Does this include an archive name? |
bool |
Does this include an category name? |
bool |
Does this include an package name? |
bool |
Does this include a version name? |
bool |
Does this include a revision name? |
Getting name components | |
str, None |
Get the archive part of the name |
str, None |
Get Non-archive part of the name |
str, None |
Get the Category name |
str, None |
Get the branch part of name |
str, None |
Get the package name |
str, None |
Get the version id part of the name |
str, None |
Get the unqualified version name |
str, None |
Get the patch-level part of the name |
Validating name components | |
bool |
Is this string a valid archive name? (Class method) |
bool |
Is this string a valid category name? (Class method) |
bool |
Is this string a valid category name? (Class method) |
bool |
Is this string a valid version id? (Class method) |
bool |
Is this string a valid unqualified patch-level name? (Class method) |
Inherited from str | |
x.__add__(y) <==> x+y | |
x.__contains__(y) <==> y in x | |
x.__eq__(y) <==> x==y | |
x.__ge__(y) <==> x>=y | |
x.__getattribute__('name') <==> x.name | |
x.__getitem__(y) <==> x[y] | |
| |
Use of negative indices is not supported. | |
x.__gt__(y) <==> x>y | |
x.__hash__() <==> hash(x) | |
x.__le__(y) <==> x<=y | |
x.__len__() <==> len(x) | |
x.__lt__(y) <==> x<y | |
x.__mod__(y) <==> x%y | |
x.__mul__(n) <==> x*n | |
x.__ne__(y) <==> x!=y | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
x.__repr__() <==> repr(x) | |
x.__rmod__(y) <==> y%x | |
x.__rmul__(n) <==> n*x | |
x.__str__() <==> str(x) | |
Return a copy of the string S with only its first character capitalized. | |
Return S centered in a string of length width. | |
Return the number of occurrences of substring sub in string S[start:end]. | |
Decodes S using the codec registered for encoding. | |
Encodes S using the codec registered for encoding. | |
Return True if S ends with the specified suffix, False otherwise. | |
Return a copy of S where all tab characters are expanded using spaces. | |
Return the lowest index in S where substring sub is found, such that sub is contained within s[start,end]. | |
Like S.find() but raise ValueError when the substring is not found. | |
Return True if all characters in S are alphanumeric and there is at least one character in S, False otherwise. | |
Return True if all characters in S are alphabetic and there is at least one character in S, False otherwise. | |
Return True if all characters in S are digits and there is at least one character in S, False otherwise. | |
Return True if all cased characters in S are lowercase and there is at least one cased character in S, False otherwise. | |
Return True if all characters in S are whitespace and there is at least one character in S, False otherwise. | |
Return True if S is a titlecased string and there is at least one character in S, i.e. | |
Return True if all cased characters in S are uppercase and there is at least one cased character in S, False otherwise. | |
Return a string which is the concatenation of the strings in the sequence. | |
Return S left justified in a string of length width. | |
Return a copy of the string S converted to lowercase. | |
Return a copy of the string S with leading whitespace removed. | |
S.replace (old, new[, count]) -> string | |
Return the highest index in S where substring sub is found, such that sub is contained within s[start,end]. | |
Like S.rfind() but raise ValueError when the substring is not found. | |
Return S right justified in a string of length width. | |
Return a copy of the string S with trailing whitespace removed. | |
Return a list of the words in the string S, using sep as the delimiter string. | |
Return a list of the lines in S, breaking at line boundaries. | |
Return True if S starts with the specified prefix, False otherwise. | |
Return a copy of the string S with leading and trailing whitespace removed. | |
Return a copy of the string S with uppercase characters converted to lowercase and vice versa. | |
Return a titlecased version of S, i.e. | |
Return a copy of the string S, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256. | |
Return a copy of the string S converted to uppercase. | |
Pad a numeric string S with zeros on the left, to fill a field of the specified width. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value |
Instance Method Details |
---|
is_category(self)Is this a category name?
|
is_package(self)Is this a package name (category or branch name)?
|
is_version(self)Is this a version name?
|
has_archive(self)Does this include an archive name?
|
has_category(self)Does this include an category name? All valid names include a category.
|
has_package(self)Does this include an package name? All valid names include a package.
|
has_version(self)Does this include a version name?
|
has_patchlevel(self)Does this include a revision name?
|
get_archive(self)Get the archive part of the name
|
get_nonarch(self)Get Non-archive part of the name
|
get_category(self)Get the Category name
|
get_branch(self)Get the branch part of name
|
get_package(self)Get the package name
|
get_version(self)Get the version id part of the name
|
get_package_version(self)Get the unqualified version name
|
get_patchlevel(self)Get the patch-level part of the name
|
__init__(self,
s)
|
object(self)Create the Category, Branch, Version or Revision object Create the namespace object corresponding to the name. This requires some guessing so, for example, nameless branches will not be recognized. This function is unsafe (categories and nameless branches are not distinguished) and is not really useful. Internally, only namespace objects should be used, and external output should be validated in a more specific way. |
Class Method Details |
---|
is_archive_name(klass, s)Is this string a valid archive name?
|
is_category_name(klass, s)Is this string a valid category name? Currently does the same thing as is_branch_name, but that might change in the future when the namespace evolves and it is more expressive to have different functions.
|
is_branch_name(klass, s)Is this string a valid category name? Currently does the same thing as is_category_name, but that might change in the future when the namespace evolves and it is more expressive to have different functions.
|
is_version_id(klass, s)Is this string a valid version id?
|
is_patchlevel(klass, s)Is this string a valid unqualified patch-level name?
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Fri Jul 7 17:05:30 2006 | http://epydoc.sf.net |