1. 29 Nov, 2021 2 commits
  2. 26 Nov, 2019 1 commit
    • Charles Ferguson's avatar
      Options for the FrameFunction being extended. · 0f1c7ef8
      Charles Ferguson authored
      In places the string version of the FrameFunction was giving us a
      expanded version, where we might not expect it - adding the parameters
      to the function name. Disabling this within the options is pretty
      simple, and makes it possible to rely on the original behaviour
      of the return value.
      0f1c7ef8
  3. 13 Nov, 2019 2 commits
    • Charles Ferguson's avatar
      Fix a small misuse of __class__ which fails for Python 2 classes. · b5cd9884
      Charles Ferguson authored
      Classes not derived from object do not have an __class__ attribute
      so we need to cope with this.
      b5cd9884
    • Charles Ferguson's avatar
      Update CodeNaming to be resilient if inspect.getmembers fails. · 2f2ca69a
      Charles Ferguson authored
      inspect.getmembers can fail on objects if they have a __get__ method
      on members which raises an exception. This happens in the six module
      when the lazy importing code is triggered, which causes a failure if
      the import cannot work (as is the case with tkinter). We fall back
      to just reporting that there are no members, which will cause the
      presentation to default to its 'function name only', rather than the
      full path naming, but will at least be safe.
      2f2ca69a
  4. 20 Oct, 2019 3 commits
    • Charles Ferguson's avatar
      Allow class constants to be hidden; truncate long lists and dicts. · 74d7540f
      Charles Ferguson authored
      It is now possible to cause class constants - values which are present
      in an object which are the same as the class member of the same name -
      to be hidden in the output. This can reduce the size of the output by
      hiding information that can be obtained from the source itself.
      
      Long lists and dictionaries are another place where the output can
      become cluttered, and it is unlikely that the reader will want to check
      the values beyond basic members of a dictionary, so these values can
      be truncated as well - they would be truncated at the non-string limit
      anyhow. Because the truncation happens at the item level, as well
      as the total string level, individual items which are very long can
      be kept from swamping the output. Additionally, the enumeration only
      happens for sufficient items to meet the configuration, so the whole
      dictionary or list does not have its representation generated only
      to be truncated.
      74d7540f
    • Charles Ferguson's avatar
      Update styled strings to the latest version. · 733e7e70
      Charles Ferguson authored
      A small fix for the issues with the repr on StyledString not being
      reported properly.
      733e7e70
    • Charles Ferguson's avatar
      Ensure that when exceptions occur the exit code is non-zero. · acf3ab22
      Charles Ferguson authored
      Check for exceptions in the shell code and cause an exit with a status
      code of 1.
      acf3ab22
  5. 12 Oct, 2019 5 commits
  6. 27 Jul, 2019 1 commit
    • Charles Ferguson's avatar
      Add integer formatting using hex and bit numbers. · 3cf3ff10
      Charles Ferguson authored
      When printing integers, it's useful to know what the hex value or whether
      it is a specific bit. It won't hurt if you're not caring about those
      values, but if you are, it's a lot easier than having to convert them
      either in your head or starting up python to print them!
      3cf3ff10
  7. 06 Jun, 2019 1 commit
    • Charles Ferguson's avatar
      Improve the handling of CodeNaming. · 21632234
      Charles Ferguson authored
      Lambda and Generator functions are handled better. Class methods are
      detected slightly differently (but likely won't actually be any more
      reliable - functions are returned for many results).
      21632234
  8. 02 Jun, 2019 1 commit
    • Charles Ferguson's avatar
      Add some very basic tests for the CodeNaming functions. · d1a2e526
      Charles Ferguson authored
      CodeNaming didn't have any tests, and could fail badly, which caused
      the backtrace to report terminal errors. There is a test for one of the
      functions in the CodeNaming which was giving problems - it should be
      expanded as we find other issues, or when we need to report different
      messages.
      d1a2e526
  9. 22 Apr, 2019 1 commit
    • Charles Ferguson's avatar
      Update CI, annotate lint warnings. · 6866ebaf
      Charles Ferguson authored
      CI updated to the latest version, and updated the linting to use the
      most recent pylintrc; with an annotation of an import that appears to
      hide the top level longtraceback module but it'll be doing the right
      thing anyhow.
      6866ebaf
  10. 21 Apr, 2019 1 commit
  11. 09 Apr, 2019 1 commit
  12. 26 Mar, 2019 3 commits
    • Charles Ferguson's avatar
      Lint: Remove redundant 'pass' in ReprPatching. · 3538b378
      Charles Ferguson authored
      Errors whilst trying to process 'repr' will end up being shown as
      an inline message (not through the error reporting system). This
      means that the output might not match up quite so nicely with what
      we hope to see, but it could help with some debugging.
      3538b378
    • Charles Ferguson's avatar
      Update the interactive header to just give the python version. · 60078820
      Charles Ferguson authored
      There's no point in saying that this is an 'InteractiveConsole' as
      the implementation isn't important. Better to say that it's Python
      with the vesion number, which is closer to the standard version.
      60078820
    • Charles Ferguson's avatar
      Replace import of deprecated 'imp' with 'types.ModuleType'. · fb3622fd
      Charles Ferguson authored
      The 'imp' module is going away, to be reokaced by the 'importlib'
      module. However, importlib, doesn't provide the 'new_module' support
      that we require for starting the main environment. For simplicity,
      this has been replaced with 'types.ModuleType', rather than going
      through the Python 3.x interfaces of locating a spec (which seems
      to not be possible for a null case).
      
      This suffices for most cases; those cases of loading through a
      loader like the Zip file, won't be handled, but then I've never
      needed them.
      fb3622fd
  13. 24 Mar, 2019 1 commit
    • Charles Ferguson's avatar
      Ensure that the PWD is on the path when invoked interactively. · 90bc0701
      Charles Ferguson authored
      In Python 2.7, the PWD was appearing as '' in the path, whilst in
      Python 3.x, it appears as an absolute path. The former is not actually
      the PWD, and would change in behaviour if the user changed directory.
      The latter is more correct, and we reproduce this behaviour in the
      shell for all versions of Python we're used with, so that we remain
      consistent across versions. Even though that means that the shell
      will differ from the regular python shell, I think that is more sane-
      and anyhow, Python 2.7 is end of life so I think moving to the Python
      3.x way of working is more sane.
      90bc0701
  14. 28 Jan, 2019 1 commit
  15. 31 Dec, 2018 1 commit
  16. 30 Dec, 2018 1 commit
  17. 28 Dec, 2018 3 commits
  18. 24 Dec, 2018 1 commit
  19. 24 Sep, 2018 2 commits
  20. 18 Sep, 2018 1 commit
  21. 13 Aug, 2018 5 commits
  22. 04 Aug, 2018 1 commit
    • Charles Ferguson's avatar
      Add in locking around singleton creation for ReduceFilename for multithreading. · 249604da
      Charles Ferguson authored
      When used within a threading environment, the race condition during the
      creation of the singleton used in ReduceFilename causes aborts in the
      constructor. This is awkward for us because it means that it is very easy
      for us to end up with a crash if two tracebacks try to happen at the same
      time. Fortunately, putting a lock around that code should make it safe
      enough to use, I think.
      249604da
  23. 25 Jun, 2018 1 commit
    • Charles Ferguson's avatar
      Update extract_* to return a namedtuple to support python 3. · 7ce203b0
      Charles Ferguson authored
      When used within Python 3, the extract_* functions are actually returning
      an object containing the elements, which returns as a tuple. In order
      to support both the Python 2 and Python 3 usages, we use a namedtuple
      to allow the interface to work whether indexed or by name.
      
      The 'locals' parameter is currently ignored and always returns None.
      7ce203b0