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. :group Specificity level: is_category, is_package, is_version :group Presence name components: has_archive, has_category, has_package, has_version, has_revision, has_patchlevel :group Getting name components: get_archive, get_nonarch, get_category, get_branch, get_package, get_version, get_package_version, get_patchlevel :group Validating name components: is_archive_name, is_category_name, is_branch_name, is_version_id, is_patchlevel
Method Summary | |
---|---|
Create a parser object for the given string. | |
Get the archive part of the name :return: archive part of the name, or the default archive name, or None if the name is invalid. | |
Get the branch part of name :return: part of the name which identifies the branch within the category, or None if the name is invalid or the empty string if the name has no branch component. | |
Get the Category name :return: part of the name which identifies the category within the archive, or None if the name is invalid or has no category component. | |
Get Non-archive part of the name :return: the name without the archive component, or None if the name is invalid or has no archive component. | |
Get the package name :return: part of the name including the category part and branch part (if present) of the name, or None if the name is not valid. | |
Get the unqualified version name :return: part of the name identifying a version in an archive, or None if the name does not contain a version id or is invalid. | |
Get the patch-level part of the name :return: part of the name identifying a patch in a version, or None if the name is not a revision or is invalid. | |
Get the version id part of the name :return: part of the name identifying a version in a branch, or None if the name is invalid or does not contain a version id. | |
Does this include an archive name?... | |
Does this include an category name? All valid names include a category. | |
Does this include an package name? All valid names include a package. | |
Does this include a revision name?... | |
Does this include a version name?... | |
Is this string a valid archive name? :param s: string to validate. (Class method) | |
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. (Class method) | |
Is this a category name?... | |
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. (Class method) | |
Is this a package name (category or branch name)?... | |
Is this string a valid unqualified patch-level name? :param s: string to validate. (Class method) | |
Is this a version name?... | |
Is this string a valid version id? :param s: string to validate. (Class method) | |
Create the Category, Branch, Version or Revision object Create the namespace object corresponding to the name. | |
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 a copy of string S with all occurrences of substring old replaced by new. | |
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 list of the words in the string S, using sep as the delimiter string, starting at the end of the string and working to the front. | |
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 |
---|
__init__(self,
s)
|
get_archive(self)Get the archive part of the name :return: archive part of the name, or the default archive name, or None if the name is invalid. :rtype: str, None |
get_branch(self)Get the branch part of name :return: part of the name which identifies the branch within the category, or None if the name is invalid or the empty string if the name has no branch component. :rtype: str, None |
get_category(self)Get the Category name :return: part of the name which identifies the category within the archive, or None if the name is invalid or has no category component. :rtype: str, None |
get_nonarch(self)Get Non-archive part of the name :return: the name without the archive component, or None if the name is invalid or has no archive component. :rtype: str, None |
get_package(self)Get the package name :return: part of the name including the category part and branch part (if present) of the name, or None if the name is not valid. :rtype: str, None |
get_package_version(self)Get the unqualified version name :return: part of the name identifying a version in an archive, or None if the name does not contain a version id or is invalid. :rtype: str, None |
get_patchlevel(self)Get the patch-level part of the name :return: part of the name identifying a patch in a version, or None if the name is not a revision or is invalid. :rtype: str, None |
get_version(self)Get the version id part of the name :return: part of the name identifying a version in a branch, or None if the name is invalid or does not contain a version id. :rtype: str, None |
has_archive(self)Does this include an archive name? :rtype: bool |
has_category(self)Does this include an category name? All valid names include a category. :rtype: bool |
has_package(self)Does this include an package name? All valid names include a package. :rtype: bool |
has_patchlevel(self)Does this include a revision name? :rtype: bool |
has_version(self)Does this include a version name? :rtype: bool |
is_category(self)Is this a category name? :rtype: bool |
is_package(self)Is this a package name (category or branch name)? :rtype: bool |
is_version(self)Is this a version name? :rtype: bool |
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? :param s: string to validate. :type s: str :rtype: bool |
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. :param s: string to validate. :type s: str :rtype: bool |
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. :param s: string to validate. :type s: str :rtype: bool |
is_patchlevel(klass, s)Is this string a valid unqualified patch-level name? :param s: string to validate. :type s: str :rtype: bool |
is_version_id(klass, s)Is this string a valid version id? :param s: string to validate. :type s: str :rtype: bool |
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Tue Jul 11 07:23:51 2006 | http://epydoc.sf.net |