# HG changeset patch # User drewp@bigasterisk.com # Date 1465697548 0 # Node ID a7de122a7b18c1cdd1cf3d220173f9bfc43bade3 # Parent bd1d03349b9a8ebabfbb6afe047a015d107ce63d clients were reading this file a LOT. Probably not a performance issue, but distracting in strace output Ignore-this: 180916361bbcc3b0e3a4fe82bda0990a diff -r bd1d03349b9a -r a7de122a7b18 light9/showconfig.py --- a/light9/showconfig.py Sun Jun 12 01:57:00 2016 +0000 +++ b/light9/showconfig.py Sun Jun 12 02:12:28 2016 +0000 @@ -28,9 +28,13 @@ "LIGHT9_SHOW env variable has not been set to the show root") return r +_showUri = None def showUri(): """Return the show URI associated with $LIGHT9_SHOW.""" - return URIRef(file(path.join(root(), 'URI')).read().strip()) + global _showUri + if _showUri is None: + _showUri = URIRef(file(path.join(root(), 'URI')).read().strip()) + return _showUri def songOnDisk(song): """given a song URI, where's the on-disk file that mpd would read?"""