/usr/share/pyshared/simpleparse/stt/TextTools/__init__.py is in python-simpleparse 2.1.0a1-6build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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 59 60 61 | """ mxTextTools - A tools package for fast text processing.
Copyright (c) 2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
Copyright (c) 2000-2003, eGenix.com Software GmbH; mailto:info@egenix.com
Copyright (c) 2003-2006, Mike Fletcher; mailto:mcfletch@vrplumber.com
See the documentation for further information on copyrights,
or contact the author. All Rights Reserved.
"""
from TextTools import *
from TextTools import __version__
### Make the types pickleable:
# Shortcuts for pickle (reduces the pickle's length)
def _CS(definition):
return CharSet(definition)
def _TT(definition):
return TagTable(definition)
def _TS(match,translate,algorithm):
return TextSearch(match,translate,algorithm)
# Needed for backward compatibility:
def _BMS(match,translate):
return BMS(match,translate)
def _FS(match,translate):
return FS(match,translate)
# Module init
class modinit:
### Register the types
import copy_reg
def pickle_CharSet(cs):
return _CS,(cs.definition,)
def pickle_TagTable(tt):
return _TT,(tt.compiled(),)
def pickle_TextSearch(ts):
return _TS,(ts.match, ts.translate, ts.algorithm)
copy_reg.pickle(CharSetType,
pickle_CharSet,
_CS)
copy_reg.pickle(TagTableType,
pickle_TagTable,
_TT)
copy_reg.pickle(TextSearchType,
pickle_TextSearch,
_TS)
if 0:
def pickle_BMS(so):
return _BMS,(so.match,so.translate)
def pickle_FS(so):
return _FS,(so.match,so.translate)
copy_reg.pickle(BMSType,
pickle_BMS,
_BMS)
copy_reg.pickle(FSType,
pickle_FS,
_FS)
del modinit
|