Пример #1
0
    def call_custom_script(self, name, params = ''):
        data_dir = generic_utility.data_dir()
        if not generic_utility.windows():
            bash = 'sh '
            ending = '.sh'
            double_quotes = ''
        else:
            bash = ''
            ending = '.cmd'
            double_quotes = '"'
        custom_script = data_dir + 'custom' + os.sep + name + ending

        if generic_utility.windows():
            custom_script = custom_script.replace('/','\\')

#        generic_utility.log('custom: '+custom_script)
        if os.path.isfile(custom_script):
            generic_utility.debug('calling: '+custom_script)
            if params != '':
                params = ' '+params
            if generic_utility.darwin():
                custom_script = generic_utility.sh_escape(custom_script)
            else:
                custom_script = double_quotes+custom_script+double_quotes

            self.call_script(bash+custom_script+params)
            return True

        return False
Пример #2
0
    def call_custom_script(self, name, params=''):
        data_dir = generic_utility.data_dir()
        if not generic_utility.windows():
            bash = 'sh '
            ending = '.sh'
            double_quotes = ''
        else:
            bash = ''
            ending = '.cmd'
            double_quotes = '"'
        custom_script = data_dir + 'custom' + os.sep + name + ending

        if generic_utility.windows():
            custom_script = custom_script.replace('/', '\\')

#        generic_utility.log('custom: '+custom_script)
        if os.path.isfile(custom_script):
            generic_utility.debug('calling: ' + custom_script)
            if params != '':
                params = ' ' + params
            if generic_utility.darwin():
                custom_script = generic_utility.sh_escape(custom_script)
            else:
                custom_script = double_quotes + custom_script + double_quotes

            self.call_script(bash + custom_script + params)
            return True

        return False
Пример #3
0
def addon():
    dialog = xbmcgui.Dialog()
    if dialog.yesno(generic_utility.addon_name + ':', generic_utility.get_string(30307)):
        try:
            xbmcvfs.rmdir(generic_utility.data_dir(), force=True)
            generic_utility.log('Addon userdata folder deleted.')
            generic_utility.notification(generic_utility.get_string(30308))
        except Exception:
            pass
Пример #4
0
def addon():
    dialog = xbmcgui.Dialog()
    if dialog.yesno(generic_utility.addon_name + ':',
                    generic_utility.get_string(30307)):
        try:
            xbmcvfs.rmdir(generic_utility.data_dir(), force=True)
            generic_utility.log('Addon userdata folder deleted.')
            generic_utility.notification(generic_utility.get_string(30308))
        except Exception:
            pass