Author: tack
Date: Wed Aug 22 19:13:12 2007
New Revision: 2783
Log:
Support ~ and env var substitution (either $ENV or ${ENV}). Breaks the
form $(ENV) though, but that was a silly form to begin with.
Modified:
trunk/beacon/src/server/config.cxml
trunk/beacon/src/server/server.py
Modified: trunk/beacon/src/server/config.cxml
==============================================================================
--- trunk/beacon/src/server/config.cxml (original)
+++ trunk/beacon/src/server/config.cxml Wed Aug 22 19:13:12 2007
@@ -4,7 +4,9 @@
<list name="monitors" default="True">
<desc lang="en">
- List of directories to monitor, e.g.
+ List of directories to monitor. Paths can contain environment
variables
+ in the form $ENV or ${ENV}, and tidle (~) will be expanded to home
+ directory. e.g.
monitors[0] = /media/mp3
monitors[1] = $(HOME)/mp3
</desc>
Modified: trunk/beacon/src/server/server.py
==============================================================================
--- trunk/beacon/src/server/server.py (original)
+++ trunk/beacon/src/server/server.py Wed Aug 22 19:13:12 2007
@@ -158,8 +158,7 @@
self._db.commit()
for dir in config.monitors:
- # FIXME: make this make generic
- self.monitor_dir(dir.replace('$(HOME)', os.environ.get('HOME')))
+ self.monitor_dir(os.path.expandvars(os.path.expanduser(dir)))
# -------------------------------------------------------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog