Overview
Comment: | database dumping integrated |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
ae30851739a8a5fb1fa819b3dec18aae |
User & Date: | c.kworr@d4daf22a-8aaf-11de-a64d-234b64dd91b4 on 2010-08-12 21:23:06.000 |
Other Links: | branch diff | manifest | tags |
Context
2010-08-12
| ||
21:24 | forget to remove broken label from kqueue check-in: a93ad7cabc user: c.kworr@d4daf22a-8aaf-11de-a64d-234b64dd91b4 tags: master, trunk | |
21:23 | database dumping integrated check-in: ae30851739 user: c.kworr@d4daf22a-8aaf-11de-a64d-234b64dd91b4 tags: master, trunk | |
2010-08-09
| ||
16:37 | some kqueue logic changes, now input stream is flushed from kqueue when eof was found check-in: ae1c0114c1 user: c.kworr@d4daf22a-8aaf-11de-a64d-234b64dd91b4 tags: master, trunk | |
Changes
Modified squid-tagger.py
from [912ca3b436]
to [71dc532cd2].
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | #!/usr/bin/env python3.1 |
︙ | |||
21 22 23 24 25 26 27 | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | - + - + + + + + + + + + | def notice(self, message): if self._syslog: self._syslog.syslog(self._syslog.LOG_NOTICE, message) # wrapper around database class tagDB: |
︙ | |||
100 101 102 103 104 105 106 107 108 109 110 111 112 113 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | + + | self.check(line) # threaded checking facility class CheckerThread(Checker): __slots__ = frozenset(['_lock', '_lock_exit', '_lock_queue', '_queue']) def __init__(self): import _thread # basic initialisation Checker.__init__(self) # Spin lock. Loop acquires it on start then releases it when holding queue # lock. This way the thread proceeds without stops while queue has data and # gets stalled when no data present. The lock is released by queue writer # after storing something into the queue |
︙ | |||
224 225 226 227 228 229 230 | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | - + + + + + + - + - + - + | def process(self, id, site, ip_address, url_path, line): # simply adding data to the queue self._queue.append((id, site, ip_address, url_path)) self._log.info('request {} queued ({})\n'.format(id, line)) # this classes processes config file and substitutes default values class Config: |
︙ | |||
273 274 275 276 277 278 279 | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | + + + + + + + + + + + + + - - - - - - - + + + + + + + - + | else: self._config.set(self._section, name, None) return(self._config.get(self._section, name)) # initializing and reading in config file config = Config() if config.options.dump: # dumping database import csv tagdb = tagDB() csv_writer = csv.writer(sys.stdout) csv_writer.writerow(['site', 'tags', 'regexp']) for row in tagdb.dump(): csv_writer.writerow([row[0], '{' + ','.join(row[1]) + '}', row[2]]) else: # main loop |
Deleted st-dump.py version [9360d0ecb7].