Popular recipes tagged "meta:requires=exceptions" but not "programs" and "observer"http://code.activestate.com/recipes/tags/meta:requires=exceptions-programs-observer/2014-02-21T09:17:23-08:00ActiveState Code RecipesAutomated management of CLI devices (Python)
2009-05-27T01:24:12-07:00Alan Holthttp://code.activestate.com/recipes/users/4170480/http://code.activestate.com/recipes/576778-automated-management-of-cli-devices/
<p style="color: grey">
Python
recipe 576778
by <a href="/recipes/users/4170480/">Alan Holt</a>
(<a href="/recipes/tags/cli/">cli</a>, <a href="/recipes/tags/management/">management</a>, <a href="/recipes/tags/ssh/">ssh</a>, <a href="/recipes/tags/telnet/">telnet</a>, <a href="/recipes/tags/tunnel/">tunnel</a>).
</p>
<p>This recipe provides a mechanism for remote, automated control of a network device via its command-line interface (CLI). It assumes that the CLI is accessed using Telnet. Furthermore, the device cannot be accessed directly, instead the user has to SSH to an intermediate jump host before Telneting to the device. </p>
Dump PostgreSQL db schema to text (Python)
2014-02-21T09:17:23-08:00Michal Niklashttp://code.activestate.com/recipes/users/186902/http://code.activestate.com/recipes/576557-dump-postgresql-db-schema-to-text/
<p style="color: grey">
Python
recipe 576557
by <a href="/recipes/users/186902/">Michal Niklas</a>
(<a href="/recipes/tags/database/">database</a>, <a href="/recipes/tags/postgres/">postgres</a>, <a href="/recipes/tags/postgresql/">postgresql</a>, <a href="/recipes/tags/schema/">schema</a>).
Revision 7.
</p>
<p>With PostgreSQL there is:</p>
<pre class="prettyprint"><code>pg_dump --schema_only
</code></pre>
<p>but I wanted to compare my PostgreSQL and Oracle database schema dumped by:
<a href="http://code.activestate.com/recipes/576534/">http://code.activestate.com/recipes/576534/</a></p>
Global Signal Dispatching (Python)
2001-12-11T19:30:28-08:00Patrick O'Brienhttp://code.activestate.com/recipes/users/137858/http://code.activestate.com/recipes/87056-global-signal-dispatching/
<p style="color: grey">
Python
recipe 87056
by <a href="/recipes/users/137858/">Patrick O'Brien</a>
.
Revision 4.
</p>
<p>This module, dispatcher.py, provides global signal dispatching services suitable for a wide variety of purposes, similar to Model-View-Controller or Model-View-Presenter patterns. This particular implementation allows a looser coupling than most Observer patterns. It also does transparent cleanup through the use of weak references and weak reference callbacks. This version defaults to using weak references, but provides an option to not use weak references for those cases where weak references are problematic (lambdas and such).</p>
A Dictionary-based two-dimensional ragged array. (Python)
2001-10-03T04:40:03-07:00Peter Olsenhttp://code.activestate.com/recipes/users/132220/http://code.activestate.com/recipes/68430-a-dictionary-based-two-dimensional-ragged-array/
<p style="color: grey">
Python
recipe 68430
by <a href="/recipes/users/132220/">Peter Olsen</a>
.
Revision 2.
</p>
<p>This class implements a two-dimensional ragged array using nested dictionaries.</p>
<p>As written this class requires Python 2.2 or later. This meets my requirements, but it may not
meet yours.</p>
<p>Klaus Alexander Seistrup has described a way to get around this restriction by substituting
"UserDict.UserDict" for "dictionary" as the base class. I believe this solves the problem
for Python versions at least as far back as 1.5.2. This approach will require some editing of
the insertion and retrieval functions to make it work.</p>
<p>Thanks Klaus!</p>
Latitude/longitude/map web-fetcher (Python)
2001-08-20T18:11:28-07:00Will Warehttp://code.activestate.com/recipes/users/98156/http://code.activestate.com/recipes/52548-latitudelongitudemap-web-fetcher/
<p style="color: grey">
Python
recipe 52548
by <a href="/recipes/users/98156/">Will Ware</a>
(<a href="/recipes/tags/web/">web</a>).
Revision 2.
</p>
<p>Given a list of cities, this recipe fetches their latitudes and longitudes from
one website (a database used for astrology, of all things) and uses them to
build a URL for another website which creates a map highlighting the cities
against the outlines of continents. Maybe some day it will be clever enough to
load the latitudes and longitudes as waypoints into your GPS receiver.</p>