# Path: bbcflib/common.py
# def normalize_url(url):
#     """Produce a fixed form for an HTTP URL.
# 
#     Make sure the URL begins with http:// and does *not* end with a /.
# 
#     >>> normalize_url('http://bbcf.epfl.ch')
#     'http://bbcf.epfl.ch'
#     >>> normalize_url('http://bbcf.epfl.ch/')
#     'http://bbcf.epfl.ch'
#     >>> normalize_url('bbcf.epfl.ch/')
#     'http://bbcf.epfl.ch'
#     """
#     # url = url.lower()
#     if not(url.startswith(("http://","https://","ftp://"))):
#         url = "http://" + url
#     return url.strip("/")


import json, urllib2
from datetime import datetime
from bbcflib.common import normalize_url
    from configobj import ConfigObj
    j = f.job(14)

.. autoclass:: Frontend

.. autoclass:: Job
"""

# Built-in modules #

# Internal modules #

################################################################################
class Frontend(object):
    """Connection to Fabrice David's web frontends for workflows.

    A Frontend object either takes *url* to connect to, or a
    ``ConfigParser`` given as the *config* keyword argument (and
    optionally a *section* keyword argument defaulting to
    ``"frontend"``.

    If a *config* argument is given, it reads the field
    ``frontend_url`` from the configuration.  If both the *url* and
    *config* arguments are given, *url* overrides config.
    """
    def __init__(self, url=None, config=None, section='frontend'):
        if url == None and config == None:
            raise TypeError("Must specify a URL or a configuration.")
        elif url != None:
            self.url = normalize_url(url)
        else:

# Path: bbcflib/common.py
# def normalize_url(url):
#     """Produce a fixed form for an HTTP URL.
# 
#     Make sure the URL begins with http:// and does *not* end with a /.
# 
#     >>> normalize_url('http://bbcf.epfl.ch')
#     'http://bbcf.epfl.ch'
#     >>> normalize_url('http://bbcf.epfl.ch/')
#     'http://bbcf.epfl.ch'
#     >>> normalize_url('bbcf.epfl.ch/')
#     'http://bbcf.epfl.ch'
#     """
#     # url = url.lower()
#     if not(url.startswith(("http://","https://","ftp://"))):
#         url = "http://" + url
#     return url.strip("/")


# Path: bbcflib/frontend.py
import json, urllib2
from datetime import datetime
from bbcflib.common import normalize_url
    from configobj import ConfigObj

    j = f.job(14)

.. autoclass:: Frontend

.. autoclass:: Job
"""

# Built-in modules #

# Internal modules #

################################################################################
class Frontend(object):
    """Connection to Fabrice David's web frontends for workflows.

    A Frontend object either takes *url* to connect to, or a
    ``ConfigParser`` given as the *config* keyword argument (and
    optionally a *section* keyword argument defaulting to
    ``"frontend"``.

    If a *config* argument is given, it reads the field
    ``frontend_url`` from the configuration.  If both the *url* and
    *config* arguments are given, *url* overrides config.
    """
    def __init__(self, url=None, config=None, section='frontend'):
        if url == None and config == None:
            raise TypeError("Must specify a URL or a configuration.")
        elif url != None:
            self.url = normalize_url(url)
        else:

            self.url = normalize_url(config.get(section, 'frontend_url'))