mirror of
https://github.com/frej/fast-export.git
synced 2025-11-02 01:05:48 +01:00
When commit ddfc3a8300 ("Run file_data_filter on deleted files")
started calling the file_data_filter plugin method, in order to make
deletion of plugin-renamed files work, the example plugins were not
updated. This commit updates the example plugins to not crash when the
file context is None.
Thanks to @hetas discovering this.
Closes 328
14 lines
363 B
Python
14 lines
363 B
Python
def build_filter(args):
|
|
return Filter(args)
|
|
|
|
class Filter():
|
|
def __init__(self, args):
|
|
pass
|
|
|
|
def file_data_filter(self,file_data):
|
|
if file_data['file_ctx'] == None:
|
|
return
|
|
file_ctx = file_data['file_ctx']
|
|
if not file_ctx.isbinary():
|
|
file_data['data'] = file_data['data'].replace(b'\r\n', b'\n')
|