|
|
|
|
|
writemsg(mystr,
noiselevel=0,
fd=None)
Prints out warning and debug messages based on the noiselimit setting |
source code
|
|
|
|
writemsg_stdout(mystr,
noiselevel=0)
Prints messages stdout based on the noiselimit setting |
source code
|
|
|
|
writemsg_level(msg,
level=0,
noiselevel=0)
Show a message for the given level as defined by the logging module
(default is 0). |
source code
|
|
|
|
normalize_path(mypath)
os.path.normpath("//foo") returns "//foo" instead
of "/foo" We dislike this behavior so we create our own
normpath func to fix it. |
source code
|
|
|
|
grabfile(myfilename,
compat_level=0,
recursive=0,
remember_source_file=False)
This function grabs the lines in a file, normalizes whitespace and
returns lines in a list; if a line begins with a #, it is ignored, as
are empty lines |
source code
|
|
|
|
|
|
|
stack_dictlist(original_dicts,
incremental=0,
incrementals=[],
ignore_none=0)
Stacks an array of dict-types into one array. |
source code
|
|
|
|
stack_dicts(dicts,
incremental=0,
incrementals=[],
ignore_none=0)
Stacks an array of dict-types into one array. |
source code
|
|
|
|
append_repo(atom_list,
repo_name,
remember_source_file=False)
Takes a list of valid atoms without repo spec and appends
::repo_name. |
source code
|
|
|
|
stack_lists(lists,
incremental=1,
remember_source_file=False,
warn_for_unmatched_removal=False,
strict_warn_for_unmatched_removal=False,
ignore_repo=False)
Stacks an array of list-types into one array. |
source code
|
|
|
|
grabdict(myfilename,
juststrings=0,
empty=0,
recursive=0,
incremental=1)
This function grabs the lines in a file, normalizes whitespace and returns lines in a dictionary |
source code
|
|
|
|
|
|
|
grabdict_package(myfilename,
juststrings=0,
recursive=0,
allow_wildcard=False,
allow_repo=False,
verify_eapi=False,
eapi=None)
Does the same thing as grabdict except it validates keys with
isvalidatom() |
source code
|
|
|
|
| grabfile_package(myfilename,
compatlevel=0,
recursive=0,
allow_wildcard=False,
allow_repo=False,
remember_source_file=False,
verify_eapi=False,
eapi=None) |
source code
|
|
|
|
|
|
|
| grablines(myfilename,
recursive=0,
remember_source_file=False) |
source code
|
|
|
|
writedict(mydict,
myfilename,
writekey=True)
Writes out a dict to a file; writekey=0 mode doesn't write out the
key and assumes all values are strings, not lists. |
source code
|
|
|
|
shlex_split(s)
This is equivalent to shlex.split, but if the current interpreter is
python2, it temporarily encodes unicode strings to bytes since
python2's shlex.split() doesn't handle unicode strings. |
source code
|
|
|
|
| getconfig(mycfg,
tolerant=False,
allow_sourcing=False,
expand=True,
recursive=False) |
source code
|
|
|
|
| varexpand(mystring,
mydict=None,
error_leader=None) |
source code
|
|
|
|
| pickle_read(filename,
default=None,
debug=0) |
source code
|
|
|
|
|
|
|
unique_array(s)
lifted from python cookbook, credit: Tim Peters Return a list of the
elements in s in arbitrary order, sans duplicates |
source code
|
|
|
|
|
|
|
apply_permissions(filename,
uid=-1,
gid=-1,
mode=-1,
mask=-1,
stat_cached=None,
follow_links=True)
Apply user, group, and mode bits to a file if the existing bits do
not already match. |
source code
|
|
|
|
apply_stat_permissions(filename,
newstat,
**kwargs)
A wrapper around apply_secpass_permissions that gets uid, gid, and
mode from a stat object |
source code
|
|
|
|
apply_recursive_permissions(top,
uid=-1,
gid=-1,
dirmode=-1,
dirmask=-1,
filemode=-1,
filemask=-1,
onerror=None)
A wrapper around apply_secpass_permissions that applies permissions
recursively. |
source code
|
|
|
|
apply_secpass_permissions(filename,
uid=-1,
gid=-1,
mode=-1,
mask=-1,
stat_cached=None,
follow_links=True)
A wrapper around apply_permissions that uses secpass and simple logic
to apply as much of the permissions as possible without generating an
obviously avoidable permission exception. |
source code
|
|
|
|
|
|
|
|
|
|
new_protect_filename(mydest,
newmd5=None,
force=False)
Resolves a config-protect filename for merging, optionally using the
last filename if the md5 matches. |
source code
|
|
|
|
|
|
|
|