This module is the foundation of Smisk and is implemented in machine native code.
See Smisk C library for documentation of the C interface.
Platforms: Linux, Mac, Unix
| Requires: | libfcgi |
|---|
Build identifier in URN form, distinguishing each unique build.
Format changed in version 1.1: in version 1.0 this was an abritrary (per-build unique) string. In 1.1 this is now a uniform URN.
Current Application (None if no application has been created).
This is actually a smisk.util.objectproxy.ObjectProxy, inducing a slight performance hit, since accessing the actual application causes intermediate calls. Application.current is the most performance-effective way to access the current application. However, in most cases the performance hit induced by the ObjectProxy is so small, the increased readability and usage of app is preferred.
Example:
>>> import smisk
>>> smisk.app
None
>>> import smisk.core
>>> smisk.core.Application()
<smisk.core.Application object at 0x6a5c0>
>>> smisk.app
<smisk.core.Application object at 0x6a5c0>
| See: | Application.current |
|---|
New in version 1.1.
Current Request (None if no application is running).
This is actually a smisk.util.objectproxy.ObjectProxy, inducing a slight performance hit, since accessing the actual application causes intermediate calls. Application.current.request is the most performance-effective way to access the current request. However, in most cases the performance hit induced by the ObjectProxy is so small, the increased readability of request is preferred.
| See: | Application.request |
|---|
New in version 1.1.
Current Response (None if no application is running).
This is actually a smisk.util.objectproxy.ObjectProxy, inducing a slight performance hit, since accessing the actual application causes intermediate calls. Application.current.response is the most performance-effective way to access the current response. However, in most cases the performance hit induced by the ObjectProxy is so small, the increased readability of response is preferred.
| See: | Application.response |
|---|
New in version 1.1.
Bind to a specific unix socket or host (and/or port).
| Parameters: |
|
|---|---|
| Raises: | smisk.IOError If already bound. |
| Raises: | IOError If socket creation fails. |
| See: |
Unbind from a previous call to bind().
If not bound, calling this function has no effect. You can test wherethere or not the current process is bound by calling listening().
| Raises: | IOError on failure. |
|---|
New in version 1.1.
Find out if this process is a “remote” process, bound to a socket by means of calling bind(). If it is listening, this function returns the address and port or the UNIX socket path.
See also: unbind()
| Raises: | smisk.IOError On failure. |
|---|---|
| Returns: | Bound path/address or None if not bound. |
Generate a universally Unique Identifier.
See documentation of pack() for an overview of :func:nbits.
The UID is calculated like this:
sha1 ( time.secs, time.usecs, pid, random[, node] )
| Note: | This is not a UUID (ISO/IEC 11578:1996) implementation. However it uses an algorithm very similar to UUID v5 (RFC 4122). Most notably, the format of the output is more compact than that of UUID v5. |
|---|---|
| Parameters: |
|
New in version 1.1.
Pack arbitrary bytes into a printable ASCII string.
Overview of nbits:
| Parameters: |
|
|---|---|
| See: |
New in version 1.1.
Calculate a hash from any python object.
New in version 1.1.