# 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):


import logging
import os
import re
import sys
import mechanize
from urllib2 import HTTPError
from optparse import OptionParser
from bs4 import BeautifulSoup
from sofine.plugins import plugin_base as plugin_base
                if ticker_str:
                    ticker_str = ticker_str.strip()
                    if ticker_str != 'News':
                        ticker = ticker_str
            # Second cell in the row has the short and full description
            desc_elem = elem.find(attrs={'id' : 'fullDesc'})
            if desc_elem and len(desc_elem.contents):
                desc_str = None
                # Sometimes this has an anchor tag etc., but only if it's a row
                #  with cash or something else that doesn't have a ticket
                # So try to get string and we will be able to if there is a ticker
                try:
                    desc_str = desc_elem.contents[0].string
                except:
                    pass
                if desc_str:
                    description = desc_str
       
        if ticker:
            position_data[ticker] = \
                {
                    'description' : description, 
                    'quantity' : quantity,
                    'change_since_purchase' : change_since_purchase,
                    'change_since_purchase_pct' : change_since_purchase_pct
                }

    return position_data



# 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/example/fidelity.py
import logging
import os
import re
import sys
import mechanize
from urllib2 import HTTPError
from optparse import OptionParser
from bs4 import BeautifulSoup
from sofine.plugins import plugin_base as plugin_base

                if ticker_str:
                    ticker_str = ticker_str.strip()
                    if ticker_str != 'News':
                        ticker = ticker_str
            # Second cell in the row has the short and full description
            desc_elem = elem.find(attrs={'id' : 'fullDesc'})
            if desc_elem and len(desc_elem.contents):
                desc_str = None
                # Sometimes this has an anchor tag etc., but only if it's a row
                #  with cash or something else that doesn't have a ticket
                # So try to get string and we will be able to if there is a ticker
                try:
                    desc_str = desc_elem.contents[0].string
                except:
                    pass
                if desc_str:
                    description = desc_str
       
        if ticker:
            position_data[ticker] = \
                {
                    'description' : description, 
                    'quantity' : quantity,
                    'change_since_purchase' : change_since_purchase,
                    'change_since_purchase_pct' : change_since_purchase_pct
                }

    return position_data



class FidelityPortfolioScraper(plugin_base.PluginBase):