obfuscator currently returns a general serialised string. It would be more useful to return a string in the same format as the file that has been obfuscated, ready to be written.
Proposed resolution
Replace serialise_data function call in obfuscator with a format_data function, which calls an appropriate file handler to format the data in the correct way. If formatting fails, format_data should serialise the data with serialise_data as before.
Issue
obfuscator
currently returns a general serialised string. It would be more useful to return a string in the same format as the file that has been obfuscated, ready to be written.Proposed resolution
Replace
serialise_data
function call inobfuscator
with aformat_data
function, which calls an appropriate file handler to format the data in the correct way. If formatting fails,format_data
should serialise the data withserialise_data
as before.