pyfileconf.io.file.write package

Submodules

pyfileconf.io.file.write.asttosource module

pyfileconf.io.file.write.asttosource.ast_node_to_source(ast_node)[source]

Uses astor package to produce source code from ast

Also handles low-level ast functions, such as wrapping in a module if necessary, and fixing line numbers for modified/extracted ast

Args:

ast_node:

Returns:

Return type

str

pyfileconf.io.file.write.base module

class pyfileconf.io.file.write.base.FileStr(import_assignment_obj, existing_imports, existing_assigns, existing_body)[source]

Bases: object

__init__(import_assignment_obj, existing_imports, existing_assigns, existing_body)[source]
Args:

import_assignment_obj: object which has method obj.as_imports_and_assignments() existing_imports: existing_assigns: existing_body: should not contain imports, but should contain rest of existing file as str

pyfileconf.io.file.write.config module

class pyfileconf.io.file.write.config.ConfigFileStr(config, existing_imports, existing_assigns, existing_body)[source]

Bases: pyfileconf.io.file.write.base.FileStr

__init__(config, existing_imports, existing_assigns, existing_body)[source]

Args: import_assignment_obj: object which has method obj.as_imports_and_assignments() existing_imports: existing_assigns: existing_body: should not contain imports, but should contain rest of existing file as str