Popular recipes by Russell http://code.activestate.com/recipes/users/4173357/2011-08-23T13:41:49-07:00ActiveState Code RecipesUpdate Google Chrome localstorage file for version compatibility (Python) 2011-08-23T13:41:49-07:00Russellhttp://code.activestate.com/recipes/users/4173357/http://code.activestate.com/recipes/577855-update-google-chrome-localstorage-file-for-version/ <p style="color: grey"> Python recipe 577855 by <a href="/recipes/users/4173357/">Russell</a> (<a href="/recipes/tags/chrome/">chrome</a>, <a href="/recipes/tags/chromium/">chromium</a>, <a href="/recipes/tags/localstorage/">localstorage</a>). </p> <p>Google chrome changes the way key/value stores in localstorage file during upgrading from 11 to 15. This breaks data of many websites and extensions which depends on localstorage. This script upgrade the old localstorage data to make them work again.</p> Super lazy load object (Python) 2010-03-16T05:02:12-07:00Russellhttp://code.activestate.com/recipes/users/4173357/http://code.activestate.com/recipes/577117-super-lazy-load-object/ <p style="color: grey"> Python recipe 577117 by <a href="/recipes/users/4173357/">Russell</a> (<a href="/recipes/tags/lazy/">lazy</a>). </p> <p>A really light implementation of lazy load technique, yet powerful and conveniet. </p> <p>Simply call this:</p> <pre class="prettyprint"><code>var1 = superlazy('key', default_value) </code></pre> <p>Your var1 will be loaded in load_setting(key) when accessed first time.</p> <p>That's it. No subclassing is needed, no declaration is needed. Value type is auto detected and handled gracefully. str, int, list, dict can all be lazily loaded from anywhere you want now.</p>