'Opens a resource from the application\'s resource folder.  To see
how this works, consider the following folder structure::
/myapplication.py
/schema.sql
/static
/style.css
/templates
/layout.html
/index.html
If you want to open the :file:`schema.sql` file you would do the
following::
with app.open_resource(\'schema.sql\') as f:
contents = f.read()
do_something_with(contents)
:param resource: the name of the resource.  To access resources within
subfolders use forward slashes as separator.
:param mode: resource file opening mode, default is \'rb\'.'

def open_resource(self, resource, mode='rb'):

    if (mode not in ('r', 'rb')):
        raise ValueError('Resources    can    only    be    opened    for    reading')
    return open(os.path.join(self.root_path, resource), mode)
