Sybren A. Stüvel
8340df129d
BAT Pack can now exclude files based on glob patterns
2018-03-14 16:06:21 +01:00
Sybren A. Stüvel
0e9de7753c
Allow Packer to be used as context manager + test for rewriting img seqs
2018-03-14 12:50:27 +01:00
Sybren A. Stüvel
c9664ca045
Report missing files in Packer.strategise()
2018-03-14 12:24:26 +01:00
Sybren A. Stüvel
575a0921c1
bat.pack.queued_copy → bat.pack.filesystem
2018-03-09 17:04:29 +01:00
Sybren A. Stüvel
15ca2f98ab
Better handling of KeyboardInterrupt to abort file transfers
2018-03-09 16:30:46 +01:00
Sybren A. Stüvel
3ae39104a9
Allow subclasses of Packer to specify a different file transferer class
2018-03-09 14:25:43 +01:00
Sybren A. Stüvel
cc06a191a1
Added more annotations for mypy
...
Function declarations that have no type annotations at all will be skipped
by mypy. Adding an explicit `-> None` tells mypy to run on those functions
too.
2018-03-09 14:23:43 +01:00
Sybren A. Stüvel
38978537bc
Removed some unused code + different line wrap style
2018-03-09 13:04:26 +01:00
Sybren A. Stüvel
ac3f6142b3
Move rewritten blend files instead of copying them
...
This will cause a nice speedup if the temporary directory happens to be on
the same file system as the target directory for the BAT Pack. This can be
influenced by setting an environment variable; see the documentation for
[tempfile.gettempdir](https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir )
2018-03-09 12:47:50 +01:00
Sybren A. Stüvel
824ca4bcb7
Rewrite blend files in temporary directory, before copying
...
This allows us to later support uploading to a non-local filesystem, such
as Amazon S3 cloud storage, after path rewriting is complete.
2018-03-09 12:33:15 +01:00
Sybren A. Stüvel
fdbbc3a20d
Static type checking with mypy
...
This does introduce some not-so-nice things, like having to annotate each
`__init__` function with `-> None`. However, the benefits of having static
type checking in a complex bit of software like BAT outweigh the downsides.
2018-03-09 11:09:47 +01:00
Sybren A. Stüvel
632d01334c
Renamed module tracer → trace
...
This is consistent with the other module names.
2018-03-09 10:02:44 +01:00
Sybren A. Stüvel
e8f41f2735
Store rewrites in AssetAction
...
This is in preparation of interchanging copying and rewriting.
2018-03-09 10:00:46 +01:00
Sybren A. Stüvel
d10264695a
Tweaked logging
2018-03-08 15:30:31 +01:00
Sybren A. Stüvel
b6527ec1ee
Moved file copy queue to separate module.
...
Also transformed into a threading.Thread subclass, rather than using a
function + module-global state variables.
2018-03-08 13:00:56 +01:00
Sybren A. Stüvel
08f538d8c8
File I/O improvements
...
- Tracer now iterates over blocks in disk order.
- Packer copies files per directory, in a separate thread.
- Packer only copies files if they don't exist yet.
- Packer also copies file permissions.
2018-03-08 12:33:15 +01:00
Sybren A. Stüvel
b5418e1f5f
Removed Packer._packed_paths
...
The info in that dict is also available in Packer._actions[...].new_path
2018-03-08 11:15:38 +01:00
Sybren A. Stüvel
8fc1072144
Formatting
2018-03-08 11:08:57 +01:00
Sybren A. Stüvel
ccdccd69cf
Speed up rewriting paths by reusing cached DNA structs & blocks
2018-03-08 10:59:45 +01:00
Sybren A. Stüvel
e2123f8090
Path rewriting for sequences seems to be working too.
2018-03-06 16:41:16 +01:00
Sybren A. Stüvel
71dd5bc11b
Path rewriting when packing.
...
Doesn't work with sequences, nor with split dirname/basename fields.
2018-03-06 16:06:36 +01:00
Sybren A. Stüvel
433ad8f16a
Moved packer code into separate class, in preparation for smarter behaviour
2018-03-06 11:58:38 +01:00