Commit Graph
123 Commits
Author SHA1 Message Date
Mike Auty b99ace86fb Tidy up exceptions to be more accurate. 2019-11-13 19:58:14 +00:00
Mike Auty 648cded5e1 Objects: Fix incorrect Bitfield maths
Turns out that #133 exposed a mistake in how we were using the end_bit
field (and it should have been picked up in review, my bad).
Essentially we were masking based on the length of the end_bit after
*already* shifting by the start_bit.  We should mask then shift, not the
other way around.

May well fix issue #135 (pdb generation will have been affected by
this).
2019-11-13 16:48:14 +00:00
Mike Auty face38436e layers: Fix up uses of is_valid. 2019-11-12 09:09:51 +00:00
Mike Auty 9a17beb77f Ensure consistency of importing interfaces. 2019-10-02 01:18:46 +01:00
Mike Auty e0b9d72c84 Update the license URL and LICENSE.txt 2019-09-25 21:44:05 +01:00
Mike Auty d2b892cf94 Fix up docstring errors in documentation build 2019-09-19 23:00:37 +01:00
Mike Auty e922cef316 Improve docstrings for all plugins, and reformat all docstrings. 2019-09-07 22:59:54 +01:00
Mike Auty a3caf39097 Use a mapping to determine kind to class. 2019-08-31 12:57:53 +01:00
Mike Auty 9cde94bceb Change the license blurb on all files. 2019-08-27 23:11:00 +01:00
Mike Auty 4cde0da8a9 Support passing through functions from specific to generic template. 2019-08-10 00:25:21 +01:00
Mike Auty 272224a1b0 Refactor all references to Context.memory to Context.layers. 2019-07-07 17:42:51 +01:00
Mike Auty e503c3667f Improve enumeration support. 2019-06-30 14:12:43 +01:00
Mike Auty 1c0cd7ddaf Make sure objects.utility is imported automatically. 2019-05-09 00:07:59 +01:00
Mike Auty 8c76a25b2d Allow VolTemplateProxies to include additional useful methods. 2019-04-17 23:53:36 +01:00
Mike Auty e5d6cd3d16 Add in Enum ObjectTemplate lookup method. 2019-04-17 23:53:22 +01:00
Mike Auty 9b488f89fd Make the default python-type for Chars an int rather than a bytes. 2019-02-06 21:06:12 +00:00
Mike Auty c64ed6a8dd Remove validity checking in favour of static-type checking.
This removes the assertions that checked plugin devs didn't do anything
overly bad in favour of using mypy to ensure appropriate type-checking.

It also moves the ProgressCallback typing information to constants in
order to avoid circular imports (since constants doesn't import
anything).
2019-01-20 02:35:49 +00:00
Mike Auty b13fcb186c Improve typing issues. 2019-01-03 01:13:53 +00:00
Mike Auty 6bb927ebfa Fix up terminology to ensure we only refer to layers not spaces. 2019-01-03 00:40:13 +00:00
Mike Auty fdc6efc4ad Add in the LICENSE and the README. 2018-12-19 23:55:03 +00:00
Andrew Caseandikelos 8f213a95d7 vol_class -> CPPObject 2018-12-19 00:54:51 +00:00
Mike Auty c5ebf91915 Yapf reformat of the patches. 2018-12-19 00:54:51 +00:00
Andrew Caseandikelos 6aac0571e6 add support for objective C classes in OSX and json format 2018-12-19 00:54:51 +00:00
Mike Auty e65a00894a Minor style tweaks and mass changes across the codebase because of it. 2018-12-17 12:46:14 +00:00
Mike Auty b61ac3bd47 Many more typing fixes. 2018-12-17 01:17:06 +00:00
Mike Auty 19572b6e1e Reformat all python files using yapf with custom volatility style. 2018-12-16 16:50:17 +00:00
Mike Auty 9824538bd9 Numerous pycharm warnings resolved
This includes:

* Better ways of checking empty lists
* Not shadowing builtin functions like filter
* Preventing invalid slash warnings by marking strings as regexps
* Removing unnecessary brackets
* Lowercase variable names
* Adding/updating parameters in docstrings
* Removing unused code (lines not chunks)
* Change in not a member tests
* Changing some methods to static
* Shorting range membership checks
* Missing parameters
* Make some exception handlers more specific
* Don't define a lambda to a variable
* A few more instance checks to help type checkers
2018-12-16 13:21:06 +00:00
Mike Auty 29d41470a4 Mass reformat of typing imports
Relented on the strict import of direct objects/classes for the typing
module only.  Typing module components can be directly imported because
it makes the code really painful to read and write otherwise.

This is still in-line with the python style guide adopted from Google at
http://google.github.io/styleguide/pyguide.html section 2.2.
2018-12-16 13:04:22 +00:00
Mike Auty f41e3e0453 Completely rework the primitive data format system. 2018-12-13 18:33:42 +00:00
Mike Auty 9949809198 Fix a minor typo. 2018-12-13 18:33:42 +00:00
Mike Auty b533d19f83 Refactor the data extraction for primitive types. 2018-12-13 18:33:42 +00:00
Mike Auty a78452e361 Fix up ugly int128 hack with a slightly nicer hack. 2018-12-13 15:56:24 +00:00
Mike Auty 90c964905a Fix up a circular import issue. 2018-11-08 00:25:26 +00:00
Mike Auty db7320e426 Bulk lint and a couple of typos fixed. 2018-11-08 00:19:17 +00:00
Mike Auty 001d53e768 Rework some code to help with typing. 2018-11-01 11:17:15 +00:00
Mike Auty 9c101aee91 Ensure pointers are masked based on their native_layer not their instantiated layer. 2018-10-04 02:44:26 +01:00
Mike Auty fa552aa3b0 Add in the native_layer_name concept to ObjectInformation. 2018-09-12 22:45:34 +01:00
Mike Auty 3a6b4ad35c Add in the has_member method for objects and templates. 2018-08-29 22:54:56 +01:00
Mike Auty d08c29ffab Improve style to use default iterators rather than explicit ones. 2018-08-05 16:18:53 +01:00
Mike Auty b1d46f843b Convert documentation to napoleon/Google format docstrings. 2018-08-05 15:52:12 +01:00
Mike Auty 7fc19ef110 Updating typing information. 2018-08-05 15:02:11 +01:00
Mike Auty bca972f28a Remove the python implementation of __getattribute__ for speed.
The __getattribute__ method is called for *all* attribute lookups, and
the python implementation is likely slow.  The only function the python
implementation provided was to check that properties started with
helper_.  Since this only provided a log message, we could add it back
in only if the log level is high enough?  Either way, it's not
significant enough to warrant costing extra time in every attribute
lookup on every object.
2018-07-30 23:58:02 +01:00
Mike Auty d9ed86bcc5 Ensure we return the correct values for dir(). 2018-06-16 14:29:51 +01:00
Mike Auty 7a52ac9deb Fix a large number of typing issues.
There are several instances where mypy didn't detect

if blah is not None:
    blah = thing

and so were rewritten as:

blah = blah or thing
2018-06-04 01:25:02 +01:00
Mike Auty 6fdf577058 Fix up another typing warning. 2018-04-12 14:57:10 +01:00
Mike Auty 66af2f16de Fix more typing issues. 2018-04-12 14:09:11 +01:00
Mike Auty c758c249d0 Fix classing issue introduced by recent pickling work. 2018-04-11 20:54:48 +01:00
Mike Auty 1f733e7dc4 Make sure we don't get in a getattr loop.
This appears to get in a loop when it's been unpickled by
multiprocessing.  My guess is that it's trying to set _concrete_members
without it being done in __init__ and there gets in a loop.

We ensure then when doing a look-up inside __getattr__, it happens using
__getattribute__.
2018-04-08 23:28:14 +01:00
Mike Auty d8f497eb71 Allow unpickling of PrimitiveObjects. 2018-04-08 22:25:46 +01:00
Mike Auty d8cdd79843 Add in pointer is_readable method to check if the pointer would translate properly. 2018-03-24 11:00:22 +00:00