Author: tack
Date: Sat Mar 25 19:40:40 2006
New Revision: 1346
Modified:
trunk/base/src/db.py
Log:
Deprecated ATTR_KEYWORDS_FILENAME and instead added a heuristic to see if the
text to index is a possible filename or not.
Modified: trunk/base/src/db.py
==============================================================================
--- trunk/base/src/db.py (original)
+++ trunk/base/src/db.py Sat Mar 25 19:40:40 2006
@@ -49,7 +49,8 @@
ATTR_INDEXED = 0x02 # Will have an SQL index
ATTR_KEYWORDS = 0x04 # Also indexed for keyword queries
-ATTR_KEYWORDS_FILENAME = 0x100 # Treat as filename for keywords index
+# XXX: deprecated, same as ATTR_KEYWORDS now
+ATTR_KEYWORDS_FILENAME = 0x04 # Treat as filename for keywords index
STOP_WORDS = (
"about", "and", "are", "but", "com", "for", "from", "how", "not",
@@ -923,7 +924,9 @@
if attr_type == str:
text = str_to_unicode(text)
- if flags & ATTR_KEYWORDS_FILENAME:
+ # FIXME: don't hardcode path length; is there a PATH_MAX in python?
+ if len(text) < 255 and re.search("\.\w{2,5}$", text):
+ # Treat
dirname, filename = os.path.split(text)
fname_noext, ext = os.path.splitext(filename)
# Remove the first 2 levels (like /home/user/) and then take
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog