Popular recipes tagged "writing"http://code.activestate.com/recipes/tags/writing/popular/2010-03-25T01:10:14-07:00ActiveState Code RecipesAvailable disk space monitoring for concurrent writes (Python) 2010-03-25T01:10:14-07:00Mateyuzohttp://code.activestate.com/recipes/users/4172453/http://code.activestate.com/recipes/577140-available-disk-space-monitoring-for-concurrent-wri/ <p style="color: grey"> Python recipe 577140 by <a href="/recipes/users/4172453/">Mateyuzo</a> (<a href="/recipes/tags/files/">files</a>, <a href="/recipes/tags/multiprocessing/">multiprocessing</a>, <a href="/recipes/tags/stat/">stat</a>, <a href="/recipes/tags/writing/">writing</a>). Revision 5. </p> <p>A DiskSpaceProctor is registered with a SyncManager to be shared by forked processes and threads. This object will check the available free space and add up filesz of concurrent writes. If there is not enough space for the requesting write, an exception is raised.</p> CMS page range validator. (Python) 2009-08-21T11:14:13-07:00Joseph Reaglehttp://code.activestate.com/recipes/users/4171494/http://code.activestate.com/recipes/576889-cms-page-range-validator/ <p style="color: grey"> Python recipe 576889 by <a href="/recipes/users/4171494/">Joseph Reagle</a> (<a href="/recipes/tags/formatting/">formatting</a>, <a href="/recipes/tags/page_ranges/">page_ranges</a>, <a href="/recipes/tags/writing/">writing</a>). </p> <p>Specification and validator for Chicago Manual of Style page ranges.</p> Arbitrary order attribute writing with ElementTree (Python) 2008-08-01T19:24:34-07:00Orri Ganelhttp://code.activestate.com/recipes/users/2259404/http://code.activestate.com/recipes/576403-arbitrary-order-attribute-writing-with-elementtree/ <p style="color: grey"> Python recipe 576403 by <a href="/recipes/users/2259404/">Orri Ganel</a> (<a href="/recipes/tags/attribute/">attribute</a>, <a href="/recipes/tags/element/">element</a>, <a href="/recipes/tags/elementtree/">elementtree</a>, <a href="/recipes/tags/element_tree/">element_tree</a>, <a href="/recipes/tags/etree/">etree</a>, <a href="/recipes/tags/order/">order</a>, <a href="/recipes/tags/sort/">sort</a>, <a href="/recipes/tags/write/">write</a>, <a href="/recipes/tags/writing/">writing</a>, <a href="/recipes/tags/xml/">xml</a>). Revision 5. </p> <p>Modified version of ElementTree with two additional parameters to the write() method: "sortflag" and "sortcmp". "sortflag" defaults to "default", which results in unmodified behavior. "sortcmp" defaults to None, which results in unmodified behavior. See discussion for usage and justification. Changes made begin on line 655.</p> <p>EDIT: in most cases, unless sortflag happened to be intended for the root, it would be ignored; added sortflag and sortcmp to self._write() call on line 724. Expect another revision in the near future to allow for specifying different orders for different xml tags.</p> <p>EDIT, the second: Added tag-specific ordering.</p>