spinn_utilities.make_tools package¶
Submodules¶
spinn_utilities.make_tools.replacer module¶
Module contents¶
-
class
spinn_utilities.make_tools.
Converter
(src, dest, dict_file)[source]¶ Bases:
object
Converts a whole directory including sub directories
Parameters: -
run
()[source]¶ Runs the file converter on a whole directory including sub-directories.
Warning
This code is absolutely not thread safe. Interwoven calls even on different FileConverter objects is dangerous! It is highly likely that dict files become corrupted and the same
message_id
is used multiple times.
-
-
class
spinn_utilities.make_tools.
FileConverter
(src, dest, dict_file)[source]¶ Bases:
object
Creates the file_convertor to convert one file
Parameters: -
bracket_count
(text)[source]¶ Net count of open brackets in line.
Parameters: text (str) – Return type: int
-
static
convert
(src, dest, dict_file, range_start=1)[source]¶ Static method to create Object and do the conversion
Parameters: Returns: The last message id use which can in turn be passed into this method again (
range_start
) to get contiguous non-overlapping IDs across many files.Return type:
-
quote_part
(text)[source]¶ Net count of double quotes in line.
Parameters: text (str) – Return type: int
-
split_by_comma_plus
(main, line_num)[source]¶ split line by comma and partially parse
Parameters: Return type:
-
unique_src
()[source]¶ Returns the suffix of the source and destination paths which is the same.
For example, assuming sources of
/spinnaker/sPyNNaker/neural_modelling/src/common/in_spikes.h
/spinnaker/sPyNNaker/neural_modelling/modified_src/common/in_spikes.h
this returnssrc/common/in_spikes.h
Returns: A pointer to the source relative to the destination Return type: str
-