1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# ETL system- Extract Transfer Load system
5
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, either version 3 of the License, or
11
# (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
##############################################################################
25
Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
26
GNU General Public License.
28
from etl import signal
30
class connector(signal):
32
Base class of ETL Connector.
35
def __init__(self,name='connector'):
38
name : Name of the connector.
40
self._type = 'connector'
41
super(connector, self).__init__()
42
self.name = name or ''
46
res = connector(name=self.name)
50
return '<Connector name = "%s" type = "%s">'%(self.name, self._type)
52
def __getstate__(self):
53
return {'name' : self.name, 'status': self.status , '_type' :self._type}
55
def __setstate__(self, state):
60
self.signal('open', {'date': datetime.datetime.today()})
62
def close(self, connector=False):
65
connector : Connector that is to be closed.
68
self.signal('close', {'date': datetime.datetime.today()})