portage.getbinpkg module

class portage.getbinpkg.PackageIndex(allowed_pkg_keys=None, default_header_data=None, default_pkg_data=None, inherited_keys=None, translated_keys=None)

Bases: object

_readpkgindex(pkgfile, pkg_entry=True)
_writepkgindex(pkgfile, items)
read(pkgfile)
readBody(pkgfile)
readHeader(pkgfile)
write(pkgfile)

Bases: html.parser.HTMLParser

Parser class that overrides HTMLParser to grab all anchors from an html page and provide suffix and prefix limitors

CDATA_CONTENT_ELEMENTS = ('script', 'style')
_decl_otherchars = ''
_parse_doctype_attlist(i, declstartpos)
_parse_doctype_element(i, declstartpos)
_parse_doctype_entity(i, declstartpos)
_parse_doctype_notation(i, declstartpos)
_parse_doctype_subset(i, declstartpos)
_scan_name(i, declstartpos)
check_for_whole_start_tag(i)
clear_cdata_mode()
close()

Handle any buffered data.

feed(data)

Feed data to the parser.

Call this as often as you want, with as little or as much text as you want (may include ‘n’).

get_anchors()
get_anchors_by_prefix(prefix)
get_anchors_by_suffix(suffix)
get_starttag_text()

Return full source of start tag: ‘<…>’.

getpos()

Return current line number and offset.

goahead(end)
handle_charref(name)
handle_comment(data)
handle_data(data)
handle_decl(decl)
handle_endtag(tag)
handle_entityref(name)
handle_pi(data)
handle_startendtag(tag, attrs)
handle_starttag(tag, attrs)
parse_bogus_comment(i, report=1)
parse_comment(i, report=1)
parse_declaration(i)
parse_endtag(i)
parse_html_declaration(i)
parse_marked_section(i, report=1)
parse_pi(i)
parse_starttag(i)
reset()

Reset this instance. Loses all unprocessed data.

set_cdata_mode(elem)
unknown_decl(data)
updatepos(i, j)
portage.getbinpkg._cmp_cpv(d1, d2)
portage.getbinpkg.create_conn(baseurl, conn=None)

Takes a protocol://site:port/address url, and an optional connection. If connection is already active, it is passed on. baseurl is reduced to address and is returned in tuple (conn,address)

portage.getbinpkg.dir_get_list(baseurl, conn=None)

Takes a base url to connect to and read from. URI should be in the form <proto>://<site>[:port]<path> Connection is used for persistent connection instances.

portage.getbinpkg.dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache=1, makepickle=None)
portage.getbinpkg.file_get(baseurl=None, dest=None, conn=None, fcmd=None, filename=None, fcmd_vars=None)

Takes a base url to connect to and read from. URI should be in the form <proto>://[user[:pass]@]<site>[:port]<path>

portage.getbinpkg.file_get_lib(baseurl, dest, conn=None)

Takes a base url to connect to and read from. URI should be in the form <proto>://<site>[:port]<path> Connection is used for persistent connection instances.

portage.getbinpkg.file_get_metadata(baseurl, conn=None, chunk_size=3000)

Takes a base url to connect to and read from. URI should be in the form <proto>://<site>[:port]<path> Connection is used for persistent connection instances.

portage.getbinpkg.make_ftp_request(conn, address, rest=None, dest=None)

Uses the |conn| object to request the data from address and issuing a rest if it is passed.

portage.getbinpkg.make_http_request(conn, address, _params={}, headers={}, dest=None)

Uses the |conn| object to request the data from address, performing Location forwarding and using the optional params and headers.

portage.getbinpkg.make_metadata_dict(data)
portage.getbinpkg.match_in_array(array, prefix='', suffix='', match_both=1, allow_overlap=0)