id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30,800 | AniList.py | ZeroQI_Hama_bundle/Contents/Code/AniList.py | ### anilist.co ###
# API exemple: https://anilist.co/graphiql?query=%7B%0A%20%20anime%3A%20Media(idMal%3A%2023273%2C%20type%3A%20ANIME)%20%7B%0A%20%20%20%20title%20%7B%0A%20%20%20%20%20%20english%0A%20%20%20%20%7D%0A%20%20%20%20coverImage%20%7B%0A%20%20%20%20%20%20url%3A%20extraLarge%0A%20%20%20%20%7D%0A%20%20%7D%0A%7... | 3,401 | Python | .py | 63 | 50.68254 | 305 | 0.68112 | ZeroQI/Hama.bundle | 1,203 | 113 | 12 | GPL-3.0 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,801 | TVTunes.py | ZeroQI_Hama_bundle/Contents/Code/TVTunes.py | ### televisiontunes.com ###
# https://www.tunefind.com/api
### Imports ###
# HAMA Modules #
import common
from common import Log, DictString, Dict, SaveDict # Direct import of heavily used functions
### Variables ###
THEME_URL = "https://www.televisiontunes.com/uploads/audio/{}.mp3"
### Functions ###
def GetMetadata... | 1,188 | Python | .py | 22 | 50.954545 | 154 | 0.641933 | ZeroQI/Hama.bundle | 1,203 | 113 | 12 | GPL-3.0 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,802 | OMDb.py | ZeroQI_Hama_bundle/Contents/Code/OMDb.py | ### omdbapi.com ###
# API https://www.omdbapi.com/
# API xml exemple: tt0412142 1408 House md https://www.omdbapi.com/?i=tt0412142
# API xml exemple: tt0186151 10559 Frequency https://www.omdbapi.com/?i=tt0186151
### Imports ###
# Python Modules #
import os
# HAMA Modules #
import common
from... | 3,348 | Python | .py | 42 | 75.380952 | 229 | 0.608551 | ZeroQI/Hama.bundle | 1,203 | 113 | 12 | GPL-3.0 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,803 | TheTVDBv2.py | ZeroQI_Hama_bundle/Contents/Code/TheTVDBv2.py | ### TheTVDB.com API v2 ###
# https://thetvdb.com/api/A27AD9BE0DA63333/series/103291/all/en.xml
### Imports ###
# Python Modules #
import os
import time
import re
from urllib import quote
# Plex Modules #
#from collections import defaultdict
# HAMA Modules #
import common
from common import Log, DictString, Dict, SaveD... | 31,283 | Python | .py | 332 | 86.415663 | 309 | 0.629028 | ZeroQI/Hama.bundle | 1,203 | 113 | 12 | GPL-3.0 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,804 | Local.py | ZeroQI_Hama_bundle/Contents/Code/Local.py | ### Local ###
### Imports ### "common.GetPosters" = "from common import GetPosters"
# Python Modules #
import os # path, listdir
import re # match, ignorecase
# HAMA Modules #
import common
from common import Log, DictString, Dict, SaveDict # Direct import of heavily used functions
### Variables ###
SEASON... | 3,554 | Python | .py | 51 | 63.901961 | 198 | 0.593777 | ZeroQI/Hama.bundle | 1,203 | 113 | 12 | GPL-3.0 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,805 | __init__.py | ZeroQI_Hama_bundle/Contents/Code/__init__.py | # -*- coding: utf-8 -*-
#
# To Do
# - 'Debug' mode: logs per serie folder, need to use scanner logging
# - search word pick serie, do levenstein i partially match only (few chars difference)
### Imports ###
# Python Modules #
import re
import os
import datetime
# HAMA Modules #
import common # Functions: G... | 14,641 | Python | .py | 158 | 88.272152 | 420 | 0.589994 | ZeroQI/Hama.bundle | 1,203 | 113 | 12 | GPL-3.0 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,806 | tvdb4.py | ZeroQI_Hama_bundle/Contents/Code/tvdb4.py | ### tvdb4 ###
### Imports ### ### Functions used ###
# Python Modules #
import os
# HAMA Modules #
import common
from common import Log, DictString, Dict, SaveDict # Direct import of heavily used functions
### Variables ###
TVDB4_MAPPING_URL = 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Sc... | 4,257 | Python | .py | 70 | 56.214286 | 178 | 0.671699 | ZeroQI/Hama.bundle | 1,203 | 113 | 12 | GPL-3.0 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,807 | AniDB.py | ZeroQI_Hama_bundle/Contents/Code/AniDB.py | ### AniBD ###
# http://api.anidb.net:9001/httpapi?request=anime&client=hama&clientver=1&protover=1&aid=6481
### Imports ###
# Python Modules #
import os
import re
import string
import datetime
import time
from lxml import etree
# HAMA Modules #
import common
from common import Log, DictString, Dict, SaveDict, GetXml #... | 35,180 | Python | .py | 370 | 87.294595 | 550 | 0.615784 | ZeroQI/Hama.bundle | 1,203 | 113 | 12 | GPL-3.0 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,808 | anidb34.py | ZeroQI_Hama_bundle/Contents/Code/anidb34.py | ### anidb34 ###
### Imports ### ### Functions used ###
# Python Modules #
import re
# HAMA Modules #
import common
from common import Log, DictString, Dict, SaveDict # Direct import of heavily used functions
### Variables ###
### Functions ###
def AdjustMapping(source, mappingList, dict_AniDB, dict_The... | 11,706 | Python | .py | 143 | 74.097902 | 199 | 0.599601 | ZeroQI/Hama.bundle | 1,203 | 113 | 12 | GPL-3.0 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,809 | TheMovieDb.py | ZeroQI_Hama_bundle/Contents/Code/TheMovieDb.py | ### TheMovieDb ### Does movies but also series, for which i call it tsdb in metadata id ##
# TMDB_SEARCH_BY_IMDBID = "https://api.TheMovieDb.org/3/find/tt0412142?api_key=7f4a0bd0bd3315bb832e17feda70b5cd&external_source=imdb_id"
### Imports ###
# Python Modules #
import os
# HAMA Modules #
import common
from com... | 13,784 | Python | .py | 135 | 94.066667 | 406 | 0.593545 | ZeroQI/Hama.bundle | 1,203 | 113 | 12 | GPL-3.0 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,810 | FanartTV.py | ZeroQI_Hama_bundle/Contents/Code/FanartTV.py | ### FanartTV.com ###
# https://webservice.fanart.tv/v3/tv/79824?api_key=cfa9dc054d221b8d107f8411cd20b13f #Naruto Shippuden
# https://webservice.fanart.tv/v3/tv/81189?api_key=cfa9dc054d221b8d107f8411cd20b13f
### Imports ###
# Python Modules #
import os
# HAMA Modules #
import common
from common import Log, DictString, ... | 4,554 | Python | .py | 40 | 110.325 | 367 | 0.665926 | ZeroQI/Hama.bundle | 1,203 | 113 | 12 | GPL-3.0 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,811 | common.py | ZeroQI_Hama_bundle/Contents/Code/common.py | ### common ###
# https://www.python.org/dev/peps/pep-0008/
# Usage: "common.GetPosters" = "from common import GetPosters"
### Imports ### ### Functions used ###
# Python Modules #
import os # path.abspath, join, dirname
import time # datetime.datetime.now()
import r... | 55,332 | Python | .py | 716 | 71.370112 | 382 | 0.638105 | ZeroQI/Hama.bundle | 1,203 | 113 | 12 | GPL-3.0 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,812 | setup.py | pycurl_pycurl/setup.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
"""Setup script for the PycURL module distribution."""
PACKAGE = "pycurl"
PY_PACKAGE = "curl"
VERSION = "7.45.3"
import glob, os, re, shlex, sys, subprocess
from setuptools import setup
from setuptools.extension import Extension
py3 = sys.version_info[0] =... | 39,516 | Python | .py | 877 | 35.366021 | 167 | 0.584287 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,813 | winbuild.py | pycurl_pycurl/winbuild.py | # This file builds official Windows binaries of PycURL and all of its dependencies.
#
# It is written to be run on a system dedicated to building pycurl, but can be configured
# for any system that has the required tools installed.
#
# Generally, the workflow of building pycurl binaries is as follows:
# 1. Install git... | 18,109 | Python | .py | 377 | 41.381963 | 160 | 0.669967 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,814 | multi-socket_action-select.py | pycurl_pycurl/examples/multi-socket_action-select.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
# Retrieves a single URL using the CurlMulti.socket_action calls, using
# select as the I/O polling mechanism:
#
# First, create a Multi object, and set socket and timer callbacks on it.
# Observed side effect: this causes the timer callback to be immediately... | 7,985 | Python | .py | 177 | 40.293785 | 91 | 0.702706 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,815 | basicfirst.py | pycurl_pycurl/examples/basicfirst.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import sys
import pycurl
PY3 = sys.version_info[0] > 2
class Test:
def __init__(self):
self.contents = ''
if PY3:
self.contents = self.contents.encode('ascii')
def body_callback(self, buf):
self.contents = self.c... | 545 | Python | .py | 21 | 22.47619 | 57 | 0.651163 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,816 | retriever.py | pycurl_pycurl/examples/retriever.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
#
# Usage: python retriever.py <file with URLs to fetch> [<# of
# concurrent connections>]
#
import sys, threading
try:
import Queue
except ImportError:
import queue as Queue
import pycurl
# We should ignore SIGPIPE when using pycurl.NOSIGN... | 2,665 | Python | .py | 87 | 24.390805 | 97 | 0.615925 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,817 | xmlrpc_curl.py | pycurl_pycurl/examples/xmlrpc_curl.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
# We should ignore SIGPIPE when using pycurl.NOSIGNAL - see
# the libcurl tutorial for more info.
try:
import signal
from signal import SIGPIPE, SIG_IGN
except ImportError:
pass
else:
signal.signal(SIGPIPE, SIG_IGN)
try:
from cStringIO im... | 2,179 | Python | .py | 67 | 25.313433 | 73 | 0.617983 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,818 | linksys.py | pycurl_pycurl/examples/linksys.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
#
# linksys.py -- program settings on a Linkys router
#
# This tool is designed to help you recover from the occasional episodes
# of catatonia that afflict Linksys boxes. It allows you to batch-program
# them rather than manually entering values to the Web in... | 21,771 | Python | .py | 499 | 34.166333 | 131 | 0.602698 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,819 | file_upload.py | pycurl_pycurl/examples/file_upload.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import os, sys
import pycurl
# Class which holds a file reference and the read callback
class FileReader:
def __init__(self, fp):
self.fp = fp
def read_callback(self, size):
return self.fp.read(size)
# Check commandline arguments
if ... | 1,179 | Python | .py | 37 | 29.351351 | 81 | 0.720459 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,820 | retriever-multi.py | pycurl_pycurl/examples/retriever-multi.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
#
# Usage: python retriever-multi.py <file with URLs to fetch> [<# of
# concurrent connections>]
#
import sys
import pycurl
# We should ignore SIGPIPE when using pycurl.NOSIGNAL - see
# the libcurl tutorial for more info.
try:
import signal
... | 3,359 | Python | .py | 106 | 26.264151 | 97 | 0.6267 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,821 | ssh_keyfunction.py | pycurl_pycurl/examples/ssh_keyfunction.py | import pycurl
sftp_server = 'sftp://web.sourceforge.net'
c = pycurl.Curl()
c.setopt(c.URL, sftp_server)
c.setopt(c.VERBOSE, True)
def keyfunction(known_key, found_key, match):
return c.KHSTAT_FINE
c.setopt(c.SSH_KNOWNHOSTS, '.known_hosts')
c.setopt(c.SSH_KEYFUNCTION, keyfunction)
c.perform()
| 302 | Python | .py | 10 | 28.3 | 45 | 0.759582 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,822 | sfquery.py | pycurl_pycurl/examples/sfquery.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
#
# sfquery -- Source Forge query script using the ClientCGI high-level interface
#
# Retrieves a SourceForge XML export object for a given project.
# Specify the *numeric* project ID. the user name, and the password,
# as arguments. If you have a valid ~/.net... | 2,457 | Python | .py | 61 | 32.327869 | 90 | 0.60786 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,823 | opensocketexception.py | pycurl_pycurl/examples/opensocketexception.py | # Exposing rich exception information from callbacks example
import pycurl, random, socket
class ConnectionRejected(Exception):
pass
def opensocket(curl, purpose, curl_address):
if random.random() < 0.5:
curl.exception = ConnectionRejected('Rejecting connection attempt in opensocket callback')
... | 861 | Python | .py | 24 | 31.458333 | 98 | 0.730351 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,824 | smtp.py | pycurl_pycurl/examples/smtp.py | # Based on the simple libcurl SMTP example:
# https://github.com/bagder/curl/blob/master/docs/examples/smtp-mail.c
# There are other SMTP examples in that directory that you may find helpful.
from . import localhost
import pycurl
try:
from io import BytesIO
except ImportError:
from StringIO import StringIO as ... | 1,099 | Python | .py | 36 | 28.916667 | 76 | 0.758784 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,825 | test_gtk.py | pycurl_pycurl/examples/tests/test_gtk.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import sys, threading
import pycurl
import pygtk
pygtk.require('2.0')
import gtk
# We should ignore SIGPIPE when using pycurl.NOSIGNAL - see
# the libcurl tutorial for more info.
try:
import signal
from signal import SIGPIPE, SIG_IGN
except ImportErr... | 2,660 | Python | .py | 85 | 25.011765 | 67 | 0.631148 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,826 | test_build_config.py | pycurl_pycurl/examples/tests/test_build_config.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import zlib
try:
from io import BytesIO
except ImportError:
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from StringIO import StringIO as BytesIO
c = pycurl.Curl()
c.setopt(c.URL, 'http://pycurl... | 1,765 | Python | .py | 61 | 25.770492 | 83 | 0.722941 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,827 | test_xmlrpc.py | pycurl_pycurl/examples/tests/test_xmlrpc.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
## XML-RPC lib included in python2.2
try:
import xmlrpclib
except ImportError:
import xmlrpc.client as xmlrpclib
import pycurl
# Header fields passed in request
xmlrpc_header = [
"User-Agent: PycURL XML-RPC Test", "Content-Type: text/xml"
]
... | 749 | Python | .py | 26 | 27 | 90 | 0.722841 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,828 | get_python3.py | pycurl_pycurl/examples/quickstart/get_python3.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
from io import BytesIO
buffer = BytesIO()
c = pycurl.Curl()
c.setopt(c.URL, 'http://pycurl.io/')
c.setopt(c.WRITEDATA, buffer)
c.perform()
c.close()
body = buffer.getvalue()
# Body is a byte string.
# We have to know the encoding in order to p... | 403 | Python | .py | 16 | 24 | 66 | 0.716146 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,829 | get_python2_https.py | pycurl_pycurl/examples/quickstart/get_python2_https.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import certifi
from StringIO import StringIO
buffer = StringIO()
c = pycurl.Curl()
c.setopt(c.URL, 'http://pycurl.io/')
c.setopt(c.WRITEDATA, buffer)
# For older PycURL versions:
#c.setopt(c.WRITEFUNCTION, buffer.write)
c.setopt(c.CAINFO, certi... | 498 | Python | .py | 19 | 25.052632 | 68 | 0.743697 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,830 | file_upload_real_fancy.py | pycurl_pycurl/examples/quickstart/file_upload_real_fancy.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
c = pycurl.Curl()
c.setopt(c.URL, 'https://httpbin.org/post')
c.setopt(c.HTTPPOST, [
('fileupload', (
# upload the contents of this file
c.FORM_FILE, __file__,
# specify a different file name for the upload
... | 483 | Python | .py | 18 | 22.5 | 54 | 0.626898 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,831 | file_upload_real.py | pycurl_pycurl/examples/quickstart/file_upload_real.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
c = pycurl.Curl()
c.setopt(c.URL, 'https://httpbin.org/post')
c.setopt(c.HTTPPOST, [
('fileupload', (
# upload the contents of this file
c.FORM_FILE, __file__,
)),
])
c.perform()
c.close()
| 291 | Python | .py | 14 | 17.785714 | 43 | 0.604396 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,832 | write_file.py | pycurl_pycurl/examples/quickstart/write_file.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
# As long as the file is opened in binary mode, both Python 2 and Python 3
# can write response body to it without decoding.
with open('out.html', 'wb') as f:
c = pycurl.Curl()
c.setopt(c.URL, 'http://pycurl.io/')
c.setopt(c.WRITEDA... | 357 | Python | .py | 12 | 26.916667 | 74 | 0.655977 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,833 | response_info.py | pycurl_pycurl/examples/quickstart/response_info.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
try:
from io import BytesIO
except ImportError:
from StringIO import StringIO as BytesIO
buffer = BytesIO()
c = pycurl.Curl()
c.setopt(c.URL, 'http://pycurl.io/')
c.setopt(c.WRITEDATA, buffer)
c.perform()
# HTTP response code, e.g. 200... | 498 | Python | .py | 19 | 24.578947 | 48 | 0.713684 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,834 | put_file.py | pycurl_pycurl/examples/quickstart/put_file.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
c = pycurl.Curl()
c.setopt(c.URL, 'https://httpbin.org/put')
c.setopt(c.UPLOAD, 1)
file = open(__file__)
c.setopt(c.READDATA, file)
c.perform()
c.close()
# File must be kept open while Curl object is using it
file.close()
| 300 | Python | .py | 13 | 21.769231 | 54 | 0.69258 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,835 | follow_redirect.py | pycurl_pycurl/examples/quickstart/follow_redirect.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
c = pycurl.Curl()
# Redirects to https://www.python.org/.
c.setopt(c.URL, 'http://www.python.org/')
# Follow redirect.
c.setopt(c.FOLLOWLOCATION, True)
c.perform()
c.close()
| 250 | Python | .py | 11 | 21.545455 | 41 | 0.691983 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,836 | file_upload_buffer.py | pycurl_pycurl/examples/quickstart/file_upload_buffer.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
c = pycurl.Curl()
c.setopt(c.URL, 'https://httpbin.org/post')
c.setopt(c.HTTPPOST, [
('fileupload', (
c.FORM_BUFFER, 'readme.txt',
c.FORM_BUFFERPTR, 'This is a fancy readme file',
)),
])
c.perform()
c.close()
| 311 | Python | .py | 14 | 19.214286 | 56 | 0.617747 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,837 | put_buffer.py | pycurl_pycurl/examples/quickstart/put_buffer.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
try:
from io import BytesIO
except ImportError:
from StringIO import StringIO as BytesIO
c = pycurl.Curl()
c.setopt(c.URL, 'https://httpbin.org/put')
c.setopt(c.UPLOAD, 1)
data = '{"json":true}'
# READDATA requires an IO-like object; a... | 472 | Python | .py | 18 | 24.555556 | 63 | 0.722222 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,838 | form_post.py | pycurl_pycurl/examples/quickstart/form_post.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
try:
# python 3
from urllib.parse import urlencode
except ImportError:
# python 2
from urllib import urlencode
c = pycurl.Curl()
c.setopt(c.URL, 'https://httpbin.org/post')
post_data = {'field': 'value'}
# Form data must be pro... | 564 | Python | .py | 21 | 24.904762 | 58 | 0.736549 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,839 | response_headers.py | pycurl_pycurl/examples/quickstart/response_headers.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import re
try:
from io import BytesIO
except ImportError:
from StringIO import StringIO as BytesIO
headers = {}
def header_function(header_line):
# HTTP standard specifies that headers are encoded in iso-8859-1.
# On Python 2, d... | 2,097 | Python | .py | 58 | 32.5 | 76 | 0.705274 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,840 | get.py | pycurl_pycurl/examples/quickstart/get.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
try:
from io import BytesIO
except ImportError:
from StringIO import StringIO as BytesIO
buffer = BytesIO()
c = pycurl.Curl()
c.setopt(c.URL, 'http://pycurl.io/')
c.setopt(c.WRITEDATA, buffer)
# For older PycURL versions:
#c.setopt(c.WR... | 583 | Python | .py | 21 | 26.238095 | 61 | 0.735242 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,841 | get_python3_https.py | pycurl_pycurl/examples/quickstart/get_python3_https.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import certifi
from io import BytesIO
buffer = BytesIO()
c = pycurl.Curl()
c.setopt(c.URL, 'http://pycurl.io/')
c.setopt(c.WRITEDATA, buffer)
c.setopt(c.CAINFO, certifi.where())
c.perform()
c.close()
body = buffer.getvalue()
# Body is a byte s... | 454 | Python | .py | 18 | 24.055556 | 66 | 0.725173 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,842 | get_python2.py | pycurl_pycurl/examples/quickstart/get_python2.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
from StringIO import StringIO
buffer = StringIO()
c = pycurl.Curl()
c.setopt(c.URL, 'http://pycurl.io/')
c.setopt(c.WRITEDATA, buffer)
# For older PycURL versions:
#c.setopt(c.WRITEFUNCTION, buffer.write)
c.perform()
c.close()
body = buffer.ge... | 447 | Python | .py | 17 | 25.117647 | 68 | 0.737705 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,843 | __init__.py | pycurl_pycurl/python/curl/__init__.py | '''A high-level interface to the pycurl extension'''
# ** mfx NOTE: the CGI class uses "black magic" using COOKIEFILE in
# combination with a non-existent file name. See the libcurl docs
# for more info.
import sys, pycurl
py3 = sys.version_info[0] == 3
# python 2/3 compatibility
if py3:
import urllib.par... | 7,470 | Python | .py | 170 | 36.329412 | 90 | 0.655855 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,844 | info_constants_test.py | pycurl_pycurl/tests/info_constants_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import util
class InfoConstantsTest(unittest.TestCase):
# CURLINFO_CONDITION_UNMET was introduced in libcurl-7.19.4
@util.min_libcurl(7, 19, 4)
def test_condition_unmet(self):
curl = pycurl.Curl()
... | 387 | Python | .py | 13 | 25.769231 | 64 | 0.687332 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,845 | duphandle_test.py | pycurl_pycurl/tests/duphandle_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import unittest
import gc
import weakref
try:
import json
except ImportError:
import simplejson as json
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))... | 5,441 | Python | .py | 130 | 33.823077 | 91 | 0.638852 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,846 | relative_url_test.py | pycurl_pycurl/tests/relative_url_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
# uses the high level interface
import curl
import unittest
from . import appmanager
setup_module, teardown_module = appmanager.setup(('app', 8380))
class RelativeUrlTest(unittest.TestCase):
def setUp(self):
self.curl = ... | 551 | Python | .py | 17 | 28 | 63 | 0.686538 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,847 | error_constants_test.py | pycurl_pycurl/tests/error_constants_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import util
class ErrorConstantsTest(unittest.TestCase):
@util.min_libcurl(7, 21, 5)
def test_not_built_in(self):
assert hasattr(pycurl, 'E_NOT_BUILT_IN')
@util.min_libcurl(7, 24, 0)
def test... | 662 | Python | .py | 19 | 29.526316 | 60 | 0.6816 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,848 | certinfo_test.py | pycurl_pycurl/tests/certinfo_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8383, dict(ssl=True)))
class CertinfoTest(unittest.TestCase):
def setUp(self):
self.curl = util.DefaultCurlLocalh... | 3,425 | Python | .py | 80 | 35.1875 | 79 | 0.65776 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,849 | high_level_curl_test.py | pycurl_pycurl/tests/high_level_curl_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
# uses the high level interface
import curl
import unittest
from . import appmanager
setup_module, teardown_module = appmanager.setup(('app', 8380))
class RelativeUrlTest(unittest.TestCase):
def setUp(self):
self.curl = ... | 930 | Python | .py | 26 | 30.269231 | 63 | 0.654749 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,850 | global_init_test.py | pycurl_pycurl/tests/global_init_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import pytest
import unittest
from . import util
class GlobalInitTest(unittest.TestCase):
def test_global_init_default(self):
# initialize libcurl with DEFAULT flags
pycurl.global_init(pycurl.GLOBAL_DEFAULT)
pycurl.... | 1,034 | Python | .py | 24 | 36.166667 | 92 | 0.698589 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,851 | header_test.py | pycurl_pycurl/tests/header_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pytest
import pycurl
import unittest
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
# NB: HTTP RFC requires headers to be latin1 encoded, which we violate.
# See th... | 1,862 | Python | .py | 42 | 37.5 | 94 | 0.682101 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,852 | matrix.py | pycurl_pycurl/tests/matrix.py | import os, os.path, subprocess, shutil
try:
from urllib.request import urlopen
except ImportError:
from urllib import urlopen
python_versions = ['2.6.8', '2.7.5', '3.1.5', '3.2.5', '3.3.5', '3.4.1']
libcurl_versions = ['7.19.0', '7.46.0']
libcurl_meta = {
'7.19.0': {
'patches': [
'cur... | 6,816 | Python | .py | 144 | 36.326389 | 214 | 0.577657 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,853 | setup_test.py | pycurl_pycurl/tests/setup_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import util
import setup as pycurl_setup
import unittest
import os, os.path, sys
import functools
try:
# Python 2
from StringIO import StringIO
except ImportError:
# Python 3
from io import StringIO
def set_env(key, new_value):
old... | 11,050 | Python | .py | 251 | 36.095618 | 99 | 0.658507 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,854 | util.py | pycurl_pycurl/tests/util.py | # -*- coding: utf-8 -*-
# vi:ts=4:et
import tempfile
import sys, socket
import time as _time
import functools
import unittest
py3 = sys.version_info[0] == 3
# python 2/3 compatibility
if py3:
from io import StringIO, BytesIO
# borrowed from six
def b(s):
'''Byte literal'''
return s.encod... | 8,396 | Python | .py | 235 | 28.370213 | 94 | 0.635046 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,855 | write_to_stringio_test.py | pycurl_pycurl/tests/write_to_stringio_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import unittest
import sys
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class WriteToStringioTest(unittest.TestCase):
def setUp(self):
self.cur... | 1,228 | Python | .py | 34 | 29.470588 | 74 | 0.650084 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,856 | setopt_string_test.py | pycurl_pycurl/tests/setopt_string_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import pytest
from . import localhost
import unittest
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class SetoptTest(unittest.TestCase):
def setUp(self):
self.curl = ut... | 821 | Python | .py | 24 | 29.083333 | 81 | 0.686076 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,857 | appmanager.py | pycurl_pycurl/tests/appmanager.py | import sys, time, os
def noop(*args):
pass
def setup(*specs):
if os.environ.get('PYCURL_STANDALONE_APP') and os.environ['PYCURL_STANDALONE_APP'].lower() in ['1', 'yes', 'true']:
return (noop, noop)
else:
return perform_setup(*specs)
def perform_setup(*specs):
from . import runwsgi
... | 1,380 | Python | .py | 41 | 27.97561 | 119 | 0.628118 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,858 | multi_test.py | pycurl_pycurl/tests/multi_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import pytest
import unittest
import select
from . import appmanager
from . import util
setup_module_1, teardown_module_1 = appmanager.setup(('app', 8380))
setup_module_2, teardown_module_2 = appmanager.setup(('app', 83... | 13,932 | Python | .py | 367 | 27.967302 | 92 | 0.574771 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,859 | header_cb_test.py | pycurl_pycurl/tests/header_cb_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import unittest
import time as _time
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class HeaderCbTest(unittest.TestCase):
def setUp(self):
self.... | 1,560 | Python | .py | 41 | 31.170732 | 74 | 0.637086 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,860 | pause_test.py | pycurl_pycurl/tests/pause_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import flaky
import pycurl
import unittest, signal
import time as _time
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
@flaky.flaky(max_runs=3)
class PauseTest(unittest.Te... | 3,008 | Python | .py | 82 | 26.085366 | 89 | 0.566128 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,861 | option_constants_test.py | pycurl_pycurl/tests/option_constants_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import pytest
import unittest
from . import util
class OptionConstantsTest(unittest.TestCase):
# CURLOPT_USERNAME was introduced in libcurl-7.19.1
@util.min_libcurl(7, 19, 1)
def test_username(self):
... | 24,208 | Python | .py | 610 | 32.522951 | 95 | 0.65295 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,862 | error_test.py | pycurl_pycurl/tests/error_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import sys
import unittest
class ErrorTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
def tearDown(self):
self.curl.close()
# error originating in libcurl
def test_pycurl_error_libcurl(self)... | 3,088 | Python | .py | 77 | 29.857143 | 91 | 0.588314 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,863 | version_comparison_test.py | pycurl_pycurl/tests/version_comparison_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import unittest
from . import util
class VersionComparisonTest(unittest.TestCase):
def test_comparison(self):
assert util.version_less_than_spec((7, 22, 0), (7, 23, 0))
assert util.version_less_than_spec((7, 22, 0), (7, 23))
asse... | 514 | Python | .py | 12 | 37.916667 | 70 | 0.625251 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,864 | seek_cb_test.py | pycurl_pycurl/tests/seek_cb_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
# Note: this test is meant to be run from pycurl project root.
import pycurl
import unittest
import os.path
from . import procmgr, localhost, util
setup_module, teardown_module = procmgr.vsftpd_setup()
class PartialFileSource:
def __init__(self):
... | 2,262 | Python | .py | 64 | 27.515625 | 78 | 0.587185 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,865 | multi_memory_mgmt_test.py | pycurl_pycurl/tests/multi_memory_mgmt_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import unittest
import gc
import flaky
import weakref
from . import util
debug = False
@flaky.flaky(max_runs=3)
class MultiMemoryMgmtTest(unittest.TestCase):
def test_opensocketfunction_collection(self):
self.check_callback(pycurl... | 1,598 | Python | .py | 46 | 26.869565 | 71 | 0.648123 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,866 | write_abort_test.py | pycurl_pycurl/tests/write_abort_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import os.path
import pycurl
import sys
import unittest
import urllib.request
class WriteAbortTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
def tearDown(self):
self.curl.close()
def test_write_abort(self):
... | 1,242 | Python | .py | 35 | 27.542857 | 79 | 0.626667 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,867 | readdata_test.py | pycurl_pycurl/tests/readdata_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
try:
import unittest2 as unittest
except ImportError:
import unittest
import sys
import os.path
try:
import json
except ImportError:
import simplejson as json
try:
import urllib.parse as urllib_parse
e... | 9,623 | Python | .py | 215 | 35.860465 | 115 | 0.642018 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,868 | multi_callback_test.py | pycurl_pycurl/tests/multi_callback_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import pytest
import sys
import unittest
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class MultiCallbackTest(unittest.TestCase):
def setUp(self):
... | 4,187 | Python | .py | 89 | 39.696629 | 113 | 0.684945 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,869 | app.py | pycurl_pycurl/tests/app.py | # -*- coding: utf-8 -*-
# vi:ts=4:et
import time as _time, sys
import flask
try:
import json
except ImportError:
import simplejson as json
py3 = sys.version_info[0] == 3
app = flask.Flask(__name__)
app.debug = True
@app.route('/success')
def ok():
return 'success'
@app.route('/short_wait')
def short_wa... | 3,904 | Python | .py | 109 | 31.880734 | 126 | 0.686353 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,870 | setopt_lifecycle_test.py | pycurl_pycurl/tests/setopt_lifecycle_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import gc
import pycurl
import unittest
try:
import json
except ImportError:
import simplejson as json
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class TestStr... | 1,818 | Python | .py | 51 | 28.372549 | 72 | 0.624787 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,871 | version_constants_test.py | pycurl_pycurl/tests/version_constants_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import util
class VersionConstantsTest(unittest.TestCase):
def test_ipv6(self):
assert hasattr(pycurl, 'VERSION_IPV6')
def test_kerberos4(self):
assert hasattr(pycurl, 'VERSION_KERBEROS4')
@... | 2,935 | Python | .py | 81 | 29.765432 | 54 | 0.653206 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,872 | weakref_test.py | pycurl_pycurl/tests/weakref_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import unittest
import weakref
import pycurl
class WeakrefTest(unittest.TestCase):
def test_easy(self):
c = pycurl.Curl()
weakref.ref(c)
c.close()
def test_multi(self):
m = pycurl.CurlMulti()
weakref.ref(m... | 443 | Python | .py | 19 | 17.263158 | 37 | 0.592233 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,873 | read_cb_test.py | pycurl_pycurl/tests/read_cb_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import unittest
import sys
try:
import json
except ImportError:
import simplejson as json
try:
import urllib.parse as urllib_parse
except ImportError:
import urllib as urllib_parse
from . import appmanage... | 4,340 | Python | .py | 105 | 33.8 | 115 | 0.662699 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,874 | multi_timer_test.py | pycurl_pycurl/tests/multi_timer_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import unittest
from . import appmanager
from . import util
setup_module_1, teardown_module_1 = appmanager.setup(('app', 8380))
setup_module_2, teardown_module_2 = appmanager.setup(('app', 8381))
setup_module_3, teardow... | 2,695 | Python | .py | 77 | 25.766234 | 86 | 0.570276 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,875 | open_socket_cb_test.py | pycurl_pycurl/tests/open_socket_cb_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import socket
import pycurl
import unittest
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
socket_open_called_ipv4 = False
socket_open_called_ipv6 = False
socket_open_call... | 4,761 | Python | .py | 117 | 33.401709 | 82 | 0.666667 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,876 | __init__.py | pycurl_pycurl/tests/__init__.py | # On recent windowses there is no localhost entry in hosts file,
# hence localhost resolves fail. https://github.com/c-ares/c-ares/issues/85
# FTP tests also seem to want the numeric IP address rather than localhost.
localhost = '127.0.0.1'
def setup_package():
# import here, not globally, so that running
# py... | 535 | Python | .py | 11 | 44.909091 | 75 | 0.743243 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,877 | setopt_unicode_test.py | pycurl_pycurl/tests/setopt_unicode_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import pytest
import unittest
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class SetoptUnicodeTest(unittest.TestCase):
def setUp(self):
self.cu... | 1,097 | Python | .py | 29 | 31.413793 | 82 | 0.670531 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,878 | subclass_test.py | pycurl_pycurl/tests/subclass_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
try:
import unittest2 as unittest
except ImportError:
import unittest
import pycurl
CLASSES = (pycurl.Curl, pycurl.CurlMulti, pycurl.CurlShare)
class SubclassTest(unittest.TestCase):
def test_baseclass_init(self):
# base classes do not a... | 3,129 | Python | .py | 81 | 26.333333 | 75 | 0.548833 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,879 | perform_test.py | pycurl_pycurl/tests/perform_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
try:
import unittest2 as unittest
except ImportError:
import unittest
import pycurl
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class PerformTest(unittest.TestC... | 2,179 | Python | .py | 54 | 32.62963 | 84 | 0.646577 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,880 | failonerror_test.py | pycurl_pycurl/tests/failonerror_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import unittest
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class FailonerrorTest(unittest.TestCase):
def setUp(self):
self.curl = util.Defaul... | 3,863 | Python | .py | 81 | 39.333333 | 122 | 0.654377 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,881 | user_agent_string_test.py | pycurl_pycurl/tests/user_agent_string_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import unittest
import pycurl
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class UserAgentStringTest(unittest.TestCase):
def setUp(self):
self.curl = util.De... | 820 | Python | .py | 22 | 32.181818 | 95 | 0.681818 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,882 | info_test.py | pycurl_pycurl/tests/info_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import util
class InfoTest(unittest.TestCase):
@util.only_ssl
def test_ssl_engines(self):
curl = pycurl.Curl()
engines = curl.getinfo(curl.SSL_ENGINES)
# Typical result:
# - an emp... | 452 | Python | .py | 16 | 23.0625 | 48 | 0.635104 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,883 | curl_object_test.py | pycurl_pycurl/tests/curl_object_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import pytest
import unittest
class ExplicitConstructionCurlObjectTest(unittest.TestCase):
def test_close(self):
c = pycurl.Curl()
c.close()
def test_close_twice(self):
c = pycurl.Curl()
c.close()
... | 5,199 | Python | .py | 117 | 36.34188 | 84 | 0.677336 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,884 | default_write_cb_test.py | pycurl_pycurl/tests/default_write_cb_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import unittest
import pycurl
import sys
import tempfile
import os
from . import appmanager, util
setup_module, teardown_module = appmanager.setup(('app', 8380))
STDOUT_FD_NUM = 1
def try_fsync(fd):
try:
os.fsync(fd)
... | 3,039 | Python | .py | 74 | 31.972973 | 79 | 0.620176 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,885 | write_test.py | pycurl_pycurl/tests/write_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
try:
import unittest2 as unittest
except ImportError:
import unittest
import pycurl
import tempfile
import shutil
import os.path
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('a... | 10,048 | Python | .py | 230 | 34.830435 | 83 | 0.641872 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,886 | seek_cb_constants_test.py | pycurl_pycurl/tests/seek_cb_constants_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import util
class SeekCbConstantsTest(unittest.TestCase):
# numeric value is understood by older libcurls but
# the constant is only defined in 7.19.5+
@util.min_libcurl(7, 19, 5)
def test_ok(self):
... | 833 | Python | .py | 26 | 26.538462 | 55 | 0.653367 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,887 | sockopt_cb_test.py | pycurl_pycurl/tests/sockopt_cb_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import unittest
import pycurl
from . import util
from . import appmanager
setup_module, teardown_module = appmanager.setup(('app', 8380))
class SockoptCbTest(unittest.TestCase):
def setUp(self):
self.curl = util.DefaultC... | 2,453 | Python | .py | 63 | 30.666667 | 91 | 0.642314 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,888 | post_test.py | pycurl_pycurl/tests/post_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import flaky
import os.path
import pycurl
import unittest
try:
import json
except ImportError:
import simplejson as json
try:
import urllib.parse as urllib_parse
except ImportError:
import urllib as urllib_parse
from .... | 7,252 | Python | .py | 179 | 31.765363 | 99 | 0.579552 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,889 | protocol_constants_test.py | pycurl_pycurl/tests/protocol_constants_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import util
class ProtocolConstantsTest(unittest.TestCase):
@util.min_libcurl(7, 19, 4)
def test_7_19_4_protocols(self):
assert hasattr(pycurl, 'PROTO_ALL')
assert hasattr(pycurl, 'PROTO_DICT')
... | 1,679 | Python | .py | 42 | 32.642857 | 47 | 0.649166 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,890 | ftp_test.py | pycurl_pycurl/tests/ftp_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
# Note: this test is meant to be run from pycurl project root.
import pycurl
import unittest
from . import util
from . import procmgr, localhost
setup_module, teardown_module = procmgr.vsftpd_setup()
class FtpTest(unittest.TestCase):
def setUp(self):
... | 1,537 | Python | .py | 41 | 30.731707 | 65 | 0.645553 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,891 | debug_test.py | pycurl_pycurl/tests/debug_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import unittest
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class DebugTest(unittest.TestCase):
def setUp(self):
self.curl = util.DefaultCurl(... | 2,275 | Python | .py | 55 | 33.690909 | 147 | 0.623812 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,892 | reload_test.py | pycurl_pycurl/tests/reload_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import pytest
import unittest
class ReloadTest(unittest.TestCase):
@pytest.mark.standalone
def test_reloading(self):
try:
# python 2
reload_fn = reload
except NameError:
# python 3
... | 413 | Python | .py | 17 | 17.764706 | 40 | 0.606599 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,893 | close_socket_cb_test.py | pycurl_pycurl/tests/close_socket_cb_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import socket
import unittest
import pycurl
from . import util
from . import appmanager
setup_module, teardown_module = appmanager.setup(('app', 8380))
class CloseSocketCbTest(unittest.TestCase):
def setUp(self):
self.cu... | 2,168 | Python | .py | 59 | 29.237288 | 77 | 0.657252 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,894 | multi_socket_select_test.py | pycurl_pycurl/tests/multi_socket_select_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import pytest
import unittest
import select
import sys
import flaky
from . import appmanager
from . import util
setup_module_1, teardown_module_1 = appmanager.setup(('app', 8380))
setup_module_2, teardown_module_2 = app... | 3,991 | Python | .py | 106 | 27.518868 | 102 | 0.568435 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,895 | version_test.py | pycurl_pycurl/tests/version_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import unittest
import pycurl
class VersionTest(unittest.TestCase):
def test_pycurl_presence_and_case(self):
assert pycurl.version.startswith('PycURL/')
def test_libcurl_presence(self):
assert 'libcurl/' in pycurl.version
| 313 | Python | .py | 10 | 27.2 | 51 | 0.712838 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,896 | xferinfo_cb_test.py | pycurl_pycurl/tests/xferinfo_cb_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import unittest
import pycurl
from . import util
from . import appmanager
setup_module, teardown_module = appmanager.setup(('app', 8380))
class XferinfoCbTest(unittest.TestCase):
def setUp(self):
self.curl = util.Default... | 2,147 | Python | .py | 58 | 28.344828 | 80 | 0.6139 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,897 | write_cb_bogus_test.py | pycurl_pycurl/tests/write_cb_bogus_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import os.path
import pycurl
import sys
import unittest
import urllib.request
class WriteAbortTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
def tearDown(self):
self.curl.close()
def write_cb_returning_strin... | 1,429 | Python | .py | 38 | 30.447368 | 87 | 0.651702 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,898 | setopt_test.py | pycurl_pycurl/tests/setopt_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import pytest
import unittest
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class SetoptTest(unittest.TestCase):
def setUp(self):
self.curl = ut... | 3,792 | Python | .py | 88 | 35.852273 | 85 | 0.664583 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |
30,899 | reset_test.py | pycurl_pycurl/tests/reset_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
from . import localhost
import pycurl
import unittest
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class ResetTest(unittest.TestCase):
def test_reset(self):
c = util.DefaultCurl()
... | 2,699 | Python | .py | 69 | 27.15942 | 78 | 0.534813 | pycurl/pycurl | 1,071 | 310 | 16 | LGPL-2.1 | 9/5/2024, 5:14:14 PM (Europe/Amsterdam) |