FePy has some optional parts you can choose to use or not. These options are provided by fepy package.
For example, you may want to use cipher option, which re-implements parts of Python Cryptoraphy Toolkit written in C using subclasses of SymmetricAlgorithm in .NET Framework. On the other hand, it will only lengthen the already long startup time if you don't need it.
There are two ways to use FePy options. One enables them at the startup time using site.py. The other enables them in the middle of execution, as in the interactive console.
IPCE already includes following two lines in site.py, and that's all you need:
import fepy fepy.install()
This reads the environment variable FEPY_OPTIONS. It is a comma separated list of option names. And then named options are enabled.
If the environment variable is not set, nothing happens and fepy.install() returns immediately.
Let's have a look at the example:
$ ipy IronPython 1.1a1 (1.1) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import socket >>> socket._fileobject Traceback (most recent call last): AttributeError: 'module' object has no attribute '_fileobject'
IronPython 1.1a1 does not have an undocumented _fileobject class in socket module. Sadly, urllib2 module is using it anyway. FePy provides fileobject option for this, but how does one enable it in the middle of execution?
Of course, you can quit, set the environment variable, and start again, but you may not want to trash the interactive session if possible. So here's how:
>>> import fepy >>> fepy.install_option('fileobject') >>> socket._fileobject <class '_fileobject._fileobject'>
Here's how to do this at the startup time:
$ export FEPY_OPTIONS=fileobject $ ipy IronPython 1.1a1 (1.1) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import socket >>> socket._fileobject <class '_fileobject._fileobject'>