Author: poeml Date: Tue Mar 20 22:15:35 2012 New Revision: 8258 URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8258&view=rev Log: mb mirrorlist: - make it work with wildcards in the path names (which are defined via 'mb markers -e'). Very nice improvement, thanks to idea and patch from Stephan Jauernick. Modified: trunk/mb/mb/files.py Modified: trunk/mb/mb/files.py URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mb/mb/files.py?rev=8258&r1=8257&r2=8258&view=diff ============================================================================== --- trunk/mb/mb/files.py (original) +++ trunk/mb/mb/files.py Tue Mar 20 22:15:35 2012 _at_@ -8,16 +8,14 @@ path can contain wildcards, which will result in a LIKE match. """ if path.find('*') >= 0 or path.find('%') >= 0: - pattern = True oprtr = 'like' path = path.replace('*', '%') else: - pattern = False oprtr = '=' - query = "SELECT mirr_hasfile_byname(%s, '%s')" \ - % (mirror_id, path) - result = conn.Server._connection.queryAll(query)[0][0] + query = "SELECT path FROM filearr WHERE path %s '%s' AND %s = ANY(mirrors)" \ + % (oprtr, path, mirror_id) + result = conn.Server._connection.queryAll(query) return result _______________________________________________ mirrorbrain-commits mailing list Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/ Note: To remove yourself from this list, send a mail with the content unsubscribe to the address mirrorbrain-commits-request_at_mirrorbrain.orgReceived on Tue Mar 20 2012 - 21:15:38 GMT
This archive was generated by hypermail 2.3.0 : Tue Mar 20 2012 - 21:17:03 GMT