12345678910111213141516171819202122 |
-
-
-
-
- import os,marlin
-
-
- def encrypt(source, target, env):
- firmware = open(target[0].path, "rb")
- renamed = open(target[0].dir.path + '/project.bin', "wb")
- length = os.path.getsize(target[0].path)
- position = 0
- try:
- while position < length:
- byte = firmware.read(1)
- renamed.write(byte)
- position += 1
- finally:
- firmware.close()
- renamed.close()
-
- marlin.add_post_action(encrypt);
|