13
13
class _DriveUtility (object ):
14
14
"""General utility functions loosely related to GD."""
15
15
16
- # Mime-types to translate to, if they appear within the "exportLinks" list.
17
- gd_to_normal_mime_mappings = {
18
- 'application/vnd.google-apps.document' :
19
- 'text/plain' ,
20
- 'application/vnd.google-apps.spreadsheet' :
21
- 'application/vnd.ms-excel' ,
22
- 'application/vnd.google-apps.presentation' :
23
- 'application/vnd.ms-powerpoint' ,
24
- 'application/vnd.google-apps.drawing' :
25
- 'application/pdf' ,
26
- 'application/vnd.google-apps.audio' :
27
- 'audio/mpeg' ,
28
- 'application/vnd.google-apps.photo' :
29
- 'image/png' ,
30
- 'application/vnd.google-apps.video' :
31
- 'video/x-flv'
32
- }
16
+ # # Mime-types to translate to, if they appear within the "exportLinks" list.
17
+ # gd_to_normal_mime_mappings = {
18
+ # 'application/vnd.google-apps.document':
19
+ # 'text/plain',
20
+ # 'application/vnd.google-apps.spreadsheet':
21
+ # 'application/vnd.ms-excel',
22
+ # 'application/vnd.google-apps.presentation':
23
+ #/gd_to_normal_mime_mappings
24
+ # 'application/vnd.ms-powerpoint',
25
+ # 'application/vnd.google-apps.drawing':
26
+ # 'application/pdf',
27
+ # 'application/vnd.google-apps.audio':
28
+ # 'audio/mpeg',
29
+ # 'application/vnd.google-apps.photo':
30
+ # 'image/png',
31
+ # 'application/vnd.google-apps.video':
32
+ # 'video/x-flv'
33
+ # }
33
34
34
35
# Default extensions for mime-types.
36
+ # TODO(dustin): !! Move this to the config directory.
35
37
default_extensions = {
36
38
'text/plain' : 'txt' ,
37
39
'application/vnd.ms-excel' : 'xls' ,
@@ -50,14 +52,15 @@ def __init__(self):
50
52
def __load_mappings (self ):
51
53
# Allow someone to override our default mappings of the GD types.
52
54
53
- gd_to_normal_mapping_filepath = \
54
- gdrivefs .conf .Conf .get ('gd_to_normal_mapping_filepath' )
55
-
56
- try :
57
- with open (gd_to_normal_mapping_filepath , 'r' ) as f :
58
- self .gd_to_normal_mime_mappings .extend (json .load (f ))
59
- except IOError :
60
- _logger .info ("No mime-mapping was found." )
55
+ # TODO(dustin): Isn't actually used, so commenting.
56
+ # gd_to_normal_mapping_filepath = \
57
+ # gdrivefs.conf.Conf.get('gd_to_normal_mapping_filepath')
58
+ #
59
+ # try:
60
+ # with open(gd_to_normal_mapping_filepath, 'r') as f:
61
+ # self.gd_to_normal_mime_mappings.extend(json.load(f))
62
+ # except IOError:
63
+ # _logger.info("No mime-mapping was found.")
61
64
62
65
# Allow someone to set file-extensions for mime-types, and not rely on
63
66
# Python's educated guesses.
0 commit comments