# Path: sofine/plugins/plugin_base.py
# class PluginBase(object):
#     def __init__(self):
#     def get_adds_keys(self):
#     def parse_args(self, argv):
#     def get_schema(self, args=None):
#     def get_namespaced_schema(self):


from sofine.plugins import plugin_base as plugin_base
from optparse import OptionParser
import json



def get_keys(path):
    """
* `path` - `string`. The path to the file_source configuration file

Retrieves a set of keys found in the file named in the `path` arg.
Keys must be written in a valid JSON object, which has a single key 
`keys` and a JSON array of valid JSON values for keys.  

    // Example 
    {"keys" : ["AAPL", "MSFT"]}

Provided as a helper to the plugin class and also as a convenience for clients 
to retrieve the keys found in a given file at `path.` A common use case might be to 
store a list of keys at `path` and start a chained sofine call with the call to 
`file_source` to retrieve a static set of keys to then pass to other plugins that 
don't add keys themselves but just retrieve attributes for the keys passed to them.
"""
    file_source_json = None
    with open(path) as f:
        file_source_json = json.load(f)
    return file_source_json['keys']



# Path: sofine/plugins/plugin_base.py
# class PluginBase(object):
#     def __init__(self):
#     def get_adds_keys(self):
#     def parse_args(self, argv):
#     def get_schema(self, args=None):
#     def get_namespaced_schema(self):


# Path: sofine/plugins/standard/file_source.py
from sofine.plugins import plugin_base as plugin_base
from optparse import OptionParser
import json




def get_keys(path):
    """
* `path` - `string`. The path to the file_source configuration file

Retrieves a set of keys found in the file named in the `path` arg.
Keys must be written in a valid JSON object, which has a single key 
`keys` and a JSON array of valid JSON values for keys.  

    // Example 
    {"keys" : ["AAPL", "MSFT"]}

Provided as a helper to the plugin class and also as a convenience for clients 
to retrieve the keys found in a given file at `path.` A common use case might be to 
store a list of keys at `path` and start a chained sofine call with the call to 
`file_source` to retrieve a static set of keys to then pass to other plugins that 
don't add keys themselves but just retrieve attributes for the keys passed to them.
"""
    file_source_json = None
    with open(path) as f:
        file_source_json = json.load(f)
    return file_source_json['keys']



class FileSource(plugin_base.PluginBase):