From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114538 invoked by alias); 25 May 2017 02:07:37 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 113843 invoked by uid 89); 25 May 2017 02:07:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=glance, SQL, claims X-HELO: mail-yb0-f170.google.com Received: from mail-yb0-f170.google.com (HELO mail-yb0-f170.google.com) (209.85.213.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 May 2017 02:07:31 +0000 Received: by mail-yb0-f170.google.com with SMTP id 187so43291108ybg.0 for ; Wed, 24 May 2017 19:07:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=lJVj63EJdzE5O3/SJaJwDqf4CtJE+mtDbDkQ1WoagTU=; b=ZWKMqdRw8yQB+yR0vgVwjhzQlK8wqlhxvyDrigBI7bRdPHvlXe2r/Ppyty9TLP9Zwh hqHw5SuoIiF7eyK3hHw63njU1os4mTRsbI21RJgXKGGHc9oTn9pskAvxglqrYWg7Pe3J fxaOK196TPeeEzI7gVEslawVyb0/DFcyq19+NxZuW6h86jUgbMOwApxDK3qM4l5T8y4b pky4MZv6QBrA7hhyIjCAPFxbELDYBDSmrMU9M1r/XeCjOVdt+bsfLMJouvHN2wzD1VYg IYlUM4BtjSHH0uBz+FimLrrEN5YLuraagYGPqYnQRm3OYGasK7uW+1vOtIBUT/yFTeA2 b68Q== X-Gm-Message-State: AODbwcB3wyM7I6vLg7Lon3gPLeSDYyJSUS+aSlev5Je9Tq5oz7vSxC/e 7pqwymGJmbIsacuLbK7npzgEhTAQ/w== X-Received: by 10.37.68.214 with SMTP id r205mr3346396yba.34.1495678053538; Wed, 24 May 2017 19:07:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.208.69 with HTTP; Wed, 24 May 2017 19:07:12 -0700 (PDT) In-Reply-To: <0107427b-3af6-739d-fe6e-5ad14a9c0708@SystematicSw.ab.ca> References: <7f2814c4-518a-c097-de05-f4c694dbf362@SystematicSw.ab.ca> <8c55fe7c-5e1c-4bec-dab5-b04e86c59ec4@cygwin.com> <2e0bdfd4-9b99-1ae8-bd82-2b986529e0a4@dronecode.org.uk> <977d9380-31dc-78de-a260-16689664129d@SystematicSw.ab.ca> <5d9a21b5-2c14-c1e8-2c33-6038aef22ace@SystematicSw.ab.ca> <8737bvjxdp.fsf@Rainer.invalid> <2a783f3e-7c6a-20ab-2130-0d8b42c73111@SystematicSw.ab.ca> <871sre5dj6.fsf@Rainer.invalid> <0107427b-3af6-739d-fe6e-5ad14a9c0708@SystematicSw.ab.ca> From: Doug Henderson Date: Thu, 25 May 2017 02:07:00 -0000 Message-ID: Subject: Re: units issues To: cygwin-apps@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00152.txt.bz2 , On 24 May 2017 at 18:16, Brian Inglis wrote: > I would appreciate it if anyone has any experience with, or can point me > to, any python3 code in any Cygwin package which works Windows proxy > authentication? I had a glance at the source. I recall adapting it to load SQL tables with units data. I recall writing code very similar to that in the units_cur{2|3} python sources to keep the table current. units_cur2 is the python2 version, units_cur3 is the python3 version of the updater. It is using the urllib and ElementTree packages which are parts of the standard python release. A possibly more featureful replacement for urllib is the requests package, available in the cygwin packages python2-requests and python3-requests. See http://docs.python-requests.org/en/master/ for the documentation. It claims "HTTP(S) Proxy Support" however I have not used that feature. There are two similar lines that use urllib: ... urllib.request.urlopen('URL1>') ... ... urllib.request.urlopen('?f=xml') ... Using requests, they become: ... requests.get('').text ... ... requests.get('', params={'f':'xml'}).text ... Some additional code is required to support proxies, but I can't help much there. See http://docs.python-requests.org/en/master/user/advanced/#proxies for info. HTH Doug -- Doug Henderson, Calgary, Alberta, Canada - from gmail.com