File: __init__.py

package info (click to toggle)
egenix-mx-base 2.0.6-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,028 kB
  • ctags: 4,762
  • sloc: ansic: 14,965; python: 11,739; sh: 313; makefile: 117
file content (35 lines) | stat: -rw-r--r-- 983 bytes parent folder | download | duplicates (3)
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
""" mxTextTools - A tools package for fast text processing.

    Copyright (c) 2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
    Copyright (c) 2000-2001, eGenix.com Software GmbH; mailto:info@egenix.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 _BMS(match,translate):
    return BMS(match,translate)
def _FS(match,translate):
    return FS(match,translate)

# Module init
class modinit:

    ### Register the two types
    import copy_reg
    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