Commit Graph
103 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 e0b9d72c84 Update the license URL and LICENSE.txt 2019-09-25 21:44:05 +01:00
Mike Auty 72567e1c50 Yapf-0.28.0 rerun across the whole codebase. 2019-09-21 21:08:23 +01:00
Mike Auty e922cef316 Improve docstrings for all plugins, and reformat all docstrings. 2019-09-07 22:59:54 +01:00
Mike Auty c88044db5b Update more API documentation. 2019-09-04 00:34:55 +01:00
Mike Auty 9cde94bceb Change the license blurb on all files. 2019-08-27 23:11:00 +01:00
Mike Auty 3af89df1e7 Update the docstrings for the core Context methods. 2019-08-14 20:50:42 +01:00
Mike Auty 5db6ade2ea Change object_type parameter for object_from_symbol. 2019-08-14 20:50:42 +01:00
Mike Auty be27aab8ae Refactor symbol to object_type (so it doesn't shadow builtin type). 2019-08-14 20:50:42 +01:00
Mike Auty 18283ab410 Move to an object_from_symbol model
Note: creation of enumerations can be done using Context.object, which
should allow reference of enumeration members by normal type objects.

If it turns out enumerations are never referenced from types, we can
easily remove the try/except in the Module.object method.
2019-08-14 20:50:42 +01:00
Mike Auty 5362e2094e Initial attempt at cleaning up the API
Context.object accepts a template or a string name (and now a type
flag).  Module.object only accepts a string (because a template already
has most of the stuff built in and might as well be passed to the
Context.object constructor).

The gotcha here is the absolute flag, which must now be set
appropriately in all cases *except* where the module is constructed
with an offset of 0 (whereby it will have no impact).
2019-08-14 20:50:42 +01:00
Mike Auty b2da35c05a Revert "Apply relative offsets to type_name as well as symbol_names for modules."
This reverts commit d67fcc9a6a.
2019-08-10 00:23:18 +01:00
Mike Auty d67fcc9a6a Apply relative offsets to type_name as well as symbol_names for modules. 2019-08-09 20:08:05 +01:00
Mike Auty 272224a1b0 Refactor all references to Context.memory to Context.layers. 2019-07-07 17:42:51 +01:00
Mike Auty 5e37080c14 Fix up misnamed get_enum/has_enum. 2019-06-30 13:35:13 +01:00
Mike Auty fcd77b4c5f Update the documentation to support the wrapper with autodoc-typehints. 2019-01-21 22:10:18 +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 6bb927ebfa Fix up terminology to ensure we only refer to layers not spaces. 2019-01-03 00:40:13 +00:00
Mike Auty 2bbb3f7878 Fix up issue identified by atcuno. 2018-12-20 15:46:42 +00:00
Mike Auty ecdc89a282 Fix a stupid typo. 2018-12-20 15:46:42 +00:00
Mike Auty 67c9c7e097 Add in fix for absolute symbol offsets within modules. 2018-12-20 15:46:42 +00:00
Mike Auty fdc6efc4ad Add in the LICENSE and the README. 2018-12-19 23:55:03 +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 1f0888cf19 Remove the functools.wraps because we don't strictly wrap, just proxy. 2018-11-28 16:24:00 +00:00
Mike Auty 68760bff40 Add wrapper convenience function and reorder imports for documentation generation. 2018-11-13 11:53:42 +00:00
Mike Auty 90d13be9a9 Ensure we pass the native_layer_name whenever constructing a subobject. 2018-09-16 15:59:30 +01:00
Mike Auty efd9dffdfe Fix up the passing of native_layer_name to object constructors. 2018-09-16 14:33:24 +01:00
Mike Auty 218567c228 Allow Context.module to create a SizedModule if a size is provided. 2018-08-09 14:53:21 +01:00
Mike Auty 0a55a7c3f2 Introduced SizedModules to simplify when we just don't care about the size. 2018-08-09 14:42:18 +01:00
Mike Auty 366269deb2 Refactor Module in interfaces to ModuleInterface. 2018-08-09 13:55:16 +01:00
Mike Auty b1d46f843b Convert documentation to napoleon/Google format docstrings. 2018-08-05 15:52:12 +01:00
Mike Auty 79d2bab44d A few additional typing fixes. 2018-07-22 13:29:43 +01:00
Mike Auty 4897b7ab81 Fix up some typing errors. 2018-07-22 13:19:20 +01:00
Mike Auty 2f28dfa6c9 Support finding symbols by ranges. 2018-07-19 09:51:51 +01:00
Mike Auty 083fd43890 Ensure get_module_symbols_by_absolute_location only returns modules at the appropriate offset. 2018-07-19 09:22:57 +01:00
Mike Auty 5c41e05876 Improve Module construction.
The hash/size determination takes time, so make the hash generated on
use (so far, only on dedupe) and cache it, since it shouldn't change.

We also cache the Module construction, so that if it's done in a loop
(like pslist), it won't keep recaculating for the same module.
2018-07-18 21:46:56 +01:00
Mike Auty cc5b470602 Remove the caching to see if it's causing the exceptions. 2018-07-18 21:08:50 +01:00
Mike Auty ce05510413 Additional fixes for module collections. 2018-07-18 14:35:54 +01:00
Mike Auty 91e94440fe Add in hashing for module differentiation and additional collection features. 2018-07-18 00:42:48 +01:00
Mike Auty 5fbf923186 Fix documentation and try to guess the size where possible. 2018-07-17 21:15:09 +01:00
Mike Auty 9c06c25fae Add in support for module sizes. 2018-06-25 00:16:17 +01:00
Mike Auty c012842bd6 Refactor the name to be more accurate. 2018-06-21 00:27:38 +01:00
Mike Auty aedcf40fc2 Add support for separate symbol_tables and name in Modules. 2018-06-21 00:25:55 +01:00
Mike Auty f957b2915e Fix up issue having made optional parameters non-optional. 2018-06-04 09:39:38 +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 44ca819869 Minor documentation tweaks. 2018-05-13 01:05:56 +01:00
Mike Auty 3ce9ad93c7 Fix return types for ModuleCollections. 2018-05-10 02:40:26 +01:00