Beispiel #1
0
 def get_plugin_info(self, filename):
     '''
     Will get the main & version information from the plugin and will
     query BukGet to look for a match.  If we do find a match we will add
     the plugin to your list of managed plugins within baskit.
     '''
     return api.search({
         'field': 'versions.md5', 
         'action': '=',
         'value': self.hash_file(filename)
     })
Beispiel #2
0
 def do_search(self, s):
     '''search [search_string]
     Searches for a given plugin name.
     '''
     results = api.search({
         'field': 'plugin_name', 
         'action': 'like',
         'value': s
     })
     print '%-20s %-20s %s' % ('Plugin Name', 'Install Name', 'Description')
     print '%s %s %s' % ('-' * 20, '-' * 20, '-' * 38)
     print '\n'.join(['%-20s %-20s %s' % (p['plugin_name'], p['slug'], p['description']) for p in results])
Beispiel #3
0
def search(*filters, **query):
    '''Searching the API.
    This function is only utilizing the POST searching and is expecting properly
    ftted search dictionaries.  Also all of the same query variables as is
    described in the API3 docs will work here as well.
    '''
    plugins = []
    query['fields'] = ['-nonexistant',]
    result = api.search(*filters, **query)
    if result is None: return None
    for plugin in result:
        plugins.append(Plugin(plugin))
    return plugins
Beispiel #4
0
def search(*filters, **query):
    '''Searching the API.
    This function is only utilizing the POST searching and is expecting
    properly fitted search dictionaries.  Also all of the same query variables
    as is described in the API3 docs will work here as well.
    '''
    plugins = []
    query['fields'] = [
        '-nonexistant',
    ]
    result = api.search(*filters, **query)
    if result is None:
        return None
    for plugin in result:
        plugins.append(Plugin(plugin))
    return plugins