Commits

Thomas Waldmann committed a4db041

fixes mimetypes read from registry issue on windows, thanks to Nick Rioux

Comments (0)

Files changed (2)

MoinMoin/util/_tests/test_mimetype.py

         ('.pdf',             'application/pdf'),
         ('.txt',             'text/plain'),
         ('.jpeg',            'image/jpeg'),
+        ('.png',             'image/png'),
+        ('.svg',             'image/svg+xml'),
         ('',                 'application/octet-stream')
         ]
 

MoinMoin/util/mimetype.py

 
 from MoinMoin import config
 
+# prevents unexpected results on Windows
+# see http://bugs.python.org/issue10551
+mimetypes.init(mimetypes.knownfiles)
 
 MIMETYPES_MORE = {
  # OpenOffice 2.x & other open document stuff
  '.rst': 'text/x-rst',
  '.flv': 'video/x-flv',
  '.wmv': 'video/x-ms-wmv',
+ '.wma': 'audio/x-ms-wma',
  '.swf': 'application/x-shockwave-flash',
  '.awd': 'application/x-anywikidraw',
  '.twd': 'application/x-twikidraw',
  '.moin': 'text/x.moin.wiki',
  '.creole': 'text/x.moin.creole',
  '.mediawiki': 'text/x-mediawiki',
+ '.ico': 'image/x-icon',
+ '.svg': 'image/svg+xml'
 }
 
 # add all mimetype patterns of pygments