Commit Graph

331 Commits (87e734b567a6b846db9eed367002564abd513e91)

Author SHA1 Message Date
Dan Puttick fc8923fddd Change Groomer private methods to public
* Changed safe_rmtree, safe_copy, safe_remove, and safe_mkdir to public methods
* If something is being used in a subclass it probably shouldn't be a private
method
2017-03-15 21:06:07 -04:00
Dan Puttick 12d5624b4d Change FileBase.log_details to Filebase._file_props
* _file_props is a dict that will hold all information about the file
* Updated filecheck.py to reflect this
* Potentially will change contents of file_props to being attributes on the
file in the future. This change would be easy since all access to _file_props
is now via set_property and get_property methods.
* Add filename to _file_props
2017-03-15 21:06:06 -04:00
Dan Puttick 1c58a7347e If no extentions FileBase.ext is now None 2017-03-15 21:06:06 -04:00
Dan Puttick b6c01db1fb Split mimetype methods
- Instead of one large function that mutates FileBase properties,
mimetype and main/subtype are determined by two separate methods
that return mimetypes.
- The API is not changed.
- Absence of mimetype is now None instead of an empty string.
2017-03-15 21:06:06 -04:00
Dan Puttick 9832101c85 Identify TODOs that are log related 2017-03-15 21:06:06 -04:00
Dan Puttick 8d7dd1197f Move run_process back to Groomer object 2017-03-15 21:06:06 -04:00
Dan Puttick 781d0a76af First working version with methods in File object
- All tests now passing with file handling methods on File object
instead of Groomer object.
- Logging functionality still isn't finished.
2017-03-15 21:06:06 -04:00
Dan Puttick 9aafe6e518 Remove cur_file from methods in File object 2017-03-15 21:06:06 -04:00
Dan Puttick 53c1598af8 Move file processing methods into File object
- It seems like filecheck will be easier to reason about if all of
the file processing stuff happens in the File object. The Groomer
object will now be responsible only for enumerating the files to
be processed.
- Tests won't pass for this commit, but wanted to make the diff
cleaner but committing this before making changes.
2017-03-15 21:04:57 -04:00
Dan Puttick 3d36c90d66 Make list_all_files a public method 2017-03-15 21:04:57 -04:00
Dan Puttick 4a99ba900a Make self.get_extension return a value 2017-03-15 21:04:57 -04:00
Dan Puttick c6ecc5e3a3 Fix process_dir bug in filecheck tests 2017-03-15 21:04:57 -04:00
Dan Puttick bfa257534a Remove old data/ path stuff from helpers.py 2017-03-15 21:04:57 -04:00
Dan Puttick cfeccc2561 Move main() into filecheck
- Also change the name of processdir to process_dir
2017-03-15 21:04:57 -04:00
Dan Puttick 61aa14c98d Change _write_log to _print_log 2017-03-15 21:04:57 -04:00
Dan Puttick 9d2f5c7241 Add .jpg test file, testfile_directory.md
- Also fixed a bug with metadata code
2017-03-15 21:04:57 -04:00
Dan Puttick a450fe6b96 Add config object to filecheck
- Grouped all configuration options for filecheck into a Config object
- Makes the code easier to read since no longer many references to different
configuration globals
2017-03-15 21:04:57 -04:00
Dan Puttick 7d62238270 Hacks to make tests pass before fixing 2017-03-15 21:04:57 -04:00
Dan Puttick 1cf8a62f46 First commit with Logger object
- Made logger object
- Moved some logger related code from Groomer to Logger
- Changed logging related tests
- Filecheck tests still do not pass
2017-03-15 21:04:57 -04:00
Dan Puttick 92d1b1cd93 Refactor metadata processing code 2017-03-15 21:01:28 -04:00
Dan Puttick e2af701ac9 Remove several pieces of unused code
* Remove python 2 KittenGroomerBase.tree
* Remove default source and dest from KittenGroomerFileCheck
* Remove unused sys import
2017-03-15 21:01:28 -04:00
Dan Puttick 774095d95a Fix list_all_files docstring 2017-03-15 21:01:28 -04:00
Dan Puttick 0be926c0eb Reorganize KittenGroomerBase __init__ 2017-03-15 21:01:28 -04:00
Dan Puttick 3cc9aa23f2 Clarify language in README 2017-03-15 21:01:28 -04:00
Dan Puttick dc76e00554 Removed broken coveralls link in README 2017-03-15 21:01:28 -04:00
Raphaël Vinot a3cad2c21e Fix forgotten copy 2017-03-14 10:47:20 +01:00
Raphaël Vinot 4cbd15a4a2 Fix spell 2017-03-10 14:56:32 +01:00
Raphaël Vinot 8a186bfd26 Merge branch 'master' of github.com:CIRCL/PyCIRCLean 2017-03-10 14:45:11 +01:00
Raphaël Vinot b0224d781a Update slides 2017-03-10 14:45:00 +01:00
Raphaël Vinot 515687b1fe Generate SHA256 hash instead of SHA1. 2017-03-10 12:20:57 +01:00
Raphaël Vinot dd35d23162 Merge pull request #8 from dputtick/dev-py3
Version 2.1
2017-01-19 18:23:17 -05:00
Dan Puttick 3041c6303f Update changelog to version 2.1 2017-01-19 17:48:14 -05:00
Dan Puttick 833ade6008 Change to Python 3 compatible only 2017-01-19 17:06:34 -05:00
Dan Puttick fd30fb3e08 Change _run_process() to use builtin timeout parameter
NOTE: this change breaks Python 2 compatability: subprocess.check_call does not
take a timeout argument in Python 2.7
2017-01-19 17:00:10 -05:00
Dan Puttick 573cf51b69 Switch back to main officedissector repo 2017-01-19 16:28:22 -05:00
Dan Puttick 4eaa639a7a Remove /playground 2017-01-19 16:23:53 -05:00
Dan Puttick 3b1df108d5 Rename test_helpers 2017-01-19 16:19:15 -05:00
Dan Puttick faf534c66f Add test.obj to src_invalid 2017-01-19 16:12:32 -05:00
Dan Puttick d06832e524 Remove kittengroomer/data/ 2017-01-19 16:11:58 -05:00
Dan Puttick 21cc175867 Move non-filecheck.py binaries into examples directory
Tests for these scripts also removed from /tests and from .travis.yml
Two .zip archives accidentally deleted from /tests/src_invalid, re-added them
and changed .gitignore to prevent the problem
2017-01-19 15:25:08 -05:00
Dan Puttick f7ab393eb6 Refactor FileBase helper methods 2017-01-18 15:51:54 -05:00
Dan Puttick d4bfe794be In FileBase, self.extension is now always lowercase 2017-01-18 15:51:54 -05:00
Dan Puttick 43c01e0f05 Add example autorun.inf file to tests/src_invalid 2017-01-18 15:51:54 -05:00
Dan Puttick 3dad4faa61 Reorganize tests making them easier to run
- The tests now automatically run depending on whether you have the dependencies
installed, instead of failing and throwing exceptions.
- CONTRIBUTING.md has more information on how to run the tests.
- When the tests run, they will save their logs to /test_logs instead
of printing them so you can read them later.
- Change names of source file directories to make them more descriptive
2017-01-18 15:51:54 -05:00
Dan Puttick 70a73dc292 Move process_file code into its own method 2017-01-18 15:51:50 -05:00
Dan Puttick 35501b69af Create test_filecheck.py 2017-01-18 15:51:47 -05:00
Dan Puttick 0badab0b20 Small setup.py change 2016-12-20 15:16:58 -05:00
Dan Puttick 173a844b69 Some reorganization of filecheck.py, adding docstrings 2016-12-20 12:35:30 -05:00
Dan Puttick ecb4f56710 Small fixes to bin/README.md 2016-12-16 17:38:40 -05:00
Dan Puttick cef4223c53 Deleting old tests, minor test reorganization. 2016-12-16 17:36:21 -05:00