Home | Trees | Indices | Help |
---|
|
1 ############################################################################## 2 # 3 # Copyright (c) 2007 ISrg (NSI, CEFETCAMPOS, BRAZIL) and Contributors. 4 # All Rights Reserved. 5 # 6 # WARNING: This program as such is intended to be used by professional 7 # programmers who take the whole responsability of assessing all potential 8 # consequences resulting from its eventual inadequacies and bugs 9 # End users who are looking for a ready-to-use solution with commercial 10 # garantees and support are strongly adviced to contract a Free Software 11 # Service Company 12 # 13 # This program is Free Software; you can redistribute it and/or 14 # modify it under the terms of the GNU General Public License 15 # as published by the Free Software Foundation; either version 2 16 # of the License, or (at your option) any later version. 17 # 18 # This program is distributed in the hope that it will be useful, 19 # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 # GNU General Public License for more details. 22 # 23 # You should have received a copy of the GNU General Public License 24 # along with this program; if not, write to the Free Software 25 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 26 # 27 ############################################################################## 28 29 import mimetypes 30 from StringIO import StringIO 3133 """ 34 This class is used for file handling 35 """7837 """ 38 Sets the filename and the file content 39 """ 40 self.setFilename(filename) 41 self.setData(data)4244 """ 45 Should be used getData instead of __call___ 46 For this object, call is useless. 47 """ 48 return self.getData()49 5254 """ 55 Set Filename and extract MimeType document 56 """ 57 self.filename = filename 58 self.mimetype = mimetypes.guess_type(filename)[0]59 6062 return self.data6365 """ 66 Set Data as a StringIO 67 """ 68 if isinstance(data,StringIO): 69 self.data = data 70 else: 71 self.data = StringIO(str(data))72 75
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Jun 2 15:41:54 2016 | http://epydoc.sourceforge.net |