Personal tools
Skip to content. | Skip to navigation
Buildout is a project designed to solve 2 problems: 1. Application-centric assembly and deployment Assembly runs the gamut from stitching together libraries to create a running program, to production deployment configuration of applications, and associated systems and tools (e.g. run-control scripts, cron jobs, logs, service registration, etc.). Buildout might be confused with build tools like make or ant, but it is a little higher level and might invoke systems like make or ant to get it's work done. Buildout might be confused with systems like puppet or chef, but it is more application focused. Systems like puppet or chef might use buildout to get their work done. Buildout is also somewhat Python-centric, even though it can be used to assemble and deploy non-python applications. It has some special features for assembling Python programs. It's scripted with Python, unlike, say puppet or chef, which are scripted with Ruby. 2. Repeatable assembly of programs from Python software distributions Buildout puts great effort toward making program assembly a highly repeatable process, whether in a very open-ended development mode, where dependency versions aren't locked down, or in a deployment environment where dependency versions are fully specified. You should be able to check buildout into a VCS and later check it out. Two checkouts built at the same time in the same environment should always give the same result, regardless of their history. Among other things, after a buildout, all dependencies should be at the most recent version consistent with any version specifications expressed in the buildout. Buildout supports applications consisting of multiple programs, with different programs in an application free to use different versions of Python distributions. This is in contrast with a Python installation (real or virtual), where, for any given distribution, there can only be one installed. To learn more about buildout, including how to use it, see http://buildout.org/.
BTree-based persistent dict-like objects (regular dict and ordered) that can be used as base classes. This is a bit of a heavyweight solution, as every zc.dict.Dict (and zc.dict.OrderedDict) is at least 3 persistent objects. Keep this in mind if you intend to create lots and lots of these. To build, run ``python bootstrap/bootstrap.py`` and then ``bin/buildout`` from this directory. A clean, non-system Python is strongly recommended. An efficient, persistent and subclassable dict PersistentDict is very inefficient if it contains more than a couple of values, and BTrees are not recommended to inherit from. This class is a simple wrapper over a BTree. It retains the efficiency of BTrees and is safe to use as a base class. Also, it implements the full Python dict interface.
The zc.lockfile package provides a basic portable implementation of interprocess locks using lock files. The purpose if not specifically to lock files, but to simply provide locks with an implementation based on file-locking primitives. Of course, these locks could be used to mediate access to other files. For example, the ZODB file storage implementation uses file locks to mediate access to file-storage database files. The database files and lock file files are separate files.
zc.mappingobject provides a wrapper for a mapping objects that provides both attribute and item access. >>> import zc.mappingobject >>> mapping = dict(a=1) >>> ob = zc.mappingobject.mappingobject(mapping) >>> ob.a 1 >>> ob.a = 2 >>> ob.a 2 >>> mapping {'a': 2} >>> list(ob) ['a'] >>> len(ob) 1 >>> ob['a'] = 3 >>> ob.a 3 >>> mapping {'a': 3} >>> del ob.a >>> mapping {} >>> ob.a Traceback (most recent call last): ... AttributeError: a >>> ob.b = 1 >>> mapping {'b': 1} >>> del ob['b'] >>> mapping
The monitor server is a server that provides a command-line interface to request various bits of information. The server is zc.ngi based, so we can use the zc.ngi testing infrastructure to demonstrate it.
The Network Gateway Interface provides: * the ability to test application networking code without use of sockets, threads or subprocesses * clean separation of application code and low-level networking code * a fairly simple inheritence free set of networking APIs * an event-based framework that makes it easy to handle many simultaneous connections while still supporting an imperative programming style.
Parse network addresses of the form: HOST:PORT >>> import zc.parse_addr >>> zc.parse_addr.parse_addr('1.2.3.4:56') ('1.2.3.4', 56) It would be great if this little utility function was part of the socket module.
Persistent queues are simply queues that are optimized for persistency via the ZODB. They assume that the ZODB is using MVCC to avoid read conflicts. They attempt to resolve write conflicts so that transactions that add and remove objects simultaneously are merged, unless the transactions are trying to remove the same value from the queue. An important characteristic of these queues is that they do not expect to hold more than one reference to any given equivalent item at a time. For instance, some of the conflict resolution features will not perform desirably if it is reasonable for your application to hold two copies of the string "hello" within the same queue at once [1]. The module provides two flavors: a simple persistent queue that keeps all contained objects in one persistent object (Queue), and a persistent queue that divides up its contents into multiple composite elements (CompositeQueue). They should be equivalent in terms of API and so are mostly examined in the abstract in this document: we'll generate instances with a representative Queue factory, that could be either class. They only differ in an aspect of their write conflict resolution behavior.
Buildout Egg-Installation Recipe The egg-installation recipe installs eggs into a buildout eggs directory. It also generates scripts in a buildout bin directory with egg paths baked into them.
ZC Buildout recipe for creating test runners