spinn_utilities.make_tools package¶
Submodules¶
spinn_utilities.make_tools.converter module¶
spinn_utilities.make_tools.log_sqllite_database module¶
- class spinn_utilities.make_tools.log_sqllite_database.LogSqlLiteDatabase(new_dict=False)[source]¶
Bases:
AbstractContextManager
Specific implementation of the Database for SQLite 3.
Note
Not thread-safe on the same database. Threads can access different DBs just fine.
Note
This totally relies on the way SQLite’s type affinities function. You can’t port to a different database engine without a lot of work.
Connects to a log dict. The location of the file can be overridden using the
C_LOGS_DICT
environment variable.- Parameters:
new_dict (bool) – Flag to say if this is a new dict or not. If True, clears and previous values. If False, makes sure the dict exists.
spinn_utilities.make_tools.replacer module¶
- class spinn_utilities.make_tools.replacer.Replacer(new_dict=False)[source]¶
Bases:
LogSqlLiteDatabase
Performs replacements.
Connects to a log dict. The location of the file can be overridden using the
C_LOGS_DICT
environment variable.- Parameters:
new_dict (bool) – Flag to say if this is a new dict or not. If True, clears and previous values. If False, makes sure the dict exists.
Module contents¶
- class spinn_utilities.make_tools.FileConverter[source]¶
Bases:
object
Converts a file. See
convert()
.- __call__(src, dest, log_file_id, log_database)[source]¶
Creates the file_convertor to convert one file.
- Parameters:
src (str) – Absolute path to source file
dest (str) – Absolute path to destination file
log_file_id (int) – Id in the database for this file
log_database (LogSqlLiteDatabase) – The database which handles the mapping of id to log messages.
- static convert(src_dir, dest_dir, file_name)[source]¶
Static method to create Object and do the conversion.