Popular recipes tagged "meta:license=lgpl" but not "manipulation"http://code.activestate.com/recipes/tags/meta:license=lgpl-manipulation/2015-01-09T10:14:15-08:00ActiveState Code RecipesSystemMutex (Python)
2015-01-09T10:14:15-08:00Fabio Zadroznyhttp://code.activestate.com/recipes/users/4180406/http://code.activestate.com/recipes/578998-systemmutex/
<p style="color: grey">
Python
recipe 578998
by <a href="/recipes/users/4180406/">Fabio Zadrozny</a>
(<a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/filelock/">filelock</a>, <a href="/recipes/tags/lock/">lock</a>, <a href="/recipes/tags/mutex/">mutex</a>).
</p>
<p>This module provides a way to create a mutex which is valid for the system (i.e.: it can be seen by multiple processes).</p>
<p>Note that the mutex is kept until release_mutex() is called or when it's garbage-collected.</p>
python string concatenation (Python)
2012-11-18T21:49:51-08:00akhil jaggarwalhttp://code.activestate.com/recipes/users/4184305/http://code.activestate.com/recipes/578333-python-string-concatenation/
<p style="color: grey">
Python
recipe 578333
by <a href="/recipes/users/4184305/">akhil jaggarwal</a>
(<a href="/recipes/tags/efficient/">efficient</a>, <a href="/recipes/tags/strings/">strings</a>).
</p>
<p>tests efficiency of string concatenation operations in python</p>
xml to python dictionary and back (Python)
2012-10-24T00:44:30-07:00kris kvilekvalhttp://code.activestate.com/recipes/users/4178118/http://code.activestate.com/recipes/577722-xml-to-python-dictionary-and-back/
<p style="color: grey">
Python
recipe 577722
by <a href="/recipes/users/4178118/">kris kvilekval</a>
(<a href="/recipes/tags/dictionary/">dictionary</a>, <a href="/recipes/tags/mapping/">mapping</a>, <a href="/recipes/tags/xml/">xml</a>).
Revision 2.
</p>
<p>Simple mapping of XML to python dictionary based on Perl XML::Simple</p>
Universal eval to string function (Python)
2011-02-24T10:17:32-08:00Jakub Jankiewiczhttp://code.activestate.com/recipes/users/4028109/http://code.activestate.com/recipes/577585-universal-eval-to-string-function/
<p style="color: grey">
Python
recipe 577585
by <a href="/recipes/users/4028109/">Jakub Jankiewicz</a>
(<a href="/recipes/tags/evaluation/">evaluation</a>, <a href="/recipes/tags/exec/">exec</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/python_scripts/">python_scripts</a>).
</p>
<p>This is a function that evaluate all expressions and statements and return the result as a string. It also return Exceptions as strings. It is used in <a href="http://trypython.jcubic.pl">trypython.jcubic.pl</a></p>
ObjectListView GetColumnClicked(event) # handler (Python)
2011-01-14T04:41:35-08:00Dev Playerhttp://code.activestate.com/recipes/users/4170638/http://code.activestate.com/recipes/577543-objectlistview-getcolumnclickedevent-handler/
<p style="color: grey">
Python
recipe 577543
by <a href="/recipes/users/4170638/">Dev Player</a>
(<a href="/recipes/tags/listctrl/">listctrl</a>, <a href="/recipes/tags/objectlistview/">objectlistview</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/wxpython/">wxpython</a>).
</p>
<p>ObjectListView is a 3rd party wxPython 2.8+ module that adds a more object-friendly API to the wx.ListCtrl(). When clicking on an item in the list it's easy to process mouse click events or item selection events. However some OS platforms do not set all the event's attributes. Also the various HitTest() methods currently on various platforms are not implemented the same. So here is a little recipe to get the column number (first column equals zero) when left clicking and item in the ObjectListView with the mouse.</p>
Auto-Initialisation with default attribute values (Python)
2010-07-20T15:04:52-07:00Luke Dickenshttp://code.activestate.com/recipes/users/4171344/http://code.activestate.com/recipes/577322-auto-initialisation-with-default-attribute-values/
<p style="color: grey">
Python
recipe 577322
by <a href="/recipes/users/4171344/">Luke Dickens</a>
.
Revision 3.
</p>
<p>This is a class adapted from one that performs a similar task in the PyML libraries by Asa Ben-Hur et al (see: <a href="http://pyml.sourceforge.net/%29." rel="nofollow">http://pyml.sourceforge.net/).</a></p>
<p>The intention is to speed up development time, by allowing managed attribute names (and their default values) to be specified in a dictionary belonging to each class (here called classinitials). This avoids rewriting the standard initialisation procedure many times over. </p>
<p>Subclasses inherit all superclasses' managed attributes, including the defaults unless overridden. This is found in the property initials. The copy constructor copies all managed attributes.</p>
<p>Finally, any named argument to the __init__ function, whose name appears in the managed attributes dictionary, overrides the class default.</p>
<p>I welcome any comments, criticism or suggested improvements.</p>
Userfriendly Webpage Template (Python)
2010-05-04T07:38:03-07:00david.gaarenstroomhttp://code.activestate.com/recipes/users/4168848/http://code.activestate.com/recipes/577203-userfriendly-webpage-template/
<p style="color: grey">
Python
recipe 577203
by <a href="/recipes/users/4168848/">david.gaarenstroom</a>
(<a href="/recipes/tags/cgi/">cgi</a>, <a href="/recipes/tags/html/">html</a>, <a href="/recipes/tags/httpserver/">httpserver</a>, <a href="/recipes/tags/mvc/">mvc</a>, <a href="/recipes/tags/template/">template</a>, <a href="/recipes/tags/web/">web</a>, <a href="/recipes/tags/webdesign/">webdesign</a>, <a href="/recipes/tags/webpagetemplate/">webpagetemplate</a>).
Revision 5.
</p>
<p>User friendly template class targeted towards Web-page usage and optimized for speed and efficiency.</p>
<p>Tags can be inserted in a template HTML file in a non-intrusive way, by using specially formatted comment strings. Therefore, the template-file can be viewed in a browser, even with prototype data embedded in it, which will later be replaced by dynamic content.
Also, webdesigners can continue to work on the template and upload it without further
modification.</p>