Naked Framework v0.1.27 Released

A new Naked release was pushed to PyPI and GitHub.  It includes extensive updates to the XDict dictionary extension & several updates to the NakedObject class.  These are classes in the Naked.toolshed.types and Naked.toolshed.c.types library modules.

XDict documentation is now available

NakedObject documentation was released last week and is current with the changes that were included in this release.

Toolshed Shell Module Updates and Documentation in the Works

I am running tests on current toolshed.shell functions and updating the module with several new functions. These functions will allow you to run shell commands (including dedicated functions for Ruby and Node.js scripts) and choose to either have the standard output stream from the executable returned to your Python script or displayed in the terminal. Standard error stream and exit status code handling will be included with options to suppress the display of the standard output in the terminal as well as the system exit call if you’d like to handle this on your end.

I am working on the documentation for this module as I finish the testing. I will publish it with the next release which will include these new shell features (and the shell Environment class which I am not changing for this release).

How to Determine the Python Interpreter Version with the Naked StateObject

To determine the version of the Python interpreter that is being used with your script, create an instance of the Naked StateObject:

from Naked.toolshed.state import StateObject
state = StateObject()

and then test for the version with StateObject attributes:

Test for Python 2 vs. Python 3

if state.py2:
    # Python 2 code
else:
    # Python 3 code

Test Full Python Versions

if state.py_major == 2 and state.py_minor == 7 and state.py_patch == 6:
    # Python 2.7.6 interpreter
elif state.py_major == 3 and state.py_minor == 3 and state.py_patch == 3:
    # Python 3.3.3 interpreter