def parse_args(usage):
    
    parser = OptionParser(usage=usage)

    parser.add_option("-d", "--debug",
                      action="store_true", dest="debug", default=False,
                      help="Enabled debugging [default: %default]")
    parser.add_option("-H", "--hours",
                      dest="hours", default=12, type='int',
                      help="Specifies the number of hours [default: %default]")    
    parser.add_option("-y", "--yaml",
                      dest="yaml", default='ebay.yaml',
                      help="Specifies the name of the YAML defaults file. [default: %default]")
    parser.add_option("-a", "--appid",
                      dest="appid", default=None,
                      help="Specifies the eBay application id to use.")
    parser.add_option("-p", "--devid",
                      dest="devid", default=None,
                      help="Specifies the eBay developer id to use.")
    parser.add_option("-c", "--certid",
                      dest="certid", default=None,
                      help="Specifies the eBay cert id to use.")
    parser.add_option("-s", "--siteid",
                      dest="siteid", default=None,
                      help="Specifies the eBay site id to use.")
    parser.add_option("-o", "--OrderRole",
                      dest="OrderRole", default='Buyer',
                      help="Specifies which OrderRole value to use. [default: %default]")

    (opts, args) = parser.parse_args()

    if opts.debug:
        set_stream_logger(level=logging.DEBUG)
    
    return opts, args
    def __init__(self,
                 debug=False,
                 method='GET',
                 proxy_host=None,
                 timeout=20,
                 proxy_port=80,
                 parallel=None,
                 **kwargs):

        if debug:
            set_stream_logger('ebaysdk')

        self.response = None
        self.request = None
        self.verb = None
        self.debug = debug
        self.method = method
        self.timeout = timeout
        self.proxy_host = proxy_host
        self.proxy_port = proxy_port

        self.proxies = dict()
        if self.proxy_host:
            proxy = 'http://%s:%s' % (self.proxy_host, self.proxy_port)
            self.proxies = {'http': proxy, 'https': proxy}

        self.session = Session()
        self.session.mount('http://', HTTPAdapter(max_retries=3))
        self.session.mount('https://', HTTPAdapter(max_retries=3))

        self.parallel = parallel

        self._reset()
    def __init__(self, debug=False, method='GET',
                 proxy_host=None, timeout=20, proxy_port=80,
                 parallel=None, **kwargs):

        if debug:
            set_stream_logger('ebaysdk')

        self.response = None
        self.request = None
        self.verb = None
        self.debug = debug
        self.method = method
        self.timeout = timeout
        self.proxy_host = proxy_host
        self.proxy_port = proxy_port

        self.proxies = dict()
        if self.proxy_host:
            proxy = 'http://%s:%s' % (self.proxy_host, self.proxy_port)
            self.proxies = {
                'http': proxy,
                'https': proxy
            }

        self.session = Session()
        self.session.mount('http://', HTTPAdapter(max_retries=3))
        self.session.mount('https://', HTTPAdapter(max_retries=3))

        self.parallel = parallel

        self._reset()
Exemple #4
0
    def __init__(self,
                 debug=False,
                 method='GET',
                 proxy_host=None,
                 timeout=20,
                 proxy_port=80,
                 parallel=None,
                 escape_xml=False,
                 **kwargs):

        if debug:
            set_stream_logger()

        self.response = None
        self.request = None
        self.verb = None
        self.config = None
        self.debug = debug
        self.method = method
        self.timeout = timeout
        self.proxy_host = proxy_host
        self.proxy_port = proxy_port
        self.escape_xml = escape_xml
        self.datetime_nodes = []
        self._list_nodes = []

        self.proxies = dict()
        if self.proxy_host:
            proxy = 'http://%s:%s' % (self.proxy_host, self.proxy_port)
            self.proxies = {'http': proxy, 'https': proxy}

        self.session = FuturesSession()
        self.session.mount('http://', HTTPAdapter(max_retries=3))
        self.session.mount('https://', HTTPAdapter(max_retries=3))

        self.parallel = parallel

        self.base_list_nodes = []
        self.datetime_nodes = []

        self._reset()
Exemple #5
0
def parse_args(usage):

    parser = OptionParser(usage=usage)

    parser.add_option("-d",
                      "--debug",
                      action="store_true",
                      dest="debug",
                      default=False,
                      help="Enabled debugging [default: %default]")
    parser.add_option("-H",
                      "--hours",
                      dest="hours",
                      default=12,
                      type='int',
                      help="Specifies the number of hours [default: %default]")
    parser.add_option(
        "-M",
        "--minutes",
        dest="minutes",
        default=0,
        type='int',
        help="Specifies the number of minutes [default: %default]")
    parser.add_option(
        "-y",
        "--yaml",
        dest="yaml",
        default='ebay.yaml',
        help="Specifies the name of the YAML defaults file. [default: %default]"
    )
    parser.add_option("-a",
                      "--appid",
                      dest="appid",
                      default=None,
                      help="Specifies the eBay application id to use.")
    parser.add_option("-p",
                      "--devid",
                      dest="devid",
                      default=None,
                      help="Specifies the eBay developer id to use.")
    parser.add_option("-c",
                      "--certid",
                      dest="certid",
                      default=None,
                      help="Specifies the eBay cert id to use.")
    parser.add_option("-s",
                      "--siteid",
                      dest="siteid",
                      default=None,
                      help="Specifies the eBay site id to use.")
    parser.add_option(
        "-o",
        "--OrderRole",
        dest="OrderRole",
        default='Buyer',
        help="Specifies which OrderRole value to use. [default: %default]")
    parser.add_option(
        "-O",
        "--OrderStatus",
        dest="OrderStatus",
        default='All',
        help="Specifies which OrderStatus value to use. [default: %default]")

    (opts, args) = parser.parse_args()

    if opts.debug:
        set_stream_logger(level=logging.DEBUG)

    return opts, args