File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44# Distributed under the terms of the Modified BSD License.
55import json
66import os
7- import re
87
98try :
109 import cPickle as pickle
@@ -100,12 +99,6 @@ def _convert_timestamp(s):
10099 return ensure_timezone (dateutil_parse (s ))
101100
102101
103- def _regexp (expr , item ):
104- """sqlite callback function for performing a regex operation"""
105- reg = re .compile (expr )
106- return reg .match (item ) is not None
107-
108-
109102# -----------------------------------------------------------------------------
110103# SQLiteDB class
111104# -----------------------------------------------------------------------------
@@ -279,7 +272,6 @@ def _init_db(self):
279272 # isolation_level = None)#,
280273 cached_statements = 64 ,
281274 )
282- self ._db .create_function ("REGEXP" , 2 , _regexp )
283275 # print dir(self._db)
284276 first_table = previous_table = self .table
285277 i = 0
Original file line number Diff line number Diff line change @@ -173,20 +173,6 @@ def test_find_records_glob(self):
173173 found = [r ['msg_id' ] for r in recs ]
174174 assert set (ref ) == set (found )
175175
176- # hist = self.db.get_history()
177- #
178- # pattern = "*" + hist[0][5:-2] + "_?"
179- # ref = [msg_id for msg_id in hist if fnmatch.fnmatch(msg_id, pattern)]
180- # recs = self.db.find_records({'msg_id': {'$glob': pattern}}, ["msg_id"])
181- # found = [r['msg_id'] for r in recs]
182- # assert set(ref) == set(found)
183- #
184- # pattern = "*_1?"
185- # ref = [msg_id for msg_id in hist if fnmatch.fnmatch(msg_id, pattern)]
186- # recs = self.db.find_records({'msg_id': {'$glob': pattern}}, ["msg_id"])
187- # found = [r['msg_id'] for r in recs]
188- # assert set(ref) == set(found)
189-
190176 def test_get_history (self ):
191177 msg_ids = self .db .get_history ()
192178 latest = datetime (1984 , 1 , 1 ).replace (tzinfo = utc )
You can’t perform that action at this time.
0 commit comments