/[packages]/updates/1/transifex/current/SOURCES/python-magic.diff
ViewVC logotype

Annotation of /updates/1/transifex/current/SOURCES/python-magic.diff

Parent Directory Parent Directory | Revision Log Revision Log


Revision 214156 - (hide annotations) (download)
Fri Feb 24 20:48:02 2012 UTC (9 years, 7 months ago) by misc
File size: 1070 byte(s)
update the patch, fixing #4499

1 misc 80861 Index: ./transifex/storage/models.py
2     ===================================================================
3     --- ./transifex/storage/models.py
4     +++ ./transifex/storage/models.py 2011-03-24 17:25:44.947065584 +0100
5     @@ -113,10 +113,18 @@
6     """
7     Try to parse the file and fill in information fields in current model
8     """
9     + # this try to guess the API of the magic module, between
10     + # the one from file and the other one from python-magic
11     + try:
12     + m = magic.Magic(mime=True)
13     + # guess mimetype and remove charset
14     + self.mime_type = m.from_file(self.get_storage_path())
15 misc 214156 + except (TypeError, AttributeError):
16 misc 80861 + m = magic.open(magic.MAGIC_NONE)
17     + m.load()
18     + self.mime_type = m.file(self.get_storage_path())
19     + m.close()
20    
21     - m = magic.Magic(mime=True)
22     - # guess mimetype and remove charset
23     - self.mime_type = m.from_file(self.get_storage_path())
24     self.save()
25    
26     parser = self.find_parser()

  ViewVC Help
Powered by ViewVC 1.1.28