Home | Trees | Indices | Help |
---|
|
1 # -*- encoding: utf-8 -*- 2 ############################################################################## 3 # 4 # ETL system- Extract Transfer Load system 5 # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved 6 # $Id$ 7 # 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. 12 # 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. 17 # 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/>. 20 # 21 ############################################################################## 22 """ 23 This is an ETL Component that writes data to facebook. 24 """ 25 26 from etl.component import component 27 2830 """ 31 This is an ETL Component that writes data to facebook. 32 """ 3361 62 6334 - def __init__(self, facebook_connector, method, domain=[], fields=['name'], name='component.input.facebook_out', transformer=None, row_limit=0):35 super(facebook_out, self).__init__(name=name, connector=facebook_connector, transformer=transformer, row_limit=row_limit) 36 self._type = 'component.output.facebook_out' 37 self.method = method 38 self.domain = domain 39 self.fields = fields40 4446 super(facebook_out, self).end() 47 if self.facebook: 48 self.connector.close(self.facebook) 49 self.facebook = False50 5165 from etl_test import etl_test 66 import etl 67 facebook_conn = etl.connector.facebook_connector('http://facebook.com', 'modiinfo@gmail.com') 68 test = etl_test.etl_component_test(facebook_out(facebook_conn, 'set_events', name='facebook test')) 69 test.check_output([{'id': 'event2', 'name': 'mustufa'}], 'main') 70 test.check_input({'main': [{'id': 'event2', 'name': 'mustufa'}]}) 71 res = test.output() 72 print res73 74 if __name__ == '__main__': 75 test() 76
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Wed Apr 29 20:37:24 2009 | http://epydoc.sourceforge.net |