Add API to get the mime types
This commit is contained in:
parent
27a3644dab
commit
98c5c0734e
@ -42,6 +42,7 @@ class Bundle:
|
|||||||
self._name = None
|
self._name = None
|
||||||
self._icon = None
|
self._icon = None
|
||||||
self._service_name = None
|
self._service_name = None
|
||||||
|
self._mime_types = None
|
||||||
self._show_launcher = True
|
self._show_launcher = True
|
||||||
self._valid = True
|
self._valid = True
|
||||||
self._path = path
|
self._path = path
|
||||||
@ -91,6 +92,10 @@ class Bundle:
|
|||||||
self._valid = False
|
self._valid = False
|
||||||
logging.error('%s must specify exec or class' % self._path)
|
logging.error('%s must specify exec or class' % self._path)
|
||||||
|
|
||||||
|
if cp.has_option(section, 'mime_types'):
|
||||||
|
mime_list = cp.get(section, 'show_launcher')
|
||||||
|
self._mime_types = mime_list.strip(';')
|
||||||
|
|
||||||
if cp.has_option(section, 'show_launcher'):
|
if cp.has_option(section, 'show_launcher'):
|
||||||
if cp.get(section, 'show_launcher') == 'no':
|
if cp.get(section, 'show_launcher') == 'no':
|
||||||
self._show_launcher = False
|
self._show_launcher = False
|
||||||
@ -166,6 +171,10 @@ class Bundle:
|
|||||||
"""Get the main Activity class"""
|
"""Get the main Activity class"""
|
||||||
return self._class
|
return self._class
|
||||||
|
|
||||||
|
def get_mime_types(self):
|
||||||
|
"""Get the MIME types supported by the activity"""
|
||||||
|
return self._mime_types
|
||||||
|
|
||||||
def get_show_launcher(self):
|
def get_show_launcher(self):
|
||||||
"""Get whether there should be a visible launcher for the activity"""
|
"""Get whether there should be a visible launcher for the activity"""
|
||||||
return self._show_launcher
|
return self._show_launcher
|
||||||
|
Loading…
Reference in New Issue
Block a user