src/a/r/arcs.shibboleth.client-0.2dev-20091210/src/main/python/arcs/shibboleth/client/shiblogout.py arcs.shibboleth.client(Download)
import optparse
from cookielib import MozillaCookieJar
import urllib2
from urllib2 import HTTPCookieProcessor
homedir = os.getenv('USERPROFILE') or os.getenv('HOME')
logout_urls = list(set(logout_urls))
opener = urllib2.build_opener(HTTPCookieProcessor(cookiejar=cj))
for url in logout_urls:
request = urllib2.Request(url)
log.debug("GET: %s" % request.get_full_url())
src/p/y/py-smsgv-HEAD/smsgv.py py-smsgv(Download)
def login (self, password):
"""Logs into the Google Account system and receives the cookies into a
file to allow continued use of the Google Voice system."""
if not self.logged_in:# We don't need to repeat this process over and over
from urllib2 import HTTPCookieProcessor, build_opener, install_opener, Request, urlopen
opener = build_opener(HTTPCookieProcessor(self.cookies))
install_opener(opener) # Let Google know we'll accept its nomtastic cookies
src/e/n/ensemblerewards-HEAD/trunk/python/mailinglist.py ensemblerewards(Download)
import re
from datetime import datetime
from urllib import urlencode
from urllib2 import urlopen, build_opener, install_opener,\
Request, HTTPCookieProcessor
from BeautifulSoup import BeautifulSoup, SoupStrainer
def __init__(self, list_id):
self.list_id = list_id
# Install a cookie jar to handle cookie-based logins.
self._cookie_jar = cookielib.CookieJar()
install_opener(build_opener(HTTPCookieProcessor(self._cookie_jar)))
def login(self, email, password):
src/e/n/ensemblerewards-HEAD/python/mailinglist.py ensemblerewards(Download)
import re
from datetime import datetime
from urllib import urlencode
from urllib2 import urlopen, build_opener, install_opener,\
Request, HTTPCookieProcessor
from BeautifulSoup import BeautifulSoup, SoupStrainer
def __init__(self, list_id):
self.list_id = list_id
# Install a cookie jar to handle cookie-based logins.
self._cookie_jar = cookielib.CookieJar()
install_opener(build_opener(HTTPCookieProcessor(self._cookie_jar)))
def login(self, email, password):
src/p/y/pywilima-0.2/lib/pywilima.py pywilima(Download)
import sys, logging, time from urllib2 import urlopen, HTTPError, HTTPCookieProcessor, install_opener, build_opener from cookielib import CookieJar from ClientForm import ParseResponse from BeautifulSoup import BeautifulSoup
def install_cookieopener(): # Install opener that handles cookies cj = CookieJar() processor = HTTPCookieProcessor(cj) install_opener(build_opener(processor))
src/r/s/rsl-0.2.1/src/rsl/misc/http.py rsl(Download)
from urllib2 import Request as Urllib2Request from urllib2 import HTTPPasswordMgrWithDefaultRealm, BaseHandler from urllib2 import HTTPCookieProcessor from urllib2 import HTTPBasicAuthHandler, build_opener, install_opener from cookielib import LWPCookieJar from httplib import HTTPMessage
COOKIEJAR.load()
except IOError:
pass
cookie_handler = HTTPCookieProcessor(COOKIEJAR)
auth_handler = HTTPBasicAuthHandler(AskPasswordHandler())
auth_handler.add_password('realm', 'host', 'username', 'password')
OPENER = build_opener(cache_handler, cookie_handler, auth_handler)
src/a/g/agtl-0.7.1.0-freerunner0/advancedcaching/downloader.py agtl(Download)
from cookielib import LWPCookieJar
cj = LWPCookieJar(self.cookiefile)
if not self.opener_installed:
from urllib2 import build_opener, install_opener, HTTPCookieProcessor
opener = build_opener(HTTPCookieProcessor(cj))
install_opener(opener)
self.opener_installed = True
src/t/r/TritonScraper-HEAD/src/triton_scraper/fetchparse.py TritonScraper(Download)
import re from cookielib import CookieJar from urllib import urlencode from urllib2 import build_opener, HTTPCookieProcessor, Request, URLError from httplib import BadStatusLine from logging import getLogger
def make_tree4url():
"""
:returns: a new :func:`tree4url` function with its own fresh associated :class:`CookieJar`
:rtype: function
"""
opener = build_opener(HTTPCookieProcessor(CookieJar()))
def tree4url(url, post_args=None, hack_around_broken_html=False):
src/p/y/pybugz-HEAD/bugz/bugzilla.py pybugz(Download)
from cStringIO import StringIO from urlparse import urlsplit, urljoin from urllib import urlencode, quote from urllib2 import build_opener, HTTPCookieProcessor, Request from config import config
else: self.cookiejar = CookieJar() self.opener = build_opener(HTTPCookieProcessor(self.cookiejar)) self.user = user self.password = password self.httpuser = httpuser
src/t/r/trowl-HEAD/src/trowl/job.py trowl(Download)
import pyres, re, urlparse, urllib2, cookielib
from urllib2 import build_opener, HTTPCookieProcessor, HTTPRedirectHandler
from lessly.misc import keystringer
from trowl.util import pquery
BASE_HEADERS = {
'User-Agent' : 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5',
def fetch(self):
"Fetches the url (but does not read from the response)."
self.cookies = cookielib.CookieJar()
self.opener = build_opener( HTTPCookieProcessor(self.cookies), HTTPRedirectHandler )
self.opener.addheaders = BASE_HEADERS.copy().items()
1 | 2 Next