utility functions

Bunch of small functions doing for useful stuff for flmake

flash.flmake.utils.git_info(d)[source]

Return the git version information for a directory.

flash.flmake.utils.hg_info(d)[source]

Return the mecurial version information for a directory.

flash.flmake.utils.svn_info(d)[source]

Return the subversion information for a directory.

flash.flmake.utils.release_info(d)[source]

Returns the version information for a stable FLASH release.

flash.flmake.utils.vc_info(d)[source]

Gets the version control information of a directory. Returns either an empty tuple when no repo is found or a 3-tuple of (repo-type, branch, version) when it is.

flash.flmake.utils.release_diff(src, clean_src)[source]

Diffs a release directory with the clean version of the release dir.

flash.flmake.utils.vc_diff(d, vc_type=None)[source]

Makes diff of the version controlled directory.

flash.flmake.utils.vc_patch(d, diff, vc_type=None)[source]

Applies a patch to a version controlled directory.

flash.flmake.utils.git_checkout(src, info, base='/tmp', cmd=None)[source]

Checks out out a copy of the git repo at info point in history in the base directory.

flash.flmake.utils.hg_checkout(src, info, base='/tmp', cmd=None)[source]

Checks out out a copy of the hg repo at info point in history in the base directory.

flash.flmake.utils.svn_checkout(src, info, base='/tmp', cmd=None)[source]

Checks out out a copy of the svn repo at info point in history in the base directory.

flash.flmake.utils.release_checkout(src, info, base='/tmp', cmd=None)[source]

Checks out out a copy of the repo at info point in history in the base directory.

flash.flmake.utils.vc_checkout(src, info, base='/tmp', cmd=None)[source]

Checks out out a copy of the source repo at info point in history in the base directory.

flash.flmake.utils.search_paths(paths, file_or_dir)[source]

Searches the paths for a file (or directory).

Parameters :

paths : list of str

Paths to search.

file_or_dir : str

File or directory name to find.

Returns :

fullpath : str

Full path of file or directory, ‘/path/to/file’.

flash.flmake.utils.desc_cmd_metadata(project_dir='.')[source]

Gathers desc metadata common to all flmake commands.

flash.flmake.utils.hash_list_to_dict(hashes, d=None)[source]

Converts a list of hashes to a recursive dictionary.

flash.flmake.utils.hash_dict_to_str(hash_dict, labels=None, indent_str='')[source]

Converts a hash dictionary to a str. Nice for printing.

flash.flmake.utils.get_rel_path(filename, basedir)[source]

Return the relative path to FILENAME from basedir

flash.flmake.utils.dir_glob(pathname)[source]

Takes a pattern (absolute or relative to current directory) and returns a list of directories matching pattern. The match is made case-insensitive

flash.flmake.utils.getHostName(sitesDir)[source]

Returns the hostname to use.

flash.flmake.utils.determine_machine()[source]

Returns directory of proper machine to use

flash.flmake.utils.strictlyCaseSensitiveFilenames()[source]

Determines whether case is strictly significant in filenames

flash.flmake.utils.add_simple_opts(parser, opts)[source]

Adds optional arguments (ie those that start with parser.prefix_chars) to the parser. The parser must be an instance of the argparse.ArgumentParser and opts should be a list of arguments. Positional arguments (those that do not start with parser.prefix_chars) and optional argument values are ignored by this function.

Previous topic

template

Next topic

variable info

This Page