Changeset 2875
- Timestamp:
- 12/06/13 13:21:08 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/selector.py
r2874 r2875 204 204 def set_msselection_field(self, selection): 205 205 """ 206 Set a field selection in msselection syntax. The msselection 207 suppports the following syntax: 208 209 pattern match: 210 - UNIX style pattern match for source name using '*' 211 (compatible with set_name) 212 213 field id selection: 214 - simple number in string ('0', '1', etc.) 215 - range specification using '~' ('0~1', etc.) 216 - range specification using '>' or '<' in combination 217 with '=' ('>=1', '<3', etc.) 218 219 comma separated multiple selection: 220 - selections can be combined by using ',' ('0,>1', 221 'mysource*,2~4', etc.) 206 222 """ 207 223 selection_list = map(string.strip, selection.split(',')) 208 224 query_list = list(self.generate_query(selection_list)) 209 query = 'SELECT FROM $1 WHERE ' + ' || '.join(query_list) 210 self._settaql(query) 225 if len(query_list) > 0: 226 query = 'SELECT FROM $1 WHERE ' + ' || '.join(query_list) 227 self._settaql(query) 211 228 212 229 def generate_query(self, selection_list): … … 217 234 a = FieldIdRegexGenerator(s) 218 235 yield '(%s)'%(a.get_regex()) 219 el se:236 elif len(s) > 0: 220 237 #print '"%s" is UNIX style pattern match'%(s) 221 238 yield '(SRCNAME == pattern(\'%s\'))'%(s)
Note:
See TracChangeset
for help on using the changeset viewer.