Main API¶
- class bright.apigen.main.DescriptionCache(cachefile='build/desc.cache')¶
A quick persistent cache for descriptions from files. The keys are (classname, filename) tuples. The values are (hashes-of-the-file, description-dictionary) tuples.
Parameters : cachefile : str, optional
Path to description cachefile.
- dump()¶
Writes the cache out to the filesystem.
- isvalid(classname, filename)¶
Boolean on whether the cach value for a (classname, filename) tuple matches the state of the file on the system.
- bright.apigen.main.describe_class(classname, filename, verbose=False)¶
Returns a description dictionary for a class (called classname) living in a file (called filename).
Parameters : classname : str
Class to describe.
filename : str
File where the class is implemented. Will remove leading 'bright_' from filename for the puprose of generating other files.
verbose : bool, optional
Flag for printing extra information during description process.
Returns : desc : dict
Description dictionary of the class.
- bright.apigen.main.dumpdesc(ns)¶
Prints the current contents of the description cache using ns.
- bright.apigen.main.genbindings(ns)¶
Generates bidnings using the command line setting specified in ns.
- bright.apigen.main.main()¶
Entry point for Bright API generation.
- bright.apigen.main.newoverwrite(s, filename)¶
Useful for not forcing re-compiles and thus playing nicely with the build system. This is acomplished by not writing the file if the existsing contents are exactly the same as what would be written out.
Parameters : s : str
string contents of file to possible
filename : str
Path to file.