assorted-commits Mailing List for Assorted projects (Page 13)
Brought to you by:
yangzhang
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(9) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(86) |
Feb
(265) |
Mar
(96) |
Apr
(47) |
May
(136) |
Jun
(28) |
Jul
(57) |
Aug
(42) |
Sep
(20) |
Oct
(67) |
Nov
(37) |
Dec
(34) |
2009 |
Jan
(39) |
Feb
(85) |
Mar
(96) |
Apr
(24) |
May
(82) |
Jun
(13) |
Jul
(10) |
Aug
(8) |
Sep
(2) |
Oct
(20) |
Nov
(31) |
Dec
(17) |
2010 |
Jan
(16) |
Feb
(11) |
Mar
(17) |
Apr
(53) |
May
(31) |
Jun
(13) |
Jul
(3) |
Aug
(6) |
Sep
(11) |
Oct
(4) |
Nov
(17) |
Dec
(17) |
2011 |
Jan
(3) |
Feb
(19) |
Mar
(5) |
Apr
(17) |
May
(3) |
Jun
(4) |
Jul
(14) |
Aug
(3) |
Sep
(2) |
Oct
(1) |
Nov
(3) |
Dec
(2) |
2012 |
Jan
(3) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
(4) |
Aug
(5) |
Sep
(2) |
Oct
(3) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(9) |
Apr
(5) |
May
|
Jun
(2) |
Jul
(1) |
Aug
(10) |
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
2014 |
Jan
(1) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <yan...@us...> - 2010-04-01 18:29:23
|
Revision: 1602 http://assorted.svn.sourceforge.net/assorted/?rev=1602&view=rev Author: yangzhang Date: 2010-04-01 18:29:16 +0000 (Thu, 01 Apr 2010) Log Message: ----------- adjusted the scala doc search google analytics code Modified Paths: -------------- scala-doc-search/trunk/src/index.php Modified: scala-doc-search/trunk/src/index.php =================================================================== --- scala-doc-search/trunk/src/index.php 2010-04-01 18:28:44 UTC (rev 1601) +++ scala-doc-search/trunk/src/index.php 2010-04-01 18:29:16 UTC (rev 1602) @@ -70,7 +70,7 @@ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> -_uacct = "UA-1561381-3"; +_uacct = "UA-1561381-1"; urchinTracker(); </script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:28:52
|
Revision: 1601 http://assorted.svn.sourceforge.net/assorted/?rev=1601&view=rev Author: yangzhang Date: 2010-04-01 18:28:44 +0000 (Thu, 01 Apr 2010) Log Message: ----------- remove some projects Modified Paths: -------------- assorted-site/trunk/index.txt Modified: assorted-site/trunk/index.txt =================================================================== --- assorted-site/trunk/index.txt 2010-04-01 18:24:03 UTC (rev 1600) +++ assorted-site/trunk/index.txt 2010-04-01 18:28:44 UTC (rev 1601) @@ -25,14 +25,14 @@ asynchronous programming framework (passive) - MIT Tools: scripts for working in MIT infrastructure (Athena, SIPB, etc.) - UI libraries - - Scala TUI: a declarative reactive programming toolkit for constructing - [ncurses]-based text user interfaces (hiatus) + <!-- - Scala TUI: a declarative reactive programming toolkit for constructing + [ncurses]-based text user interfaces (hiatus) --> - JFX Table: an editable table (spreadsheet) widget in [JavaFX] (done) - LZXGrid: an editable table (spreadsheet) widget in [OpenLaszlo] (done) - System utilities - - GDB Visual Stack Debugger: a [Python-GDB] extension that + <!-- - GDB Visual Stack Debugger: a [Python-GDB] extension that helps visualize the stack; originally designed to aid instruction on stack - smashing (hiatus) + smashing (hiatus)--> - [UDP Prober](udp-prober): small program that logs the RTTs of periodic UDP pings, and an exercise in using [`boost::asio`] (hiatus) - Throttled Repeater: small program that sends a fixed number of lines at a @@ -58,8 +58,8 @@ - [Google Tools](google-tools): Google Reader archiver (hiatus) - Myspace: crawl [MySpace] profiles within $n$ degrees of you for fast searches (done) - - O'Reilly Safari: cache text from the [O'Reilly Safari] online bookshelf for - offline reading (abandoned) + <!-- - O'Reilly Safari: cache text from the [O'Reilly Safari] online bookshelf for + offline reading (abandoned) --> - YouTube: caches [YouTube] videos from your favorites, playlists, and subscriptions (done) - MovieLookup: given an [HBO](http://hbo.com/) schedule, look up movie @@ -72,6 +72,8 @@ to allow you to use any custom command-line text filter on your WordPress posts (done) - Configuration resources and desktop tools + <!-- - [Simple Full-Text-Search](simple-fts): indexer and keyword search built on + BerkeleyDB (active) --> - [Vim syntax file for JavaFX](http://www.vim.org/scripts/script.php?script_id=1943) (done) - [Software Configurations](configs): dot files, rc files, bootstrapping, @@ -152,6 +154,8 @@ [Picard Tagger]: http://wiki.musicbrainz.org/PicardTagger [H-Store]: http://db.cs.yale.edu/hstore/ +<!--[Python-GDB]: http://sourceware.org/gdb/wiki/PythonGdb--> + What the statuses mean: - done: no more active development planned, but will generally maintain/fix @@ -181,6 +185,8 @@ [Yang Zhang]: http://www.mit.edu/~y_z/ +<a href="http://sourceforge.net/projects/assorted"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=172932&type=10" width="80" height="15" alt="Get Assorted mini-projects at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> + <!-- vim:nocin:et:ft=mkd:sw=2:ts=2 --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:24:12
|
Revision: 1600 http://assorted.svn.sourceforge.net/assorted/?rev=1600&view=rev Author: yangzhang Date: 2010-04-01 18:24:03 +0000 (Thu, 01 Apr 2010) Log Message: ----------- use async google analytics Modified Paths: -------------- assorted-site/trunk/footer.html assorted-site/trunk/header.html Modified: assorted-site/trunk/footer.html =================================================================== --- assorted-site/trunk/footer.html 2010-04-01 18:22:11 UTC (rev 1599) +++ assorted-site/trunk/footer.html 2010-04-01 18:24:03 UTC (rev 1600) @@ -1,13 +1,3 @@ -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - var pageTracker = _gat._getTracker("UA-1322384-1"); - pageTracker._initData(); - pageTracker._trackPageview(); -</script> - <script src="http://pmetrics.performancing.com/100.js" type="text/javascript"></script> <noscript><p><img alt="Performancing Metrics" src="http://pmetrics.performancing.com/100ns.gif" /></p></noscript> Modified: assorted-site/trunk/header.html =================================================================== --- assorted-site/trunk/header.html 2010-04-01 18:22:11 UTC (rev 1599) +++ assorted-site/trunk/header.html 2010-04-01 18:24:03 UTC (rev 1600) @@ -1,2 +1,16 @@ <meta name="verify-v1" content="At/TpD7cdWg7Sy1Jf+KuQdreiW/u2pCmcgNnoepdJm0=" /> +<script type="text/javascript"> +var _gaq = _gaq || []; +_gaq.push(['_setAccount', 'UA-1322384-1']); +_gaq.push(['_trackPageview']); + +(function() { +var ga = document.createElement('script'); +ga.src = ('https:' == document.location.protocol ? + 'https://ssl' : 'http://www') + + '.google-analytics.com/ga.js'; + ga.setAttribute('async', 'true'); + document.documentElement.firstChild.appendChild(ga); + })(); +</script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:22:19
|
Revision: 1599 http://assorted.svn.sourceforge.net/assorted/?rev=1599&view=rev Author: yangzhang Date: 2010-04-01 18:22:11 +0000 (Thu, 01 Apr 2010) Log Message: ----------- wrap keys and values as strings Modified Paths: -------------- python-commons/trunk/src/commons/sqlhash.py Modified: python-commons/trunk/src/commons/sqlhash.py =================================================================== --- python-commons/trunk/src/commons/sqlhash.py 2010-04-01 18:21:19 UTC (rev 1598) +++ python-commons/trunk/src/commons/sqlhash.py 2010-04-01 18:22:11 UTC (rev 1599) @@ -122,7 +122,8 @@ def __iter__(self): GET_ITEMS = 'SELECT key, value FROM shelf ORDER BY ROWID' - return iter(self._mapping.conn.cursor().execute(GET_ITEMS)) + return ((str(k), str(v)) for k,v in + iter(self._mapping.conn.cursor().execute(GET_ITEMS))) def open(file=None, *args): if file is not None: @@ -162,8 +163,7 @@ try: del self.cache[key] except KeyError: pass def iteritems(self): - for i,k in enumerate(self.keys()): - yield k, self[k] + return ((k, cPickle.loads(v)) for k,v in self.dict.items()) def sync(self): if self.cache: self.dict.update( (k, cPickle.dumps(v, self._protocol)) for k,v in self.cache.items() ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:21:30
|
Revision: 1598 http://assorted.svn.sourceforge.net/assorted/?rev=1598&view=rev Author: yangzhang Date: 2010-04-01 18:21:19 +0000 (Thu, 01 Apr 2010) Log Message: ----------- forgot to tag the 0.6 release Added Paths: ----------- python-commons/tags/0.6/ python-commons/tags/0.6/README python-commons/tags/0.6/publish.bash python-commons/tags/0.6/setup.py python-commons/tags/0.6/src/commons/__init__.py python-commons/tags/0.6/src/commons/async.py python-commons/tags/0.6/src/commons/control.py python-commons/tags/0.6/src/commons/decs.py python-commons/tags/0.6/src/commons/files.py python-commons/tags/0.6/src/commons/log.py python-commons/tags/0.6/src/commons/misc.py python-commons/tags/0.6/src/commons/path.py python-commons/tags/0.6/src/commons/progress.py python-commons/tags/0.6/src/commons/seqs.py python-commons/tags/0.6/src/commons/servers.py python-commons/tags/0.6/src/commons/sqlhash.py python-commons/tags/0.6/src/commons/startup.py python-commons/tags/0.6/src/commons/structs.py Removed Paths: ------------- python-commons/tags/0.6/README python-commons/tags/0.6/publish.bash python-commons/tags/0.6/setup.py python-commons/tags/0.6/src/commons/__init__.py python-commons/tags/0.6/src/commons/async.py python-commons/tags/0.6/src/commons/control.py python-commons/tags/0.6/src/commons/decs.py python-commons/tags/0.6/src/commons/files.py python-commons/tags/0.6/src/commons/log.py python-commons/tags/0.6/src/commons/misc.py python-commons/tags/0.6/src/commons/progress.py python-commons/tags/0.6/src/commons/seqs.py python-commons/tags/0.6/src/commons/servers.py python-commons/tags/0.6/src/commons/startup.py python-commons/tags/0.6/src/commons/structs.py Property changes on: python-commons/tags/0.6 ___________________________________________________________________ Added: svn:mergeinfo + Deleted: python-commons/tags/0.6/README =================================================================== --- python-commons/trunk/README 2009-03-01 19:45:28 UTC (rev 1240) +++ python-commons/tags/0.6/README 2010-04-01 18:21:19 UTC (rev 1598) @@ -1,77 +0,0 @@ -[documentation](doc) - -Overview --------- - -Python Commons is a general-purpose library for Python. To get a sense of -what it provides, please glance over the [documentation](doc). - -Requirements ------------- - -- [Python](http://python.org/) 2.5 -- [setuptools](http://peak.telecommunity.com/DevCenter/setuptools) 0.6 - -Certain sub-modules have extra requirements: - -- `async` requires [Twisted](http://twistedmatrix.com/trac/) 2.5 -- `files` requires [path](http://www.jorendorff.com/articles/python/path/) 2.2 - -This library has only been tested on Linux. - -Setup ------ - -To install, run `easy_install python-commons`, or download the source tarball -and run `python setup.py install`. - -Related Work ------------- - -- [ASPN Cookbook]: a valuable repository of Python snippets -- [AIMA Utilities]: accompaniment to a popular AI textbook - -[ASPN Cookbook]: http://aspn.activestate.com/ASPN/Cookbook/Python -[AIMA Utilities]: http://aima.cs.berkeley.edu/python/utils.py - -Changes -------- - -version 0.6, 2008-10-?? - -- ??? (review!) -- released for [MIT 6.00 courseware](http://assorted.sf.net/mit600/) - -version 0.5, 2008-05-14 - -- added `cp1252_to_unicode()` -- made `setup()` more flexible -- released for - [gbookmark2delicious](http://gbookmark2delicious.googlecode.com/) - -version 0.4, 2008-05-08 - -- removed extraneous debug print statements -- added `logout()` context manager -- added `seq()`, `default_if_none()` -- fixed missing `import` bug -- released for [Mailing List - Filter](http://assorted.sf.net/mailing-list-filter/) - -version 0.3, 2008-04-30 - -- added versioned guards -- added file memoization -- added retry with exp backoff -- added `countstep()` -- released for - [gbookmark2delicious](http://gbookmark2delicious.googlecode.com/) - -version 0.2, 2008-02-04 - -- added `clients`, `setup` -- released for [icedb](http://cartel.csail.mit.edu/icedb/) - -version 0.1, 2007-03-24 - -- initial release Copied: python-commons/tags/0.6/README (from rev 1451, python-commons/trunk/README) =================================================================== --- python-commons/tags/0.6/README (rev 0) +++ python-commons/tags/0.6/README 2010-04-01 18:21:19 UTC (rev 1598) @@ -0,0 +1,93 @@ +[documentation](doc) + +Overview +-------- + +Python Commons is a general-purpose library for Python. To get a sense of +what it provides, please glance over the [documentation](doc). + +Requirements +------------ + +- [Python](http://python.org/) 2.5 +- [setuptools](http://peak.telecommunity.com/DevCenter/setuptools) 0.6 + +Certain sub-modules have extra requirements: + +- `async` requires [Twisted](http://twistedmatrix.com/trac/) 2.5 +- `files` requires [path](http://www.jorendorff.com/articles/python/path/) 2.2 + +This library has only been tested on Linux. + +Setup +----- + +To install, run `easy_install python-commons`, or download the source tarball +and run `python setup.py install`. + +Related Work +------------ + +- [ASPN Cookbook]: a valuable repository of Python snippets +- [AIMA Utilities]: accompaniment to a popular AI textbook + +[ASPN Cookbook]: http://aspn.activestate.com/ASPN/Cookbook/Python +[AIMA Utilities]: http://aima.cs.berkeley.edu/python/utils.py + +Changes +------- + +version 0.6, 2008-10-?? + +- to strs added unwrap, indent, unindent, remove_empty_lines, underline, + dos2unix, quotejs, unicode2html, html2unicode, nat_lang_join, or_join, + and_join +- to misc added sendmail, days, settimeout, run, TerminalController +- imported and updated jorendorff's path.py +- to startup added command_name +- to files added read_file, write_file, write_or_rm, is_nonempty_file +- added sqlhash and sqlhash backend for shelf +- to structs added dicts2structs, structs2dicts; FreeStruct renamed to + free_struct +- to seqs added span, group_as_subseqs +- decs.pickle_memoized uses protocol 2 +- general tweaks; epydoc fixes +- python 2.6-ready +- released for [Mailing List Filter], [MIT 6.00] courseware + +[Mailing List Filter]: http://assorted.sourceforge.net/mailing-list-filter/ +[MIT 6.00]: http://web.mit.edu/~6.00/ + +version 0.5, 2008-05-14 + +- added `cp1252_to_unicode()` +- made `setup()` more flexible +- released for + [gbookmark2delicious](http://gbookmark2delicious.googlecode.com/) + +version 0.4, 2008-05-08 + +- removed extraneous debug print statements +- added `logout()` context manager +- added `seq()`, `default_if_none()` +- fixed missing `import` bug +- released for [Mailing List + Filter](http://assorted.sf.net/mailing-list-filter/) + +version 0.3, 2008-04-30 + +- added versioned guards +- added file memoization +- added retry with exp backoff +- added `countstep()` +- released for + [gbookmark2delicious](http://gbookmark2delicious.googlecode.com/) + +version 0.2, 2008-02-04 + +- added `clients`, `setup` +- released for [icedb](http://cartel.csail.mit.edu/icedb/) + +version 0.1, 2007-03-24 + +- initial release Deleted: python-commons/tags/0.6/publish.bash =================================================================== --- python-commons/trunk/publish.bash 2009-03-01 19:45:28 UTC (rev 1240) +++ python-commons/tags/0.6/publish.bash 2010-04-01 18:21:19 UTC (rev 1598) @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -post-stage() { - epydoc -o $stagedir/doc src/commons/ -} - -echo 'Remember to keep versions in sync in all three locations:' -echo '__init__.py, README (Changes), setup.bash, and setup.py' - -fullname='Python Commons' -version=0.5 -license=psf -websrcs=( README ) -rels=( pypi: ) -. assorted.bash "$@" Copied: python-commons/tags/0.6/publish.bash (from rev 1451, python-commons/trunk/publish.bash) =================================================================== --- python-commons/tags/0.6/publish.bash (rev 0) +++ python-commons/tags/0.6/publish.bash 2010-04-01 18:21:19 UTC (rev 1598) @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +post-stage() { + epydoc -v -o $stagedir/doc src/commons/ +} + +echo 'Remember to keep versions in sync in all three locations:' +echo '__init__.py, README (Changes), setup.bash, and setup.py' + +fullname='Python Commons' +version=0.6 +license=psf +websrcs=( README ) +rels=( pypi: ) +. assorted.bash "$@" Deleted: python-commons/tags/0.6/setup.py =================================================================== --- python-commons/trunk/setup.py 2009-03-01 19:45:28 UTC (rev 1240) +++ python-commons/tags/0.6/setup.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -1,43 +0,0 @@ -#!/usr/bin/env python -# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- -# vim:ft=python:et:sw=4:ts=4 - -import os,sys -sys.path.insert( 0, os.path.join( os.path.dirname( sys.argv[0] ), 'src' ) ) -from commons import setup - -pkg_info_text = """ -Metadata-Version: 1.1 -Name: python-commons -Version: 0.5 -Author: Yang Zhang -Author-email: yaaang NOSPAM at REMOVECAPS gmail -Home-page: http://assorted.sourceforge.net/python-commons -Summary: Python Commons -License: Python Software Foundation License -Description: General-purpose library of utilities and extensions to the - standard library. -Keywords: Python,common,commons,utility,utilities,library,libraries -Platform: any -Provides: commons -Classifier: Development Status :: 4 - Beta -Classifier: Environment :: No Input/Output (Daemon) -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: Python Software Foundation License -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python -Classifier: Topic :: Communications -Classifier: Topic :: Database -Classifier: Topic :: Internet -Classifier: Topic :: Software Development :: Libraries :: Python Modules -Classifier: Topic :: System -Classifier: Topic :: System :: Filesystems -Classifier: Topic :: System :: Logging -Classifier: Topic :: System :: Networking -Classifier: Topic :: Text Processing -Classifier: Topic :: Utilities -""" - -setup.run_setup( pkg_info_text, - #scripts = ['frontend/py_hotshot.py'], - ) Copied: python-commons/tags/0.6/setup.py (from rev 1451, python-commons/trunk/setup.py) =================================================================== --- python-commons/tags/0.6/setup.py (rev 0) +++ python-commons/tags/0.6/setup.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- +# vim:ft=python:et:sw=4:ts=4 + +import os,sys +sys.path.insert( 0, os.path.join( os.path.dirname( sys.argv[0] ), 'src' ) ) +from commons import setup + +pkg_info_text = """ +Metadata-Version: 1.1 +Name: python-commons +Version: 0.6 +Author: Yang Zhang +Author-email: yaaang NOSPAM at REMOVECAPS gmail +Home-page: http://assorted.sourceforge.net/python-commons +Summary: Python Commons +License: Python Software Foundation License +Description: General-purpose library of utilities and extensions to the + standard library. +Keywords: Python,common,commons,utility,utilities,library,libraries +Platform: any +Provides: commons +Classifier: Development Status :: 4 - Beta +Classifier: Environment :: No Input/Output (Daemon) +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: Python Software Foundation License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Topic :: Communications +Classifier: Topic :: Database +Classifier: Topic :: Internet +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: System +Classifier: Topic :: System :: Filesystems +Classifier: Topic :: System :: Logging +Classifier: Topic :: System :: Networking +Classifier: Topic :: Text Processing +Classifier: Topic :: Utilities +""" + +setup.run_setup( pkg_info_text, + #scripts = ['frontend/py_hotshot.py'], + ) Deleted: python-commons/tags/0.6/src/commons/__init__.py =================================================================== --- python-commons/trunk/src/commons/__init__.py 2009-03-01 19:45:28 UTC (rev 1240) +++ python-commons/tags/0.6/src/commons/__init__.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -1,40 +0,0 @@ -# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- -# vim:ft=python:et:sw=4:ts=4 - -""" -U{Python Commons<http://assorted.sf.net/python-commons>} is a -general-purpose library. - -@author: Yang Zhang -@copyright: Yang Zhang unless otherwise noted -@license: PSF -""" - -__version__ = ( 0, 5, 0 ) -__all__ = [ 'async', - 'control', - 'decs', - 'environ', - 'exceps', - 'files', - 'interp', - 'log', - 'misc', - 'networking', - 'progress', - 'seqs', - 'servers', - 'startup', - 'strs', - 'structs', - 'threads', - 'trace' ] - -# TODO more resources: -# http://aima.cs.berkeley.edu/python/utils.py -# http://aspn.activestate.com/ASPN/Cookbook/Python -# http://aspn.activestate.com/ASPN/Cookbook/Python?&recipe_status=editors -# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/413486 -# interesting: -# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259174 -# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473790 Copied: python-commons/tags/0.6/src/commons/__init__.py (from rev 1451, python-commons/trunk/src/commons/__init__.py) =================================================================== --- python-commons/tags/0.6/src/commons/__init__.py (rev 0) +++ python-commons/tags/0.6/src/commons/__init__.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -0,0 +1,40 @@ +# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- +# vim:ft=python:et:sw=4:ts=4 + +""" +U{Python Commons<http://assorted.sf.net/python-commons>} is a +general-purpose library. + +@author: Yang Zhang +@copyright: Yang Zhang unless otherwise noted +@license: PSF +""" + +__version__ = ( 0, 6, 0 ) +__all__ = [ 'async', + 'control', + 'decs', + 'environ', + 'exceps', + 'files', + 'interp', + 'log', + 'misc', + 'networking', + 'progress', + 'seqs', + 'servers', + 'startup', + 'strs', + 'structs', + 'threads', + 'trace' ] + +# TODO more resources: +# http://aima.cs.berkeley.edu/python/utils.py +# http://aspn.activestate.com/ASPN/Cookbook/Python +# http://aspn.activestate.com/ASPN/Cookbook/Python?&recipe_status=editors +# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/413486 +# interesting: +# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259174 +# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473790 Deleted: python-commons/tags/0.6/src/commons/async.py =================================================================== --- python-commons/trunk/src/commons/async.py 2009-03-01 19:45:28 UTC (rev 1240) +++ python-commons/tags/0.6/src/commons/async.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -1,77 +0,0 @@ -# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- -# vim:ft=python:et:sw=4:ts=4 - -""" -Asynchronous utilities for use with the -U{Twisted<http://twistedmatrix.com/>} library. -""" - -from twisted.internet import defer, reactor - -def async_sleep( seconds ): - """ - Acts as the asynchronous version of C{time.sleep}. - - @param seconds: The amount of time in seconds to sleep. - @type seconds: float - - @return: The L{defer.Deferred} that will be fired on wake-up. - @rtype: defer.Deferred - """ - d = defer.Deferred() - reactor.callLater( seconds, lambda: d.callback( None ) ) - return d - -def asynchronized( func ): - """ - Acts as the asynchronous version of a C{synchronized} decorator - (inspired by Java's keyword). Ensures that no event-handling path - (the asynchronous equivalent to threads) will enter the function - if another one is currently in it (which can happen if the current - "thread" is itself waiting on a deferred, thus giving the reactor - an opportunity to execute the competing "thread"). - - Provides additional protection against U{Twisted bug - 411<http://twistedmatrix.com/trac/ticket/411>}. In this case, if - too many acquisition requests are chained onto the deferred which - is fired on release, then the stack will overflow. This is - circumvented by maintaining a queue of closures and deferreds - which is checked on each release, to keep the callback chain - "flat." - - @param func: The function to decorate. - @type func: function - - @return: The "thread-safe" version of the function. - @rtype: function - """ - def wrapper( self, *args, **kwargs ): - try: - q = self._sync_queue - except AttributeError: - q = self._sync_queue = [] - def release( result ): - invoke, d = q[0] - # actually perform the callback on the outer - # deferred; the deferred running this cb() should - # just terminate and be discarded - d.callback( result ) - - del q[0] - if len( q ) > 0: - invoke, d = q[0] - # we're tempted to do just run invoke() directly, but - # that would lead to the same stack explosion - reactor.callLater( 0, invoke ) - return result - def invoke(): - return defer.maybeDeferred( func, self, *args, **kwargs ).addCallback( release ) - d = defer.Deferred() - q.append( ( invoke, d ) ) - if len( q ) == 1: - reactor.callLater( 0, invoke ) - return d - wrapper.__name__ = func.__name__ - wrapper.__dict__ = func.__dict__ - wrapper.__doc__ = func.__doc__ - return wrapper Copied: python-commons/tags/0.6/src/commons/async.py (from rev 1450, python-commons/trunk/src/commons/async.py) =================================================================== --- python-commons/tags/0.6/src/commons/async.py (rev 0) +++ python-commons/tags/0.6/src/commons/async.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -0,0 +1,77 @@ +# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- +# vim:ft=python:et:sw=4:ts=4 + +""" +Asynchronous utilities for use with the +U{Twisted<http://twistedmatrix.com/>} library. +""" + +from twisted.internet import defer, reactor + +def async_sleep( seconds ): + """ + Acts as the asynchronous version of C{time.sleep}. + + @param seconds: The amount of time in seconds to sleep. + @type seconds: float + + @return: The C{defer.Deferred} that will be fired on wake-up. + @rtype: defer.Deferred + """ + d = defer.Deferred() + reactor.callLater( seconds, lambda: d.callback( None ) ) + return d + +def asynchronized( func ): + """ + Acts as the asynchronous version of a C{synchronized} decorator + (inspired by Java's keyword). Ensures that no event-handling path + (the asynchronous equivalent to threads) will enter the function + if another one is currently in it (which can happen if the current + "thread" is itself waiting on a deferred, thus giving the reactor + an opportunity to execute the competing "thread"). + + Provides additional protection against U{Twisted bug + 411<http://twistedmatrix.com/trac/ticket/411>}. In this case, if + too many acquisition requests are chained onto the deferred which + is fired on release, then the stack will overflow. This is + circumvented by maintaining a queue of closures and deferreds + which is checked on each release, to keep the callback chain + "flat." + + @param func: The function to decorate. + @type func: function + + @return: The "thread-safe" version of the function. + @rtype: function + """ + def wrapper( self, *args, **kwargs ): + try: + q = self._sync_queue + except AttributeError: + q = self._sync_queue = [] + def release( result ): + invoke, d = q[0] + # actually perform the callback on the outer + # deferred; the deferred running this cb() should + # just terminate and be discarded + d.callback( result ) + + del q[0] + if len( q ) > 0: + invoke, d = q[0] + # we're tempted to do just run invoke() directly, but + # that would lead to the same stack explosion + reactor.callLater( 0, invoke ) + return result + def invoke(): + return defer.maybeDeferred( func, self, *args, **kwargs ).addCallback( release ) + d = defer.Deferred() + q.append( ( invoke, d ) ) + if len( q ) == 1: + reactor.callLater( 0, invoke ) + return d + wrapper.__name__ = func.__name__ + wrapper.__dict__ = func.__dict__ + wrapper.__doc__ = func.__doc__ + return wrapper Deleted: python-commons/tags/0.6/src/commons/control.py =================================================================== --- python-commons/trunk/src/commons/control.py 2009-03-01 19:45:28 UTC (rev 1240) +++ python-commons/tags/0.6/src/commons/control.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -1,59 +0,0 @@ -# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- -# vim:ft=python:et:sw=4:ts=4 - -"""Processes, idling, and signals.""" - -from logging import * -import os, signal, time - -def suicide(): - """Force-kill the current process.""" - os.kill( os.getpid(), signal.SIGKILL ) - -############################################################################# - -class Sleeper( object ): - """Sleeper class. Goes to sleep forever.""" - @classmethod - def sleep( cls ): - """ - Calls L{time.sleep} for 100000 seconds at a time in a - while-true loop. - """ - while True: - time.sleep( 100000 ) - -############################################################################# - -class SigTerm( Exception ): pass - -def handle_signal( signum, frame ): - """ - Generic signal handler that logs the received signal to the - "signal" logging channel (log level INFO) and then raises - L{SigTerm} if it was not previously raised. - - @param signum: The signal's numeric value (see C{man 7 signal}). - - @param frame: Ignored. - - @raise SigTerm: Only once. - """ - global got_signal - info( 'signal', 'got signal', str( signum ) ) - if not got_signal: - got_signal = True - raise SigTerm - -def handle_signals( *sigs ): - """ - For each given signal, register the L{handle_signal} as its - handler. - - @param sigs: The set of sigs to iterate over. - @type sigs: set - """ - global got_signal - got_signal = False - for sig in sigs: - signal.signal( signal.SIGTERM, handle_signal ) Copied: python-commons/tags/0.6/src/commons/control.py (from rev 1450, python-commons/trunk/src/commons/control.py) =================================================================== --- python-commons/tags/0.6/src/commons/control.py (rev 0) +++ python-commons/tags/0.6/src/commons/control.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -0,0 +1,59 @@ +# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- +# vim:ft=python:et:sw=4:ts=4 + +"""Processes, idling, and signals.""" + +from logging import * +import os, signal, time + +def suicide(): + """Force-kill the current process.""" + os.kill( os.getpid(), signal.SIGKILL ) + +############################################################################# + +class Sleeper( object ): + """Sleeper class. Goes to sleep forever.""" + @classmethod + def sleep( cls ): + """ + Calls C{time.sleep} for 100000 seconds at a time in a + while-true loop. + """ + while True: + time.sleep( 100000 ) + +############################################################################# + +class SigTerm( Exception ): pass + +def handle_signal( signum, frame ): + """ + Generic signal handler that logs the received signal to the + "signal" logging channel (log level INFO) and then raises + L{SigTerm} if it was not previously raised. + + @param signum: The signal's numeric value (see C{man 7 signal}). + + @param frame: Ignored. + + @raise SigTerm: Only once. + """ + global got_signal + info( 'signal', 'got signal', str( signum ) ) + if not got_signal: + got_signal = True + raise SigTerm + +def handle_signals( *sigs ): + """ + For each given signal, register the L{handle_signal} as its + handler. + + @param sigs: The set of sigs to iterate over. + @type sigs: set + """ + global got_signal + got_signal = False + for sig in sigs: + signal.signal( signal.SIGTERM, handle_signal ) Deleted: python-commons/tags/0.6/src/commons/decs.py =================================================================== --- python-commons/trunk/src/commons/decs.py 2009-03-01 19:45:28 UTC (rev 1240) +++ python-commons/tags/0.6/src/commons/decs.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -1,156 +0,0 @@ -# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- -# vim:ft=python:et:sw=4:ts=4 - -""" -Decorators and decorator utilities. - -@todo: Move the actual decorators to modules based on their topic. -""" - -from __future__ import with_statement -import functools, inspect, xmlrpclib -from cPickle import * - -def wrap_callable(any_callable, before, after): - """ - Wrap any callable with before/after calls. - - From the Python Cookbook. Modified to support C{None} for - C{before} or C{after}. - - @copyright: O'Reilly Media - - @param any_callable: The function to decorate. - @type any_callable: function - - @param before: The pre-processing procedure. If this is C{None}, then no pre-processing will be done. - @type before: function - - @param after: The post-processing procedure. If this is C{None}, then no post-processing will be done. - @type after: function - """ - def _wrapped(*a, **kw): - if before is not None: - before( ) - try: - return any_callable(*a, **kw) - finally: - if after is not None: - after( ) - # In 2.4, only: _wrapped.__name__ = any_callable.__name__ - return _wrapped - -class GenericWrapper( object ): - """ - Wrap all of an object's methods with before/after calls. This is - like a decorator for objects. - - From the I{Python Cookbook}. - - @copyright: O'Reilly Media - """ - def __init__(self, obj, before, after, ignore=( )): - # we must set into __dict__ directly to bypass __setattr__; so, - # we need to reproduce the name-mangling for double-underscores - clasname = 'GenericWrapper' - self.__dict__['_%s__methods' % clasname] = { } - self.__dict__['_%s__obj' % clasname] = obj - for name, method in inspect.getmembers(obj, inspect.ismethod): - if name not in ignore and method not in ignore: - self.__methods[name] = wrap_callable(method, before, after) - def __getattr__(self, name): - try: - return self.__methods[name] - except KeyError: - return getattr(self.__obj, name) - def __setattr__(self, name, value): - setattr(self.__obj, name, value) - -########################################################## - -def xmlrpc_safe(func): - """ - Makes a procedure "XMLRPC-safe" by returning 0 whenever the inner - function returns C{None}. This is useful because XMLRPC requires - return values, and 0 is commonly used when functions don't intend - to return anything. - - Also, if the procedure returns a boolean, it will be wrapped in - L{xmlrpclib.Boolean}. - - @param func: The procedure to decorate. - @type func: function - """ - @functools.wraps(func) - def wrapper(*args,**kwargs): - result = func(*args,**kwargs) - if result is not None: - if type( result ) == bool: - return xmlrpclib.Boolean( result ) - else: - return result - else: - return 0 - return wrapper - -########################################################## - -def file_memoized(serializer, deserializer, pathfunc): - """ - The string result of the given function is saved to the given path. - - Example:: - - @file_memoized(lambda x,f: f.write(x), - lambda f: f.read(), - lambda: "/tmp/cache") - def foo(): return "hello" - - @file_memoized(pickle.dump, - pickle.load, - lambda x,y: "/tmp/cache-%d-%d" % (x,y)) - def foo(x,y): return "hello %d %d" % (x,y) - - @param serializer: The function to serialize the return value into a - string. This should take the return value object and - the file object. - @type serializer: function - - @param deserializer: The function te deserialize the cache file contents - into the return value. This should take the file - object and return a string. - type: deserializer: function - - @param pathfunc: Returns the path where the files should be saved. This - should be able to take the same arguments as the original - function. - @type pathfunc: str - """ - def dec(func): - @functools.wraps(func) - def wrapper(*args, **kwargs): - p = pathfunc(*args, **kwargs) - try: - with file(p) as f: - return deserializer(f) - except IOError, (errno, errstr): - if errno != 2: raise - with file(p, 'w') as f: - x = func(*args, **kwargs) - serializer(x, f) - return x - return wrapper - return dec - -def file_string_memoized(pathfunc): - """ - Wrapper around L{file_memoized} that expects the decorated function to - return strings, so the string is written verbatim. - """ - return file_memoized(lambda x,f: f.write(x), lambda f: f.read(), pathfunc) - -def pickle_memoized(pathfunc): - """ - Wrapper around L{file_memoized} that uses pickle. - """ - return file_memoized(dump, load, pathfunc) Copied: python-commons/tags/0.6/src/commons/decs.py (from rev 1450, python-commons/trunk/src/commons/decs.py) =================================================================== --- python-commons/tags/0.6/src/commons/decs.py (rev 0) +++ python-commons/tags/0.6/src/commons/decs.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -0,0 +1,158 @@ +# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- +# vim:ft=python:et:sw=4:ts=4 + +""" +Decorators and decorator utilities. + +@todo: Move the actual decorators to modules based on their topic. +""" + +from __future__ import with_statement +import functools, inspect, xmlrpclib +from cPickle import * + +def wrap_callable(any_callable, before, after): + """ + Wrap any callable with before/after calls. + + From the Python Cookbook. Modified to support C{None} for + C{before} or C{after}. + + @copyright: O'Reilly Media + + @param any_callable: The function to decorate. + @type any_callable: function + + @param before: The pre-processing procedure. If this is C{None}, then no pre-processing will be done. + @type before: function + + @param after: The post-processing procedure. If this is C{None}, then no post-processing will be done. + @type after: function + """ + def _wrapped(*a, **kw): + if before is not None: + before( ) + try: + return any_callable(*a, **kw) + finally: + if after is not None: + after( ) + # In 2.4, only: _wrapped.__name__ = any_callable.__name__ + return _wrapped + +class GenericWrapper( object ): + """ + Wrap all of an object's methods with before/after calls. This is + like a decorator for objects. + + From the I{Python Cookbook}. + + @copyright: O'Reilly Media + """ + def __init__(self, obj, before, after, ignore=( )): + # we must set into __dict__ directly to bypass __setattr__; so, + # we need to reproduce the name-mangling for double-underscores + clasname = 'GenericWrapper' + self.__dict__['_%s__methods' % clasname] = { } + self.__dict__['_%s__obj' % clasname] = obj + for name, method in inspect.getmembers(obj, inspect.ismethod): + if name not in ignore and method not in ignore: + self.__methods[name] = wrap_callable(method, before, after) + def __getattr__(self, name): + try: + return self.__methods[name] + except KeyError: + return getattr(self.__obj, name) + def __setattr__(self, name, value): + setattr(self.__obj, name, value) + +########################################################## + +def xmlrpc_safe(func): + """ + Makes a procedure "XMLRPC-safe" by returning 0 whenever the inner + function returns C{None}. This is useful because XMLRPC requires + return values, and 0 is commonly used when functions don't intend + to return anything. + + Also, if the procedure returns a boolean, it will be wrapped in + C{xmlrpclib.Boolean}. + + @param func: The procedure to decorate. + @type func: function + """ + @functools.wraps(func) + def wrapper(*args,**kwargs): + result = func(*args,**kwargs) + if result is not None: + if type( result ) == bool: + return xmlrpclib.Boolean( result ) + else: + return result + else: + return 0 + return wrapper + +########################################################## + +def file_memoized(serializer, deserializer, pathfunc): + """ + The string result of the given function is saved to the given path. + + Example:: + + @file_memoized(lambda x,f: f.write(x), + lambda f: f.read(), + lambda: "/tmp/cache") + def foo(): return "hello" + + @file_memoized(pickle.dump, + pickle.load, + lambda x,y: "/tmp/cache-%d-%d" % (x,y)) + def foo(x,y): return "hello %d %d" % (x,y) + + @param serializer: The function to serialize the return value into a + string. This should take the return value object and + the file object. + @type serializer: function + + @param deserializer: The function te deserialize the cache file contents + into the return value. This should take the file + object and return a string. + @type deserializer: function + + @param pathfunc: Returns the path where the files should be saved. This + should be able to take the same arguments as the original + function. + @type pathfunc: str + """ + def dec(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + p = pathfunc(*args, **kwargs) + try: + with file(p) as f: + return deserializer(f) + except IOError, (errno, errstr): + if errno != 2: raise + with file(p, 'w') as f: + x = func(*args, **kwargs) + serializer(x, f) + return x + return wrapper + return dec + +def file_string_memoized(pathfunc): + """ + Wrapper around L{file_memoized} that expects the decorated function to + return strings, so the string is written verbatim. + """ + return file_memoized(lambda x,f: f.write(x), lambda f: f.read(), pathfunc) + +def pickle_memoized(pathfunc): + """ + Wrapper around L{file_memoized} that uses pickle. + """ + bindump = lambda x,f: dump(x,f,2) + binload = lambda x,f: load(x,f,2) + return file_memoized(bindump, binload, pathfunc) Deleted: python-commons/tags/0.6/src/commons/files.py =================================================================== --- python-commons/trunk/src/commons/files.py 2009-03-01 19:45:28 UTC (rev 1240) +++ python-commons/tags/0.6/src/commons/files.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -1,205 +0,0 @@ -# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- -# vim:ft=python:et:sw=4:ts=4 - -""" -File and directory manipulation. - -@var invalid_filename_chars: The characters which are usually -prohibited on most modern file systems. - -@var invalid_filename_chars_regex: A regex character class constructed -from L{invalid_filename_chars}. -""" - -from __future__ import with_statement - -__all__ = ''' -soft_makedirs -temp_dir -cleanse_filename -invalid_filename_chars -invalid_filename_chars_regex -disk_double_buffer -versioned_guard -versioned_cache -read_file -write_file -write_or_rm -is_nonempty_file -'''.split() - -import os, re, tempfile -from cPickle import * -from path import path - -def soft_makedirs( path ): - """ - Emulate C{mkdir -p} (doesn't complain if it already exists). - - @param path: The path of the directory to create. - @type path: str - - @raise OSError: If it cannot create the directory. It only - swallows OS error 17. - """ - try: - os.makedirs( path ) - except OSError, ex: - if ex.errno == 17: - pass - else: - raise - -def temp_dir( base_dir_name, do_create_subdir = True ): - """ - Get a temporary directory without polluting top-level /tmp. This follows - Ubuntu's conventions, choosing a temporary directory name based on - the given name plus the user name to avoid user conflicts. - - @param base_dir_name: The "name" of the temporary directory. This - is usually identifies the purpose of the directory, or the - application to which the temporary directory belongs. E.g., if joe - calls passes in C{"ssh-agent"} on a standard Linux/Unix system, - then the full path of the temporary directory will be - C{"/tmp/ssh-agent-joe"}. - @type base_dir_name: str - - @param do_create_subdir: If C{True}, then creates a - sub-sub-directory within the temporary sub-directory (and returns - the path to that). The sub-sub-directory's name is randomized - (uses L{tempfile.mkdtemp}). - @type do_create_subdir: bool - - @return: The path to the temporary (sub-)sub-directory. - @rtype: str - """ - base_dir_name += '-' + os.environ[ 'USER' ] - base_dir = path( tempfile.gettempdir() ) / base_dir_name - soft_makedirs( base_dir ) - if do_create_subdir: - return tempfile.mkdtemp( dir = base_dir ) - else: - return base_dir - -invalid_filename_chars = r'*|\/:<>?' -invalid_filename_chars_regex = r'[*|\\\/:<>?]' - -def cleanse_filename( filename ): - """ - Replaces all problematic characters in a filename with C{"_"}, as - specified by L{invalid_filename_chars}. - - @param filename: The filename to cleanse. - @type filename: str - """ - pattern = invalid_filename_chars_regex - return re.sub( pattern, '_', filename ) - -class disk_double_buffer( object ): - """ - A simple disk double-buffer. One file is for reading, the other is for - writing, and a facility for swapping the two roles is provided. - """ - def __init__( self, path_base, do_persist = True ): - self.paths = map( path, [ path_base + '.0', path_base + '.1' ] ) - self.do_persist = do_persist - self.switch_status = path( path_base + '.switched' ) - if not do_persist or not self.switch_status.exists(): - self.w, self.r = 0, 1 # default - else: - self.w, self.r = 1, 0 - self.reload_files() - def reload_files( self ): - self.writer = file( self.paths[ self.w ], 'w' ) - if not self.paths[ self.r ].exists(): - self.paths[ self.r ].touch() - self.reader = file( self.paths[ self.r ] ) - def switch( self ): - self.close() - if self.do_persist: - if self.w == 0: self.switch_status.touch() - else: self.switch_status.remove() - self.r, self.w = self.w, self.r - self.reload_files() - def write( self, x ): - self.writer.write( x ) - def read( self, len = 8192 ): - return self.reader.read( len ) - def close( self ): - self.reader.close() - self.writer.close() - -def versioned_guard(path, fresh_version): - """ - Maintain a version object. This is useful for working with versioned - caches. - - @param path: The path to the file containing the cached version object. - @type path: str - - @param fresh_version: The actual latest version that the cached version - should be compared against. - @type fresh_version: object (any type that can be compared) - - @return: True iff the cached version is obsolete (less than the fresh - version or doesn't exist). - @rtype: bool - """ - cache_version = None - try: - with file( path ) as f: cache_version = load(f) - except IOError, (errno, errstr): - if errno != 2: raise - if cache_version is None or fresh_version > cache_version: - with file( path, 'w' ) as f: dump(fresh_version, f) - return True - else: - return False - -def versioned_cache(version_path, fresh_version, cache_path, cache_func): - """ - If fresh_version is newer than the version in version_path, then invoke - cache_func and cache the result in cache_path (using pickle). - - Note the design flaw with L{versioned_guard}: the updated version value is - stored immediately, rather than after updating the cache. - - @param version_path: The path to the file version. - @type version_path: str - - @param fresh_version: The actual, up-to-date version value. - @type fresh_version: object (any type that can be compared) - - @param cache_path: The path to the cached data. - @type cache_path: str - - @param cache_func: The function that produces the fresh data to be cached. - @type cache_func: function (no arguments) - """ - if versioned_guard( version_path, fresh_version ): - # cache obsolete, force-fetch new data - result = cache_func() - with file(cache_path, 'w') as f: dump(result, f) - return result - else: - # cache up-to-date (should be available since dlcs-timestamp exists!) - with file(cache_path) as f: return load(f) - -def read_file(path): - f = file(path) - try: return f.read() - finally: f.close() - -def write_file(path, contents): - f = file(path,'w') - try: f.write(contents) - finally: f.close() - -def write_or_rm(p, contents): - 'Write the file or remove it if contents is empty.' - p = path(p) - if contents.strip(): write_file(p, contents) - elif p.isfile(): p.remove() - -def is_nonempty_file(path): - return path.isfile() and read_file(path).strip() != '' Copied: python-commons/tags/0.6/src/commons/files.py (from rev 1450, python-commons/trunk/src/commons/files.py) =================================================================== --- python-commons/tags/0.6/src/commons/files.py (rev 0) +++ python-commons/tags/0.6/src/commons/files.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -0,0 +1,205 @@ +# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- +# vim:ft=python:et:sw=4:ts=4 + +""" +File and directory manipulation. + +@var invalid_filename_chars: The characters which are usually +prohibited on most modern file systems. + +@var invalid_filename_chars_regex: A regex character class constructed +from L{invalid_filename_chars}. +""" + +from __future__ import with_statement + +__all__ = ''' +soft_makedirs +temp_dir +cleanse_filename +invalid_filename_chars +invalid_filename_chars_regex +disk_double_buffer +versioned_guard +versioned_cache +read_file +write_file +write_or_rm +is_nonempty_file +'''.split() + +import os, re, tempfile +from cPickle import * +from path import path + +def soft_makedirs( path ): + """ + Emulate C{mkdir -p} (doesn't complain if it already exists). + + @param path: The path of the directory to create. + @type path: str + + @raise OSError: If it cannot create the directory. It only + swallows OS error 17. + """ + try: + os.makedirs( path ) + except OSError, ex: + if ex.errno == 17: + pass + else: + raise + +def temp_dir( base_dir_name, do_create_subdir = True ): + """ + Get a temporary directory without polluting top-level /tmp. This follows + Ubuntu's conventions, choosing a temporary directory name based on + the given name plus the user name to avoid user conflicts. + + @param base_dir_name: The "name" of the temporary directory. This + is usually identifies the purpose of the directory, or the + application to which the temporary directory belongs. E.g., if joe + calls passes in C{"ssh-agent"} on a standard Linux/Unix system, + then the full path of the temporary directory will be + C{"/tmp/ssh-agent-joe"}. + @type base_dir_name: str + + @param do_create_subdir: If C{True}, then creates a + sub-sub-directory within the temporary sub-directory (and returns + the path to that). The sub-sub-directory's name is randomized + (uses C{tempfile.mkdtemp}). + @type do_create_subdir: bool + + @return: The path to the temporary (sub-)sub-directory. + @rtype: str + """ + base_dir_name += '-' + os.environ[ 'USER' ] + base_dir = path( tempfile.gettempdir() ) / base_dir_name + soft_makedirs( base_dir ) + if do_create_subdir: + return tempfile.mkdtemp( dir = base_dir ) + else: + return base_dir + +invalid_filename_chars = r'*|\/:<>?' +invalid_filename_chars_regex = r'[*|\\\/:<>?]' + +def cleanse_filename( filename ): + """ + Replaces all problematic characters in a filename with C{"_"}, as + specified by L{invalid_filename_chars}. + + @param filename: The filename to cleanse. + @type filename: str + """ + pattern = invalid_filename_chars_regex + return re.sub( pattern, '_', filename ) + +class disk_double_buffer( object ): + """ + A simple disk double-buffer. One file is for reading, the other is for + writing, and a facility for swapping the two roles is provided. + """ + def __init__( self, path_base, do_persist = True ): + self.paths = map( path, [ path_base + '.0', path_base + '.1' ] ) + self.do_persist = do_persist + self.switch_status = path( path_base + '.switched' ) + if not do_persist or not self.switch_status.exists(): + self.w, self.r = 0, 1 # default + else: + self.w, self.r = 1, 0 + self.reload_files() + def reload_files( self ): + self.writer = file( self.paths[ self.w ], 'w' ) + if not self.paths[ self.r ].exists(): + self.paths[ self.r ].touch() + self.reader = file( self.paths[ self.r ] ) + def switch( self ): + self.close() + if self.do_persist: + if self.w == 0: self.switch_status.touch() + else: self.switch_status.remove() + self.r, self.w = self.w, self.r + self.reload_files() + def write( self, x ): + self.writer.write( x ) + def read( self, len = 8192 ): + return self.reader.read( len ) + def close( self ): + self.reader.close() + self.writer.close() + +def versioned_guard(path, fresh_version): + """ + Maintain a version object. This is useful for working with versioned + caches. + + @param path: The path to the file containing the cached version object. + @type path: str + + @param fresh_version: The actual latest version that the cached version + should be compared against. + @type fresh_version: object (any type that can be compared) + + @return: True iff the cached version is obsolete (less than the fresh + version or doesn't exist). + @rtype: bool + """ + cache_version = None + try: + with file( path ) as f: cache_version = load(f) + except IOError, (errno, errstr): + if errno != 2: raise + if cache_version is None or fresh_version > cache_version: + with file( path, 'w' ) as f: dump(fresh_version, f) + return True + else: + return False + +def versioned_cache(version_path, fresh_version, cache_path, cache_func): + """ + If fresh_version is newer than the version in version_path, then invoke + cache_func and cache the result in cache_path (using pickle). + + Note the design flaw with L{versioned_guard}: the updated version value is + stored immediately, rather than after updating the cache. + + @param version_path: The path to the file version. + @type version_path: str + + @param fresh_version: The actual, up-to-date version value. + @type fresh_version: object (any type that can be compared) + + @param cache_path: The path to the cached data. + @type cache_path: str + + @param cache_func: The function that produces the fresh data to be cached. + @type cache_func: function (no arguments) + """ + if versioned_guard( version_path, fresh_version ): + # cache obsolete, force-fetch new data + result = cache_func() + with file(cache_path, 'w') as f: dump(result, f) + return result + else: + # cache up-to-date (should be available since dlcs-timestamp exists!) + with file(cache_path) as f: return load(f) + +def read_file(path): + f = file(path) + try: return f.read() + finally: f.close() + +def write_file(path, contents): + f = file(path,'w') + try: f.write(contents) + finally: f.close() + +def write_or_rm(p, contents): + 'Write the file or remove it if contents is empty.' + p = path(p) + if contents.strip(): write_file(p, contents) + elif p.isfile(): p.remove() + +def is_nonempty_file(path): + return path.isfile() and read_file(path).strip() != '' Deleted: python-commons/tags/0.6/src/commons/log.py =================================================================== --- python-commons/trunk/src/commons/log.py 2009-03-01 19:45:28 UTC (rev 1240) +++ python-commons/tags/0.6/src/commons/log.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -1,129 +0,0 @@ -# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- -# vim:ft=python:et:sw=4:ts=4 - -""" -Convenience functions for the standard L{logging} library. - -Functions are mostly self-explanatory. -""" - -from strs import * -from itertools import chain, imap -import logging, logging.handlers, sys -from logging import getLogger - -# TODO cleanup / reorganize this section - -def fmt( flag, *args ): - return ' '.join( chain( [ '%-20s:' % flag ], imap( str, args ) ) ) - -def log( level, flag, *args ): - getLogger( flag ).log( level, fmt( flag, *args ) ) - -def exception( flag, *args ): - getLogger( flag ).exception( fmt( flag, *args ) ) - -def critical( flag, *args ): - log( logging.CRITICAL, flag, *args ) - -def error( flag, *args ): - log( logging.ERROR, flag, *args ) - -def warning( flag, *args ): - log( logging.WARNING, flag, *args ) - -def debug( flag, *args ): - log( logging.DEBUG, flag, *args ) - -def info( flag, *args ): - log( logging.INFO, flag, *args ) - -def die( flag, *args ): - error( flag, *args ) - sys.exit( 1 ) - -def tailor_logs( flag, *prefix ): - """ - Avoid repetitive typing! Usage: - - debug,info,warning,_,_ = tailor_logs('myflag','some','prefix') - """ - def new_critical( *args ): critical( flag, * prefix + args ) - def new_debug( *args ): debug( flag, * prefix + args ) - def new_error( *args ): error( flag, * prefix + args ) - def new_info( *args ): info( flag, * prefix + args ) - def new_warning( *args ): warning( flag, * prefix + args ) - return new_debug, new_info, new_warning, new_error, new_critical - -def config_logging( level = logging.INFO, - do_console = False, - do_file = False, - do_server = False, - flags = [], - path = None, - log_format = '%(asctime)s %(levelname)-8s %(message)s', - log_date_format = None ): - """ - Configures L{logging}, promoting some common configurations. - - @param level: The default log-level threshold for all - loggers. (Note that this is not the level for all handlers.) - @type level: int - - @param do_console: Whether to enable the console handler. - @type do_console: bool - - @param do_file: Whether to enable the file handler. - @type do_file: bool - - @param do_server: Whether to enable a network socket stream - handler. - @type do_server: bool - - @param flags: The set of flags on which to lower the threshold to - L{logging.DEBUG}. - @type flags: iterable - - @param path: The path of the log file (only considered if - C{do_file} is C{True}. - @type path: str - - @param log_format: The log message formatting template. - @type log_format: str - - @param log_date_format: The timestamp formatting template. - @type log_date_format: str - """ - formatter = logging.Formatter( log_format, log_date_format ) - - logging.getLogger( '' ).setLevel( level ) - logging.raiseExceptions = False - - # log to console - if do_console: - handler = logging.StreamHandler() - handler.setLevel( logging.DEBUG ) - handler.setFormatter( formatter ) - logging.getLogger( '' ).addHandler( handler ) - - # log to files - if do_file and path is not None: - handler = logging.FileHandler( path, 'w' ) - handler.setFormatter( formatter ) - handler.setLevel( logging.DEBUG ) - logging.getLogger( '' ).addHandler( handler ) - - # log to the log server - if do_server: - handler = logging.handlers.SocketHandler( 'localhost', - logging.handlers.DEFAULT_TCP_LOGGING_PORT ) - handler.setLevel( logging.DEBUG ) - logging.getLogger( '' ).addHandler( handler ) - - for flag in flags: - logging.getLogger( flag ).setLevel( logging.DEBUG ) - -#### logging.raiseExceptions = False -#### config_path = get_usr_conf( 'LOGGING_CONFIG_PATH', 'logging.ini' ) -#### if config_path is not None: -#### logging.config.fileConfig( config_path ) Copied: python-commons/tags/0.6/src/commons/log.py (from rev 1450, python-commons/trunk/src/commons/log.py) =================================================================== --- python-commons/tags/0.6/src/commons/log.py (rev 0) +++ python-commons/tags/0.6/src/commons/log.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -0,0 +1,142 @@ +# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- +# vim:ft=python:et:sw=4:ts=4 + +""" +Convenience functions for the standard L{logging} library. + +Functions are mostly self-explanatory. +""" + +from strs import * +from itertools import chain, imap +import logging, logging.handlers, sys +from logging import getLogger + +__all__ = """ +fmt +log +exception +critical +error +warning +info +die +tailor_logs +config_logging +""".split() + +# TODO cleanup / reorganize this section + +def fmt( flag, *args ): + return ' '.join( chain( [ '%-20s:' % flag ], imap( unicode, args ) ) ) + +def log( level, flag, *args ): + getLogger( flag ).log( level, fmt( flag, *args ) ) + +def exception( flag, *args ): + getLogger( flag ).exception( fmt( flag, *args ) ) + +def critical( flag, *args ): + log( logging.CRITICAL, flag, *args ) + +def error( flag, *args ): + log( logging.ERROR, flag, *args ) + +def warning( flag, *args ): + log( logging.WARNING, flag, *args ) + +def debug( flag, *args ): + log( logging.DEBUG, flag, *args ) + +def info( flag, *args ): + log( logging.INFO, flag, *args ) + +def die( flag, *args ): + error( flag, *args ) + sys.exit( 1 ) + +def tailor_logs( flag, *prefix ): + """ + Avoid repetitive typing! Usage:: + + debug,info,warning,_,_ = tailor_logs('myflag','some','prefix') + """ + def new_critical( *args ): critical( flag, * prefix + args ) + def new_debug( *args ): debug( flag, * prefix + args ) + def new_error( *args ): error( flag, * prefix + args ) + def new_info( *args ): info( flag, * prefix + args ) + def new_warning( *args ): warning( flag, * prefix + args ) + return new_debug, new_info, new_warning, new_error, new_critical + +def config_logging( level = logging.INFO, + do_console = False, + do_file = False, + do_server = False, + flags = [], + path = None, + log_format = '%(asctime)s %(levelname)-8s %(message)s', + log_date_format = None ): + """ + Configures L{logging}, promoting some common configurations. + + @param level: The default log-level threshold for all + loggers. (Note that this is not the level for all handlers.) + @type level: int + + @param do_console: Whether to enable the console handler. + @type do_console: bool + + @param do_file: Whether to enable the file handler. + @type do_file: bool + + @param do_server: Whether to enable a network socket stream + handler. + @type do_server: bool + + @param flags: The set of flags on which to lower the threshold to + C{logging.DEBUG}. + @type flags: iterable + + @param path: The path of the log file (only considered if + C{do_file} is C{True}. + @type path: str + + @param log_format: The log message formatting template. + @type log_format: str + + @param log_date_format: The timestamp formatting template. + @type log_date_format: str + """ + formatter = logging.Formatter( log_format, log_date_format ) + + logging.getLogger( '' ).setLevel( level ) + logging.raiseExceptions = False + + # log to console + if do_console: + handler = logging.StreamHandler() + handler.setLevel( logging.DEBUG ) + handler.setFormatter( formatter ) + logging.getLogger( '' ).addHandler( handler ) + + # log to files + if do_file and path is not None: + handler = logging.FileHandler( path, 'w' ) + handler.setFormatter( formatter ) + handler.setLevel( logging.DEBUG ) + logging.getLogger( '' ).addHandler( handler ) + + # log to the log server + if do_server: + handler = logging.handlers.SocketHandler( 'localhost', + logging.handlers.DEFAULT_TCP_LOGGING_PORT ) + handler.setLevel( logging.DEBUG ) + logging.getLogger( '' ).addHandler( handler ) + + for flag in flags: + logging.getLogger( flag ).setLevel( logging.DEBUG ) + +#### logging.raiseExceptions = False +#### config_path = get_usr_conf( 'LOGGING_CONFIG_PATH', 'logging.ini' ) +#### if config_path is not None: +#### logging.config.fileConfig( config_path ) Deleted: python-commons/tags/0.6/src/commons/misc.py =================================================================== --- python-commons/trunk/src/commons/misc.py 2009-03-01 19:45:28 UTC (rev 1240) +++ python-commons/tags/0.6/src/commons/misc.py 2010-04-01 18:21:19 UTC (rev 1598) @@ -1,324 +0,0 @@ -# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- -# vim:ft=python:et:sw=4:ts=4 - -""" -Miscellanea. -""" - -__all__ = ''' -TerminalController -cleartimeout -days -default_if_none -generate_bit_fields -remove_colors -run -sendmail -seq -settimeout -tc -timeout_exception -wall_clock -'''.split() - -# -# Email -# ... [truncated message content] |
From: <yan...@us...> - 2010-04-01 18:19:24
|
Revision: 1597 http://assorted.svn.sourceforge.net/assorted/?rev=1597&view=rev Author: yangzhang Date: 2010-04-01 18:19:17 +0000 (Thu, 01 Apr 2010) Log Message: ----------- append / to directory symlinks by default in bash readline Modified Paths: -------------- configs/trunk/src/inputrc Modified: configs/trunk/src/inputrc =================================================================== --- configs/trunk/src/inputrc 2010-04-01 18:18:17 UTC (rev 1596) +++ configs/trunk/src/inputrc 2010-04-01 18:19:17 UTC (rev 1597) @@ -23,6 +23,9 @@ # don't flash and don't beep at me set bell-style none +# append / to directory symlinks +set mark-symlinked-directories on + # alt key magic; useful for vim #set meta-flag on #set input-meta on This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:18:24
|
Revision: 1596 http://assorted.svn.sourceforge.net/assorted/?rev=1596&view=rev Author: yangzhang Date: 2010-04-01 18:18:17 +0000 (Thu, 01 Apr 2010) Log Message: ----------- added old python source from the old sharing-gateway project Added Paths: ----------- movie-lookup/trunk/oldsrc/ movie-lookup/trunk/oldsrc/format-movie-info.py movie-lookup/trunk/oldsrc/get-movie-info.py Added: movie-lookup/trunk/oldsrc/format-movie-info.py =================================================================== --- movie-lookup/trunk/oldsrc/format-movie-info.py (rev 0) +++ movie-lookup/trunk/oldsrc/format-movie-info.py 2010-04-01 18:18:17 UTC (rev 1596) @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +import cPickle as pickle +import re + +f = file( 'output.txt' ) +items = pickle.load( f ) +f.close() + +print len( items ) +for item in items[:10]: + print item['orig_name'] +for item in items[-10:]: + print item['orig_name'] Property changes on: movie-lookup/trunk/oldsrc/format-movie-info.py ___________________________________________________________________ Added: svn:executable + * Added: movie-lookup/trunk/oldsrc/get-movie-info.py =================================================================== --- movie-lookup/trunk/oldsrc/get-movie-info.py (rev 0) +++ movie-lookup/trunk/oldsrc/get-movie-info.py 2010-04-01 18:18:17 UTC (rev 1596) @@ -0,0 +1,209 @@ +#!/usr/bin/env python + +import cPickle as pickle +import HTMLParser +import re +import sys +import urllib +import urllib2 +import twisted.python.text as text + +def urlopen( *args ): + while True: + try: + page = urllib2.urlopen( *args ) + return page.geturl(), page.readlines() + except KeyboardInterrupt: + raise + except: + sys.stderr.write( 'connection error, retrying...\n' ) + +class SearchParser( HTMLParser.HTMLParser ): + + def __init__( self, query ): + HTMLParser.HTMLParser.__init__( self ) + self.query = query + self.title = None + self.is_match = False + + def handle_starttag( self, tag, attrs ): + attrs = dict( attrs ) + if tag == 'a' and 'class' in attrs and ( + attrs['class'] == 'table-hl-header-link' or + attrs['class'] == 'movie-link' ): + self.next_url = attrs['href'] + + def handle_data( self, data ): + self.title = data + if self.query == simplify( data ): + self.is_match = True + +class ReviewsParser( HTMLParser.HTMLParser ): + + def __init__( self ): + HTMLParser.HTMLParser.__init__( self ) + self.do_extract = False + + def handle_starttag( self, tag, attrs ): + if tag == 'span': + attrs = dict( attrs ) + if 'class' in attrs and attrs[ 'class' ] == 'movie-body-text-bold': + self.do_extract = True + + def handle_data( self, data ): + if self.do_extract: + self.rating = data + self.do_extract = False + +class AboutParser( HTMLParser.HTMLParser ): + + def __init__( self ): + HTMLParser.HTMLParser.__init__( self ) + self.do_extract = False + self.summary = None + self.span_level = 0 + self.start_span_level = None + + def handle_starttag( self, tag, attrs ): + if tag == 'span': + attrs = dict( attrs ) + if 'class' in attrs and attrs[ 'class' ] == 'movie-body-text': + assert self.start_span_level == None + self.do_extract = True + self.start_span_level = self.span_level + self.span_level += 1 + + def handle_endtag( self, tag ): + if tag == 'span': + self.span_level -= 1 + if self.span_level == self.start_span_level: + self.do_extract = False + + def handle_data( self, data ): + if self.do_extract: + if self.summary is None: + self.summary = data + else: + self.summary += '\n' + data + +def simplify( text ): + def clean( text ): + text = re.sub( r'\s+', ' ', text ) + text = re.sub( r'^\s|\s$', '', text ) + return text + text = text.strip().lower() + text = re.sub( r'^(a|an|the)\b', '', text ) + text = re.sub( r'\(\d{4}\)$', '', text ) + text = clean( text ) + text = re.sub( r', (a|an|the)$', '', text ) + text = re.sub( r'[-,\.:]', ' ', text ) + text = re.sub( r'\(.*\)$', '', text ) + text = clean( text ) + return text + +def lookup( name ): + global appfile + item = {} + item[ 'orig_name' ] = name + item[ 'simp_name' ] = simplify( name ) + name = simplify( name ) + if re.search( r"[^0-9a-z' ]", name ) is not None: + print '\t', "ERROR PARSING NAME" + item[ 'parse_error' ] = True + else: + url, lines = urlopen( 'http://www.rottentomatoes.com/search/movie.php?%s' % + ( urllib.urlencode( { 'searchby': 'movies', 'search': name } ), ) ) + matches = [] + has_match = False + base_url = None + item[ 'search_url '] = url + item[ 'search_lines '] = lines + for line in lines: + if '<h1>' in line: + has_match = True + base_url = url + break + if 'table-hl-header-link' in line or 'movie-link' in line: + line = line[ line.find( '<a' ) : line.find( '</a>' ) + 4 ] + parser = SearchParser( name ) + parser.feed( line ) + parser.close() + + if parser.title is not None: + matches.append( ( parser.title, parser.next_url ) ) + if not has_match and parser.is_match: + has_match = True + item[ 'best_match' ] = (parser.title, parser.next_url) + next_url = parser.next_url + + item[ 'has_match' ] = has_match + item[ 'matches' ] = matches + if not has_match: + print '\t', 'CANNOT RESOLVE MATCHES' + for match in matches: + print '\t', match + else: + if base_url is None: + base_url = 'http://www.rottentomatoes.com' + next_url + reviews_url = base_url + url, lines = urlopen( reviews_url ) + else: + reviews_url = base_url + print '\t', base_url + item[ 'base_url' ] = base_url + + item[ 'reviews_url' ] = reviews_url + item[ 'reviews_lines' ] = lines + for line in lines: + if 'movie-body-text-bold' in line: + reviews_parser = ReviewsParser() + reviews_parser.feed( line ) + reviews_parser.close() + item[ 'rating' ] = reviews_parser.rating + break + + about_url = base_url + 'about.php' + url, lines = urlopen( about_url ) + item[ 'about_url' ] = about_url + item[ 'about_lines' ] = lines + start_line = None + for i, line in enumerate( lines ): + if 'movie-body-text' in line: + start_line = i + if start_line is not None and '</span>' in line: + rest = ''.join( lines[ start_line : i + 1 ] ) + about_parser = AboutParser() + about_parser.feed( rest ) + about_parser.close() + item[ 'summary' ] = about_parser.summary + break + + pickle.dump( item, appfile ) + + return item + +def main( argv = sys.argv ): + global appfile + items = [] + min = 0 + if len( argv ) > 1: + min = int( argv[1] ) + + f = file( 'movies.txt' ) + names = f.readlines() # [ simplify(line) for line in f.xreadlines() ] + f.close() + appfile = file( 'append.txt', 'w' ) + for i, name in enumerate( names ): + if i >= min: # and i == 31: + print i, ':', name + item = lookup( name ) + items.append( item ) + print + appfile.close() + + outfile = file( 'output.txt', 'w' ) + pickle.dump( items, outfile ) + outfile.close() + +if __name__ == '__main__': + sys.exit( main() ) Property changes on: movie-lookup/trunk/oldsrc/get-movie-info.py ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:17:42
|
Revision: 1595 http://assorted.svn.sourceforge.net/assorted/?rev=1595&view=rev Author: yangzhang Date: 2010-04-01 18:17:35 +0000 (Thu, 01 Apr 2010) Log Message: ----------- use single space-delimited file for mappings and a file for the list of files to be processed; reindented Modified Paths: -------------- shell-tools/trunk/src/map-syms.py Modified: shell-tools/trunk/src/map-syms.py =================================================================== --- shell-tools/trunk/src/map-syms.py 2010-04-01 18:16:18 UTC (rev 1594) +++ shell-tools/trunk/src/map-syms.py 2010-04-01 18:17:35 UTC (rev 1595) @@ -1,34 +1,27 @@ -#!/usr/bin/env python -# vim:et:sw=4 - -import common, sys, re - -# TODO add option to switch between regex & literal -# TODO add option to specify the mappings - -def main( argv = sys.argv ): - patternFile = file('pattern') - replaceFile = file('replace') - zipped = zip(patternFile.readlines(), replaceFile.readlines()) - - filePaths = sys.argv[2:] - - for filePath in filePaths: - file = file(filePath, 'r+') - f = file.read() - for pattern, replace in zipped: - pattern = pattern.rstrip() - replace = replace.rstrip() - if pattern == replace: - continue - pattern = r'\b' + re.escape(pattern) + r'\b' -# pattern = r'\b' + pattern + r'\b' - f = re.sub(pattern, - replace, - f) - file.seek(0) - file.write(f) - file.truncate(); - file.close() - -common.run_main() +#!/usr/bin/env python + +import re, sys + +def main(argv): + subs, paths = argv[1], argv[2:] + with open(subs) as f: + subs = [tuple(line.split()) for line in f.read().strip().split('\n')] + for path in paths: + with open(path, 'r+') as f: + cnt = f.read() + for pat, rep in subs: + pat = pat.rstrip() + rep = rep.rstrip() + if pat == rep: + continue + pat = r'\b' + re.escape(pat) + r'\b' + cnt = re.sub(pat, rep, cnt) + f.seek(0) + f.write(cnt) + f.truncate() + f.close() + +if __name__ == '__main__': + sys.exit(main(sys.argv)) + +# vim:et:sw=2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:16:25
|
Revision: 1594 http://assorted.svn.sourceforge.net/assorted/?rev=1594&view=rev Author: yangzhang Date: 2010-04-01 18:16:18 +0000 (Thu, 01 Apr 2010) Log Message: ----------- added local gem prefix for paths Modified Paths: -------------- shell-tools/trunk/src/bash-commons/bashrc.bash Modified: shell-tools/trunk/src/bash-commons/bashrc.bash =================================================================== --- shell-tools/trunk/src/bash-commons/bashrc.bash 2010-04-01 18:15:53 UTC (rev 1593) +++ shell-tools/trunk/src/bash-commons/bashrc.bash 2010-04-01 18:16:18 UTC (rev 1594) @@ -46,7 +46,8 @@ # Back up or restore vars. function reset_var { - local var="$1" orig="ORIG_$var" + local var="$1" + local orig="ORIG_$var" if ! is_declared "$orig" ; then # eval [[ ! \"\$$orig\" ]] ; then eval export $orig=\"\$$var\" else @@ -82,7 +83,7 @@ if [[ "${subdir:0:1}" == / || "$subdir" == '' ]] ; then pieces=( "${pieces[@]}" "$subdir" ) else - pieces=( "${pieces[@]}" {"$USER_PREFIX","$USER_TOAST_PREFIX","$USER_CABAL_PREFIX","$GLOBAL_PREFIX","$GLOBAL_TOAST_PREFIX"}/"$subdir" ) + pieces=( "${pieces[@]}" {"$GEM_PREFIX","$USER_PREFIX","$USER_TOAST_PREFIX","$USER_CABAL_PREFIX","$GLOBAL_PREFIX","$GLOBAL_TOAST_PREFIX"}/"$subdir" ) fi done prepend_var "$var" "${pieces[@]}" @@ -90,6 +91,7 @@ # general +export GEM_PREFIX="$HOME/.gem/ruby/1.8" export USER_PREFIX="$HOME/.local/armed" export USER_PKG="$HOME/.local/pkg" export USER_TOAST_PREFIX="$HOME/.toast/armed" @@ -151,7 +153,8 @@ export PYTHONSTARTUP="$HOME/.pythonrc.py" pythonpath_prepend= -PYTHONVERSION=${PYTHONVERSION:-} +: ${PYTHONVERSION:=} +reset_var PYTHONVERSION if [[ ! "$PYTHONVERSION" ]] && type python >& /dev/null then PYTHONVERSION="$(python-version)" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:16:00
|
Revision: 1593 http://assorted.svn.sourceforge.net/assorted/?rev=1593&view=rev Author: yangzhang Date: 2010-04-01 18:15:53 +0000 (Thu, 01 Apr 2010) Log Message: ----------- don't show error if pkg user doesn't exist Modified Paths: -------------- shell-tools/trunk/src/bash-commons/common.bash Modified: shell-tools/trunk/src/bash-commons/common.bash =================================================================== --- shell-tools/trunk/src/bash-commons/common.bash 2010-04-01 18:13:54 UTC (rev 1592) +++ shell-tools/trunk/src/bash-commons/common.bash 2010-04-01 18:15:53 UTC (rev 1593) @@ -533,7 +533,7 @@ local pkg_user= if [[ "${PKG_USER:-}" ]] ; then pkg_user="$PKG_USER" - elif sudo -u pkg echo -n ; then + elif sudo -u pkg echo -n >& /dev/null ; then pkg_user=pkg else pkg_user=root This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:14:01
|
Revision: 1592 http://assorted.svn.sourceforge.net/assorted/?rev=1592&view=rev Author: yangzhang Date: 2010-04-01 18:13:54 +0000 (Thu, 01 Apr 2010) Log Message: ----------- flush on each printed status Modified Paths: -------------- sandbox/trunk/src/one-off-scripts/tweetrec/tweetrec.py Modified: sandbox/trunk/src/one-off-scripts/tweetrec/tweetrec.py =================================================================== --- sandbox/trunk/src/one-off-scripts/tweetrec/tweetrec.py 2010-04-01 18:12:06 UTC (rev 1591) +++ sandbox/trunk/src/one-off-scripts/tweetrec/tweetrec.py 2010-04-01 18:13:54 UTC (rev 1592) @@ -7,6 +7,7 @@ # on_data's dicts are actually more useful than on_sample's Sample objects. def on_data(self, status): print status, + sys.stdout.flush() with file(os.path.expanduser('~/.tweetrec.auth')) as f: u,p = map(str.rstrip, f.readlines()) Stream(u, p, MySl()).sample() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:12:13
|
Revision: 1591 http://assorted.svn.sourceforge.net/assorted/?rev=1591&view=rev Author: yangzhang Date: 2010-04-01 18:12:06 +0000 (Thu, 01 Apr 2010) Log Message: ----------- added some comments describing the observations Modified Paths: -------------- sandbox/trunk/src/bash/kill-propagation/user.bash Modified: sandbox/trunk/src/bash/kill-propagation/user.bash =================================================================== --- sandbox/trunk/src/bash/kill-propagation/user.bash 2010-04-01 18:11:15 UTC (rev 1590) +++ sandbox/trunk/src/bash/kill-propagation/user.bash 2010-04-01 18:12:06 UTC (rev 1591) @@ -1,5 +1,11 @@ #!/usr/bin/env bash +# user -> wrap1 -> wrap2 -> some-app +# wrap1 exits quickly +# user kills wrap2 +# some-app is left standing +# moral: kill is not propagated to children + pid=$( ./wrap1.bash ) echo sleeping sleep 5 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:11:23
|
Revision: 1590 http://assorted.svn.sourceforge.net/assorted/?rev=1590&view=rev Author: yangzhang Date: 2010-04-01 18:11:15 +0000 (Thu, 01 Apr 2010) Log Message: ----------- added demo of building a windows command-line app for wine Added Paths: ----------- sandbox/trunk/src/win/cmdline/ sandbox/trunk/src/win/cmdline/Makefile sandbox/trunk/src/win/cmdline/main.cpp Copied: sandbox/trunk/src/win/cmdline/Makefile (from rev 1494, sandbox/trunk/src/win/mingw/Makefile) =================================================================== --- sandbox/trunk/src/win/cmdline/Makefile (rev 0) +++ sandbox/trunk/src/win/cmdline/Makefile 2010-04-01 18:11:15 UTC (rev 1590) @@ -0,0 +1,2 @@ +CXX = i586-mingw32msvc-g++ +all: main Property changes on: sandbox/trunk/src/win/cmdline/Makefile ___________________________________________________________________ Added: svn:mergeinfo + Added: sandbox/trunk/src/win/cmdline/main.cpp =================================================================== --- sandbox/trunk/src/win/cmdline/main.cpp (rev 0) +++ sandbox/trunk/src/win/cmdline/main.cpp 2010-04-01 18:11:15 UTC (rev 1590) @@ -0,0 +1,6 @@ +#include <windows.h> +#include <iostream> +using namespace std; +int main(int argc, char **argv) { + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:10:32
|
Revision: 1589 http://assorted.svn.sourceforge.net/assorted/?rev=1589&view=rev Author: yangzhang Date: 2010-04-01 18:10:25 +0000 (Thu, 01 Apr 2010) Log Message: ----------- iomanip demo Modified Paths: -------------- sandbox/trunk/src/cc/iomanip.cc Modified: sandbox/trunk/src/cc/iomanip.cc =================================================================== --- sandbox/trunk/src/cc/iomanip.cc 2010-04-01 18:09:40 UTC (rev 1588) +++ sandbox/trunk/src/cc/iomanip.cc 2010-04-01 18:10:25 UTC (rev 1589) @@ -4,7 +4,8 @@ int main() { for (int i = 0; i < 20; ++i) - cout << hex << setfill('0') << setw(2) << i << ' '; - cout << endl; + cout << hex << setfill('0') << setw(3) << i << ' '; + // the hex formatter does not reset, but the others do. + cout << 20 << endl; return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:09:48
|
Revision: 1588 http://assorted.svn.sourceforge.net/assorted/?rev=1588&view=rev Author: yangzhang Date: 2010-04-01 18:09:40 +0000 (Thu, 01 Apr 2010) Log Message: ----------- fixed build for scala/regex-check-plugin Modified Paths: -------------- sandbox/trunk/src/scala/regex-check-plugin/Makefile Modified: sandbox/trunk/src/scala/regex-check-plugin/Makefile =================================================================== --- sandbox/trunk/src/scala/regex-check-plugin/Makefile 2010-04-01 18:08:53 UTC (rev 1587) +++ sandbox/trunk/src/scala/regex-check-plugin/Makefile 2010-04-01 18:09:40 UTC (rev 1588) @@ -4,6 +4,6 @@ RegexCheck.jar: com/sygneca/regexcheck/RegexCheck.class jar cf $@ com/ scalac-plugin.xml RegexTest.class: RegexTest.scala RegexCheck.jar - scalac -classpath . -Xplugin:RegexCheck.jar $< + scalac -Xplugin:RegexCheck.jar $< clean: rm -rf com/ RegexCheck.jar *.class This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-04-01 18:09:01
|
Revision: 1587 http://assorted.svn.sourceforge.net/assorted/?rev=1587&view=rev Author: yangzhang Date: 2010-04-01 18:08:53 +0000 (Thu, 01 Apr 2010) Log Message: ----------- logger should append by default Modified Paths: -------------- python-commons/trunk/src/commons/log.py Modified: python-commons/trunk/src/commons/log.py =================================================================== --- python-commons/trunk/src/commons/log.py 2010-03-31 02:49:43 UTC (rev 1586) +++ python-commons/trunk/src/commons/log.py 2010-04-01 18:08:53 UTC (rev 1587) @@ -121,7 +121,7 @@ # log to files if do_file and path is not None: - handler = logging.FileHandler( path, 'w' ) + handler = logging.FileHandler( path, 'a' ) handler.setFormatter( formatter ) handler.setLevel( logging.DEBUG ) logging.getLogger( '' ).addHandler( handler ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-03-31 02:49:50
|
Revision: 1586 http://assorted.svn.sourceforge.net/assorted/?rev=1586&view=rev Author: yangzhang Date: 2010-03-31 02:49:43 +0000 (Wed, 31 Mar 2010) Log Message: ----------- added story (orig blog post) to README Modified Paths: -------------- mailing-list-filter/trunk/README Modified: mailing-list-filter/trunk/README =================================================================== --- mailing-list-filter/trunk/README 2010-03-23 20:47:28 UTC (rev 1585) +++ mailing-list-filter/trunk/README 2010-03-31 02:49:43 UTC (rev 1586) @@ -43,6 +43,51 @@ Install the program using the standard `setup.py` program. +Story +----- + +First it was fine. Few msgs. Then OOM. Then wrote disk-based version using +shelf. Ran for way too long. Custom shelf using sqlite. Naive bidirectional +flagging = slow. + +Just make a pass, and whenever you come across a message you sent, then add it +to a set `flagged`, and recursively scan everything it points to. This will +miss things pointing to it, though. + +What if we make a second pass? That doesn't work, because messages may have +been received out of order. + +What if we sort by timestamp? There are no reliable timestamp headers. + +What if we do a topological sort (using buffered repository trees +http://docs.google.com/viewer?a=v&q=cache:ps9Mi3deobAJ:www.learnignorance.com/un/papers/a-curtis-topo-sorting-in-external-memory.pdf+external+topological+graph+sort&hl=en&gl=us&sig=AHIEtbR0xTrytGJ2iKBQoJHGCD8datGXYQ)? +There may be missing references/gaps; not necessarily trees. + +The solution is to patch up these. + +Take advantage of the spatial locality during the scan. + +http://1060.org/blogxter/entry?publicid=4C423C78012A7BEF0C9C6BB33B8E406C&token= + +The Map-Reduce programming model doesn't lend itself well to certain graph +processing tasks---for instance, computing shortest paths requires $n$ MR jobs, +where $n$ is the longest path (though once enough paths have been resolved and +the graph can be pruned to a small-enough size, one can crunch on a smaller +problem). + +Google has a large scale graph processing system called [Pregel], of which +there's not a lot of information. It implements the [Bulk Synchronous +Parallel][BSP] model of computation, where each node does a bunch of work; this +can in turn be implemented in terms of Map-Reduce (even though the Google +project doesn't necessarily do so). [Apache Hama] is the open-source +counterpart to Pregel and builds atop Hadoop. + +[Pregel]: http://googleresearch.blogspot.com/2009/06/large-scale-graph-computing-at-google.html +[BSP]: http://en.wikipedia.org/wiki/Bulk_Synchronous_Parallel +[Apache Hama]: http://incubator.apache.org/hama/ + +http://portal.acm.org/citation.cfm?id=1582716.1582723 + Todo ---- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-03-23 20:47:46
|
Revision: 1585 http://assorted.svn.sourceforge.net/assorted/?rev=1585&view=rev Author: yangzhang Date: 2010-03-23 20:47:28 +0000 (Tue, 23 Mar 2010) Log Message: ----------- added serialization test Added Paths: ----------- sandbox/trunk/src/java/SerializeTest.java Added: sandbox/trunk/src/java/SerializeTest.java =================================================================== --- sandbox/trunk/src/java/SerializeTest.java (rev 0) +++ sandbox/trunk/src/java/SerializeTest.java 2010-03-23 20:47:28 UTC (rev 1585) @@ -0,0 +1,46 @@ + + +import java.io.*; + +class SerializeTest implements Serializable{ + + transient int x; + + private int y; + + public SerializeTest(int a, int b){ + + x = a; + y = b; + + } + + public String toString(){ + + return "{x=" + x + ", y=" + y + "}"; + + } + + public static void main(String[] args) throws Exception{ + + SerializeTest st = new SerializeTest(66, 61); + System.out.println("Before Write := " + st); + + System.out.println("\n Writing SerializeTest object to disk"); + FileOutputStream out = new FileOutputStream("serialized.txt"); + ObjectOutputStream so = new ObjectOutputStream(out); + so.writeObject(st); + so.flush(); + + System.out.println("\n Reading SerializeTest object from disk\n"); + FileInputStream in = new FileInputStream("serialized.txt"); + ObjectInputStream si = new ObjectInputStream(in); + SerializeTest fromdisk = (SerializeTest)si.readObject(); + + /* x will be 0 because it won't be read from disk since transient */ + System.out.println("After Read := " + fromdisk); + + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-03-20 15:48:21
|
Revision: 1584 http://assorted.svn.sourceforge.net/assorted/?rev=1584&view=rev Author: yangzhang Date: 2010-03-20 15:48:07 +0000 (Sat, 20 Mar 2010) Log Message: ----------- added sml modeline Modified Paths: -------------- configs/trunk/src/emacs/yang.el Added Paths: ----------- configs/trunk/src/emacs/sml-modeline.el Added: configs/trunk/src/emacs/sml-modeline.el =================================================================== --- configs/trunk/src/emacs/sml-modeline.el (rev 0) +++ configs/trunk/src/emacs/sml-modeline.el 2010-03-20 15:48:07 UTC (rev 1584) @@ -0,0 +1,1234 @@ +<?xml version="1.0"?> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> +<meta content="Loggerhead/1.17 Python/2.5.2 Bazaar/2.1.0 Paste/1.7.2 PasteDeploy/1.3.3 SimpleTAL/4.1 Pygments/0.9 simplejson/2.0.9" name="generator" /> +<title>~nxhtml/nxhtml/main : contents of util/sml-modeline.el at revision 599</title> +<link href="/static/css/global.css" rel="stylesheet" /> + +<script type="text/javascript"> +var global_path = 'http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/'; +var collapsed_icon_path = '/static/images/treeCollapsed.png'; +var expanded_icon_path = '/static/images/treeExpanded.png'; +</script> +<script src="/static/javascript/yui/build/yui/yui-min.js" type="text/javascript"></script> +<script src="/static/javascript/yui/build/oop/oop-min.js" type="text/javascript"></script> +<script src="/static/javascript/yui/build/event/event-min.js" type="text/javascript"></script> +<script src="/static/javascript/yui/build/attribute/attribute-min.js" type="text/javascript"></script> +<script src="/static/javascript/yui/build/base/base-min.js" type="text/javascript"></script> +<script src="/static/javascript/yui/build/dom/dom-min.js" type="text/javascript"></script> +<script src="/static/javascript/yui/build/node/node-min.js" type="text/javascript"></script> +<script src="/static/javascript/yui/build/anim/anim-min.js" type="text/javascript"></script> +<script src="/static/javascript/yui/build/io/io-base-min.js" type="text/javascript"></script> +<script src="/static/javascript/custom.js" type="text/javascript"></script> + +<link href="/static/css/annotate.css" media="all" type="text/css" rel="stylesheet" /> +<link href="/static/css/highlight.css" media="all" type="text/css" rel="stylesheet" /> + +</head> +<body> + + +<ul id="menuTabs"> + + +<li><a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/changes" title="Changes">Changes</a></li> +<li><a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/files" title="Files" id="on">Files</a></li> +<li><a href="https://help.launchpad.net/Loggerhead" title="Help">Help</a></li> + +</ul> + +<div id="loggerheadCont"> +<div id="search_terms"></div> +<h1> + +<a href="https://code.launchpad.net/~nxhtml/nxhtml/main">~nxhtml/nxhtml/main</a> + + +<span>: <span class="breadcrumb"> +/<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/files/599?file_id=util-20080724174035-zgon4j679232cch3-9">util</a>/sml-modeline.el +</span> (revision 599)</span> +</h1> +<div> + +<ul id="submenuTabs"> +<li id="first"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/files/599">browse files</a> +</li> +<li> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/599">view revision</a> +</li> +<li> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/changes?filter_file_id=smlmodeline.el-20100318165023-n7kkswg6dlq8l6b3-1">view changes to this file</a> +</li> +<li id="last"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/download/head%3A/smlmodeline.el-20100318165023-n7kkswg6dlq8l6b3-1/sml-modeline.el">download file</a> +</li> +</ul> +<div class="annotate"> +<table id="logentries"> +<tr class="logheader"> +<td class="annoLineTit">Line</td> +<td class="annoRevTit">Revision</td> +<td class="annoContTit">Contents</td> +</tr> +<tr class="blueRow1"> +<td class="annoLine"><a id="L1" href="#L1">1</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;; sml-modeline.el --- Show position in a scrollbar like way in mode-line</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L2" href="#L2">2</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L3" href="#L3">3</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; Author: Lennart Borgman (lennart O borgman A gmail O com)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L4" href="#L4">4</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; Created: 2010-03-16 Tue</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L5" href="#L5">5</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/590.1.1" title="590.1.1 by Lennart Borgman, on 18 Mar 2010 16:56 (2010-03-18 16:56:27)">590.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; Version: 0.5</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L6" href="#L6">6</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; Last-Updated: 2010-03-18 Thu</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L7" href="#L7">7</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/590.1.1" title="590.1.1 by Lennart Borgman, on 18 Mar 2010 16:56 (2010-03-18 16:56:27)">590.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; URL: http://bazaar.launchpad.net/~nxhtml/nxhtml/main/annotate/head%3A/util/sml-modeline.el</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L8" href="#L8">8</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; Keywords:</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L9" href="#L9">9</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; Compatibility:</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L10" href="#L10">10</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L11" href="#L11">11</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; Features that might be required by this library:</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L12" href="#L12">12</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L13" href="#L13">13</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/591.1.1" title="591.1.1 by Lennart Borgman, on 18 Mar 2010 19:52 (2010-03-18 19:52:41)">591.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; None</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L14" href="#L14">14</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L15" href="#L15">15</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L16" href="#L16">16</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L17" href="#L17">17</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;; Commentary:</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L18" href="#L18">18</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L19" href="#L19">19</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; Show scrollbar like position indicator in mode line.</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L20" href="#L20">20</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/593.1.1" title="593.1.1 by Lennart Borgman, on 18 Mar 2010 22:21 (2010-03-18 22:21:37)">593.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; See the global minor mode `sml-modeline-mode' for more information.</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L21" href="#L21">21</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L22" href="#L22">22</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; Idea and part of this code is adapted from David Engster's and Drew</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L23" href="#L23">23</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; Adam's code in these mail messages:</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L24" href="#L24">24</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L25" href="#L25">25</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg00523.html</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L26" href="#L26">26</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; http://permalink.gmane.org/gmane.emacs.devel/122038</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L27" href="#L27">27</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L28" href="#L28">28</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L29" href="#L29">29</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L30" href="#L30">30</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;; Change log:</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L31" href="#L31">31</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L32" href="#L32">32</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L33" href="#L33">33</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L34" href="#L34">34</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L35" href="#L35">35</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; This program is free software; you can redistribute it and/or</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L36" href="#L36">36</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; modify it under the terms of the GNU General Public License as</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L37" href="#L37">37</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; published by the Free Software Foundation; either version 3, or</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L38" href="#L38">38</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; (at your option) any later version.</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L39" href="#L39">39</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L40" href="#L40">40</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; This program is distributed in the hope that it will be useful,</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L41" href="#L41">41</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; but WITHOUT ANY WARRANTY; without even the implied warranty of</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L42" href="#L42">42</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L43" href="#L43">43</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; General Public License for more details.</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L44" href="#L44">44</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L45" href="#L45">45</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; You should have received a copy of the GNU General Public License</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L46" href="#L46">46</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; along with this program; see the file COPYING. If not, write to</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L47" href="#L47">47</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L48" href="#L48">48</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; Floor, Boston, MA 02110-1301, USA.</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L49" href="#L49">49</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L50" href="#L50">50</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L51" href="#L51">51</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L52" href="#L52">52</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;; Code:</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L53" href="#L53">53</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L54" href="#L54">54</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;;###autoload</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L55" href="#L55">55</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-p">(</span><span class="pyg-nv">defgroup</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline</span><span class="pyg-"> </span><span class="pyg-no">nil</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L56" href="#L56">56</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/593.1.1" title="593.1.1 by Lennart Borgman, on 18 Mar 2010 22:21 (2010-03-18 22:21:37)">593.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-s">"Customization group for `sml-modeline-mode'."</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L57" href="#L57">57</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-ss">:group</span><span class="pyg-"> </span><span class="pyg-ss">'frames</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L58" href="#L58">58</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L59" href="#L59">59</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/594.1.1" title="594.1.1 by Lennart Borgman, on 19 Mar 2010 00:04 (2010-03-19 00:04:56)">594.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-p">(</span><span class="pyg-nb">defun</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-refresh</span><span class="pyg-"> </span><span class="pyg-p">()</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L60" href="#L60">60</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-s">"Refresh after option changes if loaded."</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L61" href="#L61">61</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">when</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">featurep</span><span class="pyg-"> </span><span class="pyg-ss">'sml-modeline</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L62" href="#L62">62</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">when</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">and</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">boundp</span><span class="pyg-"> </span><span class="pyg-ss">'sml-modeline-mode</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L63" href="#L63">63</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-mode</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L64" href="#L64">64</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">sml-modeline-mode</span><span class="pyg-"> </span><span class="pyg-mi">-1</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L65" href="#L65">65</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">sml-modeline-mode</span><span class="pyg-"> </span><span class="pyg-mi">1</span><span class="pyg-p">))))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L66" href="#L66">66</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L67" href="#L67">67</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-p">(</span><span class="pyg-nv">defcustom</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-len</span><span class="pyg-"> </span><span class="pyg-mi">12</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L68" href="#L68">68</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-s">"Mode line indicator total length."</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L69" href="#L69">69</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-ss">:type</span><span class="pyg-"> </span><span class="pyg-ss">'integer</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L70" href="#L70">70</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/594.1.1" title="594.1.1 by Lennart Borgman, on 19 Mar 2010 00:04 (2010-03-19 00:04:56)">594.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-ss">:set</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">lambda</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">sym</span><span class="pyg-"> </span><span class="pyg-nv">val</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L71" href="#L71">71</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">set-default</span><span class="pyg-"> </span><span class="pyg-nv">sym</span><span class="pyg-"> </span><span class="pyg-nv">val</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L72" href="#L72">72</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">sml-modeline-refresh</span><span class="pyg-p">))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L73" href="#L73">73</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-ss">:group</span><span class="pyg-"> </span><span class="pyg-ss">'sml-modeline</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L74" href="#L74">74</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L75" href="#L75">75</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/594.1.1" title="594.1.1 by Lennart Borgman, on 19 Mar 2010 00:04 (2010-03-19 00:04:56)">594.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-p">(</span><span class="pyg-nv">defcustom</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-borders</span><span class="pyg-"> </span><span class="pyg-no">nil</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L76" href="#L76">76</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-s">"Indicator borders.</span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L77" href="#L77">77</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-s">This is a pair of indicators, like [] or nil."</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L78" href="#L78">78</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-ss">:type</span><span class="pyg-"> </span><span class="pyg-o">'</span><span class="pyg-p">(</span><span class="pyg-nv">choice</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">const</span><span class="pyg-"> </span><span class="pyg-ss">:tag</span><span class="pyg-"> </span><span class="pyg-s">"None"</span><span class="pyg-"> </span><span class="pyg-no">nil</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L79" href="#L79">79</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">cons</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">string</span><span class="pyg-"> </span><span class="pyg-ss">:tag</span><span class="pyg-"> </span><span class="pyg-s">"Left border"</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L80" href="#L80">80</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">string</span><span class="pyg-"> </span><span class="pyg-ss">:tag</span><span class="pyg-"> </span><span class="pyg-s">"Right border"</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L81" href="#L81">81</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/594.1.1" title="594.1.1 by Lennart Borgman, on 19 Mar 2010 00:04 (2010-03-19 00:04:56)">594.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-ss">:set</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">lambda</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">sym</span><span class="pyg-"> </span><span class="pyg-nv">val</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L82" href="#L82">82</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">set-default</span><span class="pyg-"> </span><span class="pyg-nv">sym</span><span class="pyg-"> </span><span class="pyg-nv">val</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L83" href="#L83">83</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">sml-modeline-refresh</span><span class="pyg-p">))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L84" href="#L84">84</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-ss">:group</span><span class="pyg-"> </span><span class="pyg-ss">'sml-modeline</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L85" href="#L85">85</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L86" href="#L86">86</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-p">(</span><span class="pyg-nv">defcustom</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-numbers</span><span class="pyg-"> </span><span class="pyg-ss">'percentage</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L87" href="#L87">87</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-s">"Position number style.</span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L88" href="#L88">88</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-s">This can be 'percentage or 'line-number."</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L89" href="#L89">89</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-ss">:type</span><span class="pyg-"> </span><span class="pyg-o">'</span><span class="pyg-p">(</span><span class="pyg-nv">choice</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">const</span><span class="pyg-"> </span><span class="pyg-ss">:tag</span><span class="pyg-"> </span><span class="pyg-s">"Line numbers"</span><span class="pyg-"> </span><span class="pyg-nv">line-numbers</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L90" href="#L90">90</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">const</span><span class="pyg-"> </span><span class="pyg-ss">:tag</span><span class="pyg-"> </span><span class="pyg-s">"Percentage"</span><span class="pyg-"> </span><span class="pyg-nv">percentage</span><span class="pyg-p">))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L91" href="#L91">91</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-ss">:set</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">lambda</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">sym</span><span class="pyg-"> </span><span class="pyg-nv">val</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L92" href="#L92">92</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">set-default</span><span class="pyg-"> </span><span class="pyg-nv">sym</span><span class="pyg-"> </span><span class="pyg-nv">val</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L93" href="#L93">93</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">sml-modeline-refresh</span><span class="pyg-p">))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L94" href="#L94">94</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-ss">:group</span><span class="pyg-"> </span><span class="pyg-ss">'sml-modeline</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L95" href="#L95">95</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L96" href="#L96">96</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-p">(</span><span class="pyg-nv">defface</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-end-face</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L97" href="#L97">97</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-o">'</span><span class="pyg-p">((</span><span class="pyg-no">t</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-ss">:inherit</span><span class="pyg-"> </span><span class="pyg-nv">match</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L98" href="#L98">98</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-s">"Face for invisible buffer parts."</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L99" href="#L99">99</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-ss">:group</span><span class="pyg-"> </span><span class="pyg-ss">'sml-modeline</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L100" href="#L100">100</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; 'face `(:background ,(face-foreground 'mode-line-inactive)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L101" href="#L101">101</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; :foreground ,(face-background 'mode-line))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L102" href="#L102">102</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L103" href="#L103">103</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/594.1.1" title="594.1.1 by Lennart Borgman, on 19 Mar 2010 00:04 (2010-03-19 00:04:56)">594.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-p">(</span><span class="pyg-nv">defface</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-vis-face</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L104" href="#L104">104</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-o">'</span><span class="pyg-p">((</span><span class="pyg-no">t</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-ss">:inherit</span><span class="pyg-"> </span><span class="pyg-nv">region</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L105" href="#L105">105</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-s">"Face for invisible buffer parts."</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L106" href="#L106">106</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-ss">:group</span><span class="pyg-"> </span><span class="pyg-ss">'sml-modeline</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L107" href="#L107">107</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; 'face `(:background ,(face-foreground 'mode-line)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L108" href="#L108">108</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-c1">;; :foreground ,(face-background 'mode-line))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L109" href="#L109">109</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L110" href="#L110">110</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/594.1.1" title="594.1.1 by Lennart Borgman, on 19 Mar 2010 00:04 (2010-03-19 00:04:56)">594.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-c1">;;(sml-modeline-create)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L111" href="#L111">111</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-p">(</span><span class="pyg-nb">defun</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-create</span><span class="pyg-"> </span><span class="pyg-p">()</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L112" href="#L112">112</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">let*</span><span class="pyg-"> </span><span class="pyg-p">((</span><span class="pyg-nv">wstart</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">window-start</span><span class="pyg-p">))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L113" href="#L113">113</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">wend</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">window-end</span><span class="pyg-p">))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L114" href="#L114">114</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/594.1.1" title="594.1.1 by Lennart Borgman, on 19 Mar 2010 00:04 (2010-03-19 00:04:56)">594.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-nv">number-max</span><span class="pyg-"> </span><span class="pyg-nv">number-beg</span><span class="pyg-"> </span><span class="pyg-nv">number-end</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L115" href="#L115">115</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">sml-begin</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">or</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">car</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-borders</span><span class="pyg-p">)</span><span class="pyg-"> </span><span class="pyg-s">""</span><span class="pyg-p">))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L116" href="#L116">116</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">sml-end</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">or</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">cdr</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-borders</span><span class="pyg-p">)</span><span class="pyg-"> </span><span class="pyg-s">""</span><span class="pyg-p">))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L117" href="#L117">117</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">inner-len</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">-</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-len</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">length</span><span class="pyg-"> </span><span class="pyg-nv">sml-begin</span><span class="pyg-p">)</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">length</span><span class="pyg-"> </span><span class="pyg-nv">sml-end</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L118" href="#L118">118</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-nv">bpad-len</span><span class="pyg-"> </span><span class="pyg-nv">epad-len</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L119" href="#L119">119</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-nv">pos-%</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L120" href="#L120">120</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/594.1.1" title="594.1.1 by Lennart Borgman, on 19 Mar 2010 00:04 (2010-03-19 00:04:56)">594.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-nv">start</span><span class="pyg-"> </span><span class="pyg-nv">end</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L121" href="#L121">121</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-nb">string</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L122" href="#L122">122</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/594.1.1" title="594.1.1 by Lennart Borgman, on 19 Mar 2010 00:04 (2010-03-19 00:04:56)">594.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">if</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">not</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">or</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb"><</span><span class="pyg-"> </span><span class="pyg-nv">wend</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">save-restriction</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">widen</span><span class="pyg-p">)</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">point-max</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L123" href="#L123">123</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">></span><span class="pyg-"> </span><span class="pyg-nv">wstart</span><span class="pyg-"> </span><span class="pyg-mi">1</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow1"> +<td class="annoLine"><a id="L124" href="#L124">124</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/589.1.1" title="589.1.1 by Lennart Borgman, on 18 Mar 2010 16:50 (2010-03-18 16:50:52)">589.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-s">""</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L125" href="#L125">125</a></td> +<td class="annoRev"> +<a href="http://bazaar.launchpad.net/%7Enxhtml/nxhtml/main/revision/594.1.1" title="594.1.1 by Lennart Borgman, on 19 Mar 2010 00:04 (2010-03-19 00:04:56)">594.1.1</a> +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">cond</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L126" href="#L126">126</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">((</span><span class="pyg-nb">eq</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-numbers</span><span class="pyg-"> </span><span class="pyg-ss">'percentage</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L127" href="#L127">127</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">setq</span><span class="pyg-"> </span><span class="pyg-nv">number-max</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">save-restriction</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">widen</span><span class="pyg-p">)</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">point-max</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L128" href="#L128">128</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">setq</span><span class="pyg-"> </span><span class="pyg-nv">number-beg</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">/</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">float</span><span class="pyg-"> </span><span class="pyg-nv">wstart</span><span class="pyg-p">)</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">float</span><span class="pyg-"> </span><span class="pyg-nv">number-max</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L129" href="#L129">129</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">setq</span><span class="pyg-"> </span><span class="pyg-nv">number-end</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">/</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">float</span><span class="pyg-"> </span><span class="pyg-nv">wend</span><span class="pyg-p">)</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">float</span><span class="pyg-"> </span><span class="pyg-nv">number-max</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L130" href="#L130">130</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">setq</span><span class="pyg-"> </span><span class="pyg-nv">start</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">floor</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">*</span><span class="pyg-"> </span><span class="pyg-nv">number-beg</span><span class="pyg-"> </span><span class="pyg-nv">inner-len</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L131" href="#L131">131</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">setq</span><span class="pyg-"> </span><span class="pyg-nv">end</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">floor</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">*</span><span class="pyg-"> </span><span class="pyg-nv">number-end</span><span class="pyg-"> </span><span class="pyg-nv">inner-len</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L132" href="#L132">132</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">setq</span><span class="pyg-"> </span><span class="pyg-nb">string</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L133" href="#L133">133</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">concat</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">format</span><span class="pyg-"> </span><span class="pyg-s">"%02d"</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">round</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">*</span><span class="pyg-"> </span><span class="pyg-nv">number-beg</span><span class="pyg-"> </span><span class="pyg-mi">100</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L134" href="#L134">134</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-s">"-"</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L135" href="#L135">135</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">format</span><span class="pyg-"> </span><span class="pyg-s">"%02d"</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">round</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">*</span><span class="pyg-"> </span><span class="pyg-nv">number-end</span><span class="pyg-"> </span><span class="pyg-mi">100</span><span class="pyg-p">)))</span><span class="pyg-"> </span><span class="pyg-s">"%%"</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L136" href="#L136">136</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">((</span><span class="pyg-nb">eq</span><span class="pyg-"> </span><span class="pyg-nv">sml-modeline-numbers</span><span class="pyg-"> </span><span class="pyg-ss">'line-numbers</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L137" href="#L137">137</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">save-restriction</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L138" href="#L138">138</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">widen</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L139" href="#L139">139</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">setq</span><span class="pyg-"> </span><span class="pyg-nv">number-max</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">line-number-at-pos</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">point-max</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L140" href="#L140">140</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">setq</span><span class="pyg-"> </span><span class="pyg-nv">number-beg</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">line-number-at-pos</span><span class="pyg-"> </span><span class="pyg-nv">wstart</span><span class="pyg-p">))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L141" href="#L141">141</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">setq</span><span class="pyg-"> </span><span class="pyg-nv">number-end</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">line-number-at-pos</span><span class="pyg-"> </span><span class="pyg-nv">wend</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L142" href="#L142">142</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">setq</span><span class="pyg-"> </span><span class="pyg-nv">start</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">floor</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">*</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">/</span><span class="pyg-"> </span><span class="pyg-nv">number-beg</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">float</span><span class="pyg-"> </span><span class="pyg-nv">number-max</span><span class="pyg-p">))</span><span class="pyg-"> </span><span class="pyg-nv">inner-len</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L143" href="#L143">143</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">setq</span><span class="pyg-"> </span><span class="pyg-nv">end</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">floor</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">*</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">/</span><span class="pyg-"> </span><span class="pyg-nv">number-end</span><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">float</span><span class="pyg-"> </span><span class="pyg-nv">number-max</span><span class="pyg-p">))</span><span class="pyg-"> </span><span class="pyg-nv">inner-len</span><span class="pyg-p">)))</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L144" href="#L144">144</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-k">setq</span><span class="pyg-"> </span><span class="pyg-nb">string</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L145" href="#L145">145</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nv">concat</span><span class="pyg-"> </span><span class="pyg-s">"L"</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L146" href="#L146">146</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">format</span><span class="pyg-"> </span><span class="pyg-s">"%02d"</span><span class="pyg-"> </span><span class="pyg-nv">number-beg</span><span class="pyg-p">)</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L147" href="#L147">147</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-s">"-"</span><span class="pyg-"></span></pre></td> +</tr><tr class="blueRow0"> +<td class="annoLine"><a id="L148" href="#L148">148</a></td> +<td class="annoRev"> + +</td> +<td class="annoCont"><pre><span class="pyg-"> </span><span class="pyg-p">(</span><span class="pyg-nb">format</span><span class=... [truncated message content] |
From: <yan...@us...> - 2010-03-18 19:54:52
|
Revision: 1583 http://assorted.svn.sourceforge.net/assorted/?rev=1583&view=rev Author: yangzhang Date: 2010-03-18 19:54:46 +0000 (Thu, 18 Mar 2010) Log Message: ----------- added =>? Modified Paths: -------------- scala-commons/trunk/src/commons/Misc.scala Modified: scala-commons/trunk/src/commons/Misc.scala =================================================================== --- scala-commons/trunk/src/commons/Misc.scala 2010-03-18 19:50:29 UTC (rev 1582) +++ scala-commons/trunk/src/commons/Misc.scala 2010-03-18 19:54:46 UTC (rev 1583) @@ -5,6 +5,11 @@ object Misc { /** + * Shorthand for PartialFunction. May be built in to Scala 2.8. + */ + type =>?[-A, +B] = PartialFunction[A, B] + + /** * @deprecated Use {@link Iterator.from} instead. */ @serializable This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-03-18 19:50:35
|
Revision: 1582 http://assorted.svn.sourceforge.net/assorted/?rev=1582&view=rev Author: yangzhang Date: 2010-03-18 19:50:29 +0000 (Thu, 18 Mar 2010) Log Message: ----------- backup -> personal Modified Paths: -------------- configs/trunk/src/cron/backup.bash Modified: configs/trunk/src/cron/backup.bash =================================================================== --- configs/trunk/src/cron/backup.bash 2010-03-18 19:50:22 UTC (rev 1581) +++ configs/trunk/src/cron/backup.bash 2010-03-18 19:50:29 UTC (rev 1582) @@ -21,7 +21,7 @@ duplicity $args "$1" "scp://hv//export/home/yang/backup-zs.ath.cx/$2" } -run-duplicity ~/personal/ backup +run-duplicity ~/personal/ personal run-duplicity ~/.purple/ purple run-duplicity ~/.xchat2/ xchat run-duplicity ~/.mozilla-thunderbird/r9d4e7vh.default/Mail/'Local Folders'/ \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-03-18 19:50:34
|
Revision: 1581 http://assorted.svn.sourceforge.net/assorted/?rev=1581&view=rev Author: yangzhang Date: 2010-03-18 19:50:22 +0000 (Thu, 18 Mar 2010) Log Message: ----------- renamed yang-xps410 to zs.ath.cx Modified Paths: -------------- configs/trunk/src/synergy.conf Modified: configs/trunk/src/synergy.conf =================================================================== --- configs/trunk/src/synergy.conf 2010-03-18 19:47:05 UTC (rev 1580) +++ configs/trunk/src/synergy.conf 2010-03-18 19:50:22 UTC (rev 1581) @@ -1,23 +1,23 @@ # vim:et:sw=2:ts=2 section: screens - yang-xps410: + zs.ath.cx: harvard.csail.mit.edu: yang-d600: yang-x41t: end section: links - yang-xps410: + zs.ath.cx: left = yang-d600 right = harvard.csail.mit.edu harvard.csail.mit.edu: - left = yang-xps410 + left = zs.ath.cx right = yang-x41t yang-x41t: left = harvard.csail.mit.edu right = yang-d600 yang-d600: left = yang-x41t - right = yang-xps410 + right = zs.ath.cx end section: options screenSaverSync = false This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-03-18 19:47:19
|
Revision: 1580 http://assorted.svn.sourceforge.net/assorted/?rev=1580&view=rev Author: yangzhang Date: 2010-03-18 19:47:05 +0000 (Thu, 18 Mar 2010) Log Message: ----------- reorg/cleanup Modified Paths: -------------- configs/trunk/src/ssh/config Modified: configs/trunk/src/ssh/config =================================================================== --- configs/trunk/src/ssh/config 2010-03-18 19:46:35 UTC (rev 1579) +++ configs/trunk/src/ssh/config 2010-03-18 19:47:05 UTC (rev 1580) @@ -240,6 +240,10 @@ # Misc # +Host oasis + HostName catenova.org + User oasis + Host icfp HostName 128.30.79.174 User knoppix @@ -266,7 +270,7 @@ User root # -# CSAIL +# CSAIL G9 # Host hv @@ -327,14 +331,6 @@ User yang # -# MIT -# - -Host ath - HostName athena.dialup.mit.edu - User y_z - -# # Personal # @@ -395,40 +391,54 @@ HostName nms.csail.mit.edu User yang -Host login.csail.mit.edu svn.csail.mit.edu linerva.mit.edu - GSSAPIAuthentication yes - GSSAPIKeyExchange yes - GSSAPIDelegateCredentials yes +# +# CSAIL +# Host cs HostName login.csail.mit.edu User yang ForwardX11 yes -Host lin - HostName linerva.mit.edu - User y_z - ForwardX11 yes - #GSSAPIDelegateCredentials yes - Host athcs HostName athena.csail.mit.edu User y_z ForwardX11 yes -Host home - HostName zs.ath.cx +# +# MIT +# + +Host yz + HostName yz.xvm.mit.edu User yang + +Host ath + HostName athena.dialup.mit.edu + User y_z + +Host lin + HostName linerva.mit.edu + User y_z ForwardX11 yes +# +# Berkeley +# + Host ocf HostName apocalypse.ocf.berkeley.edu User yangsta -Host oasis - HostName catenova.org - User oasis +# +# KRB +# +Host cs login.csail.mit.edu svn.csail.mit.edu lin linerva.mit.edu + GSSAPIAuthentication yes + GSSAPIKeyExchange yes + GSSAPIDelegateCredentials yes + # # retired, but kept here as a quick reference # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-03-18 19:46:48
|
Revision: 1579 http://assorted.svn.sourceforge.net/assorted/?rev=1579&view=rev Author: yangzhang Date: 2010-03-18 19:46:35 +0000 (Thu, 18 Mar 2010) Log Message: ----------- added git k Modified Paths: -------------- configs/trunk/src/gitconfig Modified: configs/trunk/src/gitconfig =================================================================== --- configs/trunk/src/gitconfig 2010-03-12 07:16:15 UTC (rev 1578) +++ configs/trunk/src/gitconfig 2010-03-18 19:46:35 UTC (rev 1579) @@ -1,18 +1,21 @@ [alias] - b = branch - ci = commit -a - co = checkout + b = branch + ci = commit -a + co = checkout com = commit d = diff - dc = diff --cached - h = help - llog = log --date=local - pr = pull --rebase - st = status + dc = diff --cached + h = help + llog = log --date=local + pr = pull --rebase + st = status sta = stash up = pull + k = log --decorate --oneline --graph [core] - excludesfile = /home/yang/.gitignore + excludesfile = /home/yang/.gitignore [user] - name = Yang Zhang - email = ya...@gm... + name = Yang Zhang + email = ya...@gm... +[merge] + conflictstyle = diff3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2010-03-12 07:16:22
|
Revision: 1578 http://assorted.svn.sourceforge.net/assorted/?rev=1578&view=rev Author: yangzhang Date: 2010-03-12 07:16:15 +0000 (Fri, 12 Mar 2010) Log Message: ----------- imported JdbcInserter from relationalcloud Added Paths: ----------- scala-commons/trunk/src/commons/JdbcInserter.scala Added: scala-commons/trunk/src/commons/JdbcInserter.scala =================================================================== --- scala-commons/trunk/src/commons/JdbcInserter.scala (rev 0) +++ scala-commons/trunk/src/commons/JdbcInserter.scala 2010-03-12 07:16:15 UTC (rev 1578) @@ -0,0 +1,66 @@ +package commons + +import scala.collection.{mutable => mut} + +import Jdbc._ +import Timer._ + +abstract class JdbcInserter[Row](insTemplate: String, rowTemplate: String, conn: java.sql.Connection) { + type Chunk = Seq[Row] + def insert(item: Chunk) = queue put Some(item) + def npar = 10 + def end = { + inserters foreach (_ => queue put None) + inserters map (_()) + } + def fill(ps: RichPreparedStatement, row: Row): RichPreparedStatement + val queue = new java.util.concurrent.LinkedBlockingQueue[Option[Chunk]](1000) + val inserters = 1 to npar map (_ => inserter) + def inserter = scala.concurrent.ops.future { + conn setAutoCommit false + + val batchSize = 1000 + val batchPs = ps2Rich(conn prepareStatement <p> + {insTemplate} values {1 to batchSize map (_ => rowTemplate) mkString ","} + </p>.text) + val singlePs = ps2Rich(conn prepareStatement <p> + {insTemplate} values {rowTemplate} + </p>.text) + + val buf = new mut.ArrayBuffer[Chunk] + + // keep taking chunks off the queue, inserting batchSize at a time + def loop { + var bufLength = 0 + while (true) { + val item = queue.take + if (item == None) return + + buf += item.get + bufLength += item.get.length + + // once we have enough for a batch + if (bufLength >= batchSize) { + val (fst,snd) = buf.flatten splitAt batchSize + + // insert the first 1,000 + for (row <- fst) fill(batchPs, row) + print("inserting...(queue.size " + queue.size + ")") + printTime { batchPs.execute } + conn.commit + + // keep the remainder + buf.clear + buf += snd + bufLength = snd.length + } + } + } + loop + + // insert the leftovers + for (row <- buf.flatten) fill(singlePs, row).addBatch + singlePs.executeBatch + conn.commit + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |