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
fdc6efc4ad
Add in the LICENSE and the README.
2018-12-19 23:55:03 +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
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
2288f54a44
Raise exception instead of returning None.
2018-10-11 14:26:37 +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
981d333195
Fix ObjectInterface __getattr__ making objects that don't override return None rather than raising an AttributeError.
2018-08-17 10:52:48 +01:00
Mike Auty
b1d46f843b
Convert documentation to napoleon/Google format docstrings.
2018-08-05 15:52:12 +01:00
Mike Auty
c0ec52822b
Add some typing fixes.
2018-06-16 14:19:36 +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
1bae0f26c9
Make sure we don't get in getattr loops.
2018-04-04 00:40:30 +01:00
Mike Auty
efada8a15f
Bring relative_child_offset typing in line with practice.
2018-03-23 16:04:03 +00:00
Mike Auty
942de5f166
Finish adding type-annotations thoughout the code.
2017-12-13 20:48:52 +00:00
Mike Auty
f40fae197d
Convert to python3.5 syntax (no local type-annotations).
2017-12-13 20:48:52 +00:00
Mike Auty
21b4506b7b
Add in type-annotations for the remaining interfaces.
2017-12-13 20:48:52 +00:00
Mike Auty
def6de51bd
Add in the ability to get a symbol table from a specific object (often self.get_symbol_table).
2017-11-09 23:11:05 +00:00
Mike Auty
6523364c90
Add a validate method to all objects to allow for (optional) validation of data on construction.
2017-09-22 09:57:01 +01:00
Mike Auty
cd2eaeab06
Rename the imported context interface to match other examples in the code.
2017-01-23 01:12:44 +00:00
Mike Auty
547a3d94bb
Fix up the documentation and leave a note about cast accepting short type names.
2017-01-04 22:10:27 +00:00
Mike Auty
e596c6a1b7
Further documentation updates.
2017-01-03 23:06:39 +00:00
Mike Auty
a7ea6e2210
Improve the object/template documentation.
2017-01-01 01:43:08 +00:00
Mike Auty
8f6f5f6403
Update object interface documentation.
2016-12-30 02:36:06 +00:00
Mike Auty
433f47c458
Allow casting to inherit the symbol table of its parent.
2016-12-25 18:34:14 +00:00
Mike Auty
e230bbf6a8
Ensure we don't ever get in a loop looking up ._vol (could happen when pickling/unpickling).
2016-12-25 00:02:11 +00:00
Mike Auty
2323e15ec3
Clarify in the documentation that these updates are transient.
2016-12-18 19:38:22 +00:00
Mike Auty
09ee0e6258
Fix fairly deep flaw where resolved templates could be modified by casting or creating an object.
2016-12-18 19:21:27 +00:00
Mike Auty
6b973f1538
Expose VolTemplateProxy.vol values in the Proxy (to allow for enumeration access in a template).
2016-12-18 02:19:46 +00:00
Mike Auty
bd3762a81c
Improve exception returns in TemplateProxy.
2016-12-18 01:52:06 +00:00
Mike Auty
2c60747355
Minor fix, small but might as well fix it.
2016-12-14 00:27:41 +00:00
Mike Auty
797e51608e
Move the masking code into the data layer.
2016-12-07 09:50:59 +00:00
Mike Auty
6cb5d06d6d
Ensure all offsets are normalized to fall within their layer's address range.
2016-12-07 00:07:57 +00:00
Mike Auty
667014a1fd
Attempt to standardize error message display.
2016-10-30 17:51:45 +00:00
Mike Auty
d1b58143fe
Add in UnresolvedTemplate type.
...
This template type allows objects that have not been able to be resolved
to exist within the symbol system. It emits a debug message on creation
so that intermediate format developers can identify potential issues,
but does not raise an exception so as to allow partial tables to be
used.
If the UnresolvedTemplate is called (to create an object) before the
symbol has been added to the symbolspace, it will fail with a
SymbolError (as thrown by the individual SymbolTable). For this reason,
the class has been made private to the SymbolSpace class to prevent
unexpected use.
2016-10-30 16:54:12 +00:00
Mike Auty
e02feed16e
Python 3 has a sane super() implementation (no arguments), so convert to using that.
2016-08-14 00:55:02 +01:00
Mike Auty
2d23c93def
Completely refactor constants and structures to symbols and types.
2016-05-22 11:51:06 +01:00
Mike Auty
9c9183feb2
API change: Alter cast to accept object parameters rather than inheriting (which usually will be wrong).
2016-02-14 01:40:25 +00:00
Mike Auty
df4a4d5e8d
Remove abstract method from classmethods (since it won't error if the abstract method isn't implemented until instantiation.
2016-01-10 16:30:37 +00:00
Mike Auty
bcbfee9016
Refactor the validity function names to make it easier for autocomplete to find.
2015-12-29 22:24:32 +00:00
Mike Auty
d258c56991
Rerun pylint with pycharm-5 and fix pep8 issues as well.
2015-11-21 13:12:00 +00:00
Mike Auty
cadb761f67
Fix documentation typo.
2015-01-05 16:01:14 +00:00
Mike Auty
49fa45cda1
Clean-up the namespace even more by putting the template proxy code into its own subclass.
2015-01-05 15:57:35 +00:00
Mike Auty
465bf03ad1
Fix casting.
2015-01-05 15:05:26 +00:00
Mike Auty
87967853f7
Convert volinfo namespace to vol namespace.
2015-01-05 15:04:40 +00:00
Mike Auty
0af0a5b21f
Avoid built-in shadowing.
2015-01-04 21:16:54 +00:00
Mike Auty
ea3ba27a04
Refactor template_* functions.
2015-01-04 20:52:34 +00:00
Mike Auty
95238f7f01
Eradicate **magic where possible and rename where appropriate.
2015-01-04 04:55:17 +00:00
Mike Auty
e9e7f396ed
Refactor ReadOnlyInformation to the more appropriate ReadOnlyMapping.
2015-01-04 04:54:02 +00:00