Popular recipes tagged "automate"http://code.activestate.com/recipes/tags/automate/2011-02-19T17:50:42-08:00ActiveState Code RecipesConnect PyGTK object events to class methods automatically (Python) 2011-02-19T17:50:42-08:00Pavel Krchttp://code.activestate.com/recipes/users/4177047/http://code.activestate.com/recipes/577577-connect-pygtk-object-events-to-class-methods-autom/ <p style="color: grey"> Python recipe 577577 by <a href="/recipes/users/4177047/">Pavel Krc</a> (<a href="/recipes/tags/automate/">automate</a>, <a href="/recipes/tags/connect/">connect</a>, <a href="/recipes/tags/decorator/">decorator</a>, <a href="/recipes/tags/event/">event</a>, <a href="/recipes/tags/pygtk/">pygtk</a>). Revision 2. </p> <p>A module that allows you to not to repeat yourself (DRY) while writing typical PyGTK constructions (an object containing PyGTK widgets with its methods servicing widget events) by calling connect() automatically. See docstring.</p> Robot Pager (Search engines and others) (Python) 2010-10-10T19:33:20-07:00Carlos del Ojohttp://code.activestate.com/recipes/users/4173977/http://code.activestate.com/recipes/577420-robot-pager-search-engines-and-others/ <p style="color: grey"> Python recipe 577420 by <a href="/recipes/users/4173977/">Carlos del Ojo</a> (<a href="/recipes/tags/automate/">automate</a>, <a href="/recipes/tags/engine/">engine</a>, <a href="/recipes/tags/paging/">paging</a>, <a href="/recipes/tags/robot/">robot</a>, <a href="/recipes/tags/search/">search</a>, <a href="/recipes/tags/websites/">websites</a>). Revision 3. </p> <p>This is a class to make easy the development of robots, to parse results over a website with a paging. For example Google, Yahoo, Bing, or any other page with paging system.</p> <p>PagerEngine is the main class. I've developed three more clases implementing GoogleSearch, YahooSearch and BingSearch as examples.</p> <p>Inheriting from PagerEngine (and having RexExp knowledge) you can easily develop other robots for other websites.</p> Purge Mysql binary logs (Python) 2010-01-12T15:14:10-08:00Umang Gopanihttp://code.activestate.com/recipes/users/4172787/http://code.activestate.com/recipes/577004-purge-mysql-binary-logs/ <p style="color: grey"> Python recipe 577004 by <a href="/recipes/users/4172787/">Umang Gopani</a> (<a href="/recipes/tags/automate/">automate</a>, <a href="/recipes/tags/binary_logs/">binary_logs</a>, <a href="/recipes/tags/master_slave/">master_slave</a>, <a href="/recipes/tags/mysql/">mysql</a>, <a href="/recipes/tags/purge/">purge</a>). Revision 8. </p> <p>Being a MySQL DBA , one faces a common issue in replication environment -> Disk space issue on master, since the number of binary logs have increased. Now, one of the solution to this would be using expire_logs_days parameter in your mysql config file. But what if, the slave is lagging by few hours or if the slave is broken since few days and the binary logs are removed due to the parameter set. Whenever the salve comes up, it will go bonkers, knowing that the binary log where it last stopped no more exists.</p> <p>I faced this issue a couple of time until I decided to automate it using a script. Herewith I am attaching a python script which can run regularly in cron.</p> BlueMon (Python) 2009-01-25T13:51:58-08:00nigel spinneyhttp://code.activestate.com/recipes/users/4113342/http://code.activestate.com/recipes/576627-bluemon/ <p style="color: grey"> Python recipe 576627 by <a href="/recipes/users/4113342/">nigel spinney</a> (<a href="/recipes/tags/automate/">automate</a>, <a href="/recipes/tags/bluetooth/">bluetooth</a>, <a href="/recipes/tags/parallel_port/">parallel_port</a>, <a href="/recipes/tags/speech/">speech</a>, <a href="/recipes/tags/ubuntu/">ubuntu</a>). </p> <p>Scans for discoverable bluetooth devices every 35 seconds, and announces (with espeak in Ubuntu) and logs, devices which come into or out of range. Idea for automated processes like turning on exterior lighting and heating by the parallel port</p>