Skip to content

Commit 7f3cb08

Browse files
committed
Merge branch 'master' of github.com:dsoprea/GDriveFS
2 parents 29c2de2 + 3f83163 commit 7f3cb08

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

gdrivefs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Conf(object):
1919
}}
2020

2121
auth_cache_filepath = None
22-
gd_to_normal_mapping_filepath = '/etc/gdfs/mime_mapping.json'
22+
# gd_to_normal_mapping_filepath = '/etc/gdfs/mime_mapping.json'
2323
extension_mapping_filepath = '/etc/gdfs/extension_mapping.json'
2424
query_decay_intermed_prefix_length = 7
2525
file_jobthread_max_idle_time = 60

gdrivefs/utility.py

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,27 @@
1313
class _DriveUtility(object):
1414
"""General utility functions loosely related to GD."""
1515

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+
# }
3334

3435
# Default extensions for mime-types.
36+
# TODO(dustin): !! Move this to the config directory.
3537
default_extensions = {
3638
'text/plain': 'txt',
3739
'application/vnd.ms-excel': 'xls',
@@ -50,14 +52,15 @@ def __init__(self):
5052
def __load_mappings(self):
5153
# Allow someone to override our default mappings of the GD types.
5254

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.")
6164

6265
# Allow someone to set file-extensions for mime-types, and not rely on
6366
# Python's educated guesses.

0 commit comments

Comments
 (0)