# Copyright (C) 2005 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
-# Metafiles
-init := PLC/__init__.py PLC/Methods/__init__.py
+# Metafiles - manage Legacy/ and Accessors by hand
+init := PLC/__init__.py PLC/Methods/__init__.py PLC/Legacy/__init__.py
-# Python modules
-# see PLCAPI.spec for the settings of modules
-# default is : no extra module get built
+# python-pycurl and python-psycopg2 avail. from fedora 5
+# we used to ship our own version of psycopg2 and pycurl, for fedora4
+# starting with 5.0, support for these two modules is taken out
-## Temporarily until we can kill the Fedora Core 2 build
-#curl_vernum := $(shell printf %d 0x$(shell curl-config --vernum))
-#pycurl_vernum := $(shell printf %d 0x070d01) # 7.13.1
-#pycurl_incompatnum := $(shell printf %d 0x071000) # 7.16.0
-#ifeq ($(shell test $(curl_vernum) -ge $(pycurl_vernum) && echo 1),1)
-#ifeq ($(shell test $(curl_vernum) -ge $(pycurl_incompatnum) && echo 0),1)
-#modules += pycurl
-#endif
-#endif
-
-modules-install := $(foreach module, $(modules), $(module)-install)
-modules-clean := $(foreach module, $(modules), $(module)-clean)
-
-# Other stuff
-subdirs := doc php php/xmlrpc
+# Other stuff - doc not implicit, it's redone by myplc-docs
+subdirs := php php/xmlrpc
# autoconf compatible variables
-DESTDIR := /plc/root
+DESTDIR := /
datadir := /usr/share
bindir := /usr/bin
PWD := $(shell pwd)
-all: $(init) $(subdirs) $(modules)
+all: $(init) $(subdirs)
python setup.py build
-install: $(modules-install)
+install:
python setup.py install \
--install-purelib=$(DESTDIR)/$(datadir)/plc_api \
--install-scripts=$(DESTDIR)/$(datadir)/plc_api \
--install-data=$(DESTDIR)/$(datadir)/plc_api
install -D -m 755 php/xmlrpc/xmlrpc.so $(DESTDIR)/$(shell php-config --extension-dir)/xmlrpc.so
- install -D -m 755 refresh-peer.py $(DESTDIR)/$(bindir)/refresh-peer.py
-$(subdirs): $(init) $(modules)
+$(subdirs): $(init)
$(subdirs): %:
$(MAKE) -C $@
-$(modules):
- # Install in the current directory so that we can import it while developing
- cd $@ && \
- python setup.py build && \
- python setup.py install_lib --install-dir=$(PWD)
-
-$(modules-install): %-install:
- cd $* && \
- python setup.py install_lib --install-dir=$(DESTDIR)/$(datadir)/plc_api
-
-$(modules-clean): %-clean:
- cd $* && python setup.py clean && rm -rf build
-
-clean: $(modules-clean)
+clean:
find . -name '*.pyc' | xargs rm -f
rm -f $(INIT)
for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir clean ; done
index-clean:
rm $(init)
-tags:
- find . '(' -name '*.py' -o -name '*.sql' -o -name '*.php' -o -name Makefile ')' | xargs etags
-
-########## make sync PLCHOST=hostname
-ifdef PLCHOST
-PLCSSH:=root@$(PLCHOST)
-endif
-
-LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc'
-RSYNC_EXCLUDES := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
-RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
-RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
-
-sync:
-ifeq (,$(PLCSSH))
- echo "sync: You must define target host as PLCHOST on the command line"
- echo " e.g. make sync PLCHOST=private.one-lab.org" ; exit 1
-else
- +$(RSYNC) PLC planetlab4.sql migrations $(PLCSSH):/plc/root/usr/share/plc_api/
- ssh $(PLCSSH) chroot /plc/root apachectl graceful
-endif
-
-####################
-# All .py files in PLC/
+#################### regenerate indexes - not used by the build, as both files are svn added - please update as appropriate
+########## PLC/
# the current content of __init__.py
PLC_now := $(sort $(shell fgrep -v '"' PLC/__init__.py 2>/dev/null))
# what should be declared
PLC/__init__.py: force
endif
PLC/__init__.py:
- (echo 'all = """' ; cd PLC; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@
-
+ (echo '## Please use make index to update this file' ; echo 'all = """' ; cd PLC; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@
+########## Methods/
# the current content of __init__.py
METHODS_now := $(sort $(shell fgrep -v '"' PLC/Methods/__init__.py 2>/dev/null))
# what should be declared
PLC/Methods/__init__.py: force
endif
PLC/Methods/__init__.py:
- (echo 'methods = """' ; cd PLC/Methods; ls -1 *.py system/*.py | grep -v __init__ | sed -e 's,.py$$,,' -e 's,system/,system.,' ; echo '""".split()') > $@
+ (echo '## Please use make index to update this file' ; echo 'native_methods = """' ; cd PLC/Methods; ls -1 *.py system/*.py | grep -v __init__ | sed -e 's,.py$$,,' -e 's,system/,system.,' ; echo '""".split()') > $@
+
+########## Legacy/
+# the current content of __init__.py
+LEGACY_now := $(sort $(shell fgrep -v '"' PLC/Legacy/__init__.py 2>/dev/null))
+# what should be declared
+LEGACY_paths := $(filter-out %/__init__.py, $(wildcard PLC/Legacy/*.py))
+LEGACY_files := $(sort $(notdir $(LEGACY_paths:.py=)))
+
+ifneq ($(LEGACY_now),$(LEGACY_files))
+PLC/Legacy/__init__.py: force
+endif
+PLC/Legacy/__init__.py:
+ (echo '## Please use make index to update this file' ; echo 'native_methods = """' ; cd PLC/Legacy; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' -e 's,system/,system.,' ; echo '""".split()') > $@
+
+##########
+
+
force:
-.PHONY: all install force clean index tags $(subdirs) $(modules)
+.PHONY: all install force clean index tags $(subdirs)
+
+#################### devel tools
+tags:
+ find . '(' -name '*.py' -o -name '*.sql' -o -name '*.php' -o -name Makefile ')' | xargs etags
+
+.PHONY: tags
+
+########## sync
+# 2 forms are supported
+# (*) if your plc root context has direct ssh access:
+# make sync PLC=private.one-lab.org
+# (*) otherwise, entering through the root context
+# make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr
+
+ifdef GUEST
+ifdef PLCHOST
+SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
+SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST)
+endif
+endif
+ifdef PLC
+SSHURL:=root@$(PLC):/
+SSHCOMMAND:=ssh root@$(PLC)
+endif
+
+LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc'
+RSYNC_EXCLUDES := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
+RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
+RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
+
+sync:
+ifeq (,$(SSHURL))
+ @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
+ @echo " e.g. make sync PLC=private.one-lab.org"
+ @echo " or make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr"
+ @exit 1
+else
+ +$(RSYNC) plcsh PLC planetlab5.sql migrations $(SSHURL)/usr/share/plc_api/
+ $(SSHCOMMAND) exec apachectl graceful
+endif
#################### convenience, for debugging only
# make +foo : prints the value of $(foo)
#
# Copyright (C) 2004-2006 The Trustees of Princeton University
# $Id$
+# $URL$
#
import sys
#
# Copyright (C) 2004-2006 The Trustees of Princeton University
# $Id$
+# $URL$
#
import sys
from PLC.Config import Config
from PLC.Faults import *
import PLC.Methods
+import PLC.Legacy
+import PLC.Accessors
+
+def import_deep(name):
+ mod = __import__(name)
+ components = name.split('.')
+ for comp in components[1:]:
+ mod = getattr(mod, comp)
+ return mod
class PLCAPI:
- methods = PLC.Methods.methods
+ # flat list of method names
+ native_methods = PLC.Methods.native_methods
+ legacy_methods = PLC.Legacy.native_methods
+
+ # other_methods_map : dict {methodname: fullpath}
+ # e.g. 'Accessors' -> 'PLC.Accessors.Accessors'
+ other_methods_map={}
+ for subdir in [ 'Accessors' ]:
+ path="PLC."+subdir
+ # scan e.g. PLC.Accessors.__all__
+ pkg = __import__(path).__dict__[subdir]
+ for modulename in getattr(pkg,"__all__"):
+ fullpath=path+"."+modulename
+ for method in getattr(import_deep(fullpath),"methods"):
+ other_methods_map[method] = fullpath
+
+ all_methods = native_methods + legacy_methods + other_methods_map.keys()
+
def __init__(self, config = "/etc/planetlab/plc_config", encoding = "utf-8"):
self.encoding = encoding
"""
# Look up method
- if method not in self.methods:
+ if method not in self.all_methods:
raise PLCInvalidAPIMethod, method
-
+
# Get new instance of method
try:
classname = method.split(".")[-1]
- module = __import__("PLC.Methods." + method, globals(), locals(), [classname])
+ if method in self.native_methods:
+ fullpath="PLC.Methods." + method
+ elif method in self.legacy_methods:
+ fullpath="PLC.Legacy." + method
+ else:
+ fullpath=self.other_methods_map[method]
+ module = __import__(fullpath, globals(), locals(), [classname])
return getattr(module, classname)(self)
except ImportError, AttributeError:
- raise PLCInvalidAPIMethod, method
+ raise PLCInvalidAPIMethod, "import error %s for %s" % (AttributeError,fullpath)
def call(self, source, method, *args):
"""
--- /dev/null
+# Marta Carbone - unipi
+# $Id$
+# $URL$
+
+from PLC.Nodes import Node
+from PLC.Accessors.Factory import define_accessors, all_roles
+
+import sys
+current_module = sys.modules[__name__]
+
+# XXX define possible subclasses
+# define the dummynetbox SubClass strings
+dbox_subclass = 'DummynetBox'
+
+# define the type of a node as a dummynetbox
+define_accessors(current_module, Node, 'Subclass', 'subclass', 'node/config',
+ 'type of node definition', get_roles=all_roles, set_roles='pi')
+
+# define the dummynetbox connected to a node
+define_accessors(current_module, Node, 'DummynetBox', 'dummynetbox_id', 'node/config',
+ 'dummynetbox connected to the node', get_roles=all_roles, set_roles='pi')
+
--- /dev/null
+# Thierry Parmentelat - INRIA
+# $Id: Accessors_site.py 14587 2009-07-19 13:18:50Z thierry $
+# $URL: http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.3-29/PLC/Accessors/Accessors_site.py $
+#
+
+methods=[]
+
+from PLC.Nodes import Node
+from PLC.Interfaces import Interface
+from PLC.Slices import Slice
+#from PLC.Ilinks import Ilink
+
+from PLC.Accessors.Factory import define_accessors, all_roles, tech_roles
+
+import sys
+current_module = sys.modules[__name__]
+
+#### example 1 : attach vlan ids on interfaces
+# The third argument expose_in_api is a boolean flag that tells whether this tag may be handled
+# through the Add/Get/Update methods as a native field
+#
+#define_accessors(current_module, Interface, "Vlan", "vlan",
+# "interface/general", "tag for setting VLAN id",
+# get_roles=all_roles, set_roles=tech_roles)
+
+##### example 2 :
+# the slice page uses the category field in the following way
+# it considers all tag types for which 'category' matches 'node*/ui*'
+# for these, the category field is split into pieces using /
+# the parts may define the following settings:
+# header: to use instead of the full tagname (in which case a footnote appears with the 'description')
+# type: exported as the type for the javascript table (used for how-to-sort)
+# rank: to be used for sorting columns (defaults to tagname)
+
+#################### MySlice tags
+define_accessors(current_module, Node, "Reliability", "reliability",
+ # category
+ "node/monitor/ui/header=R/type=int/rank=ad",
+ # description : used to add a footnote to the table if header is set in category
+ "average reliability (% uptime) over the last week",
+ get_roles=all_roles, set_roles=tech_roles, expose_in_api=True)
+
+define_accessors(current_module, Node, "Load", "load",
+ "node/monitor/ui/header=l/type=sortAlphaNumericBottom",
+ "average load (% CPU utilization) over the last week",
+ get_roles=all_roles, set_roles=tech_roles, expose_in_api=True)
+
+define_accessors(current_module, Node, "ASNumber", "asnumber",
+ "node/location/ui/header=AS/type=sortAlphaNumericBottom/rank=z",
+ "Autonomous System id",
+ get_roles=all_roles, set_roles=tech_roles, expose_in_api=True)
--- /dev/null
+# Thierry Parmentelat - INRIA
+# $Id$
+# $URL$
+#
+# Shortcuts_site.py is the place where you can define your own tag accessors
+# this will not be overwritten through rpm upgrades in a myplc-devel packaging
+#
+# methods denotes the set of methods (names) that get inserted into the API
+# it is updated by define_accessors
+
+methods=[]
+
+from PLC.Nodes import Node
+from PLC.Interfaces import Interface
+from PLC.Slices import Slice
+#from PLC.Ilinks import Ilink
+
+from PLC.Accessors.Factory import define_accessors, all_roles, tech_roles
+
+import sys
+current_module = sys.modules[__name__]
+
+#### example : attach vlan ids on interfaces
+# The third argument expose_in_api is a boolean flag that tells whether this tag may be handled
+# through the Add/Get/Update methods as a native field
+#
+#define_accessors(current_module, Interface, "Vlan", "vlan",
+# "interface/general", "tag for setting VLAN id",
+# get_roles=all_roles, set_roles=tech_roles)
--- /dev/null
+# Thierry Parmentelat - INRIA
+# $Id$
+# $URL$
+
+from PLC.Nodes import Node
+from PLC.Interfaces import Interface
+from PLC.Slices import Slice
+#from PLC.Ilinks import Ilink
+
+from PLC.Accessors.Factory import define_accessors, all_roles, tech_roles
+
+import sys
+current_module = sys.modules[__name__]
+
+# NOTE.
+# most of these tag types are defined in MyPLC/db-config, so any details here in the
+# description/category area is unlikely to make it into the database
+#
+
+# slice vref
+# xxx - don't expose yet in api interface and slices dont know how to use that yet
+define_accessors(current_module, Slice, "Vref", "vref",
+ "slice/config", "vserver reference image type",
+ get_roles=all_roles, set_roles=["admin"], expose_in_api=True)
+
+
+# node architecture
+define_accessors(current_module, Node, "Arch", "arch",
+ "node/config", "architecture name",
+ get_roles=all_roles, set_roles=tech_roles, expose_in_api=True)
+# distribution to be deployed
+define_accessors(current_module, Node, "Pldistro", "pldistro",
+ "node/config", "PlanetLab distribution",
+ get_roles=all_roles, set_roles=["admin"], expose_in_api=True)
+# node deployment (alpha, beta, ...)
+define_accessors(current_module, Node, "Deployment", "deployment",
+ "node/operation", 'typically "alpha", "beta", or "production"',
+ get_roles=all_roles, set_roles=["admin"], expose_in_api=True)
+# extension
+define_accessors(current_module, Node, "Extensions", "extensions",
+ "node/config", "space-separated list of extensions to install",
+ get_roles=all_roles, set_roles=["admin"],expose_in_api=True)
+# test nodes perform their installation from an uncompressed bootstrapfs
+define_accessors(current_module, Node, "PlainBootstrapfs", "plain-bootstrapfs",
+ "node/config", "use uncompressed bootstrapfs when set",
+ get_roles=all_roles, set_roles=tech_roles)
+
+# the tags considered when creating a boot CD
+define_accessors(current_module, Node, "Serial", "serial",
+ "node/bootcd", "serial to use when creating the boot CD -- see GetBootMedium")
+define_accessors(current_module, Node, "Cramfs", "cramfs",
+ "node/bootcd", "boot CD to use cramfs if set -- see GetBootMedium")
+define_accessors(current_module, Node, "Kvariant", "kvariant",
+ "node/bootcd", "the variant to use for creating the boot CD -- see GetBootMedium")
+define_accessors(current_module, Node, "Kargs", "kargs",
+ "node/bootcd", "extra args to pass the kernel on the Boot CD -- see GetBootMedium")
+define_accessors(current_module, Node, "NoHangcheck", "no-hangcheck",
+ "node/bootcd", "disable hangcheck on the boot CD if set -- see GetBootMedium")
+
+# interface
+# xxx - don't expose yet in api interface and slices dont know how to use that yet
+define_accessors(current_module, Interface, "Ifname", "ifname",
+ "interface/config", "linux name",
+ get_roles=all_roles, set_roles=tech_roles, expose_in_api=True)
+define_accessors(current_module, Interface, "Driver", "driver",
+ "interface/config", "driver name",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Alias", "alias",
+ "interface/config", "interface alias",
+ get_roles=all_roles, set_roles=tech_roles)
--- /dev/null
+# Thierry Parmentelat - INRIA
+# $Id$
+# $URL$
+
+from PLC.Nodes import Node
+from PLC.Interfaces import Interface
+from PLC.Slices import Slice
+#from PLC.Ilinks import Ilink
+
+from PLC.Accessors.Factory import define_accessors, all_roles, tech_roles
+
+import sys
+current_module = sys.modules[__name__]
+
+#### Wireless
+define_accessors(current_module, Interface, "Mode", "mode",
+ "interface/wifi", "Wifi operation mode - see iwconfig",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Essid", "essid",
+ "interface/wifi", "Wireless essid - see iwconfig",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Nw", "nw",
+ "interface/wifi", "Wireless nw - see iwconfig",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Freq", "freq",
+ "interface/wifi", "Wireless freq - see iwconfig",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Channel", "channel",
+ "interface/wifi", "Wireless channel - see iwconfig",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Sens", "sens",
+ "interface/wifi", "Wireless sens - see iwconfig",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Rate", "rate",
+ "interface/wifi", "Wireless rate - see iwconfig",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Key", "key",
+ "interface/wifi", "Wireless key - see iwconfig key",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Key1", "key1",
+ "interface/wifi", "Wireless key1 - see iwconfig key[1]",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Key2", "key2",
+ "interface/wifi", "Wireless key2 - see iwconfig key[2]",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Key3", "key3",
+ "interface/wifi", "Wireless key3 - see iwconfig key[3]",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Key4", "key4",
+ "interface/wifi", "Wireless key4 - see iwconfig key[4]",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "SecurityMode", "securitymode",
+ "interface/wifi", "Wireless securitymode - see iwconfig enc",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Iwconfig", "iwconfig",
+ "interface/wifi", "Wireless iwconfig - see ifup-wireless",
+ get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Iwpriv", "iwpriv",
+ "interface/wifi", "Wireless iwpriv - see ifup-wireless",
+ get_roles=all_roles, set_roles=tech_roles)
--- /dev/null
+# Thierry Parmentelat - INRIA
+# $Id$
+# $URL$
+
+from types import NoneType
+
+from PLC.Method import Method
+from PLC.Auth import Auth
+from PLC.Parameter import Parameter, Mixed
+
+from PLC.Faults import *
+
+from PLC.Nodes import Nodes, Node
+from PLC.NodeTags import NodeTags, NodeTag
+from PLC.Interfaces import Interfaces, Interface
+from PLC.InterfaceTags import InterfaceTags, InterfaceTag
+from PLC.Slices import Slices, Slice
+from PLC.SliceTags import SliceTags, SliceTag
+
+# this is another story..
+#from PLC.Ilinks import Ilink
+
+from PLC.TagTypes import TagTypes, TagType
+
+# known classes : { class -> secondary_key }
+taggable_classes = { Node : {'table_class' : Nodes,
+ 'joins_class' : NodeTags, 'join_class' : NodeTag,
+ 'secondary_key': 'hostname'},
+ Interface : {'table_class' : Interfaces,
+ 'joins_class': InterfaceTags, 'join_class': InterfaceTag,
+ 'secondary_key' : 'ip'},
+ Slice: {'table_class' : Slices,
+ 'joins_class': SliceTags, 'join_class': SliceTag,
+ 'secondary_key':'name'},
+# Ilink : xxx
+ }
+
+# xxx probably defined someplace else
+all_roles = [ 'admin', 'pi', 'tech', 'user', 'node' ]
+tech_roles = [ 'admin', 'pi', 'tech' ]
+
+#
+# generates 2 method classes:
+# Get<classname><methodsuffix> (auth, id_or_name) -> value or None
+# Set<classname><methodsuffix> (auth, id_or_name, value) -> None
+# value is always a string, no cast nor typecheck for now
+#
+# The expose_in_api flag tells whether this tag may be handled
+# through the Add/Get/Update methods as a native field
+#
+# note: tag_min_role_id gets attached to the tagtype instance,
+# while get_roles and set_roles get attached to the created methods
+# this might need a cleanup
+#
+
+def define_accessors (module, objclass, methodsuffix, tagname,
+ category, description,
+ get_roles=['admin'], set_roles=['admin'],
+ tag_min_role_id=10, expose_in_api = False):
+
+ if objclass not in taggable_classes:
+ try:
+ raise PLCInvalidArgument,"PLC.Accessors.Factory: unknown class %s"%objclass.__name__
+ except:
+ raise PLCInvalidArgument,"PLC.Accessors.Factory: unknown class ??"
+
+ # side-effect on, say, Node.tags, if required
+ if expose_in_api:
+ getattr(objclass,'tags')[tagname]=Parameter(str,"accessor")
+
+ classname=objclass.__name__
+ get_name = "Get" + classname + methodsuffix
+ set_name = "Set" + classname + methodsuffix
+
+ # create method objects under PLC.Method.Method
+ get_class = type (get_name, (Method,),
+ {"__doc__":"Accessor 'get' method designed for %s objects using tag %s"%\
+ (classname,tagname)})
+ set_class = type (set_name, (Method,),
+ {"__doc__":"Accessor 'set' method designed for %s objects using tag %s"%\
+ (classname,tagname)})
+ # accepts
+ get_accepts = [ Auth () ]
+ primary_key=objclass.primary_key
+ secondary_key = taggable_classes[objclass]['secondary_key']
+ get_accepts += [ Mixed (objclass.fields[primary_key], objclass.fields[secondary_key]) ]
+ # for set, idem set of arguments + one additional arg, the new value
+ set_accepts = get_accepts + [ Parameter (str,"New tag value") ]
+
+ # returns
+ get_returns = Mixed (Parameter (str), Parameter(NoneType))
+ set_returns = Parameter(NoneType)
+
+ # store in classes
+ setattr(get_class,'roles',get_roles)
+ setattr(get_class,'accepts',get_accepts)
+ setattr(get_class,'returns', get_returns)
+ setattr(get_class,'skip_typecheck',True)
+
+ setattr(set_class,'roles',set_roles)
+ setattr(set_class,'accepts',set_accepts)
+ setattr(set_class,'returns', set_returns)
+ setattr(set_class,'skip_typecheck',True)
+
+ table_class = taggable_classes[objclass]['table_class']
+ joins_class = taggable_classes[objclass]['joins_class']
+ join_class = taggable_classes[objclass]['join_class']
+
+ # body of the get method
+ def get_call (self, auth, id_or_name):
+ # search the tagtype - xxx - might need a cache
+ tag_types = TagTypes (self.api, {'tagname': tagname})
+ if not tag_types:
+ return None
+ tag_type_id = tag_types[0]['tag_type_id']
+ filter = {'tag_type_id':tag_type_id}
+ if isinstance (id_or_name,int):
+ filter[primary_key]=id_or_name
+ else:
+ filter[secondary_key]=id_or_name
+ joins = joins_class (self.api,filter,['value'])
+ if not joins:
+ # xxx - we return None even if id_or_name is not valid
+ return None
+ else:
+ return joins[0]['value']
+
+ # attach it
+ setattr (get_class,"call",get_call)
+
+ # body of the set method
+ def set_call (self, auth, id_or_name, value):
+ # locate the object
+ if isinstance (id_or_name, int):
+ filter={primary_key:id_or_name}
+ else:
+ filter={secondary_key:id_or_name}
+ objs = table_class(self.api, filter,[primary_key,secondary_key])
+ if not objs:
+ raise PLCInvalidArgument, "Cannot set tag on %s %r"%(objclass.__name__,id_or_name)
+ primary_id = objs[0][primary_key]
+
+ # search tag type & create if needed
+ tag_types = TagTypes (self.api, {'tagname':tagname})
+ if tag_types:
+ tag_type = tag_types[0]
+ else:
+ # not found: create it
+ tag_type_fields = {'tagname':tagname,
+ 'category' : category,
+ 'description' : description,
+ 'min_role_id': tag_min_role_id}
+ tag_type = TagType (self.api, tag_type_fields)
+ tag_type.sync()
+ tag_type_id = tag_type['tag_type_id']
+
+ # locate the join object (e.g. NodeTag, SliceTag or InterfaceTag)
+ filter = {'tag_type_id':tag_type_id}
+ if isinstance (id_or_name,int):
+ filter[primary_key]=id_or_name
+ else:
+ filter[secondary_key]=id_or_name
+ joins = joins_class (self.api,filter)
+ # setting to something non void
+ if value is not None:
+ if not joins:
+ join = join_class (self.api)
+ join['tag_type_id']=tag_type_id
+ join[primary_key]=primary_id
+ join['value']=value
+ join.sync()
+ else:
+ joins[0]['value']=value
+ joins[0].sync()
+ # providing an empty value means clean up
+ else:
+ if joins:
+ join=joins[0]
+ join.delete()
+ # log it
+ self.event_objects= { objclass.__name__ : [primary_id] }
+ self.message=objclass.__name__
+ if secondary_key in objs[0]:
+ self.message += " %s "%objs[0][secondary_key]
+ else:
+ self.message += " %d "%objs[0][primary_key]
+ self.message += "updated"
+
+ # attach it
+ setattr (set_class,"call",set_call)
+
+ # define in module
+ setattr(module,get_name,get_class)
+ setattr(module,set_name,set_class)
+ # add in <module>.methods
+ try:
+ methods=getattr(module,'methods')
+ except:
+ methods=[]
+ methods += [get_name,set_name]
+ setattr(module,'methods',methods)
+
--- /dev/null
+# each module to define in "methods" the set of methods that it defines
+
+__all__ = """
+Accessors_standard
+Accessors_wireless
+Accessors_dummynetbox
+Accessors_site
+""".split()
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from types import StringTypes
+# $Id$
+# $URL$
+
from PLC.Faults import *
from PLC.Parameter import Parameter
from PLC.Table import Row, Table
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
import crypt
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Persons
from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
+from PLC.Interfaces import Interface, Interfaces
from PLC.Sessions import Session, Sessions
from PLC.Peers import Peer, Peers
from PLC.Boot import notify_owners
+def map_auth(auth):
+ if auth['AuthMethod'] == "session":
+ expected = SessionAuth()
+ elif auth['AuthMethod'] == "password" or \
+ auth['AuthMethod'] == "capability":
+ expected = PasswordAuth()
+ elif auth['AuthMethod'] == "gpg":
+ expected = GPGAuth()
+ elif auth['AuthMethod'] == "hmac" or \
+ auth['AuthMethod'] == "hmac_dummybox":
+ expected = BootAuth()
+ elif auth['AuthMethod'] == "anonymous":
+ expected = AnonymousAuth()
+ else:
+ raise PLCInvalidArgument("must be 'session', 'password', 'gpg', 'hmac', 'hmac_dummybox', or 'anonymous'", "AuthMethod")
+ return expected
+
class Auth(Parameter):
"""
Base class for all API authentication methods, as well as a class
# mandatory fields were present.
assert 'AuthMethod' in auth
- if auth['AuthMethod'] == "session":
- expected = SessionAuth()
- elif auth['AuthMethod'] == "password" or \
- auth['AuthMethod'] == "capability":
- expected = PasswordAuth()
- elif auth['AuthMethod'] == "gpg":
- expected = GPGAuth()
- elif auth['AuthMethod'] == "hmac":
- expected = BootAuth()
- elif auth['AuthMethod'] == "anonymous":
- expected = AnonymousAuth()
- else:
- raise PLCInvalidArgument("must be 'session', 'password', 'gpg', 'hmac', or 'anonymous'", "AuthMethod")
+ expected = map_auth(auth)
# Re-check using the specified authentication method
method.type_check("auth", auth, expected, (auth,) + args)
# on record for the node.
key = node['boot_nonce']
- nodenetwork = None
- if node['nodenetwork_ids']:
- nodenetworks = NodeNetworks(method.api, node['nodenetwork_ids'])
- for nodenetwork in nodenetworks:
- if nodenetwork['is_primary']:
+ interface = None
+ if node['interface_ids']:
+ interfaces = Interfaces(method.api, node['interface_ids'])
+ for interface in interfaces:
+ if interface['is_primary']:
break
- if not nodenetwork or not nodenetwork['is_primary']:
+ if not interface or not interface['is_primary']:
raise PLCAuthenticationFailure, "No primary network interface on record"
if method.source is None:
raise PLCAuthenticationFailure, "Cannot determine IP address of requestor"
- if nodenetwork['ip'] != method.source[0]:
+ if interface['ip'] != method.source[0]:
raise PLCAuthenticationFailure, "Requestor IP %s does not match node IP %s" % \
- (method.source[0], nodenetwork['ip'])
+ (method.source[0], interface['ip'])
else:
raise PLCAuthenticationFailure, "No node key or boot nonce"
# We encode in UTF-8 before calculating the HMAC, which is
# an 8-bit algorithm.
- digest = hmac.new(key, msg.encode('utf-8'), sha).hexdigest()
+ # python 2.6 insists on receiving a 'str' as opposed to a 'unicode'
+ digest = hmac.new(str(key), msg.encode('utf-8'), sha).hexdigest()
if digest != auth['value']:
raise PLCAuthenticationFailure, "Call could not be authenticated"
# Copyright (C) 2007 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from PLC.Faults import *
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from PLC.Faults import *
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from PLC.Faults import *
# Copyright (C) 2004-2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
import os
+# $Id$
+# $URL$
import time
import sys
import syslog
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from PLC.Faults import *
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from PLC.Faults import *
#
# Copyright (C) 2004-2006 The Trustees of Princeton University
# $Id$
+# $URL$
#
import xmlrpclib
+# $Id$
+# $URL$
from types import StringTypes
try:
set
as well as sorting and clipping.
- fields should be a dictionary of field names and types
- Only filters on non-sequence type fields are supported.
+ fields should be a dictionary of field names and types.
+ As of PLCAPI-4.3-26, we provide support for filtering on
+ sequence types as well, with the special '&' and '|' modifiers.
example : fields = {'node_id': Parameter(int, "Node identifier"),
'hostname': Parameter(int, "Fully qualified hostname", max = 255),
...}
Special features:
+ * a field starting with '&' or '|' should refer to a sequence type
+ the semantic is then that the object value (expected to be a list)
+ should contain all (&) or any (|) value specified in the corresponding
+ filter value. See other examples below.
+ example : filter = { '|role_ids' : [ 20, 40 ] }
+ example : filter = { '|roles' : ['tech', 'pi'] }
+ example : filter = { '&roles' : ['admin', 'tech'] }
+ example : filter = { '&roles' : 'tech' }
+
* a field starting with the ~ character means negation.
example : filter = { '~peer_id' : None }
SQL wildcard character.
example : filter = { 'hostname' : '*.jp' }
- * fields starting with - are special and relate to row selection, i.e. sorting and clipping
+ * the filter's keys starting with '-' are special and relate to sorting and clipping
* '-SORT' : a field name, or an ordered list of field names that are used for sorting
these fields may start with + (default) or - for denoting increasing or decreasing order
example : filter = { '-SORT' : [ '+node_id', '-hostname' ] }
* '-LIMIT' : the amount of rows to be returned
example : filter = { '-OFFSET' : 100, '-LIMIT':25}
- A realistic example would read
- GetNodes ( { 'hostname' : '*.edu' , '-SORT' : 'hostname' , '-OFFSET' : 30 , '-LIMIT' : 25 } )
- and that would return nodes matching '*.edu' in alphabetical order from 31th to 55th
+ Here are a few realistic examples
+
+ GetNodes ( { 'node_type' : 'regular' , 'hostname' : '*.edu' , '-SORT' : 'hostname' , '-OFFSET' : 30 , '-LIMIT' : 25 } )
+ would return regular (usual) nodes matching '*.edu' in alphabetical order from 31th to 55th
+
+ GetPersons ( { '|role_ids' : [ 20 , 40] } )
+ would return all persons that have either pi (20) or tech (40) roles
+
+ GetPersons ( { '&role_ids' : 10 } )
+ GetPersons ( { '&role_ids' : 10 } )
+ GetPersons ( { '|role_ids' : [ 10 ] } )
+ GetPersons ( { '|role_ids' : [ 10 ] } )
+ all 4 forms are equivalent and would return all admin users in the system
"""
def __init__(self, fields = {}, filter = {}, doc = "Attribute filter"):
# Declare ourselves as a type of parameter that can take
# either a value or a list of values for each of the specified
# fields.
- self.fields = {}
-
- for field, expected in fields.iteritems():
- # Cannot filter on sequences
- if python_type(expected) in (list, tuple, set):
- continue
-
- # Accept either a value or a list of values of the specified type
- self.fields[field] = Mixed(expected, [expected])
+ self.fields = dict ( [ ( field, Mixed (expected, [expected]))
+ for (field,expected) in fields.iteritems() ] )
# Null filter means no filter
Parameter.__init__(self, self.fields, doc = doc, nullok = True)
- # this code is not used anymore
- # at some point the select in the DB for event objects was done on
- # the events table directly, that is stored as a timestamp, thus comparisons
- # needed to be done based on SQL timestamps as well
- def unix2timestamp (self,unix):
- s = time.gmtime(unix)
- return "TIMESTAMP'%04d-%02d-%02d %02d:%02d:%02d'" % (s.tm_year,s.tm_mon,s.tm_mday,
- s.tm_hour,s.tm_min,s.tm_sec)
-
def sql(self, api, join_with = "AND"):
"""
Returns a SQL conditional that represents this filter.
'<' : False, '>' : False,
'[' : False, ']' : False,
'-' : False,
+ '&' : False, '|' : False,
}
-
- for char in modifiers.keys():
- if field[0] == char:
- modifiers[char]=True;
- field = field[1:]
- break
+ def check_modifiers(field):
+ if field[0] in modifiers.keys():
+ modifiers[field[0]] = True
+ field = field[1:]
+ return check_modifiers(field)
+ return field
+ field = check_modifiers(field)
# filter on fields
if not modifiers['-']:
if field not in self.fields:
raise PLCInvalidArgument, "Invalid filter field '%s'" % field
+ # handling array fileds always as compound values
+ if modifiers['&'] or modifiers['|']:
+ if not isinstance(value, (list, tuple, set)):
+ value = [value,]
+
if isinstance(value, (list, tuple, set)):
- # Turn empty list into (NULL) instead of invalid ()
+ # handling filters like '~slice_id':[]
+ # this should return true, as it's the opposite of 'slice_id':[] which is false
+ # prior to this fix, 'slice_id':[] would have returned ``slice_id IN (NULL) '' which is unknown
+ # so it worked by coincidence, but the negation '~slice_ids':[] would return false too
if not value:
- value = [None]
-
- operator = "IN"
- value = map(str, map(api.db.quote, value))
- value = "(%s)" % ", ".join(value)
+ if modifiers['&'] or modifiers['|']:
+ operator = "="
+ value = "'{}'"
+ else:
+ field=""
+ operator=""
+ value = "FALSE"
+ else:
+ value = map(str, map(api.db.quote, value))
+ if modifiers['&']:
+ operator = "@>"
+ value = "ARRAY[%s]" % ", ".join(value)
+ elif modifiers['|']:
+ operator = "&&"
+ value = "ARRAY[%s]" % ", ".join(value)
+ else:
+ operator = "IN"
+ value = "(%s)" % ", ".join(value)
else:
if value is None:
operator = "IS"
elif isinstance(value, StringTypes) and \
(value.find("*") > -1 or value.find("%") > -1):
operator = "LIKE"
- value = str(api.db.quote(value.replace("*", "%")))
+ # insert *** in pattern instead of either * or %
+ # we dont use % as requests are likely to %-expansion later on
+ # actual replacement to % done in PostgreSQL.py
+ value = value.replace ('*','***')
+ value = value.replace ('%','***')
+ value = str(api.db.quote(value))
else:
operator = "="
if modifiers['<']:
operator='<='
if modifiers[']']:
operator='>='
- else:
- value = str(api.db.quote(value))
+
+ value = str(api.db.quote(value))
clause = "%s %s %s" % (field, operator, value)
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
import os
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+from PLC.Faults import *
+from PLC.Parameter import Parameter
+from PLC.Filter import Filter
+from PLC.Table import Row, Table
+from PLC.Interfaces import Interface, Interfaces
+from PLC.TagTypes import TagType, TagTypes
+
+class Ilink(Row):
+ """
+ Representation of a row in the ilink table.
+ To use, instantiate with a dict of values.
+ """
+
+ table_name = 'ilink'
+ primary_key = 'ilink_id'
+ fields = {
+ 'ilink_id': Parameter(int, "ilink identifier"),
+ 'tag_type_id': TagType.fields['tag_type_id'],
+ 'src_interface_id': Parameter(int, "source interface identifier"),
+ 'dst_interface_id': Parameter(int, "destination interface identifier"),
+ 'value': Parameter( str, "optional ilink value"),
+ }
+
+class Ilinks(Table):
+ """
+ Representation of row(s) from the ilink table in the
+ database.
+ """
+
+ def __init__(self, api, ilink_filter = None, columns = None):
+ Table.__init__(self, api, Ilink, columns)
+
+ sql = "SELECT %s FROM view_ilinks WHERE True" % \
+ ", ".join(self.columns)
+
+ if ilink_filter is not None:
+ if isinstance(ilink_filter, (list, tuple, set)):
+ ilink_filter = Filter(Ilink.fields, {'ilink_id': ilink_filter})
+ elif isinstance(ilink_filter, dict):
+ ilink_filter = Filter(Ilink.fields, ilink_filter)
+ elif isinstance(ilink_filter, int):
+ ilink_filter = Filter(Ilink.fields, {'ilink_id': [ilink_filter]})
+ else:
+ raise PLCInvalidArgument, "Wrong ilink filter %r"%ilink_filter
+ sql += " AND (%s) %s" % ilink_filter.sql(api)
+
+
+ self.selectall(sql)
+# $Id$
+# $URL$
#
# Functions for interacting with the initscripts table in the database
#
class InitScripts(Table):
"""
- Representation of the initscipts table in the database.
+ Representation of the initscripts table in the database.
"""
def __init__(self, api, initscript_filter = None, columns = None):
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision$
+#
+from PLC.Faults import *
+from PLC.Parameter import Parameter
+from PLC.Filter import Filter
+from PLC.Table import Row, Table
+from PLC.TagTypes import TagType, TagTypes
+from PLC.Interfaces import Interface
+
+class InterfaceTag(Row):
+ """
+ Representation of a row in the interface_tag.
+ To use, instantiate with a dict of values.
+ """
+
+ table_name = 'interface_tag'
+ primary_key = 'interface_tag_id'
+ fields = {
+ 'interface_tag_id': Parameter(int, "Interface setting identifier"),
+ 'interface_id': Interface.fields['interface_id'],
+ 'ip': Interface.fields['ip'],
+ 'tag_type_id': TagType.fields['tag_type_id'],
+ 'tagname': TagType.fields['tagname'],
+ 'description': TagType.fields['description'],
+ 'category': TagType.fields['category'],
+ 'min_role_id': TagType.fields['min_role_id'],
+ 'value': Parameter(str, "Interface setting value"),
+ ### relations
+
+ }
+
+class InterfaceTags(Table):
+ """
+ Representation of row(s) from the interface_tag table in the
+ database.
+ """
+
+ def __init__(self, api, interface_tag_filter = None, columns = None):
+ Table.__init__(self, api, InterfaceTag, columns)
+
+ sql = "SELECT %s FROM view_interface_tags WHERE True" % \
+ ", ".join(self.columns)
+
+ if interface_tag_filter is not None:
+ if isinstance(interface_tag_filter, (list, tuple, set)):
+ interface_tag_filter = Filter(InterfaceTag.fields, {'interface_tag_id': interface_tag_filter})
+ elif isinstance(interface_tag_filter, dict):
+ interface_tag_filter = Filter(InterfaceTag.fields, interface_tag_filter)
+ elif isinstance(interface_tag_filter, int):
+ interface_tag_filter = Filter(InterfaceTag.fields, {'interface_tag_id': [interface_tag_filter]})
+ else:
+ raise PLCInvalidArgument, "Wrong interface setting filter %r"%interface_tag_filter
+ sql += " AND (%s) %s" % interface_tag_filter.sql(api)
+
+
+ self.selectall(sql)
#
-# Functions for interacting with the nodenetworks table in the database
+# Functions for interacting with the interfaces table in the database
#
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from types import StringTypes
return (address1 & netmask) == (address2 & netmask)
-class NodeNetwork(Row):
+class Interface(Row):
"""
- Representation of a row in the nodenetworks table. To use, optionally
+ Representation of a row in the interfaces table. To use, optionally
instantiate with a dict of values. Update as you would a
dict. Commit to the database with sync().
"""
- table_name = 'nodenetworks'
- primary_key = 'nodenetwork_id'
- join_tables = ['nodenetwork_setting']
+ table_name = 'interfaces'
+ primary_key = 'interface_id'
+ join_tables = ['interface_tag']
fields = {
- 'nodenetwork_id': Parameter(int, "Node interface identifier"),
+ 'interface_id': Parameter(int, "Node interface identifier"),
'method': Parameter(str, "Addressing method (e.g., 'static' or 'dhcp')"),
'type': Parameter(str, "Address type (e.g., 'ipv4')"),
'ip': Parameter(str, "IP address", nullok = True),
'hostname': Parameter(str, "(Optional) Hostname", nullok = True),
'node_id': Parameter(int, "Node associated with this interface"),
'is_primary': Parameter(bool, "Is the primary interface for this node"),
- 'nodenetwork_setting_ids' : Parameter([int], "List of nodenetwork settings"),
+ 'interface_tag_ids' : Parameter([int], "List of interface settings"),
}
+ view_tags_name = "view_interface_tags"
+ tags = {}
+
def validate_method(self, method):
network_methods = [row['method'] for row in NetworkMethods(self.api)]
if method not in network_methods:
raise PLCInvalidArgument, "No such node %d"%node_id
node = nodes[0]
- if node['nodenetwork_ids']:
- conflicts = NodeNetworks(self.api, node['nodenetwork_ids'])
- for nodenetwork in conflicts:
- if ('nodenetwork_id' not in self or \
- self['nodenetwork_id'] != nodenetwork['nodenetwork_id']) and \
- nodenetwork['is_primary']:
+ if node['interface_ids']:
+ conflicts = Interfaces(self.api, node['interface_ids'])
+ for interface in conflicts:
+ if ('interface_id' not in self or \
+ self['interface_id'] != interface['interface_id']) and \
+ interface['is_primary']:
raise PLCInvalidArgument, "Can only set one primary interface per node"
return is_primary
if 'ip' not in self or not self['ip']:
raise PLCInvalidArgument, "For ipmi method, ip is required"
-class NodeNetworks(Table):
+class Interfaces(Table):
"""
- Representation of row(s) from the nodenetworks table in the
+ Representation of row(s) from the interfaces table in the
database.
"""
- def __init__(self, api, nodenetwork_filter = None, columns = None):
- Table.__init__(self, api, NodeNetwork, columns)
-
- sql = "SELECT %s FROM view_nodenetworks WHERE True" % \
- ", ".join(self.columns)
-
- if nodenetwork_filter is not None:
- if isinstance(nodenetwork_filter, (list, tuple, set)):
- nodenetwork_filter = Filter(NodeNetwork.fields, {'nodenetwork_id': nodenetwork_filter})
- elif isinstance(nodenetwork_filter, dict):
- nodenetwork_filter = Filter(NodeNetwork.fields, nodenetwork_filter)
- elif isinstance(nodenetwork_filter, int):
- nodenetwork_filter = Filter(NodeNetwork.fields, {'nodenetwork_id': [nodenetwork_filter]})
+ def __init__(self, api, interface_filter = None, columns = None):
+ Table.__init__(self, api, Interface, columns)
+
+ # the view that we're selecting upon: start with view_nodes
+ view = "view_interfaces"
+ # as many left joins as requested tags
+ for tagname in self.tag_columns:
+ view= "%s left join %s using (%s)"%(view,Interface.tagvalue_view_name(tagname),
+ Interface.primary_key)
+
+ sql = "SELECT %s FROM %s WHERE True" % \
+ (", ".join(self.columns.keys()+self.tag_columns.keys()),view)
+
+ if interface_filter is not None:
+ if isinstance(interface_filter, (list, tuple, set)):
+ # Separate the list into integers and strings
+ ints = filter(lambda x: isinstance(x, (int, long)), interface_filter)
+ strs = filter(lambda x: isinstance(x, StringTypes), interface_filter)
+ interface_filter = Filter(Interface.fields, {'interface_id': ints, 'ip': strs})
+ sql += " AND (%s) %s" % interface_filter.sql(api, "OR")
+ elif isinstance(interface_filter, dict):
+ allowed_fields=dict(Interface.fields.items()+Interface.tags.items())
+ interface_filter = Filter(allowed_fields, interface_filter)
+ sql += " AND (%s) %s" % interface_filter.sql(api)
+ elif isinstance(interface_filter, int):
+ interface_filter = Filter(Interface.fields, {'interface_id': [interface_filter]})
+ sql += " AND (%s) %s" % interface_filter.sql(api)
+ elif isinstance (interface_filter, StringTypes):
+ interface_filter = Filter(Interface.fields, {'ip':[interface_filter]})
+ sql += " AND (%s) %s" % interface_filter.sql(api, "AND")
else:
- raise PLCInvalidArgument, "Wrong node network filter %r"%nodenetwork_filter
- sql += " AND (%s) %s" % nodenetwork_filter.sql(api)
+ raise PLCInvalidArgument, "Wrong interface filter %r"%interface_filter
self.selectall(sql)
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from PLC.Faults import *
+# $Id$
+# $URL$
import re
from PLC.Faults import *
'peer_key_id': Parameter(int, "Foreign key identifier at peer", nullok = True),
}
- # for Cache
- class_key= 'key'
- foreign_fields = ['key_type']
- foreign_xrefs = []
-
def validate_key_type(self, key_type):
key_types = [row['key_type'] for row in KeyTypes(self.api)]
if key_type not in key_types:
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacyNodeNetworks import v42rename, v43rename
+from PLC.Methods.AddInterface import AddInterface
+class AddNodeNetwork(AddInterface):
+ """ Legacy version of AddInterface. """
+ status = "deprecated"
+ def call(self, auth, node_id_or_hostname, interface_fields):
+ node_id_or_hostname=patch(node_id_or_hostname,v42rename)
+ interface_fields=patch(interface_fields,v42rename)
+ result=AddInterface.call(self,auth,node_id_or_hostname,interface_fields)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacyNodeNetworkSettings import v42rename, v43rename
+from PLC.Methods.AddInterfaceTag import AddInterfaceTag
+class AddNodeNetworkSetting(AddInterfaceTag):
+ """ Legacy version of AddInterfaceTag. """
+ status = "deprecated"
+ def call(self, auth, interface_id, tag_type_id_or_name, value):
+ interface_id=patch(interface_id,v42rename)
+ tag_type_id_or_name=patch(tag_type_id_or_name,v42rename)
+ value=patch(value,v42rename)
+ result=AddInterfaceTag.call(self,auth,interface_id,tag_type_id_or_name,value)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacyNodeNetworkSettingTypes import v42rename, v43rename
+from PLC.Methods.AddTagType import AddTagType
+class AddNodeNetworkSettingType(AddTagType):
+ """ Legacy version of AddTagType. """
+ status = "deprecated"
+ def call(self, auth, tag_type_fields):
+ tag_type_fields=patch(tag_type_fields,v42rename)
+ result=AddTagType.call(self,auth,tag_type_fields)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacySliceAttributes import v42rename, v43rename
+from PLC.Methods.AddSliceTag import AddSliceTag
+class AddSliceAttribute(AddSliceTag):
+ """ Legacy version of AddSliceTag. """
+ status = "deprecated"
+ def call(self, auth, slice_id_or_name, tag_type_id_or_name, value, node_id_or_hostname = None, nodegroup_id_or_name = None):
+ slice_id_or_name=patch(slice_id_or_name,v42rename)
+ tag_type_id_or_name=patch(tag_type_id_or_name,v42rename)
+ value=patch(value,v42rename)
+ node_id_or_hostname=patch(node_id_or_hostname,v42rename)
+ nodegroup_id_or_name=patch(nodegroup_id_or_name,v42rename)
+ result=AddSliceTag.call(self,auth,slice_id_or_name,tag_type_id_or_name,value,node_id_or_hostname,nodegroup_id_or_name)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacySliceAttributeTypes import v42rename, v43rename
+from PLC.Methods.AddTagType import AddTagType
+class AddSliceAttributeType(AddTagType):
+ """ Legacy version of AddTagType. """
+ status = "deprecated"
+ def call(self, auth, tag_type_fields):
+ tag_type_fields=patch(tag_type_fields,v42rename)
+ result=AddTagType.call(self,auth,tag_type_fields)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacyNodeNetworks import v42rename, v43rename
+from PLC.Methods.DeleteInterface import DeleteInterface
+class DeleteNodeNetwork(DeleteInterface):
+ """ Legacy version of DeleteInterface. """
+ status = "deprecated"
+ def call(self, auth, interface_id):
+ interface_id=patch(interface_id,v42rename)
+ result=DeleteInterface.call(self,auth,interface_id)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacyNodeNetworkSettings import v42rename, v43rename
+from PLC.Methods.DeleteInterfaceTag import DeleteInterfaceTag
+class DeleteNodeNetworkSetting(DeleteInterfaceTag):
+ """ Legacy version of DeleteInterfaceTag. """
+ status = "deprecated"
+ def call(self, auth, interface_tag_id):
+ interface_tag_id=patch(interface_tag_id,v42rename)
+ result=DeleteInterfaceTag.call(self,auth,interface_tag_id)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacyNodeNetworkSettingTypes import v42rename, v43rename
+from PLC.Methods.DeleteTagType import DeleteTagType
+class DeleteNodeNetworkSettingType(DeleteTagType):
+ """ Legacy version of DeleteTagType. """
+ status = "deprecated"
+ def call(self, auth, tag_type_id_or_name):
+ tag_type_id_or_name=patch(tag_type_id_or_name,v42rename)
+ result=DeleteTagType.call(self,auth,tag_type_id_or_name)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacySliceAttributes import v42rename, v43rename
+from PLC.Methods.DeleteSliceTag import DeleteSliceTag
+class DeleteSliceAttribute(DeleteSliceTag):
+ """ Legacy version of DeleteSliceTag. """
+ status = "deprecated"
+ def call(self, auth, slice_tag_id):
+ slice_tag_id=patch(slice_tag_id,v42rename)
+ result=DeleteSliceTag.call(self,auth,slice_tag_id)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacySliceAttributeTypes import v42rename, v43rename
+from PLC.Methods.DeleteTagType import DeleteTagType
+class DeleteSliceAttributeType(DeleteTagType):
+ """ Legacy version of DeleteTagType. """
+ status = "deprecated"
+ def call(self, auth, tag_type_id_or_name):
+ tag_type_id_or_name=patch(tag_type_id_or_name,v42rename)
+ result=DeleteTagType.call(self,auth,tag_type_id_or_name)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacyNodeNetworkSettingTypes import v42rename, v43rename
+from PLC.Methods.GetTagTypes import GetTagTypes
+class GetNodeNetworkSettingTypes(GetTagTypes):
+ """ Legacy version of GetTagTypes. """
+ status = "deprecated"
+ def call(self, auth, tag_type_filter = None, return_fields = None):
+ tag_type_filter=patch(tag_type_filter,v42rename)
+ return_fields=patch(return_fields,v42rename)
+ result=GetTagTypes.call(self,auth,tag_type_filter,return_fields)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacyNodeNetworkSettings import v42rename, v43rename
+from PLC.Methods.GetInterfaceTags import GetInterfaceTags
+class GetNodeNetworkSettings(GetInterfaceTags):
+ """ Legacy version of GetInterfaceTags. """
+ status = "deprecated"
+ def call(self, auth, interface_tag_filter = None, return_fields = None):
+ interface_tag_filter=patch(interface_tag_filter,v42rename)
+ return_fields=patch(return_fields,v42rename)
+ result=GetInterfaceTags.call(self,auth,interface_tag_filter,return_fields)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacyNodeNetworks import v42rename, v43rename
+from PLC.Methods.GetInterfaces import GetInterfaces
+class GetNodeNetworks(GetInterfaces):
+ """ Legacy version of GetInterfaces. """
+ status = "deprecated"
+ def call(self, auth, interface_filter = None, return_fields = None):
+ interface_filter=patch(interface_filter,v42rename)
+ return_fields=patch(return_fields,v42rename)
+ result=GetInterfaces.call(self,auth,interface_filter,return_fields)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacySliceAttributeTypes import v42rename, v43rename
+from PLC.Methods.GetTagTypes import GetTagTypes
+class GetSliceAttributeTypes(GetTagTypes):
+ """ Legacy version of GetTagTypes. """
+ status = "deprecated"
+ def call(self, auth, tag_type_filter = None, return_fields = None):
+ tag_type_filter=patch(tag_type_filter,v42rename)
+ return_fields=patch(return_fields,v42rename)
+ result=GetTagTypes.call(self,auth,tag_type_filter,return_fields)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacySliceAttributes import v42rename, v43rename
+from PLC.Methods.GetSliceTags import GetSliceTags
+class GetSliceAttributes(GetSliceTags):
+ """ Legacy version of GetSliceTags. """
+ status = "deprecated"
+ def call(self, auth, slice_tag_filter = None, return_fields = None):
+ slice_tag_filter=patch(slice_tag_filter,v42rename)
+ return_fields=patch(return_fields,v42rename)
+ result=GetSliceTags.call(self,auth,slice_tag_filter,return_fields)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacyNodeNetworks import v42rename, v43rename
+from PLC.Methods.UpdateInterface import UpdateInterface
+class UpdateNodeNetwork(UpdateInterface):
+ """ Legacy version of UpdateInterface. """
+ status = "deprecated"
+ def call(self, auth, interface_id, interface_fields):
+ interface_id=patch(interface_id,v42rename)
+ interface_fields=patch(interface_fields,v42rename)
+ result=UpdateInterface.call(self,auth,interface_id,interface_fields)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacyNodeNetworkSettings import v42rename, v43rename
+from PLC.Methods.UpdateInterfaceTag import UpdateInterfaceTag
+class UpdateNodeNetworkSetting(UpdateInterfaceTag):
+ """ Legacy version of UpdateInterfaceTag. """
+ status = "deprecated"
+ def call(self, auth, interface_tag_id, value):
+ interface_tag_id=patch(interface_tag_id,v42rename)
+ value=patch(value,v42rename)
+ result=UpdateInterfaceTag.call(self,auth,interface_tag_id,value)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacyNodeNetworkSettingTypes import v42rename, v43rename
+from PLC.Methods.UpdateTagType import UpdateTagType
+class UpdateNodeNetworkSettingType(UpdateTagType):
+ """ Legacy version of UpdateTagType. """
+ status = "deprecated"
+ def call(self, auth, tag_type_id_or_name, tag_type_fields):
+ tag_type_id_or_name=patch(tag_type_id_or_name,v42rename)
+ tag_type_fields=patch(tag_type_fields,v42rename)
+ result=UpdateTagType.call(self,auth,tag_type_id_or_name,tag_type_fields)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacySliceAttributes import v42rename, v43rename
+from PLC.Methods.UpdateSliceTag import UpdateSliceTag
+class UpdateSliceAttribute(UpdateSliceTag):
+ """ Legacy version of UpdateSliceTag. """
+ status = "deprecated"
+ def call(self, auth, slice_tag_id, value):
+ slice_tag_id=patch(slice_tag_id,v42rename)
+ value=patch(value,v42rename)
+ result=UpdateSliceTag.call(self,auth,slice_tag_id,value)
+ return patch(result,v43rename)
--- /dev/null
+# $Id$
+# $URL$
+from PLC.v42Legacy import patch
+from PLC.v42LegacySliceAttributeTypes import v42rename, v43rename
+from PLC.Methods.UpdateTagType import UpdateTagType
+class UpdateSliceAttributeType(UpdateTagType):
+ """ Legacy version of UpdateTagType. """
+ status = "deprecated"
+ def call(self, auth, tag_type_id_or_name, tag_type_fields):
+ tag_type_id_or_name=patch(tag_type_id_or_name,v42rename)
+ tag_type_fields=patch(tag_type_fields,v42rename)
+ result=UpdateTagType.call(self,auth,tag_type_id_or_name,tag_type_fields)
+ return patch(result,v43rename)
--- /dev/null
+## Please use make index to update this file
+native_methods = """
+AddNodeNetwork
+AddNodeNetworkSetting
+AddNodeNetworkSettingType
+AddSliceAttribute
+AddSliceAttributeType
+DeleteNodeNetwork
+DeleteNodeNetworkSetting
+DeleteNodeNetworkSettingType
+DeleteSliceAttribute
+DeleteSliceAttributeType
+GetNodeNetworkSettingTypes
+GetNodeNetworkSettings
+GetNodeNetworks
+GetSliceAttributeTypes
+GetSliceAttributes
+UpdateNodeNetwork
+UpdateNodeNetworkSetting
+UpdateNodeNetworkSettingType
+UpdateSliceAttribute
+UpdateSliceAttributeType
+""".split()
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from PLC.Parameter import Parameter
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
import xmlrpclib
from PLC.Nodes import Node, Nodes
from PLC.Persons import Person, Persons
-class Method:
+# we inherit object because we use new-style classes for legacy methods
+class Method (object):
"""
Base class for all PLCAPI functions. At a minimum, all PLCAPI
functions must define:
try:
start = time.time()
- (min_args, max_args, defaults) = self.args()
+
+ # legacy code cannot be type-checked, due to the way Method.args() works
+ if not hasattr(self,"skip_typecheck"):
+ (min_args, max_args, defaults) = self.args()
- # Check that the right number of arguments were passed in
- if len(args) < len(min_args) or len(args) > len(max_args):
- raise PLCInvalidArgumentCount(len(args), len(min_args), len(max_args))
+ # Check that the right number of arguments were passed in
+ if len(args) < len(min_args) or len(args) > len(max_args):
+ raise PLCInvalidArgumentCount(len(args), len(min_args), len(max_args))
- for name, value, expected in zip(max_args, args, self.accepts):
- self.type_check(name, value, expected, args)
+ for name, value, expected in zip(max_args, args, self.accepts):
+ self.type_check(name, value, expected, args)
result = self.call(*args, **kwds)
runtime = time.time() - start
-
+
if self.api.config.PLC_API_DEBUG or hasattr(self, 'message'):
self.log(None, runtime, *args)
# Prepend caller and method name to expected faults
fault.faultString = caller + ": " + self.name + ": " + fault.faultString
runtime = time.time() - start
- self.log(fault, runtime, *args)
- raise fault
+
+ if self.api.config.PLC_API_DEBUG:
+ self.log(fault, runtime, *args)
+
+ raise fault
def log(self, fault, runtime, *args):
"""
# Do not log system or Get calls
#if self.name.startswith('system') or self.name.startswith('Get'):
# return False
+ # Do not log ReportRunlevel
+ if self.name.startswith('system'):
+ return False
+ if self.name.startswith('ReportRunlevel'):
+ return False
# Create a new event
event = Event(self.api)
event['runtime'] = runtime
# Redact passwords and sessions
- if args and isinstance(args[0], dict):
- # what type of auth this is
- if args[0].has_key('AuthMethod'):
- auth_methods = ['session', 'password', 'capability', 'gpg', 'hmac','anonymous']
- auth_method = args[0]['AuthMethod']
- if auth_method in auth_methods:
- event['auth_type'] = auth_method
- for password in 'AuthString', 'session':
- if args[0].has_key(password):
- auth = args[0].copy()
- auth[password] = "Removed by API"
- args = (auth,) + args[1:]
+ newargs = args
+ if args:
+ newargs = []
+ for arg in args:
+ if not isinstance(arg, dict):
+ newargs.append(arg)
+ continue
+ # what type of auth this is
+ if arg.has_key('AuthMethod'):
+ auth_methods = ['session', 'password', 'capability', 'gpg', 'hmac','anonymous']
+ auth_method = arg['AuthMethod']
+ if auth_method in auth_methods:
+ event['auth_type'] = auth_method
+ for password in 'AuthString', 'session', 'password':
+ if arg.has_key(password):
+ arg = arg.copy()
+ arg[password] = "Removed by API"
+ newargs.append(arg)
# Log call representation
# XXX Truncate to avoid DoS
- event['call'] = self.name + pprint.saferepr(args)
+ event['call'] = self.name + pprint.saferepr(newargs)
event['call_name'] = self.name
# Both users and nodes can call some methods
That represents the minimum and maximum sets of arguments that
this function accepts and the defaults for the optional arguments.
"""
-
+
# Inspect call. Remove self from the argument list.
max_args = self.call.func_code.co_varnames[1:self.call.func_code.co_argcount]
defaults = self.call.func_defaults
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
Auth(),
ConfFile.fields['conf_file_id'],
Mixed(NodeGroup.fields['nodegroup_id'],
- NodeGroup.fields['name'])
+ NodeGroup.fields['groupname'])
]
returns = Parameter(int, '1 if successful')
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.TagTypes import TagType, TagTypes
+from PLC.Ilinks import Ilink, Ilinks
+from PLC.Interfaces import Interface, Interfaces
+
+from PLC.Sites import Sites
+
+class AddIlink(Method):
+ """
+ Create a link between two interfaces
+ The link has a tag type, that needs be created beforehand
+ and an optional value.
+
+ Returns the new ilink_id (> 0) if successful, faults
+ otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech', 'user']
+
+ accepts = [
+ Auth(),
+ # refer to either the id or the type name
+ Ilink.fields['src_interface_id'],
+ Ilink.fields['dst_interface_id'],
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
+ Ilink.fields['value'],
+ ]
+
+ returns = Parameter(int, 'New ilink_id (> 0) if successful')
+
+ def call(self, auth, src_if_id, dst_if_id, tag_type_id_or_name, value):
+
+ src_if = Interfaces (self.api, [src_if_id],['interface_id'])
+ if not src_if:
+ raise PLCInvalidArgument, "No such source interface %r"%src_if_id
+ dst_if = Interfaces (self.api, [dst_if_id],['interface_id'])
+ if not dst_if:
+ raise PLCInvalidArgument, "No such destination interface %r"%dst_if_id
+
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "AddIlink: No such tag type %r"%tag_type_id_or_name
+ tag_type = tag_types[0]
+
+ # checks for existence - with the same type
+ conflicts = Ilinks(self.api,
+ {'tag_type_id':tag_type['tag_type_id'],
+ 'src_interface_id':src_if_id,
+ 'dst_interface_id':dst_if_id,})
+
+ if len(conflicts) :
+ ilink=conflicts[0]
+ raise PLCInvalidArgument, "Ilink (%s,%d,%d) already exists and has value %r"\
+ %(tag_type['name'],src_if_id,dst_if_id,ilink['value'])
+
+ if 'admin' not in self.caller['roles']:
+# # check permission : it not admin, is the user affiliated with the right site(s) ????
+# # locate node
+# node = Nodes (self.api,[node['node_id']])[0]
+# # locate site
+# site = Sites (self.api, [node['site_id']])[0]
+# # check caller is affiliated with this site
+# if self.caller['person_id'] not in site['person_ids']:
+# raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified ilink, requires role %d",required_min_role
+
+ ilink = Ilink(self.api)
+ ilink['tag_type_id'] = tag_type['tag_type_id']
+ ilink['src_interface_id'] = src_if_id
+ ilink['dst_interface_id'] = dst_if_id
+ ilink['value'] = value
+
+ ilink.sync()
+
+ self.object_type = 'Interface'
+ self.object_ids = [src_if_id,dst_if_id]
+
+ return ilink['ilink_id']
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
--- /dev/null
+# $Id$
+# $URL$
+from PLC.Faults import *
+from PLC.Auth import Auth
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Table import Row
+
+from PLC.Nodes import Node, Nodes
+from PLC.Interfaces import Interface, Interfaces
+from PLC.TagTypes import TagTypes
+from PLC.InterfaceTags import InterfaceTags
+from PLC.Methods.AddInterfaceTag import AddInterfaceTag
+from PLC.Methods.UpdateInterfaceTag import UpdateInterfaceTag
+
+cannot_update = ['interface_id', 'node_id']
+
+class AddInterface(Method):
+ """
+
+ Adds a new network for a node. Any values specified in
+ interface_fields are used, otherwise defaults are
+ used.
+
+ If type is static, then ip, gateway, network, broadcast, netmask,
+ and dns1 must all be specified in interface_fields. If type is
+ dhcp, these parameters, even if specified, are ignored.
+
+ PIs and techs may only add interfaces to their own nodes. Admins may
+ add interfaces to any node.
+
+ Returns the new interface_id (> 0) if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech']
+
+ accepted_fields = Row.accepted_fields(cannot_update, Interface.fields, exclude=True)
+ accepted_fields.update(Interface.tags)
+
+ accepts = [
+ Auth(),
+ Mixed(Node.fields['node_id'],
+ Node.fields['hostname']),
+ accepted_fields
+ ]
+
+ returns = Parameter(int, 'New interface_id (> 0) if successful')
+
+
+ def call(self, auth, node_id_or_hostname, interface_fields):
+
+ [native,tags,rejected]=Row.split_fields(interface_fields,[Interface.fields,Interface.tags])
+
+ # type checking
+ native = Row.check_fields (native, self.accepted_fields)
+ if rejected:
+ raise PLCInvalidArgument, "Cannot add Interface with column(s) %r"%rejected
+
+ # Check if node exists
+ nodes = Nodes(self.api, [node_id_or_hostname])
+ if not nodes:
+ raise PLCInvalidArgument, "No such node %r"%node_id_or_hostname
+ node = nodes[0]
+
+ # Authenticated function
+ assert self.caller is not None
+
+ # If we are not an admin, make sure that the caller is a
+ # member of the site where the node exists.
+ if 'admin' not in self.caller['roles']:
+ if node['site_id'] not in self.caller['site_ids']:
+ raise PLCPermissionDenied, "Not allowed to add an interface to the specified node"
+
+ # Add interface
+ interface = Interface(self.api, native)
+ interface['node_id'] = node['node_id']
+ # if this is the first interface, make it primary
+ if not node['interface_ids']:
+ interface['is_primary'] = True
+ interface.sync()
+
+ # Logging variables
+ self.object_objects = { 'Node': [node['node_id']],
+ 'Interface' : [interface['interface_id']] }
+ self.message = "Interface %d added" % interface['interface_id']
+
+ for (tagname,value) in tags.iteritems():
+ # the tagtype instance is assumed to exist, just check that
+ if not TagTypes(self.api,{'tagname':tagname}):
+ raise PLCInvalidArgument,"No such TagType %s"%tagname
+ interface_tags=InterfaceTags(self.api,{'tagname':tagname,'interface_id':interface['interface_id']})
+ if not interface_tags:
+ AddInterfaceTag(self.api).__call__(auth,interface['interface_id'],tagname,value)
+ else:
+ UpdateInterfaceTag(self.api).__call__(auth,interface_tags[0]['interface_tag_id'],value)
+
+ return interface['interface_id']
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision$
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.TagTypes import TagType, TagTypes
+from PLC.InterfaceTags import InterfaceTag, InterfaceTags
+from PLC.Interfaces import Interface, Interfaces
+
+from PLC.Nodes import Nodes
+from PLC.Sites import Sites
+
+class AddInterfaceTag(Method):
+ """
+ Sets the specified setting for the specified interface
+ to the specified value.
+
+ In general only tech(s), PI(s) and of course admin(s) are allowed to
+ do the change, but this is defined in the tag type object.
+
+ Returns the new interface_tag_id (> 0) if successful, faults
+ otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech', 'user']
+
+ accepts = [
+ Auth(),
+ # no other way to refer to a interface
+ InterfaceTag.fields['interface_id'],
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
+ InterfaceTag.fields['value'],
+ ]
+
+ returns = Parameter(int, 'New interface_tag_id (> 0) if successful')
+
+ object_type = 'Interface'
+
+
+ def call(self, auth, interface_id, tag_type_id_or_name, value):
+ interfaces = Interfaces(self.api, [interface_id])
+ if not interfaces:
+ raise PLCInvalidArgument, "No such interface %r"%interface_id
+ interface = interfaces[0]
+
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "No such tag type %r"%tag_type_id_or_name
+ tag_type = tag_types[0]
+
+ # checks for existence - does not allow several different settings
+ conflicts = InterfaceTags(self.api,
+ {'interface_id':interface['interface_id'],
+ 'tag_type_id':tag_type['tag_type_id']})
+
+ if len(conflicts) :
+ raise PLCInvalidArgument, "Interface %d already has setting %d"%(interface['interface_id'],
+ tag_type['tag_type_id'])
+
+ # check permission : it not admin, is the user affiliated with the right site
+ if 'admin' not in self.caller['roles']:
+ # locate node
+ node = Nodes (self.api,[interface['node_id']])[0]
+ # locate site
+ site = Sites (self.api, [node['site_id']])[0]
+ # check caller is affiliated with this site
+ if self.caller['person_id'] not in site['person_ids']:
+ raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified interface setting, requires role %d",required_min_role
+
+ interface_tag = InterfaceTag(self.api)
+ interface_tag['interface_id'] = interface['interface_id']
+ interface_tag['tag_type_id'] = tag_type['tag_type_id']
+ interface_tag['value'] = value
+
+ interface_tag.sync()
+ self.object_ids = [interface_tag['interface_tag_id']]
+
+ return interface_tag['interface_tag_id']
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
+from PLC.Auth import Auth
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Nodes import Node, Nodes
-from PLC.NodeGroups import NodeGroup, NodeGroups
+from PLC.Table import Row
+
from PLC.Sites import Site, Sites
-from PLC.Auth import Auth
+from PLC.Nodes import Node, Nodes
+from PLC.TagTypes import TagTypes
+from PLC.NodeTags import NodeTags
+from PLC.Methods.AddNodeTag import AddNodeTag
+from PLC.Methods.UpdateNodeTag import UpdateNodeTag
-can_update = lambda (field, value): field in \
- ['hostname', 'boot_state', 'model', 'version']
+can_update = ['hostname', 'node_type', 'boot_state', 'model', 'version']
class AddNode(Method):
"""
roles = ['admin', 'pi', 'tech']
- node_fields = dict(filter(can_update, Node.fields.items()))
+ accepted_fields = Row.accepted_fields(can_update,Node.fields)
+ accepted_fields.update(Node.tags)
accepts = [
Auth(),
Mixed(Site.fields['site_id'],
Site.fields['login_base']),
- node_fields
+ accepted_fields
]
returns = Parameter(int, 'New node_id (> 0) if successful')
def call(self, auth, site_id_or_login_base, node_fields):
- node_fields = dict(filter(can_update, node_fields.items()))
+
+ [native,tags,rejected]=Row.split_fields(node_fields,[Node.fields,Node.tags])
+
+ # type checking
+ native = Row.check_fields(native, self.accepted_fields)
+ if rejected:
+ raise PLCInvalidArgument, "Cannot add Node with column(s) %r"%rejected
# Get site information
sites = Sites(self.api, [site_id_or_login_base])
else:
assert self.caller['person_id'] in site['person_ids']
- node = Node(self.api, node_fields)
+ node = Node(self.api, native)
node['site_id'] = site['site_id']
node.sync()
- self.event_objects = {'Site': [site['site_id']],
- 'Node': [node['node_id']]}
- self.message = "Node %s created" % node['node_id']
+ for (tagname,value) in tags.iteritems():
+ # the tagtype instance is assumed to exist, just check that
+ if not TagTypes(self.api,{'tagname':tagname}):
+ raise PLCInvalidArgument,"No such TagType %s"%tagname
+ node_tags=NodeTags(self.api,{'tagname':tagname,'node_id':node['node_id']})
+ if not node_tags:
+ AddNodeTag(self.api).__call__(auth,node['node_id'],tagname,value)
+ else:
+ UpdateNodeTag(self.api).__call__(auth,node_tags[0]['node_tag_id'],value)
+ self.event_objects = {'Site': [site['site_id']],
+ 'Node': [node['node_id']]}
+ self.message = "Node %s created" % node['node_id']
+
return node['node_id']
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.NodeGroups import NodeGroup, NodeGroups
from PLC.Auth import Auth
-can_update = lambda (field, value): field in \
- ['name', 'description']
+from PLC.NodeGroups import NodeGroup, NodeGroups
+from PLC.TagTypes import TagType, TagTypes
+from PLC.NodeTags import NodeTag, NodeTags
+
+can_update = lambda (field, value): field in NodeGroup.fields.keys() and field != NodeGroup.primary_field
class AddNodeGroup(Method):
"""
accepts = [
Auth(),
- nodegroup_fields
+ NodeGroup.fields['groupname'],
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
+ NodeTag.fields['value'],
]
returns = Parameter(int, 'New nodegroup_id (> 0) if successful')
- def call(self, auth, nodegroup_fields):
- nodegroup_fields = dict(filter(can_update, nodegroup_fields.items()))
+ def call(self, auth, groupname, tag_type_id_or_tagname, value):
+ # locate tag type
+ tag_types = TagTypes (self.api,[tag_type_id_or_tagname])
+ if not(tag_types):
+ raise PLCInvalidArgument, "No such tag type %r"%tag_type_id_or_tagname
+ tag_type=tag_types[0]
+
+ nodegroup_fields = { 'groupname' : groupname,
+ 'tag_type_id' : tag_type['tag_type_id'],
+ 'value' : value }
nodegroup = NodeGroup(self.api, nodegroup_fields)
nodegroup.sync()
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field not in ['nodenetwork_id', 'node_id']
-
-class AddNodeNetwork(Method):
- """
-
- Adds a new network for a node. Any values specified in
- nodenetwork_fields are used, otherwise defaults are
- used. Acceptable values for method may be retrieved via
- GetNetworkMethods. Acceptable values for type may be retrieved via
- GetNetworkTypes.
-
- If type is static, ip, gateway, network, broadcast, netmask, and
- dns1 must all be specified in nodenetwork_fields. If type is dhcp,
- these parameters, even if specified, are ignored.
-
- PIs and techs may only add networks to their own nodes. Admins may
- add networks to any node.
-
- Returns the new nodenetwork_id (> 0) if successful, faults otherwise.
- """
-
- roles = ['admin', 'pi', 'tech']
-
- nodenetwork_fields = dict(filter(can_update, NodeNetwork.fields.items()))
-
- accepts = [
- Auth(),
- Mixed(Node.fields['node_id'],
- Node.fields['hostname']),
- nodenetwork_fields
- ]
-
- returns = Parameter(int, 'New nodenetwork_id (> 0) if successful')
-
-
- def call(self, auth, node_id_or_hostname, nodenetwork_fields):
- nodenetwork_fields = dict(filter(can_update, nodenetwork_fields.items()))
-
- # Check if node exists
- nodes = Nodes(self.api, [node_id_or_hostname])
- if not nodes:
- raise PLCInvalidArgument, "No such node"
- node = nodes[0]
-
- # Authenticated function
- assert self.caller is not None
-
- # If we are not an admin, make sure that the caller is a
- # member of the site where the node exists.
- if 'admin' not in self.caller['roles']:
- if node['site_id'] not in self.caller['site_ids']:
- raise PLCPermissionDenied, "Not allowed to add node network for specified node"
-
- # Add node network
- nodenetwork = NodeNetwork(self.api, nodenetwork_fields)
- nodenetwork['node_id'] = node['node_id']
- # if this is the first node network, make it primary
- if not node['nodenetwork_ids']:
- nodenetwork['is_primary'] = True
- nodenetwork.sync()
-
- # Logging variables
- self.object_ids = [node['node_id'], nodenetwork['nodenetwork_id']]
- self.messgage = "Node network %d added" % nodenetwork['nodenetwork_id']
-
- return nodenetwork['nodenetwork_id']
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import Auth
-
-from PLC.NodeNetworkSettingTypes import NodeNetworkSettingType, NodeNetworkSettingTypes
-from PLC.NodeNetworkSettings import NodeNetworkSetting, NodeNetworkSettings
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-
-from PLC.Nodes import Nodes
-from PLC.Sites import Sites
-
-class AddNodeNetworkSetting(Method):
- """
- Sets the specified setting for the specified nodenetwork
- to the specified value.
-
- In general only tech(s), PI(s) and of course admin(s) are allowed to
- do the change, but this is defined in the nodenetwork setting type object.
-
- Returns the new nodenetwork_setting_id (> 0) if successful, faults
- otherwise.
- """
-
- roles = ['admin', 'pi', 'tech', 'user']
-
- accepts = [
- Auth(),
- # no other way to refer to a nodenetwork
- NodeNetworkSetting.fields['nodenetwork_id'],
- Mixed(NodeNetworkSettingType.fields['nodenetwork_setting_type_id'],
- NodeNetworkSettingType.fields['name']),
- NodeNetworkSetting.fields['value'],
- ]
-
- returns = Parameter(int, 'New nodenetwork_setting_id (> 0) if successful')
-
- object_type = 'NodeNetwork'
-
-
- def call(self, auth, nodenetwork_id, nodenetwork_setting_type_id_or_name, value):
- nodenetworks = NodeNetworks(self.api, [nodenetwork_id])
- if not nodenetworks:
- raise PLCInvalidArgument, "No such nodenetwork %r"%nodenetwork_id
- nodenetwork = nodenetworks[0]
-
- nodenetwork_setting_types = NodeNetworkSettingTypes(self.api, [nodenetwork_setting_type_id_or_name])
- if not nodenetwork_setting_types:
- raise PLCInvalidArgument, "No such nodenetwork setting type %r"%nodenetwork_setting_type_id_or_name
- nodenetwork_setting_type = nodenetwork_setting_types[0]
-
- # checks for existence - does not allow several different settings
- conflicts = NodeNetworkSettings(self.api,
- {'nodenetwork_id':nodenetwork['nodenetwork_id'],
- 'nodenetwork_setting_type_id':nodenetwork_setting_type['nodenetwork_setting_type_id']})
-
- if len(conflicts) :
- raise PLCInvalidArgument, "Nodenetwork %d already has setting %d"%(nodenetwork['nodenetwork_id'],
- nodenetwork_setting_type['nodenetwork_setting_type_id'])
-
- # check permission : it not admin, is the user affiliated with the right site
- if 'admin' not in self.caller['roles']:
- # locate node
- node = Nodes (self.api,[nodenetwork['node_id']])[0]
- # locate site
- site = Sites (self.api, [node['site_id']])[0]
- # check caller is affiliated with this site
- if self.caller['person_id'] not in site['person_ids']:
- raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
-
- required_min_role = nodenetwork_setting_type ['min_role_id']
- if required_min_role is not None and \
- min(self.caller['role_ids']) > required_min_role:
- raise PLCPermissionDenied, "Not allowed to modify the specified nodenetwork setting, requires role %d",required_min_role
-
- nodenetwork_setting = NodeNetworkSetting(self.api)
- nodenetwork_setting['nodenetwork_id'] = nodenetwork['nodenetwork_id']
- nodenetwork_setting['nodenetwork_setting_type_id'] = nodenetwork_setting_type['nodenetwork_setting_type_id']
- nodenetwork_setting['value'] = value
-
- nodenetwork_setting.sync()
- self.object_ids = [nodenetwork_setting['nodenetwork_setting_id']]
-
- return nodenetwork_setting['nodenetwork_setting_id']
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-
-
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.NodeNetworkSettingTypes import NodeNetworkSettingType, NodeNetworkSettingTypes
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field in \
- ['name', 'description', 'category', 'min_role_id']
-
-class AddNodeNetworkSettingType(Method):
- """
- Adds a new type of nodenetwork setting.
- Any fields specified are used, otherwise defaults are used.
-
- Returns the new nodenetwork_setting_id (> 0) if successful,
- faults otherwise.
- """
-
- roles = ['admin']
-
- nodenetwork_setting_type_fields = dict(filter(can_update, NodeNetworkSettingType.fields.items()))
-
- accepts = [
- Auth(),
- nodenetwork_setting_type_fields
- ]
-
- returns = Parameter(int, 'New nodenetwork_setting_id (> 0) if successful')
-
-
- def call(self, auth, nodenetwork_setting_type_fields):
- nodenetwork_setting_type_fields = dict(filter(can_update, nodenetwork_setting_type_fields.items()))
- nodenetwork_setting_type = NodeNetworkSettingType(self.api, nodenetwork_setting_type_fields)
- nodenetwork_setting_type.sync()
-
- self.object_ids = [nodenetwork_setting_type['nodenetwork_setting_type_id']]
-
- return nodenetwork_setting_type['nodenetwork_setting_type_id']
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.Sites import Sites
+from PLC.Nodes import Node, Nodes
+from PLC.TagTypes import TagType, TagTypes
+from PLC.NodeTags import NodeTag, NodeTags
+
+
+class AddNodeTag(Method):
+ """
+ Sets the specified tag for the specified node
+ to the specified value.
+
+ In general only tech(s), PI(s) and of course admin(s) are allowed to
+ do the change, but this is defined in the node tag type object.
+
+ Returns the new node_tag_id (> 0) if successful, faults
+ otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech', 'user']
+
+ accepts = [
+ Auth(),
+ # no other way to refer to a node
+ Mixed(Node.fields['node_id'],
+ Node.fields['hostname']),
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
+ NodeTag.fields['value'],
+ ]
+
+ returns = Parameter(int, 'New node_tag_id (> 0) if successful')
+
+ object_type = 'Node'
+
+
+ def call(self, auth, node_id, tag_type_id_or_name, value):
+ nodes = Nodes(self.api, [node_id])
+ if not nodes:
+ raise PLCInvalidArgument, "No such node %r"%node_id
+ node = nodes[0]
+
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "No such node tag type %r"%tag_type_id_or_name
+ tag_type = tag_types[0]
+
+ # checks for existence - does not allow several different tags
+ conflicts = NodeTags(self.api,
+ {'node_id':node['node_id'],
+ 'tag_type_id':tag_type['tag_type_id']})
+
+ if len(conflicts) :
+ raise PLCInvalidArgument, "Node %d already has tag %d"%(node['node_id'],
+ tag_type['tag_type_id'])
+
+ # check permission : it not admin, is the user affiliated with the right site
+ if 'admin' not in self.caller['roles']:
+ # locate node
+ node = Nodes (self.api,[node['node_id']])[0]
+ # locate site
+ site = Sites (self.api, [node['site_id']])[0]
+ # check caller is affiliated with this site
+ if self.caller['person_id'] not in site['person_ids']:
+ raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified node tag, requires role %d",required_min_role
+
+ node_tag = NodeTag(self.api)
+ node_tag['node_id'] = node['node_id']
+ node_tag['tag_type_id'] = tag_type['tag_type_id']
+ node_tag['value'] = value
+
+ node_tag.sync()
+ self.object_ids = [node_tag['node_tag_id']]
+
+ return node_tag['node_tag_id']
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.NodeGroups import NodeGroup, NodeGroups
-from PLC.Nodes import Node, Nodes
-from PLC.Auth import Auth
-
-class AddNodeToNodeGroup(Method):
- """
- Add a node to the specified node group. If the node is
- already a member of the nodegroup, no errors are returned.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- accepts = [
- Auth(),
- Mixed(Node.fields['node_id'],
- Node.fields['hostname']),
- Mixed(NodeGroup.fields['nodegroup_id'],
- NodeGroup.fields['name']),
- ]
-
- returns = Parameter(int, '1 if successful')
-
-
- def call(self, auth, node_id_or_hostname, nodegroup_id_or_name):
- # Get node info
- nodes = Nodes(self.api, [node_id_or_hostname])
- if not nodes:
- raise PLCInvalidArgument, "No such node"
- node = nodes[0]
-
- if node['peer_id'] is not None:
- raise PLCInvalidArgument, "Not a local node"
-
- # Get nodegroup info
- nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
- if not nodegroups:
- raise PLCInvalidArgument, "No such nodegroup"
-
- nodegroup = nodegroups[0]
-
- # add node to nodegroup
- if node['node_id'] not in nodegroup['node_ids']:
- nodegroup.add_node(node)
-
- # Logging variables
- self.event_objects = {'NodeGroup': [nodegroup['nodegroup_id']],
- 'Node': [node['node_id']]}
- self.message = 'Node %d added to node group %d' % \
- (node['node_id'], nodegroup['nodegroup_id'])
- return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
--- /dev/null
+# $Id$
+# $URL$
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.NodeTypes import NodeType, NodeTypes
+from PLC.Auth import Auth
+
+class AddNodeType(Method):
+ """
+ Adds a new node node type.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin']
+
+ accepts = [
+ Auth(),
+ NodeType.fields['node_type']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+
+ def call(self, auth, name):
+ node_type = NodeType(self.api)
+ node_type['node_type'] = name
+ node_type.sync(insert = True)
+
+ return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
#
# Thierry Parmentelat - INRIA
#
from PLC.Peers import Peer, Peers
can_update = lambda (field, value): field in \
- ['peername', 'peer_url', 'key', 'cacert']
+ ['peername', 'peer_url', 'key', 'cacert', 'shortname', 'hrn_root']
class AddPeer(Method):
"""
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
person = Person(self.api, person_fields)
person.sync()
- # Logging variables
- self.event_objects = {'Person': [person['person_id']]}
- self.message = 'Person %d added' % person['person_id']
+ # Logging variables
+ self.event_objects = {'Person': [person['person_id']]}
+ self.message = 'Person %d added' % person['person_id']
return person['person_id']
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
if person['peer_id'] is not None:
raise PLCInvalidArgument, "Not a local account"
- # If we are not admin, make sure caller is adding a key to their account
+ # If we are not admin, make sure caller is adding a key to their account
if 'admin' not in self.caller['roles']:
if person['person_id'] != self.caller['person_id']:
raise PLCPermissionDenied, "You may only modify your own keys"
person.add_key(key, commit = True)
# Logging variables
- self.event_objects = {'Person': [person['person_id']],
- 'Key': [key['key_id']]}
- self.message = 'Key %d added to person %d' % \
- (key['key_id'], person['person_id'])
+ self.event_objects = {'Person': [person['person_id']],
+ 'Key': [key['key_id']]}
+ self.message = 'Key %d added to person %d' % \
+ (key['key_id'], person['person_id'])
return key['key_id']
--- /dev/null
+# $Id: AddPersonTag.py 14587 2009-07-19 13:18:50Z thierry $
+# $URL: http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.3-27/PLC/Methods/AddPersonTag.py $
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 14587 $
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.TagTypes import TagType, TagTypes
+from PLC.PersonTags import PersonTag, PersonTags
+from PLC.Persons import Person, Persons
+
+from PLC.Nodes import Nodes
+
+class AddPersonTag(Method):
+ """
+ Sets the specified setting for the specified person
+ to the specified value.
+
+ In general only tech(s), PI(s) and of course admin(s) are allowed to
+ do the change, but this is defined in the tag type object.
+
+ Returns the new person_tag_id (> 0) if successful, faults
+ otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech', 'user']
+
+ accepts = [
+ Auth(),
+ # no other way to refer to a person
+ PersonTag.fields['person_id'],
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
+ PersonTag.fields['value'],
+ ]
+
+ returns = Parameter(int, 'New person_tag_id (> 0) if successful')
+
+ object_type = 'Person'
+
+
+ def call(self, auth, person_id, tag_type_id_or_name, value):
+ persons = Persons(self.api, [person_id])
+ if not persons:
+ raise PLCInvalidArgument, "No such person %r"%person_id
+ person = persons[0]
+
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "No such tag type %r"%tag_type_id_or_name
+ tag_type = tag_types[0]
+
+ # checks for existence - does not allow several different settings
+ conflicts = PersonTags(self.api,
+ {'person_id':person['person_id'],
+ 'tag_type_id':tag_type['tag_type_id']})
+
+ if len(conflicts) :
+ raise PLCInvalidArgument, "Person %d already has setting %d"%(person['person_id'],
+ tag_type['tag_type_id'])
+
+ # check permission : it not admin, is the user affiliated with the same site as this person
+ if 'admin' not in self.caller['roles']:
+ # check caller is affiliated with at least one of Person's sites
+ if len(set(person['site_ids']) & set(self.caller['site_ids'])) == 0:
+ raise PLCPermissionDenied, "Not a member of the person's sites: %s"%person['site_ids']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified person setting, requires role %d",required_min_role
+
+ person_tag = PersonTag(self.api)
+ person_tag['person_id'] = person['person_id']
+ person_tag['tag_type_id'] = tag_type['tag_type_id']
+ person_tag['value'] = value
+
+ person_tag.sync()
+ self.object_ids = [person_tag['person_tag_id']]
+
+ return person_tag['person_tag_id']
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
if site['site_id'] not in person['site_ids']:
site.add_person(person)
- # Logging variables
- self.event_objects = {'Site': [site['site_id']],
- 'Person': [person['person_id']]}
- self.message = 'Person %d added to site %d' % \
- (person['person_id'], site['site_id'])
+ # Logging variables
+ self.event_objects = {'Site': [site['site_id']],
+ 'Person': [person['person_id']]}
+ self.message = 'Person %d added to site %d' % \
+ (person['person_id'], site['site_id'])
+
return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
import time
from PLC.Method import Method
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
can_update = lambda (field, value): field in \
['name', 'abbreviated_name', 'login_base',
'is_public', 'latitude', 'longitude', 'url',
- 'max_slices', 'max_slivers', 'enabled']
+ 'max_slices', 'max_slivers', 'enabled', 'ext_consortium_id']
class AddSite(Method):
"""
site = Site(self.api, site_fields)
site.sync()
- # Logging variables
- self.event_objects = {'Site': [site['site_id']]}
+ # Logging variables
+ self.event_objects = {'Site': [site['site_id']]}
self.message = 'Site %d created' % site['site_id']
- return site['site_id']
+ return site['site_id']
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
--- /dev/null
+# $Id: AddSiteTag.py 14587 2009-07-19 13:18:50Z thierry $
+# $URL: http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.3-27/PLC/Methods/AddSiteTag.py $
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 14587 $
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.TagTypes import TagType, TagTypes
+from PLC.SiteTags import SiteTag, SiteTags
+from PLC.Sites import Site, Sites
+
+from PLC.Nodes import Nodes
+from PLC.Sites import Sites
+
+class AddSiteTag(Method):
+ """
+ Sets the specified setting for the specified site
+ to the specified value.
+
+ In general only tech(s), PI(s) and of course admin(s) are allowed to
+ do the change, but this is defined in the tag type object.
+
+ Returns the new site_tag_id (> 0) if successful, faults
+ otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech', 'user']
+
+ accepts = [
+ Auth(),
+ # no other way to refer to a site
+ SiteTag.fields['site_id'],
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
+ SiteTag.fields['value'],
+ ]
+
+ returns = Parameter(int, 'New site_tag_id (> 0) if successful')
+
+ object_type = 'Site'
+
+
+ def call(self, auth, site_id, tag_type_id_or_name, value):
+ sites = Sites(self.api, [site_id])
+ if not sites:
+ raise PLCInvalidArgument, "No such site %r"%site_id
+ site = sites[0]
+
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "No such tag type %r"%tag_type_id_or_name
+ tag_type = tag_types[0]
+
+ # checks for existence - does not allow several different settings
+ conflicts = SiteTags(self.api,
+ {'site_id':site['site_id'],
+ 'tag_type_id':tag_type['tag_type_id']})
+
+ if len(conflicts) :
+ raise PLCInvalidArgument, "Site %d already has setting %d"%(site['site_id'],
+ tag_type['tag_type_id'])
+
+ # check permission : it not admin, is the user affiliated with the right site
+ if 'admin' not in self.caller['roles']:
+ # locate site
+ site = Sites (self.api, site_id)[0]
+ # check caller is affiliated with this site
+ if self.caller['person_id'] not in site['person_ids']:
+ raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified site setting, requires role %d",required_min_role
+
+ site_tag = SiteTag(self.api)
+ site_tag['site_id'] = site['site_id']
+ site_tag['tag_type_id'] = tag_type['tag_type_id']
+ site_tag['value'] = value
+
+ site_tag.sync()
+ self.object_ids = [site_tag['site_tag_id']]
+
+ return site_tag['site_tag_id']
+# $Id$
+# $URL$
import re
from PLC.Faults import *
+from PLC.Auth import Auth
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+from PLC.Table import Row
+
from PLC.Slices import Slice, Slices
-from PLC.Auth import Auth
from PLC.Sites import Site, Sites
+from PLC.TagTypes import TagTypes
+from PLC.SliceTags import SliceTags
+from PLC.Methods.AddSliceTag import AddSliceTag
+from PLC.Methods.UpdateSliceTag import UpdateSliceTag
-can_update = lambda (field, value): field in \
- ['name', 'instantiation', 'url', 'description', 'max_nodes']
+can_update = ['name', 'instantiation', 'url', 'description', 'max_nodes']
class AddSlice(Method):
"""
roles = ['admin', 'pi']
- slice_fields = dict(filter(can_update, Slice.fields.items()))
+ accepted_fields = Row.accepted_fields(can_update, Slice.fields)
+ accepted_fields.update(Slice.tags)
accepts = [
Auth(),
- slice_fields
+ accepted_fields
]
returns = Parameter(int, 'New slice_id (> 0) if successful')
def call(self, auth, slice_fields):
- slice_fields = dict(filter(can_update, slice_fields.items()))
+
+ [native,tags,rejected]=Row.split_fields(slice_fields,[Slice.fields,Slice.tags])
+
+ # type checking
+ native = Row.check_fields (native, self.accepted_fields)
+ if rejected:
+ raise PLCInvalidArgument, "Cannot add Slice with column(s) %r"%rejected
+
+ # Authenticated function
+ assert self.caller is not None
# 1. Lowercase.
# 2. Begins with login_base (letters or numbers).
if 'admin' not in self.caller['roles']:
if site['site_id'] not in self.caller['site_ids']:
- raise PLCPermissionDenied, "Slice prefix %s must be the same as the login_base of one of your sites"%login_base
+ raise PLCPermissionDenied, "Slice prefix %s must match one of your sites' login_base"%login_base
if len(site['slice_ids']) >= site['max_slices']:
- raise PLCInvalidArgument, "Site %s has reached (%d) its maximum allowable slice count (%d)"%(site['name'],
- len(site['slice_ids']),
- site['max_slices'])
-
+ raise PLCInvalidArgument, \
+ "Site %s has reached (%d) its maximum allowable slice count (%d)"%(site['name'],
+ len(site['slice_ids']),
+ site['max_slices'])
if not site['enabled']:
- raise PLCInvalidArgument, "Site %s is disabled can cannot create slices" % (site['name'])
+ raise PLCInvalidArgument, "Site %s is disabled and can cannot create slices" % (site['name'])
- slice = Slice(self.api, slice_fields)
+ slice = Slice(self.api, native)
slice['creator_person_id'] = self.caller['person_id']
slice['site_id'] = site['site_id']
slice.sync()
- self.event_objects = {'Slice': [slice['slice_id']]}
-
+ for (tagname,value) in tags.iteritems():
+ # the tagtype instance is assumed to exist, just check that
+ if not TagTypes(self.api,{'tagname':tagname}):
+ raise PLCInvalidArgument,"No such TagType %s"%tagname
+ slice_tags=SliceTags(self.api,{'tagname':tagname,'slice_id':slice['slice_id']})
+ if not slice_tags:
+ AddSliceTag(self.api).__call__(auth,slice['slice_id'],tagname,value)
+ else:
+ UpdateSliceTag(self.api).__call__(auth,slice_tags[0]['slice_tag_id'],value)
+
+ self.event_objects = {'Slice': [slice['slice_id']]}
+ self.message = "Slice %d created" % slice['slice_id']
+
return slice['slice_id']
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-from PLC.Slices import Slice, Slices
-from PLC.Nodes import Node, Nodes
-from PLC.SliceAttributes import SliceAttribute, SliceAttributes
-from PLC.NodeGroups import NodeGroup, NodeGroups
-from PLC.InitScripts import InitScript, InitScripts
-from PLC.Auth import Auth
-
-class AddSliceAttribute(Method):
- """
- Sets the specified attribute of the slice (or sliver, if
- node_id_or_hostname is specified) to the specified value.
-
- Attributes may require the caller to have a particular role in
- order to be set or changed. Users may only set attributes of
- slices or slivers of which they are members. PIs may only set
- attributes of slices or slivers at their sites, or of which they
- are members. Admins may set attributes of any slice or sliver.
-
- Returns the new slice_attribute_id (> 0) if successful, faults
- otherwise.
- """
-
- roles = ['admin', 'pi', 'user']
-
- accepts = [
- Auth(),
- Mixed(SliceAttribute.fields['slice_id'],
- SliceAttribute.fields['name']),
- Mixed(SliceAttribute.fields['attribute_type_id'],
- SliceAttribute.fields['name']),
- Mixed(SliceAttribute.fields['value'],
- InitScript.fields['name']),
- Mixed(Node.fields['node_id'],
- Node.fields['hostname'],
- None),
- Mixed(NodeGroup.fields['nodegroup_id'],
- NodeGroup.fields['name'])
- ]
-
- returns = Parameter(int, 'New slice_attribute_id (> 0) if successful')
-
- def call(self, auth, slice_id_or_name, attribute_type_id_or_name, value, node_id_or_hostname = None, nodegroup_id_or_name = None):
- slices = Slices(self.api, [slice_id_or_name])
- if not slices:
- raise PLCInvalidArgument, "No such slice"
- slice = slices[0]
-
- attribute_types = SliceAttributeTypes(self.api, [attribute_type_id_or_name])
- if not attribute_types:
- raise PLCInvalidArgument, "No such slice attribute type"
- attribute_type = attribute_types[0]
-
- if 'admin' not in self.caller['roles']:
- if self.caller['person_id'] in slice['person_ids']:
- pass
- elif 'pi' not in self.caller['roles']:
- raise PLCPermissionDenied, "Not a member of the specified slice"
- elif slice['site_id'] not in self.caller['site_ids']:
- raise PLCPermissionDenied, "Specified slice not associated with any of your sites"
-
- if attribute_type['min_role_id'] is not None and \
- min(self.caller['role_ids']) > attribute_type['min_role_id']:
- raise PLCPermissionDenied, "Not allowed to set the specified slice attribute"
-
- # if initscript is specified, validate value
- if attribute_type['name'] in ['initscript']:
- initscripts = InitScripts(self.api, {'enabled': True, 'name': value})
- if not initscripts:
- raise PLCInvalidArgument, "No such plc initscript"
-
- slice_attribute = SliceAttribute(self.api)
- slice_attribute['slice_id'] = slice['slice_id']
- slice_attribute['attribute_type_id'] = attribute_type['attribute_type_id']
- slice_attribute['value'] = unicode(value)
-
- # Sliver attribute if node is specified
- if node_id_or_hostname is not None:
- nodes = Nodes(self.api, [node_id_or_hostname])
- if not nodes:
- raise PLCInvalidArgument, "No such node"
- node = nodes[0]
-
- if node['node_id'] not in slice['node_ids']:
- raise PLCInvalidArgument, "Node not in the specified slice"
- slice_attribute['node_id'] = node['node_id']
-
- # Sliver attribute shared accross nodes if nodegroup is sepcified
- if nodegroup_id_or_name is not None:
- nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
- if not nodegroups:
- raise PLCInvalidArgument, "No such nodegroup"
- nodegroup = nodegroups[0]
-
- slice_attribute['nodegroup_id'] = nodegroup['nodegroup_id']
-
- # Check if slice attribute alreay exists
- slice_attributes_check = SliceAttributes(self.api, {'slice_id': slice['slice_id'], 'name': attribute_type['name'], 'value': value})
- for slice_attribute_check in slice_attributes_check:
- if 'node_id' in slice_attribute and slice_attribute['node_id'] == slice_attribute_check['node_id']:
- raise PLCInvalidArgument, "Sliver attribute already exists"
- if 'nodegroup_id' in slice_attribute and slice_attribute['nodegroup_id'] == slice_attribute_check['nodegroup_id']:
- raise PLCInvalidArgument, "Slice attribute already exists for this nodegroup"
- if node_id_or_hostname is None and nodegroup_id_or_name is None:
- raise PLCInvalidArgument, "Slice attribute already exists"
-
- slice_attribute.sync()
- self.event_objects = {'SliceAttribute': [slice_attribute['slice_attribute_id']]}
-
- return slice_attribute['slice_attribute_id']
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field in \
- ['name', 'description', 'min_role_id']
-
-class AddSliceAttributeType(Method):
- """
- Adds a new type of slice attribute. Any fields specified in
- attribute_type_fields are used, otherwise defaults are used.
-
- Returns the new attribute_type_id (> 0) if successful, faults
- otherwise.
- """
-
- roles = ['admin']
-
- attribute_type_fields = dict(filter(can_update, SliceAttributeType.fields.items()))
-
- accepts = [
- Auth(),
- attribute_type_fields
- ]
-
- returns = Parameter(int, 'New attribute_id (> 0) if successful')
-
-
- def call(self, auth, attribute_type_fields):
- attribute_type_fields = dict(filter(can_update, attribute_type_fields.items()))
- attribute_type = SliceAttributeType(self.api, attribute_type_fields)
- attribute_type.sync()
-
- self.event_objects = {'AttributeType': [attribute_type['attribute_type_id']]}
-
- return attribute_type['attribute_type_id']
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
--- /dev/null
+# $Id$
+# $URL$
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.TagTypes import TagType, TagTypes
+from PLC.Slices import Slice, Slices
+from PLC.Nodes import Node, Nodes
+from PLC.SliceTags import SliceTag, SliceTags
+from PLC.NodeGroups import NodeGroup, NodeGroups
+from PLC.InitScripts import InitScript, InitScripts
+from PLC.Auth import Auth
+
+class AddSliceTag(Method):
+ """
+ Sets the specified attribute of the slice (or sliver, if
+ node_id_or_hostname is specified) to the specified value.
+
+ Attributes may require the caller to have a particular role in
+ order to be set or changed. Users may only set attributes of
+ slices or slivers of which they are members. PIs may only set
+ attributes of slices or slivers at their sites, or of which they
+ are members. Admins may set attributes of any slice or sliver.
+
+ Returns the new slice_tag_id (> 0) if successful, faults
+ otherwise.
+ """
+
+ roles = ['admin', 'pi', 'user', 'node']
+
+ accepts = [
+ Auth(),
+ Mixed(Slice.fields['slice_id'],
+ Slice.fields['name']),
+ Mixed(SliceTag.fields['tag_type_id'],
+ SliceTag.fields['tagname']),
+ Mixed(SliceTag.fields['value'],
+ InitScript.fields['name']),
+ Mixed(Node.fields['node_id'],
+ Node.fields['hostname'],
+ None),
+ Mixed(NodeGroup.fields['nodegroup_id'],
+ NodeGroup.fields['groupname'])
+ ]
+
+ returns = Parameter(int, 'New slice_tag_id (> 0) if successful')
+
+ def call(self, auth, slice_id_or_name, tag_type_id_or_name, value, node_id_or_hostname = None, nodegroup_id_or_name = None):
+ slices = Slices(self.api, [slice_id_or_name])
+ if not slices:
+ raise PLCInvalidArgument, "No such slice %r"%slice_id_or_name
+ slice = slices[0]
+
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "No such tag type %r"%tag_type_id_or_name
+ tag_type = tag_types[0]
+
+ if not isinstance(self.caller, Node):
+ if ('admin' not in self.caller['roles']):
+ if self.caller['person_id'] in slice['person_ids']:
+ pass
+ elif 'pi' not in self.caller['roles']:
+ raise PLCPermissionDenied, "Not a member of the specified slice"
+ elif slice['site_id'] not in self.caller['site_ids']:
+ raise PLCPermissionDenied, "Specified slice not associated with any of your sites"
+
+ if tag_type['min_role_id'] is not None and \
+ min(self.caller['role_ids']) > tag_type['min_role_id']:
+ raise PLCPermissionDenied, "Not allowed to set the specified slice attribute"
+ else:
+ ### make node's min_role_id == PI min_role_id
+ node_role_id = 20
+ if tag_type['min_role_id'] is not None and node_role_id > tag_type['min_role_id']:
+ raise PLCPermissionDenied, "Not allowed to set the specified slice attribute"
+
+ # if initscript is specified, validate value
+ if tag_type['tagname'] in ['initscript']:
+ initscripts = InitScripts(self.api, {'enabled': True, 'name': value})
+ if not initscripts:
+ raise PLCInvalidArgument, "No such plc initscript %r"%value
+
+ slice_tag = SliceTag(self.api)
+ slice_tag['slice_id'] = slice['slice_id']
+ slice_tag['tag_type_id'] = tag_type['tag_type_id']
+ slice_tag['value'] = unicode(value)
+
+ # Sliver attribute if node is specified
+ if node_id_or_hostname is not None or isinstance(self.caller, Node):
+ node_id = None
+ if isinstance(self.caller, Node):
+ node = self.caller
+ node_id = node['node_id']
+
+ if node_id_or_hostname is not None:
+ nodes = Nodes(self.api, [node_id_or_hostname])
+ if not nodes:
+ raise PLCInvalidArgument, "No such node"
+ node = nodes[0]
+ if node_id <> None and node_id <> node['node_id']:
+ raise PLCPermissionDenied, "Not allowed to set another node's sliver attribute"
+ else:
+ node_id = node['node_id']
+
+ system_slice_tags = SliceTags(self.api, {'tagname': 'system', 'value': '1'}).dict('slice_id')
+ system_slice_ids = system_slice_tags.keys()
+ if slice['slice_id'] not in system_slice_ids and node_id not in slice['node_ids']:
+ raise PLCInvalidArgument, "Node not in the specified slice %s not in %s"%(slice['slice_id'],system_slice_ids)
+ slice_tag['node_id'] = node['node_id']
+
+ # Sliver attribute shared accross nodes if nodegroup is sepcified
+ if nodegroup_id_or_name is not None:
+ if isinstance(self.caller, Node):
+ raise PLCPermissionDenied, "Not allowed to set nodegroup slice attributes"
+
+ nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
+ if not nodegroups:
+ raise PLCInvalidArgument, "No such nodegroup %r"%nodegroup_id_or_name
+ nodegroup = nodegroups[0]
+
+ slice_tag['nodegroup_id'] = nodegroup['nodegroup_id']
+
+ # Check if slice attribute alreay exists
+ slice_tags_check = SliceTags(self.api, {'slice_id': slice['slice_id'],
+ 'tagname': tag_type['tagname'],
+ 'value': value})
+ for slice_tag_check in slice_tags_check:
+ if 'node_id' in slice_tag and slice_tag['node_id'] == slice_tag_check['node_id']:
+ raise PLCInvalidArgument, "Sliver attribute already exists"
+ if 'nodegroup_id' in slice_tag and slice_tag['nodegroup_id'] == slice_tag_check['nodegroup_id']:
+ raise PLCInvalidArgument, "Slice attribute already exists for this nodegroup"
+ if node_id_or_hostname is None and nodegroup_id_or_name is None:
+ raise PLCInvalidArgument, "Slice attribute already exists"
+
+ slice_tag.sync()
+ self.event_objects = {'SliceTag': [slice_tag['slice_tag_id']]}
+
+ return slice_tag['slice_tag_id']
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.TagTypes import TagType, TagTypes
+from PLC.Auth import Auth
+
+can_update = lambda (field, value): field in \
+ ['tagname', 'description', 'category', 'min_role_id']
+
+class AddTagType(Method):
+ """
+ Adds a new type of node tag.
+ Any fields specified are used, otherwise defaults are used.
+
+ Returns the new node_tag_id (> 0) if successful,
+ faults otherwise.
+ """
+
+ roles = ['admin']
+
+ tag_type_fields = dict(filter(can_update, TagType.fields.items()))
+
+ accepts = [
+ Auth(),
+ tag_type_fields
+ ]
+
+ returns = Parameter(int, 'New node_tag_id (> 0) if successful')
+
+
+ def call(self, auth, tag_type_fields):
+ tag_type_fields = dict(filter(can_update, tag_type_fields.items()))
+ tag_type = TagType(self.api, tag_type_fields)
+ tag_type.sync()
+
+ self.object_ids = [tag_type['tag_type_id']]
+
+ return tag_type['tag_type_id']
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.AddressTypes import AddressType, AddressTypes
-from PLC.Auth import Auth
-from PLC.Methods.AddAddressType import AddAddressType
-
-class AdmAddAddressType(AddAddressType):
- """
- Deprecated. See AddAddressType.
- """
-
- status = "deprecated"
-
- accepts = [
- Auth(),
- AddressType.fields['name']
- ]
-
- def call(self, auth, name):
- return AddAddressType.call(self, auth, {'name': name})
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Nodes import Node, Nodes
-from PLC.Sites import Site, Sites
-from PLC.Auth import Auth
-from PLC.Methods.AddNode import AddNode
-
-can_update = lambda (field, value): field in \
- ['model', 'version']
-
-class AdmAddNode(AddNode):
- """
- Deprecated. See AddNode.
- """
-
- status = "deprecated"
-
- node_fields = dict(filter(can_update, Node.fields.items()))
-
- accepts = [
- Auth(),
- Site.fields['site_id'],
- Node.fields['hostname'],
- Node.fields['boot_state'],
- node_fields
- ]
-
- def call(self, auth, site_id, hostname, boot_state, node_fields = {}):
- node_fields['site_id'] = site_id
- node_fields['hostname'] = hostname
- node_fields['boot_state'] = boot_state
- return AddNode.call(self, auth, node_fields)
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.NodeGroups import NodeGroup, NodeGroups
-from PLC.Auth import Auth
-from PLC.Methods.AddNodeGroup import AddNodeGroup
-
-class AdmAddNodeGroup(AddNodeGroup):
- """
- Deprecated. See AddNodeGroup.
- """
-
- status = "deprecated"
-
- accepts = [
- Auth(),
- NodeGroup.fields['name'],
- NodeGroup.fields['description']
- ]
-
- def call(self, auth, name, description):
- return AddNodeGroup.call(self, auth, {'name': name, 'description': description})
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import Auth
-from PLC.Methods.AddNodeNetwork import AddNodeNetwork
-
-can_update = lambda (field, value): field not in ['nodenetwork_id', 'node_id', 'method', 'type']
-
-class AdmAddNodeNetwork(AddNodeNetwork):
- """
- Deprecated. See AddNodeNetwork.
- """
-
- status = "deprecated"
-
- nodenetwork_fields = dict(filter(can_update, NodeNetwork.fields.items()))
-
- accepts = [
- Auth(),
- NodeNetwork.fields['node_id'],
- NodeNetwork.fields['method'],
- NodeNetwork.fields['type'],
- nodenetwork_fields
- ]
-
- def call(self, auth, node_id, method, type, nodenetwork_fields = {}):
- nodenetwork_fields['node_id'] = node_id
- nodenetwork_fields['method'] = method
- nodenetwork_fields['type'] = type
- return AddNodeNetwork.call(self, auth, nodenetwork_fields)
+++ /dev/null
-from PLC.Methods.AddNodeToNodeGroup import AddNodeToNodeGroup
-
-class AdmAddNodeToNodeGroup(AddNodeToNodeGroup):
- """
- Deprecated. See AddNodeToNodeGroup.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Persons import Person, Persons
-from PLC.Auth import Auth
-from PLC.Methods.AddPerson import AddPerson
-
-can_update = lambda (field, value): field in \
- ['title', 'email', 'password', 'phone', 'url', 'bio']
-
-class AdmAddPerson(AddPerson):
- """
- Deprecated. See AddPerson.
- """
-
- status = "deprecated"
-
- person_fields = dict(filter(can_update, Person.fields.items()))
-
- accepts = [
- Auth(),
- Person.fields['first_name'],
- Person.fields['last_name'],
- person_fields
- ]
-
- def call(self, auth, first_name, last_name, person_fields = {}):
- person_fields['first_name'] = first_name
- person_fields['last_name'] = last_name
- return AddPerson.call(self, auth, person_fields)
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Keys import Key, Keys
-from PLC.Persons import Person, Persons
-from PLC.Auth import Auth
-from PLC.Methods.AddPersonKey import AddPersonKey
-
-class AdmAddPersonKey(AddPersonKey):
- """
- Deprecated. See AddPersonKey. Keys can no longer be marked as
- primary, i.e. the is_primary argument does nothing.
- """
-
- status = "deprecated"
-
- accepts = [
- Auth(),
- Mixed(Person.fields['person_id'],
- Person.fields['email']),
- Key.fields['key_type'],
- Key.fields['key'],
- Parameter(int, "Make this key the primary key")
- ]
-
- def call(self, auth, person_id_or_email, key_type, key_value, is_primary):
- key_fields = {'key_type': key_type, 'key_value': key_value}
- return AddPersonKey.call(self, auth, person_id_or_email, key_fields)
+++ /dev/null
-from PLC.Methods.AddPersonToSite import AddPersonToSite
-
-class AdmAddPersonToSite(AddPersonToSite):
- """
- Deprecated. See AddPersonToSite.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Sites import Site, Sites
-from PLC.Auth import Auth
-from PLC.Methods.AddSite import AddSite
-
-can_update = lambda (field, value): field in \
- ['is_public', 'latitude', 'longitude', 'url']
-
-class AdmAddSite(AddSite):
- """
- Deprecated. See AddSite.
- """
-
- status = "deprecated"
-
- site_fields = dict(filter(can_update, Site.fields.items()))
-
- accepts = [
- Auth(),
- Site.fields['name'],
- Site.fields['abbreviated_name'],
- Site.fields['login_base'],
- site_fields
- ]
-
- def call(self, auth, name, abbreviated_name, login_base, site_fields = {}):
- site_fields['name'] = name
- site_fields['abbreviated_name'] = abbreviated_name
- site_fields['login_base'] = login_base
- return AddSite.call(self, auth, site_fields)
+++ /dev/null
-from PLC.Methods.AddPCU import AddPCU
-
-class AdmAddSitePowerControlUnit(AddPCU):
- """
- Deprecated. See AddPCU.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Nodes import Node, Nodes
-from PLC.PCUs import PCU, PCUs
-from PLC.Auth import Auth
-from PLC.Methods.AddNodeToPCU import AddNodeToPCU
-
-class AdmAssociateNodeToPowerControlUnitPort(AddNodeToPCU):
- """
- Deprecated. See AddNodeToPCU.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'tech']
-
- accepts = [
- Auth(),
- PCU.fields['pcu_id'],
- Parameter(int, 'PCU port number'),
- Mixed(Node.fields['node_id'],
- Node.fields['hostname']),
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, pcu_id, port, node_id_or_hostname):
- return AddNodeToPCU(self, auth, node_id_or_hostname, pcu_id, port)
+++ /dev/null
-from PLC.Methods.AuthCheck import AuthCheck
-
-class AdmAuthCheck(AuthCheck):
- """
- Deprecated. See AuthCheck.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Methods.DeleteAddressType import DeleteAddressType
-
-class AdmDeleteAddressType(DeleteAddressType):
- """
- Deprecated. See DeleteAddressType.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Persons import Person, Persons
-from PLC.Keys import Key, Keys
-from PLC.Auth import Auth
-
-class AdmDeleteAllPersonKeys(Method):
- """
- Deprecated. Functionality can be implemented with GetPersons and
- DeleteKey.
-
- Deletes all of the keys associated with an account. Non-admins may
- only delete their own keys.
-
- Non-admins may only delete their own keys.
-
- Returns 1 if successful, faults otherwise.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'tech', 'user']
-
- accepts = [
- Auth(),
- Mixed(Person.fields['person_id'],
- Person.fields['email'])
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, person_id_or_email):
- # Get account information
- persons = Persons(self.api, [person_id_or_email])
- if not persons:
- raise PLCInvalidArgument, "No such account"
-
- person = persons[0]
-
- if 'admin' not in self.caller['roles']:
- if self.caller['person_id'] != person['person_id']:
- raise PLCPermissionDenied, "Not allowed to update specified account"
-
- key_ids = person['key_ids']
- if not key_ids:
- return 1
-
- # Get associated key details
- keys = Keys(self.api, key_ids)
-
- for key in keys:
- key.delete()
-
- return 1
+++ /dev/null
-from PLC.Methods.DeleteNode import DeleteNode
-
-class AdmDeleteNode(DeleteNode):
- """
- Deprecated. See DeleteNode.
- """
-
- status = "deprecated"
-
+++ /dev/null
-from PLC.Methods.DeleteNodeGroup import DeleteNodeGroup
-
-class AdmDeleteNodeGroup(DeleteNodeGroup):
- """
- Deprecated. See DeleteNodeGroup.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import Auth
-from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Methods.DeleteNodeNetwork import DeleteNodeNetwork
-
-class AdmDeleteNodeNetwork(DeleteNodeNetwork):
- """
- Deprecated. See DeleteNodeNetwork.
- """
-
- status = "deprecated"
-
- accepts = [
- Auth(),
- Mixed(Node.fields['node_id'],
- Node.fields['hostname']),
- NodeNetwork.fields['nodenetwork_id']
- ]
-
- def call(self, auth, node_id_or_hostname, nodenetwork_id):
- return DeleteNodeNetwork.call(self, auth, nodenetwork_id)
+++ /dev/null
-from PLC.Methods.DeletePerson import DeletePerson
-
-class AdmDeletePerson(DeletePerson):
- """
- Deprecated. See DeletePerson.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Persons import Person, Persons
-from PLC.Keys import Key, Keys
-from PLC.Auth import Auth
-
-class AdmDeletePersonKeys(Method):
- """
- Deprecated. Functionality can be implemented with GetPersons and
- DeleteKey.
-
- Deletes the specified keys. Non-admins may only delete their own
- keys.
-
- Returns 1 if successful, faults otherwise.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'tech', 'user']
-
- accepts = [
- Auth(),
- Mixed(Person.fields['person_id'],
- Person.fields['email']),
- [Key.fields['key_id']]
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, person_id_or_email, key_ids):
- # Get account information
- persons = Persons(self.api, [person_id_or_email])
- if not persons:
- raise PLCInvalidArgument, "No such account"
- person = persons[0]
-
- if person['peer_id'] is not None:
- raise PLCInvalidArgument, "Not a local account"
-
- if 'admin' not in self.caller['roles']:
- if self.caller['person_id'] != person['person_id']:
- raise PLCPermissionDenied, "Not allowed to update specified account"
-
- key_ids = set(key_ids).intersection(person['key_ids'])
- if not key_ids:
- return 1
-
- # Get associated key details
- keys = Keys(self.api, key_ids)
-
- for key in keys:
- key.delete()
-
- return 1
+++ /dev/null
-from PLC.Methods.DeleteSite import DeleteSite
-
-class AdmDeleteSite(DeleteSite):
- """
- Deprecated. See DeleteSite.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Methods.DeletePCU import DeletePCU
-
-class AdmDeleteSitePowerControlUnit(DeletePCU):
- """
- Deprecated. See DeletePCU.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Nodes import Node, Nodes
-from PLC.PCUs import PCU, PCUs
-from PLC.Auth import Auth
-from PLC.Methods.DeleteNodeFromPCU import DeleteNodeFromPCU
-
-class AdmDisassociatePowerControlUnitPort(DeleteNodeFromPCU):
- """
- Deprecated. See DeleteNodeFromPCU.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'tech']
-
- accepts = [
- Auth(),
- PCU.fields['pcu_id'],
- Parameter(int, 'PCU port number'),
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, pcu_id, port):
- pcus = PCUs(self.api, [pcu_id])
- if not pcus:
- raise PLCInvalidArgument, "No such PCU"
-
- pcu = pcus[0]
-
- ports = dict(zip(pcu['ports'], pcu['node_ids']))
- if port not in ports:
- raise PLCInvalidArgument, "No node on that port or no such port"
-
- return DeleteNodeFromPCU(self, auth, ports[port], pcu_id)
+++ /dev/null
-import random
-import base64
-
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import Auth
-
-class AdmGenerateNodeConfFile(Method):
- """
- Deprecated. Functionality can be implemented with GetNodes,
- GetNodeNetworks, and UpdateNode.
-
- Creates a new node configuration file if all network settings are
- present. This function will generate a new node key for the
- specified node, effectively invalidating any old configuration
- files.
-
- Non-admins can only generate files for nodes at their sites.
-
- Returns the contents of the file if successful, faults otherwise.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'tech']
-
- accepts = [
- Auth(),
- Mixed(Node.fields['node_id'],
- Node.fields['hostname'])
- ]
-
- returns = Parameter(str, "Node configuration file")
-
- def call(self, auth, node_id_or_hostname):
- # Get node information
- nodes = Nodes(self.api, [node_id_or_hostname])
- if not nodes:
- raise PLCInvalidArgument, "No such node"
- node = nodes[0]
-
- if node['peer_id'] is not None:
- raise PLCInvalidArgument, "Not a local node"
-
- # If we are not an admin, make sure that the caller is a
- # member of the site at which the node is located.
- if 'admin' not in self.caller['roles']:
- if node['site_id'] not in self.caller['site_ids']:
- raise PLCPermissionDenied, "Not allowed to generate a configuration file for that node"
-
- # Get node networks for this node
- primary = None
- nodenetworks = NodeNetworks(self.api, node['nodenetwork_ids'])
- for nodenetwork in nodenetworks:
- if nodenetwork['is_primary']:
- primary = nodenetwork
- break
- if primary is None:
- raise PLCInvalidArgument, "No primary network configured"
-
- # Split hostname into host and domain parts
- parts = node['hostname'].split(".", 1)
- if len(parts) < 2:
- raise PLCInvalidArgument, "Node hostname is invalid"
- host = parts[0]
- domain = parts[1]
-
- # Generate 32 random bytes
- bytes = random.sample(xrange(0, 256), 32)
- # Base64 encode their string representation
- node['key'] = base64.b64encode("".join(map(chr, bytes)))
- # XXX Boot Manager cannot handle = in the key
- node['key'] = node['key'].replace("=", "")
- # Save it
- node.sync()
-
- # Generate node configuration file suitable for BootCD
- file = ""
-
- file += 'NODE_ID="%d"\n' % node['node_id']
- file += 'NODE_KEY="%s"\n' % node['key']
-
- if primary['mac']:
- file += 'NET_DEVICE="%s"\n' % primary['mac'].lower()
-
- file += 'IP_METHOD="%s"\n' % primary['method']
-
- if primary['method'] == 'static':
- file += 'IP_ADDRESS="%s"\n' % primary['ip']
- file += 'IP_GATEWAY="%s"\n' % primary['gateway']
- file += 'IP_NETMASK="%s"\n' % primary['netmask']
- file += 'IP_NETADDR="%s"\n' % primary['network']
- file += 'IP_BROADCASTADDR="%s"\n' % primary['broadcast']
- file += 'IP_DNS1="%s"\n' % primary['dns1']
- file += 'IP_DNS2="%s"\n' % (primary['dns2'] or "")
-
- file += 'HOST_NAME="%s"\n' % host
- file += 'DOMAIN_NAME="%s"\n' % domain
-
- for nodenetwork in nodenetworks:
- if nodenetwork['method'] == 'ipmi':
- file += 'IPMI_ADDRESS="%s"\n' % nodenetwork['ip']
- if nodenetwork['mac']:
- file += 'IPMI_MAC="%s"\n' % nodenetwork['mac'].lower()
- break
-
- return file
+++ /dev/null
-from PLC.Methods.GetAddressTypes import GetAddressTypes
-
-class AdmGetAllAddressTypes(GetAddressTypes):
- """
- Deprecated. See GetAddressTypes.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Methods.GetKeyTypes import GetKeyTypes
-
-class AdmGetAllKeyTypes(GetKeyTypes):
- """
- Deprecated. See GetKeyTypes.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import Auth
-from PLC.Methods.GetNodeNetworks import GetNodeNetworks
-
-class AdmGetAllNodeNetworks(GetNodeNetworks):
- """
- Deprecated. Functionality can be implemented with GetNodes and
- GetNodeNetworks.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'user', 'tech']
-
- accepts = [
- Auth(),
- Mixed(Node.fields['node_id'],
- Node.fields['hostname'])
- ]
-
- returns = [NodeNetwork.fields]
-
- def call(self, auth, node_id_or_hostname):
- # Get node information
- nodes = Nodes(self.api, [node_id_or_hostname])
- if not nodes:
- raise PLCInvalidArgument, "No such node"
- node = nodes[0]
-
- if not node['nodenetwork_ids']:
- return []
-
- return GetNodeNetworks.call(self, auth, node['nodenetwork_ids'])
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter
-from PLC.Auth import Auth
-from PLC.Methods.GetRoles import GetRoles
-
-class AdmGetAllRoles(GetRoles):
- """
- Deprecated. See GetRoles.
-
- Return all possible roles as a struct:
-
- {'10': 'admin', '20': 'pi', '30': 'user', '40': 'tech'}
-
- Note that because of XML-RPC marshalling limitations, the keys to
- this struct are string representations of the integer role
- identifiers.
- """
-
- status = "deprecated"
-
- returns = dict
-
- def call(self, auth):
- roles_list = GetRoles.call(self, auth)
-
- roles_dict = {}
- for role in roles_list:
- # Stringify the keys!
- roles_dict[str(role['role_id'])] = role['name']
-
- return roles_dict
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import Auth
-from PLC.NodeGroups import NodeGroup, NodeGroups
-
-class AdmGetNodeGroupNodes(Method):
- """
- Deprecated. See GetNodeGroups.
-
- Returns a list of node_ids for the node group specified.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'user', 'tech']
-
- accepts = [
- Auth(),
- Mixed(NodeGroup.fields['nodegroup_id'],
- NodeGroup.fields['name'])
- ]
-
- returns = NodeGroup.fields['node_ids']
-
- def call(self, auth, nodegroup_id_or_name):
- # Get nodes in this nodegroup
- nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
- if not nodegroups:
- raise PLCInvalidArgument, "No such node group"
-
- # Get the info for the node group specified
- nodegroup = nodegroups[0]
-
- # Return the list of node_ids
- return nodegroup['node_ids']
+++ /dev/null
-from PLC.Methods.GetNodeGroups import GetNodeGroups
-
-class AdmGetNodeGroups(GetNodeGroups):
- """
- Deprecated. See GetNodeGroups.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Methods.GetNodes import GetNodes
-
-class AdmGetNodes(GetNodes):
- """
- Deprecated. See GetNodes. All fields are now always returned.
- """
-
- status = "deprecated"
-
- def call(self, auth, node_id_or_hostname_list = None, return_fields = None):
- return GetNodes.call(self, auth, node_id_or_hostname_list)
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Persons import Person, Persons
-from PLC.Keys import Key, Keys
-from PLC.Auth import Auth
-from PLC.Methods.GetKeys import GetKeys
-
-class AdmGetPersonKeys(GetKeys):
- """
- Deprecated. Functionality can be implemented with GetPersons and
- GetKeys.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'user', 'tech']
-
- accepts = [
- Auth(),
- Mixed(Person.fields['person_id'],
- Person.fields['email']),
- [Key.fields['key_id']]
- ]
-
- returns = [Key.fields]
-
- def call(self, auth, person_id_or_email):
- # Get account information
- persons = Persons(self.api, [person_id_or_email])
- if not persons:
- raise PLCInvalidArgument, "No such account"
-
- person = persons[0]
-
- if 'admin' not in self.caller['roles']:
- if self.caller['person_id'] != person['person_id']:
- raise PLCPermissionDenied, "Not allowed to view keys for specified account"
-
- return GetKeys.call(self, auth, person['key_ids'])
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Persons import Person, Persons
-from PLC.Auth import Auth
-
-class AdmGetPersonRoles(Method):
- """
- Deprecated. See GetPersons.
-
- Return the roles that the specified person has as a struct:
-
- {'10': 'admin', '30': 'user', '20': 'pi', '40': 'tech'}
-
- Admins can get the roles for any user. PIs can only get the roles
- for members of their sites. All others may only get their own
- roles.
-
- Note that because of XML-RPC marshalling limitations, the keys to
- this struct are string representations of the integer role
- identifiers.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'user', 'tech']
-
- accepts = [
- Auth(),
- Mixed(Person.fields['person_id'],
- Person.fields['email'])
- ]
-
- returns = dict
-
- def call(self, auth, person_id_or_email):
- # Get account information
- persons = Persons(self.api, [person_id_or_email])
- if not persons:
- raise PLCInvalidArgument, "No such account"
-
- person = persons[0]
-
- # Authenticated function
- assert self.caller is not None
-
- # Check if we can view this account
- if not self.caller.can_view(person):
- raise PLCPermissionDenied, "Not allowed to view specified account"
-
- # Stringify the keys!
- role_ids = map(str, person['role_ids'])
- roles = person['roles']
-
- return dict(zip(role_ids, roles))
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Persons import Person, Persons
-from PLC.Sites import Site, Sites
-from PLC.Auth import Auth
-
-class AdmGetPersonSites(Method):
- """
- Deprecated. See GetPersons.
-
- Returns the sites that the specified person is associated with as
- an array of site identifiers.
-
- Admins may retrieve details about anyone. Users and techs may only
- retrieve details about themselves. PIs may retrieve details about
- themselves and others at their sites.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'user', 'tech']
-
- accepts = [
- Auth(),
- Mixed(Person.fields['person_id'],
- Person.fields['email'])
- ]
-
- returns = Person.fields['site_ids']
-
- def call(self, auth, person_id_or_email):
- # Get account information
- persons = Persons(self.api, [person_id_or_email])
- if not persons:
- raise PLCInvalidArgument, "No such account"
-
- person = persons[0]
-
- # Authenticated function
- assert self.caller is not None
-
- # Check if we can view this account
- if not self.caller.can_view(person):
- raise PLCPermissionDenied, "Not allowed to view specified account"
-
- return person['site_ids']
+++ /dev/null
-from PLC.Methods.GetPersons import GetPersons
-
-class AdmGetPersons(GetPersons):
- """
- Deprecated. See GetPersons.
- """
-
- status = "deprecated"
-
- def call(self, auth, person_id_or_email_list = None, return_fields = None):
- return GetPersons.call(self, auth, person_id_or_email_list)
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.PCUs import PCU, PCUs
-from PLC.Auth import Auth
-
-class AdmGetPowerControlUnitNodes(Method):
- """
- Deprecated. See GetPCUs.
-
- Returns a list of the nodes, and the ports they are assigned to,
- on the specified PCU.
-
- Admin may query all PCUs. Non-admins may only query the PCUs at
- their sites.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'tech']
-
- accepts = [
- Auth(),
- PCU.fields['pcu_id']
- ]
-
- returns = [{'node_id': Parameter(int, "Node identifier"),
- 'port_number': Parameter(int, "Port number")}]
-
- def call(self, auth, pcu_id):
- pcus = PCUs(self.api, [pcu_id])
- if not pcus:
- raise PLCInvalidArgument, "No such PCU"
- pcu = pcus[0]
-
- if 'admin' not in self.caller['roles']:
- if pcu['site_id'] not in self.caller['site_ids']:
- raise PLCPermissionDenied, "Not allowed to view that PCU"
-
- return [{'node_id': node_id, 'port_number': port} \
- for (node_id, port) in zip(pcu['node_ids'], pcu['ports'])]
+++ /dev/null
-from PLC.Methods.GetPCUs import GetPCUs
-
-class AdmGetPowerControlUnits(GetPCUs):
- """
- Deprecated. See GetPCUs.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Sites import Site, Sites
-from PLC.Auth import Auth
-
-class AdmGetSiteNodes(Method):
- """
- Deprecated. See GetSites.
-
- Return a struct containing an array of node_ids for each of the
- sites specified. Note that the keys of the struct are strings, not
- integers, because of XML-RPC marshalling limitations.
-
- Admins may retrieve details about all nodes on a site by not specifying
- site_id_or_name or by specifying an empty list. Users and
- techs may only retrieve details about themselves. PIs may retrieve
- details about themselves and others at their sites.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'user', 'tech']
-
- accepts = [
- Auth(),
- [Mixed(Site.fields['site_id'],
- Site.fields['name'])],
- ]
-
- returns = dict
-
- def call(self, auth, site_id_or_name_list = None):
- # Get site information
- sites = Sites(self.api, site_id_or_name_list)
- if not sites:
- raise PLCInvalidArgument, "No such site"
-
- # Convert to {str(site_id): [node_id]}
- site_nodes = {}
- for site in sites:
- site_nodes[str(site['site_id'])] = site['node_ids']
-
- return site_nodes
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Sites import Site, Sites
-from PLC.Persons import Person, Persons
-from PLC.Auth import Auth
-
-class AdmGetSitePIs(Method):
- """
- Deprecated. Functionality can be implemented with GetSites and
- GetPersons.
-
- Return a list of person_ids of the PIs for the site specified.
- """
-
- status = "deprecated"
-
- roles = ['admin']
-
- accepts = [
- Auth(),
- Mixed(Site.fields['site_id'],
- Site.fields['login_base'])
- ]
-
- returns = Site.fields['person_ids']
-
- def call(self, auth, site_id_or_login_base):
- # Authenticated function
- assert self.caller is not None
-
- # Get site information
- sites = Sites(self.api, [site_id_or_login_base])
- if not sites:
- raise PLCInvalidArgument, "No such site"
-
- site = sites[0]
-
- persons = Persons(self.api, site['person_ids'])
-
- has_pi_role = lambda person: 'pi' in person['roles']
- pis = filter(has_pi_role, persons)
-
- return [pi['person_id'] for pi in pis]
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Sites import Site, Sites
-from PLC.Auth import Auth
-
-class AdmGetSitePersons(Method):
- """
- Deprecated. See GetSites.
-
- Return a list of person_ids for the site specified.
-
- PIs may only retrieve the person_ids of accounts at their
- site. Admins may retrieve the person_ids of accounts at any site.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi']
-
- accepts = [
- Auth(),
- Mixed(Site.fields['site_id'],
- Site.fields['login_base'])
- ]
-
- returns = Site.fields['person_ids']
-
- def call(self, auth, site_id_or_login_base):
- # Authenticated function
- assert self.caller is not None
-
- # Get site information
- sites = Sites(self.api, [site_id_or_login_base])
- if not sites:
- raise PLCInvalidArgument, "No such site"
-
- site = sites[0]
-
- if 'admin' not in self.caller['roles']:
- if site['site_id'] not in self.caller['site_ids']:
- raise PLCPermissionDenied, "Not allowed to view accounts at that site"
-
- return site['person_ids']
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.PCUs import PCU, PCUs
-from PLC.Sites import Site, Sites
-from PLC.Auth import Auth
-
-class AdmGetSitePowerControlUnits(Method):
- """
- Deprecated. Functionality can be implemented with GetSites and GetPCUs.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'tech']
-
- accepts = [
- Auth(),
- Mixed(Site.fields['site_id'],
- Site.fields['login_base'])
- ]
-
- returns = [PCU.fields]
-
- def call(self, auth, site_id_or_login_base):
- sites = Sites(self.api, [site_id_or_login_base])
- if not sites:
- raise PLCInvalidArgument, "No such site"
- site = sites[0]
-
- if 'admin' not in self.caller['roles']:
- if site['site_id'] not in self.caller['site_ids']:
- raise PLCPermissionDenied, "Not allowed to view the PCUs at that site"
-
- return PCUs(self.api, site['pcu_ids'])
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Sites import Site, Sites
-from PLC.Persons import Person, Persons
-from PLC.Auth import Auth
-
-class AdmGetSiteTechContacts(Method):
- """
- Deprecated. Functionality can be implemented with GetSites and
- GetPersons.
-
- Return a list of person_ids of the technical contacts for the site
- specified.
- """
-
- status = "deprecated"
-
- roles = ['admin']
-
- accepts = [
- Auth(),
- Mixed(Site.fields['site_id'],
- Site.fields['login_base'])
- ]
-
- returns = Site.fields['person_ids']
-
- def call(self, auth, site_id_or_login_base):
- # Authenticated function
- assert self.caller is not None
-
- # Get site information
- sites = Sites(self.api, [site_id_or_login_base])
- if not sites:
- raise PLCInvalidArgument, "No such site"
-
- site = sites[0]
-
- persons = Persons(self.api, site['person_ids'])
-
- has_tech_role = lambda person: 'tech' in person['roles']
- techs = filter(has_tech_role, persons)
-
- return [tech['person_id'] for tech in techs]
+++ /dev/null
-from PLC.Methods.GetSites import GetSites
-
-class AdmGetSites(GetSites):
- """
- Deprecated. See GetSites.
- """
-
- status = "deprecated"
-
- def call(self, auth, site_id_or_login_base_list = None, return_fields = None):
- return GetSites.call(self, auth, site_id_or_login_base_list)
+++ /dev/null
-from PLC.Methods.AddRoleToPerson import AddRoleToPerson
-
-class AdmGrantRoleToPerson(AddRoleToPerson):
- """
- Deprecated. See AddRoleToPerson.
- """
-
- status = "deprecated"
-
- def call(self, auth, person_id_or_email, role_id_or_name):
- return AddRoleToPerson.call(self, auth, role_id_or_name, person_id_or_email)
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Persons import Person, Persons
-from PLC.Auth import Auth
-from PLC.Roles import Role, Roles
-
-class AdmIsPersonInRole(Method):
- """
- Deprecated. Functionality can be implemented with GetPersons.
-
- Returns 1 if the specified account has the specified role, 0
- otherwise. This function differs from AdmGetPersonRoles() in that
- any authorized user can call it. It is currently restricted to
- verifying PI roles.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'user', 'tech']
-
- accepts = [
- Auth(),
- Mixed(Person.fields['person_id'],
- Person.fields['email']),
- Mixed(Parameter(int, "Role identifier"),
- Parameter(str, "Role name"))
- ]
-
- returns = Parameter(int, "1 if account has role, 0 otherwise")
-
- def call(self, auth, person_id_or_email, role_id_or_name):
- # This is a totally fucked up function. I have no idea why it
- # exists or who calls it, but here is how it is supposed to
- # work.
-
- # Only allow PI roles to be checked
- roles = {}
- for role in Roles(self.api):
- roles[role['role_id']] = role['name']
- roles[role['name']] = role['role_id']
-
- if role_id_or_name not in roles:
- raise PLCInvalidArgument, "Invalid role identifier or name"
-
- if isinstance(role_id_or_name, int):
- role_id = role_id_or_name
- else:
- role_id = roles[role_id_or_name]
-
- if roles[role_id] != "pi":
- raise PLCInvalidArgument, "Only the PI role may be checked"
-
- # Get account information
- persons = Persons(self.api, [person_id_or_email])
-
- # Rather than raise an error, and indicate whether or not
- # the person is real, return 0.
- if not persons:
- return 0
-
- person = persons[0]
-
- if role_id in person['role_ids']:
- return 1
-
- return 0
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Nodes import Node, Nodes
-from PLC.ConfFiles import ConfFile, ConfFiles
-from PLC.Auth import Auth
-
-class AdmQueryConfFile(Method):
- """
- Deprecated. See GetConfFiles.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'user', 'tech']
-
- accepts = [
- Auth(),
- {'node_id': Node.fields['node_id']}
- ]
-
- returns = [ConfFile.fields['conf_file_id']]
-
- def call(self, auth, search_vals):
- if 'node_id' in search_vals:
- conf_files = ConfFiles(self.api)
-
- conf_files = filter(lambda conf_file: \
- search_vals['node_id'] in conf_file['node_ids'],
- conf_files)
-
- if conf_files:
- return [conf_file['conf_file_id'] for conf_file in conf_files]
-
- return []
+++ /dev/null
-import socket
-
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks, valid_ip
-from PLC.Auth import Auth
-
-class AdmQueryNode(Method):
- """
- Deprecated. Functionality can be implemented with GetNodes and
- GetNodeNetworks.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'user', 'tech']
-
- accepts = [
- Auth(),
- {'node_hostname': Node.fields['hostname'],
- 'nodenetwork_ip': NodeNetwork.fields['ip'],
- 'nodenetwork_mac': NodeNetwork.fields['mac'],
- 'nodenetwork_method': NodeNetwork.fields['method']}
- ]
-
- returns = [Node.fields['node_id']]
-
- def call(self, auth, search_vals):
- # Get possible nodenetworks
- if 'node_hostname' in search_vals:
- nodes = Nodes(self.api, [search_vals['node_hostname']])
- if not nodes:
- return []
-
- # No network interface filters specified
- if 'nodenetwork_ip' not in search_vals and \
- 'nodenetwork_mac' not in search_vals and \
- 'nodenetwork_method' not in search_vals:
- return [nodes[0]['node_id']]
-
- if nodes[0]['nodenetwork_ids']:
- nodenetworks = NodeNetworks(self.api, nodes[0]['nodenetwork_ids'])
- else:
- nodenetworks = []
- else:
- nodenetworks = NodeNetworks(self.api)
-
- if 'nodenetwork_ip' in search_vals:
- if not valid_ip(search_vals['nodenetwork_ip']):
- raise PLCInvalidArgument, "Invalid IP address"
- nodenetworks = filter(lambda nodenetwork: \
- socket.inet_aton(nodenetwork['ip']) == socket.inet_aton(search_vals['nodenetwork_ip']),
- nodenetworks)
-
- if 'nodenetwork_mac' in search_vals:
- nodenetworks = filter(lambda nodenetwork: \
- nodenetwork['mac'].lower() == search_vals['nodenetwork_mac'].lower(),
- nodenetworks)
-
- if 'nodenetwork_method' in search_vals:
- nodenetworks = filter(lambda nodenetwork: \
- nodenetwork['method'].lower() == search_vals['nodenetwork_method'].lower(),
- nodenetworks)
-
- return [nodenetwork['node_id'] for nodenetwork in nodenetworks]
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Persons import Person, Persons
-from PLC.Auth import Auth
-
-class AdmQueryPerson(Method):
- """
- Deprecated. See GetPersons.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'user', 'tech']
-
- accepts = [
- Auth(),
- {'email': Person.fields['email']}
- ]
-
- returns = [Person.fields['person_id']]
-
- def call(self, auth, search_vals):
- if 'email' in search_vals:
- persons = Persons(self.api, [search_vals['email']])
- if persons:
- return [persons[0]['person_id']]
-
- return []
+++ /dev/null
-import socket
-
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.PCUs import PCU, PCUs
-from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks, valid_ip
-from PLC.Auth import Auth
-
-class AdmQueryPowerControlUnit(Method):
- """
- Deprecated. Functionality can be implemented with GetPCUs or
- GetNodes.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'user', 'tech']
-
- accepts = [
- Auth(),
- {'pcu_hostname': PCU.fields['hostname'],
- 'pcu_ip': PCU.fields['ip'],
- 'node_hostname': Node.fields['hostname'],
- 'node_id': Node.fields['node_id']}
- ]
-
- returns = [PCU.fields['pcu_id']]
-
- def call(self, auth, search_vals):
- # Get all PCUs. This is a stupid function. The API should not
- # be used for DB mining.
- pcus = PCUs(self.api)
-
- if 'pcu_hostname' in search_vals:
- pcus = filter(lambda pcu: \
- pcu['hostname'].lower() == search_vals['pcu_hostname'].lower(),
- pcus)
-
- if 'pcu_ip' in search_vals:
- if not valid_ip(search_vals['pcu_ip']):
- raise PLCInvalidArgument, "Invalid IP address"
- pcus = filter(lambda pcu: \
- socket.inet_aton(pcu['ip']) == socket.inet_aton(search_vals['pcu_ip']),
- pcus)
-
- if 'node_id' in search_vals:
- pcus = filter(lambda pcu: \
- search_vals['node_id'] in pcu['node_ids'],
- pcus)
-
- if 'node_hostname' in search_vals:
- pcus = filter(lambda pcu: \
- search_vals['node_hostname'] in \
- [node['hostname'] for node in Nodes(self.api, pcu['node_ids'])],
- pcus)
-
- return [pcu['pcu_id'] for pcu in pcus]
+++ /dev/null
-import socket
-
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Sites import Site, Sites
-from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks, valid_ip
-from PLC.Auth import Auth
-
-class AdmQuerySite(Method):
- """
- Deprecated. Functionality can be implemented with GetSites and
- GetNodes.
- """
-
- status = "deprecated"
-
- roles = ['admin', 'pi', 'user', 'tech']
-
- accepts = [
- Auth(),
- {'site_name': Site.fields['name'],
- 'site_abbreviatedname': Site.fields['abbreviated_name'],
- 'site_loginbase': Site.fields['login_base'],
- 'node_hostname': Node.fields['hostname'],
- 'node_id': Node.fields['node_id'],
- 'nodenetwork_ip': NodeNetwork.fields['ip'],
- 'nodenetwork_mac': NodeNetwork.fields['mac']}
- ]
-
- returns = [Site.fields['site_id']]
-
- def call(self, auth, search_vals):
- if 'site_loginbase' in search_vals:
- sites = Sites(self.api, [search_vals['site_loginbase']])
- else:
- sites = Sites(self.api)
-
- if 'site_name' in search_vals:
- sites = filter(lambda site: \
- site['name'] == search_vals['site_name'],
- sites)
-
- if 'site_abbreviatedname' in search_vals:
- sites = filter(lambda site: \
- site['abbreviatedname'] == search_vals['site_abbreviatedname'],
- sites)
-
- if 'node_id' in search_vals:
- sites = filter(lambda site: \
- search_vals['node_id'] in site['node_ids'],
- sites)
-
- if 'node_hostname' in search_vals or \
- 'nodenetwork_ip' in search_vals or \
- 'nodenetwork_mac' in search_vals:
- for site in sites:
- site['hostnames'] = []
- site['ips'] = []
- site['macs'] = []
- if site['node_ids']:
- nodes = Nodes(self.api, site['node_ids'])
- for node in nodes:
- site['hostnames'].append(node['hostname'])
- if 'nodenetwork_ip' in search_vals or \
- 'nodenetwork_mac' in search_vals:
- nodenetworks = NodeNetworks(self.api, node['nodenetwork_ids'])
- site['ips'] += [nodenetwork['ip'] for nodenetwork in nodenetworks]
- site['macs'] += [nodenetwork['mac'] for nodenetwork in nodenetworks]
-
- if 'node_hostname' in search_vals:
- sites = filter(lambda site: \
- search_vals['node_hostname'] in site['hostnames'],
- sites)
-
- if 'nodenetwork_ip' in search_vals:
- sites = filter(lambda site: \
- search_vals['nodenetwork_ip'] in site['ips'],
- sites)
-
- if 'nodenetwork_mac' in search_vals:
- sites = filter(lambda site: \
- search_vals['nodenetwork_mac'] in site['macs'],
- sites)
-
- return [site['site_id'] for site in sites]
+++ /dev/null
-from PLC.Methods.RebootNode import RebootNode
-
-class AdmRebootNode(RebootNode):
- """
- Deprecated. See RebootNode.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Methods.DeleteNodeFromNodeGroup import DeleteNodeFromNodeGroup
-
-class AdmRemoveNodeFromNodeGroup(DeleteNodeFromNodeGroup):
- """
- Deprecated. See DeleteNodeFromNodeGroup.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Methods.DeletePersonFromSite import DeletePersonFromSite
-
-class AdmRemovePersonFromSite(DeletePersonFromSite):
- """
- Deprecated. See DeletePersonFromSite.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Methods.DeleteRoleFromPerson import DeleteRoleFromPerson
-
-class AdmRevokeRoleFromPerson(DeleteRoleFromPerson):
- """
- Deprecated. See DeleteRoleFromPerson.
- """
-
- status = "deprecated"
-
- def call(self, auth, person_id_or_email, role_id_or_name):
- return DeleteRoleFromPerson.call(self, auth, role_id_or_name, person_id_or_email)
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Persons import Person, Persons
-from PLC.Auth import Auth
-from PLC.Methods.UpdatePerson import UpdatePerson
-
-class AdmSetPersonEnabled(UpdatePerson):
- """
- Deprecated. See UpdatePerson.
- """
-
- status = "deprecated"
-
- accepts = [
- Auth(),
- Mixed(Person.fields['person_id'],
- Person.fields['email']),
- Person.fields['enabled']
- ]
-
- def call(self, auth, person_id_or_email, enabled):
- return UpdatePerson.call(self, auth, person_id_or_email, {'enabled': enabled})
+++ /dev/null
-from PLC.Methods.SetPersonPrimarySite import SetPersonPrimarySite
-
-class AdmSetPersonPrimarySite(SetPersonPrimarySite):
- """
- Deprecated. See SetPersonPrimarySite.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Methods.UpdateNode import UpdateNode
-
-class AdmUpdateNode(UpdateNode):
- """
- Deprecated. See UpdateNode.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.NodeGroups import NodeGroup, NodeGroups
-from PLC.Auth import Auth
-from PLC.Methods.UpdateNodeGroup import UpdateNodeGroup
-
-class AdmUpdateNodeGroup(UpdateNodeGroup):
- """
- Deprecated. See UpdateNodeGroup.
- """
-
- status = "deprecated"
-
- accepts = [
- Auth(),
- Mixed(NodeGroup.fields['nodegroup_id'],
- NodeGroup.fields['name']),
- NodeGroup.fields['name'],
- NodeGroup.fields['description']
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, nodegroup_id_or_name, name, description):
- return UpdateNodeGroup.call(self, auth, nodegroup_id_or_name,
- {'name': name, 'description': description})
+++ /dev/null
-from PLC.Methods.UpdateNodeNetwork import UpdateNodeNetwork
-
-class AdmUpdateNodeNetwork(UpdateNodeNetwork):
- """
- Deprecated. See UpdateNodeNetwork.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Methods.UpdatePerson import UpdatePerson
-
-class AdmUpdatePerson(UpdatePerson):
- """
- Deprecated. See UpdatePerson.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Methods.UpdateSite import UpdateSite
-
-class AdmUpdateSite(UpdateSite):
- """
- Deprecated. See UpdateSite.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Methods.UpdatePCU import UpdatePCU
-
-class AdmUpdateSitePowerControlUnit(UpdatePCU):
- """
- Deprecated. See UpdatePCU.
- """
-
- status = "deprecated"
+++ /dev/null
-from PLC.Methods.GetNodeGroups import GetNodeGroups
-
-class AnonAdmGetNodeGroups(GetNodeGroups):
- """
- Deprecated. See GetNodeGroups. All fields are now always returned
- """
-
- status = "deprecated"
-
- def call(self, auth, nodegroup_id_or_name_list = None, return_fields = None):
- return GetNodeGroups.call(self, auth, nodegroup_id_or_name_list)
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth, BootAuth
--- /dev/null
+# $Id$
+# $URL$
+
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Filter import Filter
+from PLC.Auth import Auth
+from PLC.Persons import Persons
+from PLC.Sites import Sites
+from PLC.Nodes import Nodes
+from PLC.Slices import Slices
+from PLC.Keys import Keys
+from PLC.Peers import Peers
+from PLC.Faults import *
+
+class BindObjectToPeer(Method):
+ """
+ This method is a hopefully temporary hack to let the sfa correctly
+ attach the objects it creates to a remote peer object. This is
+ needed so that the sfa federation link can work in parallel with
+ RefreshPeer, as RefreshPeer depends on remote objects being
+ correctly marked.
+
+ BindRemoteObjectToPeer is allowed to admins only.
+ """
+
+ roles = ['admin']
+
+ known_types = ['site','person','slice','node','key']
+ types_doc = ",".join(["'%s'"%type for type in known_types])
+
+ accepts = [
+ Auth(),
+ Parameter(str,"Object type, among "+types_doc),
+ Parameter(int,"object_id"),
+ Parameter(str,"peer shortname"),
+ Parameter(int,"remote object_id, set to 0 if unknown"),
+ ]
+
+ returns = Parameter (int, '1 if successful')
+
+ def locate_object (self, object_type, object_id):
+ # locate e.g. the Nodes symbol
+ class_obj = globals()[object_type.capitalize()+'s']
+ id_name=object_type+'_id'
+ # invoke e.g. Nodes ({'node_id':node_id})
+ objs=class_obj(self.api,{id_name:object_id})
+ if len(objs) != 1:
+ raise PLCInvalidArgument,"Cannot locate object, type=%s id=%d"%\
+ (type,object_id)
+ return objs[0]
+
+
+ def call(self, auth, object_type, object_id, shortname,remote_object_id):
+
+ object_type = object_type.lower()
+ if object_type not in self.known_types:
+ raise PLCInvalidArgument, 'Unrecognized object type %s'%object_type
+
+ peers=Peers(self.api,{'shortname':shortname.upper()})
+ if len(peers) !=1:
+ raise PLCInvalidArgument, 'No such peer with shortname %s'%shortname
+
+ peer=peers[0]
+ object = self.locate_object (object_type, object_id)
+
+ # There is no need to continue if the object is already bound to this peer
+ if object['peer_id'] in [peer['peer_id']]:
+ return 1
+
+ adder_name = 'add_'+object_type
+ add_function = getattr(type(peer),adder_name)
+ add_function(peer,object,remote_object_id)
+
+ return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Methods.AuthCheck import AuthCheck
class BootCheckAuthentication(AuthCheck):
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import BootAuth
from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
+from PLC.Interfaces import Interface, Interfaces
from PLC.Sessions import Session, Sessions
class BootGetNodeDetails(Method):
'hostname': Node.fields['hostname'],
'boot_state': Node.fields['boot_state'],
'model': Node.fields['model'],
- 'networks': [NodeNetwork.fields],
+ 'networks': [Interface.fields],
'session': Session.fields['session_id'],
}
details['session'] = session['session_id']
- if self.caller['nodenetwork_ids']:
- details['networks'] = NodeNetworks(self.api, self.caller['nodenetwork_ids'])
+ if self.caller['interface_ids']:
+ details['networks'] = Interfaces(self.api, self.caller['interface_ids'])
# XXX Boot Manager cannot unmarshal None
for network in details['networks']:
for field in network:
else:
network[field] = ""
- self.messge = "Node request boot_state (%s) and networks" % \
+ self.message = "Node request boot_state (%s) and networks" % \
(details['boot_state'])
return details
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth, BootAuth, SessionAuth
roles = ['node']
accepts = [
- Mixed(BootAuth(), SessionAuth()),
+ Auth(),
Message.fields['message_id'],
Parameter(int, "Notify PIs"),
Parameter(int, "Notify technical contacts"),
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth, BootAuth, SessionAuth
from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
+from PLC.Interfaces import Interface, Interfaces
can_update = lambda (field, value): field in \
['method', 'mac', 'gateway', 'network',
roles = ['node']
- nodenetwork_fields = dict(filter(can_update, NodeNetwork.fields.items()))
+ interface_fields = dict(filter(can_update, Interface.fields.items()))
accepts = [
Mixed(BootAuth(), SessionAuth()),
{'boot_state': Node.fields['boot_state'],
- 'primary_network': nodenetwork_fields,
+ 'primary_network': interface_fields,
'ssh_host_key': Node.fields['ssh_rsa_key']}
]
if node_fields.has_key('ssh_host_key'):
self.caller['ssh_rsa_key'] = node_fields['ssh_host_key']
- # Update primary node network state
+ # Update primary interface state
if node_fields.has_key('primary_network'):
primary_network = node_fields['primary_network']
- if 'nodenetwork_id' not in primary_network:
- raise PLCInvalidArgument, "Node network not specified"
- if primary_network['nodenetwork_id'] not in self.caller['nodenetwork_ids']:
- raise PLCInvalidArgument, "Node network not associated with calling node"
+ if 'interface_id' not in primary_network:
+ raise PLCInvalidArgument, "Interface not specified"
+ if primary_network['interface_id'] not in self.caller['interface_ids']:
+ raise PLCInvalidArgument, "Interface not associated with calling node"
- nodenetworks = NodeNetworks(self.api, [primary_network['nodenetwork_id']])
- if not nodenetworks:
- raise PLCInvalidArgument, "No such node network"
- nodenetwork = nodenetworks[0]
+ interfaces = Interfaces(self.api, [primary_network['interface_id']])
+ if not interfaces:
+ raise PLCInvalidArgument, "No such interface %r"%interface_id
+ interface = interfaces[0]
- if not nodenetwork['is_primary']:
- raise PLCInvalidArgument, "Not the primary node network on record"
+ if not interface['is_primary']:
+ raise PLCInvalidArgument, "Not the primary interface on record"
- nodenetwork_fields = dict(filter(can_update, primary_network.items()))
- nodenetwork.update(nodenetwork_fields)
- nodenetwork.sync(commit = False)
+ interface_fields = dict(filter(can_update, primary_network.items()))
+ interface.update(interface_fields)
+ interface.sync(commit = False)
+
+ # indicate that node has booted & contacted PLC.
+ if isinstance(self.caller, Node):
+ node = self.caller
+ node.update_last_contact()
self.caller.sync(commit = True)
- self.message = "Node updated: %s" % ", ".join(node_fields.keys())
+ self.message = "Node updated: %s" % ", ".join(node_fields.keys())
return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
Auth(),
ConfFile.fields['conf_file_id'],
Mixed(NodeGroup.fields['nodegroup_id'],
- NodeGroup.fields['name'])
+ NodeGroup.fields['groupname'])
]
returns = Parameter(int, '1 if successful')
--- /dev/null
+# Delete an Emulation link
+#
+# Marta Carbone - unipi
+# $Id$
+# $URL$
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Nodes import Node, Nodes
+from PLC.Auth import Auth
+from PLC.Method import Method
+from PLC.NodeTags import *
+from PLC.Accessors.Accessors_dummynetbox import * # import dummynet accessors
+
+class DeleteEmulationLink(Method):
+ """
+ Delete a connection between a node and a dummynetbox.
+
+ Returns 1 if successful, faults otherwise.
+
+ """
+ roles = ['admin', 'pi', 'tech']
+
+ accepts = [
+ Auth(),
+ Parameter(int, 'node_id'),
+ ]
+
+ returns = Parameter(int, '1 is successful, 0 if not found, fault otherwise')
+
+ def call(self, auth, node_id):
+
+ assert self.caller is not None
+
+ # check for node existence
+ nodes= Nodes(self.api, [node_id])
+ if not nodes:
+ raise PLCInvalidArgument, "Node %s not found" % node_id
+
+ # check for roles permission to call this method
+ if 'admin' not in self.caller['roles']:
+ if site not in self.caller['site_ids']:
+ raise PLCPermissionDenied, "Not allowed to delete this link"
+
+ # check for the right subclass
+ subclass = GetNodeSubclass(self.api)
+ node_subclass = subclass.call(auth, node_id)
+ if node_subclass != None:
+ raise PLCInvalidArgument, "%s is not a node, subclass is %s" % (node_id, node_subclass)
+
+ # Delete from the nodetags the entry with
+ # the given node_id and tagtype = 'dummynetbox'
+ nodetag = NodeTags(self.api, {'node_id':node_id, 'tagname':'dummynetbox_id'})
+
+ if not nodetag:
+ return 0
+
+ nodetag[0].delete()
+
+ return 1
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.Ilinks import Ilink, Ilinks
+from PLC.Interfaces import Interface, Interfaces
+from PLC.Nodes import Node, Nodes
+from PLC.Sites import Site, Sites
+from PLC.TagTypes import TagType, TagTypes
+
+class DeleteIlink(Method):
+ """
+ Deletes the specified ilink
+
+ Attributes may require the caller to have a particular
+ role in order to be deleted, depending on the related tag type.
+ Admins may delete attributes of any slice or sliver.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'user']
+
+ accepts = [
+ Auth(),
+ Ilink.fields['ilink_id']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ object_type = 'Interface'
+
+
+ def call(self, auth, ilink_id):
+ ilinks = Ilinks(self.api, [ilink_id])
+ if not ilinks:
+ raise PLCInvalidArgument, "No such ilink %r"%ilink_id
+ ilink = ilinks[0]
+
+ tag_type_id = ilink['tag_type_id']
+ tag_type = TagTypes (self.api,[tag_type_id])[0]
+ required_min_role = tag_type ['min_role_id']
+
+ # check permission : it not admin, is the user affiliated with the right site<S>
+ if 'admin' not in self.caller['roles']:
+ for key in ['src_interface_id','dst_interface_id']:
+ # locate interface
+ interface_id=ilink[key]
+ interface = Interfaces (self.api,interface_id)[0]
+ node_id=interface['node_id']
+ node = Nodes (self.api,node_id) [0]
+ # locate site
+ site_id = node['site_id']
+ site = Sites (self.api, [site_id]) [0]
+ # check caller is affiliated with this site
+ if self.caller['person_id'] not in site['person_ids']:
+ raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
+
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified ilink, requires role %d",required_min_role
+
+ ilink.delete()
+ self.object_ids = [ilink['src_interface_id'],ilink['dst_interface_id']]
+
+ return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
"""
Deletes an existing initscript.
- Returns 1 if successfuli, faults otherwise.
+ Returns 1 if successful, faults otherwise.
"""
roles = ['admin']
accepts = [
Auth(),
- InitScript.fields['initscript_id']
+ Mixed(InitScript.fields['initscript_id'],
+ InitScript.fields['name']),
]
returns = Parameter(int, '1 if successful')
- def call(self, auth, initscript_id):
- initscripts = InitScripts(self.api, [initscript_id])
+ def call(self, auth, initscript_id_or_name):
+ initscripts = InitScripts(self.api, [initscript_id_or_name])
if not initscripts:
raise PLCInvalidArgument, "No such initscript"
--- /dev/null
+# $Id$
+# $URL$
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+from PLC.Nodes import Node, Nodes
+from PLC.Interfaces import Interface, Interfaces
+
+class DeleteInterface(Method):
+ """
+ Deletes an existing interface.
+
+ Admins may delete any interface. PIs and techs may only delete
+ interface interfaces associated with nodes at their sites.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech']
+
+ accepts = [
+ Auth(),
+ Interface.fields['interface_id']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+
+ def call(self, auth, interface_id):
+
+ # Get interface information
+ interfaces = Interfaces(self.api, [interface_id])
+ if not interfaces:
+ raise PLCInvalidArgument, "No such interface %r"%interface_id
+ interface = interfaces[0]
+
+ # Get node information
+ nodes = Nodes(self.api, [interface['node_id']])
+ if not nodes:
+ raise PLCInvalidArgument, "No such node %r"%node_id
+ node = nodes[0]
+
+ # Authenticated functino
+ assert self.caller is not None
+
+ # If we are not an admin, make sure that the caller is a
+ # member of the site at which the node is located.
+ if 'admin' not in self.caller['roles']:
+ if node['site_id'] not in self.caller['site_ids']:
+ raise PLCPermissionDenied, "Not allowed to delete this interface"
+
+ interface.delete()
+
+ # Logging variables
+ self.event_objects = {'Interface': [interface['interface_id']]}
+ self.message = "Interface %d deleted" % interface['interface_id']
+
+ return 1
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision$
+#
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.InterfaceTags import InterfaceTag, InterfaceTags
+from PLC.Interfaces import Interface, Interfaces
+
+from PLC.Nodes import Node, Nodes
+from PLC.Sites import Site, Sites
+
+class DeleteInterfaceTag(Method):
+ """
+ Deletes the specified interface setting
+
+ Attributes may require the caller to have a particular role in order
+ to be deleted, depending on the related tag type.
+ Admins may delete attributes of any slice or sliver.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'user']
+
+ accepts = [
+ Auth(),
+ InterfaceTag.fields['interface_tag_id']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ object_type = 'Interface'
+
+
+ def call(self, auth, interface_tag_id):
+ interface_tags = InterfaceTags(self.api, [interface_tag_id])
+ if not interface_tags:
+ raise PLCInvalidArgument, "No such interface tag %r"%interface_tag_id
+ interface_tag = interface_tags[0]
+
+ ### reproducing a check from UpdateSliceTag, looks dumb though
+ interfaces = Interfaces(self.api, [interface_tag['interface_id']])
+ if not interfaces:
+ raise PLCInvalidArgument, "No such interface %r"%interface_tag['interface_id']
+ interface = interfaces[0]
+
+ assert interface_tag['interface_tag_id'] in interface['interface_tag_ids']
+
+ # check permission : it not admin, is the user affiliated with the right site
+ if 'admin' not in self.caller['roles']:
+ # locate node
+ node = Nodes (self.api,[interface['node_id']])[0]
+ # locate site
+ site = Sites (self.api, [node['site_id']])[0]
+ # check caller is affiliated with this site
+ if self.caller['person_id'] not in site['person_ids']:
+ raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified interface setting, requires role %d",required_min_role
+
+ interface_tag.delete()
+ self.object_ids = [interface_tag['interface_tag_id']]
+
+ return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
key.delete()
- # Logging variables
- self.event_objects = {'Key': [key['key_id']]}
- self.message = 'Key %d deleted' % key['key_id']
+ # Logging variables
+ self.event_objects = {'Key': [key['key_id']]}
+ self.message = 'Key %d deleted' % key['key_id']
return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
if node['site_id'] not in self.caller['site_ids']:
raise PLCPermissionDenied, "Not allowed to delete nodes from specified site"
+ node_id=node['node_id']
+ site_id=node['site_id']
node.delete()
- # Logging variables
- self.event_objects = {'Node': [node['node_id']]}
- self.message = "Node %d deleted" % node['node_id']
+ # Logging variables
+ # it's not much use to attach to the node as it's going to vanish...
+ self.event_objects = {'Node': [node_id], 'Site': [site_id] }
+ self.message = "Node %d deleted" % node['node_id']
return 1
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.NodeGroups import NodeGroup, NodeGroups
-from PLC.Nodes import Node, Nodes
-from PLC.Auth import Auth
-
-class DeleteNodeFromNodeGroup(Method):
- """
- Removes a node from the specified node group.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- accepts = [
- Auth(),
- Mixed(Node.fields['node_id'],
- Node.fields['hostname']),
- Mixed(NodeGroup.fields['nodegroup_id'],
- NodeGroup.fields['name']),
- ]
-
- returns = Parameter(int, '1 if successful')
-
-
- def call(self, auth, node_id_or_hostname, nodegroup_id_or_name):
- # Get node info
- nodes = Nodes(self.api, [node_id_or_hostname])
- if not nodes:
- raise PLCInvalidArgument, "No such node"
-
- node = nodes[0]
-
- # Get nodegroup info
- nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
- if not nodegroups:
- raise PLCInvalidArgument, "No such nodegroup"
-
- nodegroup = nodegroups[0]
-
- # Remove node from nodegroup
- if node['node_id'] in nodegroup['node_ids']:
- nodegroup.remove_node(node)
-
- # Logging variables
- self.event_objects = {'NodeGroup': [nodegroup['nodegroup_id']],
- 'Node': [node['node_id']]}
- self.message = 'node %d deleted from node group %d' % \
- (node['node_id'], nodegroup['nodegroup_id'])
-
- return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
accepts = [
Auth(),
Mixed(NodeGroup.fields['nodegroup_id'],
- NodeGroup.fields['name'])
+ NodeGroup.fields['groupname'])
]
returns = Parameter(int, '1 if successful')
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import Auth
-from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-
-class DeleteNodeNetwork(Method):
- """
- Deletes an existing node network interface.
-
- Admins may delete any node network. PIs and techs may only delete
- node network interfaces associated with nodes at their sites.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin', 'pi', 'tech']
-
- accepts = [
- Auth(),
- NodeNetwork.fields['nodenetwork_id']
- ]
-
- returns = Parameter(int, '1 if successful')
-
-
- def call(self, auth, nodenetwork_id):
-
- # Get node network information
- nodenetworks = NodeNetworks(self.api, [nodenetwork_id])
- if not nodenetworks:
- raise PLCInvalidArgument, "No such node network"
- nodenetwork = nodenetworks[0]
-
- # Get node information
- nodes = Nodes(self.api, [nodenetwork['node_id']])
- if not nodes:
- raise PLCInvalidArgument, "No such node"
- node = nodes[0]
-
- # Authenticated functino
- assert self.caller is not None
-
- # If we are not an admin, make sure that the caller is a
- # member of the site at which the node is located.
- if 'admin' not in self.caller['roles']:
- if node['site_id'] not in self.caller['site_ids']:
- raise PLCPermissionDenied, "Not allowed to delete this node network"
-
- nodenetwork.delete()
-
- # Logging variables
- self.event_objects = {'NodeNetwork': [nodenetwork['nodenetwork_id']]}
- self.message = "Node network %d deleted" % nodenetwork['nodenetwork_id']
-
- return 1
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import Auth
-
-from PLC.NodeNetworkSettings import NodeNetworkSetting, NodeNetworkSettings
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-
-from PLC.Nodes import Node, Nodes
-from PLC.Sites import Site, Sites
-
-class DeleteNodeNetworkSetting(Method):
- """
- Deletes the specified nodenetwork setting
-
- Attributes may require the caller to have a particular role in order
- to be deleted, depending on the related nodenetwork setting type.
- Admins may delete attributes of any slice or sliver.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin', 'pi', 'user']
-
- accepts = [
- Auth(),
- NodeNetworkSetting.fields['nodenetwork_setting_id']
- ]
-
- returns = Parameter(int, '1 if successful')
-
- object_type = 'NodeNetwork'
-
-
- def call(self, auth, nodenetwork_setting_id):
- nodenetwork_settings = NodeNetworkSettings(self.api, [nodenetwork_setting_id])
- if not nodenetwork_settings:
- raise PLCInvalidArgument, "No such nodenetwork setting %r"%nodenetwork_setting_id
- nodenetwork_setting = nodenetwork_settings[0]
-
- ### reproducing a check from UpdateSliceAttribute, looks dumb though
- nodenetworks = NodeNetworks(self.api, [nodenetwork_setting['nodenetwork_id']])
- if not nodenetworks:
- raise PLCInvalidArgument, "No such nodenetwork %r"%nodenetwork_setting['nodenetwork_id']
- nodenetwork = nodenetworks[0]
-
- assert nodenetwork_setting['nodenetwork_setting_id'] in nodenetwork['nodenetwork_setting_ids']
-
- # check permission : it not admin, is the user affiliated with the right site
- if 'admin' not in self.caller['roles']:
- # locate node
- node = Nodes (self.api,[nodenetwork['node_id']])[0]
- # locate site
- site = Sites (self.api, [node['site_id']])[0]
- # check caller is affiliated with this site
- if self.caller['person_id'] not in site['person_ids']:
- raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
-
- required_min_role = nodenetwork_setting_type ['min_role_id']
- if required_min_role is not None and \
- min(self.caller['role_ids']) > required_min_role:
- raise PLCPermissionDenied, "Not allowed to modify the specified nodenetwork setting, requires role %d",required_min_role
-
- nodenetwork_setting.delete()
- self.object_ids = [nodenetwork_setting['nodenetwork_setting_id']]
-
- return 1
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.NodeNetworkSettingTypes import NodeNetworkSettingType, NodeNetworkSettingTypes
-from PLC.Auth import Auth
-
-class DeleteNodeNetworkSettingType(Method):
- """
- Deletes the specified nodenetwork setting type.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- accepts = [
- Auth(),
- Mixed(NodeNetworkSettingType.fields['nodenetwork_setting_type_id'],
- NodeNetworkSettingType.fields['name']),
- ]
-
- returns = Parameter(int, '1 if successful')
-
-
- def call(self, auth, nodenetwork_setting_type_id_or_name):
- nodenetwork_setting_types = NodeNetworkSettingTypes(self.api, [nodenetwork_setting_type_id_or_name])
- if not nodenetwork_setting_types:
- raise PLCInvalidArgument, "No such nodenetwork setting type"
- nodenetwork_setting_type = nodenetwork_setting_types[0]
-
- nodenetwork_setting_type.delete()
- self.object_ids = [nodenetwork_setting_type['nodenetwork_setting_type_id']]
-
- return 1
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.NodeTags import NodeTag, NodeTags
+from PLC.Nodes import Node, Nodes
+
+from PLC.Nodes import Node, Nodes
+from PLC.Sites import Site, Sites
+
+class DeleteNodeTag(Method):
+ """
+ Deletes the specified node tag
+
+ Attributes may require the caller to have a particular role in order
+ to be deleted, depending on the related node tag type.
+ Admins may delete attributes of any slice or sliver.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'user']
+
+ accepts = [
+ Auth(),
+ NodeTag.fields['node_tag_id']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ object_type = 'Node'
+
+
+ def call(self, auth, node_tag_id):
+ node_tags = NodeTags(self.api, [node_tag_id])
+ if not node_tags:
+ raise PLCInvalidArgument, "No such node tag %r"%node_tag_id
+ node_tag = node_tags[0]
+
+ ### reproducing a check from UpdateSliceTag, looks dumb though
+ nodes = Nodes(self.api, [node_tag['node_id']])
+ if not nodes:
+ raise PLCInvalidArgument, "No such node %r"%node_tag['node_id']
+ node = nodes[0]
+
+ assert node_tag['node_tag_id'] in node['node_tag_ids']
+
+ # check permission : it not admin, is the user affiliated with the right site
+ if 'admin' not in self.caller['roles']:
+ # locate node
+ node = Nodes (self.api,[node['node_id']])[0]
+ # locate site
+ site = Sites (self.api, [node['site_id']])[0]
+ # check caller is affiliated with this site
+ if self.caller['person_id'] not in site['person_ids']:
+ raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified node tag, requires role %d",required_min_role
+
+ node_tag.delete()
+ self.object_ids = [node_tag['node_tag_id']]
+
+ return 1
--- /dev/null
+# $Id$
+# $URL$
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.NodeTypes import NodeType, NodeTypes
+from PLC.Auth import Auth
+
+class DeleteNodeType(Method):
+ """
+ Deletes a node node type.
+
+ WARNING: This will cause the deletion of all nodes in this boot
+ state.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin']
+
+ accepts = [
+ Auth(),
+ NodeType.fields['node_type']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+
+ def call(self, auth, name):
+ node_types = NodeTypes(self.api, [name])
+ if not node_types:
+ raise PLCInvalidArgument, "No such node type"
+ node_type = node_types[0]
+
+ node_type.delete()
+
+ return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
person.delete()
- # Logging variables
- self.event_objects = {'Person': [person['person_id']]}
- self.message = 'Person %d deleted' % person['person_id']
+ # Logging variables
+ self.event_objects = {'Person': [person['person_id']]}
+ self.message = 'Person %d deleted' % person['person_id']
return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
if site['site_id'] in person['site_ids']:
site.remove_person(person)
- # Logging variables
- self.event_objects = {'Site': [site['site_id']],
- 'Person': [person['person_id']]}
- self.message = 'Person %d deleted from site %d ' % \
- (person['person_id'], site['site_id'])
+ # Logging variables
+ self.event_objects = {'Site': [site['site_id']],
+ 'Person': [person['person_id']]}
+ self.message = 'Person %d deleted from site %d ' % \
+ (person['person_id'], site['site_id'])
+
return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
--- /dev/null
+# $Id: DeletePersonTag.py 14587 2009-07-19 13:18:50Z thierry $
+# $URL: http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.3-27/PLC/Methods/DeletePersonTag.py $
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 14587 $
+#
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.PersonTags import PersonTag, PersonTags
+from PLC.Persons import Person, Persons
+
+from PLC.Nodes import Node, Nodes
+from PLC.Persons import Person, Persons
+
+class DeletePersonTag(Method):
+ """
+ Deletes the specified person setting
+
+ Attributes may require the caller to have a particular role in order
+ to be deleted, depending on the related tag type.
+ Admins may delete attributes of any slice or sliver.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'user']
+
+ accepts = [
+ Auth(),
+ PersonTag.fields['person_tag_id']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ object_type = 'Person'
+
+
+ def call(self, auth, person_tag_id):
+ person_tags = PersonTags(self.api, [person_tag_id])
+ if not person_tags:
+ raise PLCInvalidArgument, "No such person tag %r"%person_tag_id
+ person_tag = person_tags[0]
+
+ ### reproducing a check from UpdateSliceTag, looks dumb though
+ persons = Persons(self.api, [person_tag['person_id']])
+ if not persons:
+ raise PLCInvalidArgument, "No such person %r"%person_tag['person_id']
+ person = persons[0]
+
+ assert person_tag['person_tag_id'] in person['person_tag_ids']
+
+ # check permission : it not admin, is the user affiliated with the right person
+ if 'admin' not in self.caller['roles']:
+ # check caller is affiliated with this person's site
+ if len(set(person['site_ids']) & set(self.caller['site_ids'])) == 0:
+ raise PLCPermissionDenied, "Not a member of the person's sites: %s"%person['site_ids']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified person setting, requires role %d",required_min_role
+
+ person_tag.delete()
+ self.object_ids = [person_tag['person_tag_id']]
+
+ return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
import time
from PLC.Method import Method
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
site.delete()
- # Logging variables
- self.event_objects = {'Site': [site['site_id']]}
- self.message = 'Site %d deleted' % site['site_id']
+ # Logging variables
+ self.event_objects = {'Site': [site['site_id']]}
+ self.message = 'Site %d deleted' % site['site_id']
+
return 1
--- /dev/null
+# $Id: DeleteSiteTag.py 14587 2009-07-19 13:18:50Z thierry $
+# $URL: http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.3-27/PLC/Methods/DeleteSiteTag.py $
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 14587 $
+#
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.SiteTags import SiteTag, SiteTags
+from PLC.Sites import Site, Sites
+
+from PLC.Nodes import Node, Nodes
+from PLC.Sites import Site, Sites
+
+class DeleteSiteTag(Method):
+ """
+ Deletes the specified site setting
+
+ Attributes may require the caller to have a particular role in order
+ to be deleted, depending on the related tag type.
+ Admins may delete attributes of any slice or sliver.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'user']
+
+ accepts = [
+ Auth(),
+ SiteTag.fields['site_tag_id']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ object_type = 'Site'
+
+
+ def call(self, auth, site_tag_id):
+ site_tags = SiteTags(self.api, [site_tag_id])
+ if not site_tags:
+ raise PLCInvalidArgument, "No such site tag %r"%site_tag_id
+ site_tag = site_tags[0]
+
+ ### reproducing a check from UpdateSliceTag, looks dumb though
+ sites = Sites(self.api, [site_tag['site_id']])
+ if not sites:
+ raise PLCInvalidArgument, "No such site %r"%site_tag['site_id']
+ site = sites[0]
+
+ assert site_tag['site_tag_id'] in site['site_tag_ids']
+
+ # check permission : it not admin, is the user affiliated with the right site
+ if 'admin' not in self.caller['roles']:
+ # check caller is affiliated with this site
+ if self.caller['person_id'] not in site['person_ids']:
+ raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified site setting, requires role %d",required_min_role
+
+ site_tag.delete()
+ self.object_ids = [site_tag['site_tag_id']]
+
+ return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-from PLC.Auth import Auth
-
-class DeleteSliceAttributeType(Method):
- """
- Deletes the specified slice attribute.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- accepts = [
- Auth(),
- Mixed(SliceAttributeType.fields['attribute_type_id'],
- SliceAttributeType.fields['name']),
- ]
-
- returns = Parameter(int, '1 if successful')
-
-
- def call(self, auth, attribute_type_id_or_name):
- attribute_types = SliceAttributeTypes(self.api, [attribute_type_id_or_name])
- if not attribute_types:
- raise PLCInvalidArgument, "No such slice attribute type"
- attribute_type = attribute_types[0]
-
- attribute_type.delete()
- self.event_objects = {'AttributeType': [attribute_type['attribute_type_id']]}
-
- return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.SliceAttributes import SliceAttribute, SliceAttributes
+from PLC.SliceTags import SliceTag, SliceTags
from PLC.Slices import Slice, Slices
from PLC.Nodes import Node, Nodes
from PLC.Auth import Auth
-class DeleteSliceAttribute(Method):
+class DeleteSliceTag(Method):
"""
Deletes the specified slice or sliver attribute.
accepts = [
Auth(),
- SliceAttribute.fields['slice_attribute_id']
+ SliceTag.fields['slice_tag_id']
]
returns = Parameter(int, '1 if successful')
- def call(self, auth, slice_attribute_id):
- slice_attributes = SliceAttributes(self.api, [slice_attribute_id])
- if not slice_attributes:
+ def call(self, auth, slice_tag_id):
+ slice_tags = SliceTags(self.api, [slice_tag_id])
+ if not slice_tags:
raise PLCInvalidArgument, "No such slice attribute"
- slice_attribute = slice_attributes[0]
+ slice_tag = slice_tags[0]
- slices = Slices(self.api, [slice_attribute['slice_id']])
+ slices = Slices(self.api, [slice_tag['slice_id']])
if not slices:
raise PLCInvalidArgument, "No such slice"
slice = slices[0]
- assert slice_attribute['slice_attribute_id'] in slice['slice_attribute_ids']
+ assert slice_tag['slice_tag_id'] in slice['slice_tag_ids']
if 'admin' not in self.caller['roles']:
if self.caller['person_id'] in slice['person_ids']:
elif slice['site_id'] not in self.caller['site_ids']:
raise PLCPermissionDenied, "Specified slice not associated with any of your sites"
- if slice_attribute['min_role_id'] is not None and \
- min(self.caller['role_ids']) > slice_attribute['min_role_id']:
+ if slice_tag['min_role_id'] is not None and \
+ min(self.caller['role_ids']) > slice_tag['min_role_id']:
raise PLCPermissioinDenied, "Not allowed to delete the specified attribute"
- slice_attribute.delete()
- self.event_objects = {'SliceAttribute': [slice_attribute['slice_attribute_id']]}
+ slice_tag.delete()
+ self.event_objects = {'SliceTag': [slice_tag['slice_tag_id']]}
return 1
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.TagTypes import TagType, TagTypes
+from PLC.Auth import Auth
+
+class DeleteTagType(Method):
+ """
+ Deletes the specified node tag type.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin']
+
+ accepts = [
+ Auth(),
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+
+ def call(self, auth, tag_type_id_or_name):
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "No such node tag type"
+ tag_type = tag_types[0]
+
+ tag_type.delete()
+ self.object_ids = [tag_type['tag_type_id']]
+
+ return 1
+# $Id$
+# $URL$
import random
import base64
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
+from PLC.Interfaces import Interface, Interfaces
from PLC.Auth import Auth
class GenerateNodeConfFile(Method):
if node['site_id'] not in self.caller['site_ids']:
raise PLCPermissionDenied, "Not allowed to generate a configuration file for that node"
- # Get node networks for this node
+ # Get interfaces for this node
primary = None
- nodenetworks = NodeNetworks(self.api, node['nodenetwork_ids'])
- for nodenetwork in nodenetworks:
- if nodenetwork['is_primary']:
- primary = nodenetwork
+ interfaces = Interfaces(self.api, node['interface_ids'])
+ for interface in interfaces:
+ if interface['is_primary']:
+ primary = interface
break
if primary is None:
raise PLCInvalidArgument, "No primary network configured"
file += 'HOST_NAME="%s"\n' % host
file += 'DOMAIN_NAME="%s"\n' % domain
- for nodenetwork in nodenetworks:
- if nodenetwork['method'] == 'ipmi':
- file += 'IPMI_ADDRESS="%s"\n' % nodenetwork['ip']
- if nodenetwork['mac']:
- file += 'IPMI_MAC="%s"\n' % nodenetwork['mac'].lower()
+ for interface in interfaces:
+ if interface['method'] == 'ipmi':
+ file += 'IPMI_ADDRESS="%s"\n' % interface['ip']
+ if interface['mac']:
+ file += 'IPMI_MAC="%s"\n' % interface['mac'].lower()
break
return file
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
# $Id$
+# $URL$
import random
import base64
import os
import os.path
+import time
from PLC.Faults import *
from PLC.Method import Method
from PLC.Auth import Auth
from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.NodeNetworkSettings import NodeNetworkSetting, NodeNetworkSettings
-from PLC.NodeGroups import NodeGroup, NodeGroups
+from PLC.Interfaces import Interface, Interfaces
+from PLC.InterfaceTags import InterfaceTag, InterfaceTags
+from PLC.NodeTags import NodeTag, NodeTags
# could not define this in the class..
-boot_medium_actions = [ 'node-preview',
- 'node-floppy',
- 'node-iso',
- 'node-usb',
- 'generic-iso',
- 'generic-usb',
- ]
+# create a dict with the allowed actions for each type of node
+allowed_actions = {
+ 'regular' : [ 'node-preview',
+ 'node-floppy',
+ 'node-iso',
+ 'node-usb',
+ 'generic-iso',
+ 'generic-usb',
+ ],
+ 'dummynet' : [ 'node-preview',
+ 'dummynet-iso',
+ 'dummynet-usb',
+ ],
+ }
# compute a new key
-# xxx used by GetDummyBoxMedium
def compute_key():
# Generate 32 random bytes
bytes = random.sample(xrange(0, 256), 32)
This method is a redesign based on former, supposedly dedicated,
AdmGenerateNodeConfFile
- As compared with its ancestor, this method provides a much more detailed
+ As compared with its ancestor, this method provides a much more
detailed interface, that allows to
(*) either just preview the node config file -- in which case
the node key is NOT recomputed, and NOT provided in the output
(*) or just provide the generic ISO or USB boot images
in which case of course the node_id_or_hostname parameter is not used
- action is expected among the following string constants
+ action is expected among the following string constants according the
+ node type value:
+
+ for a 'regular' node:
(*) node-preview
(*) node-floppy
(*) node-iso
(*) generic-iso
(*) generic-usb
+ for a 'dummynet' node:
+ (*) node-preview
+ (*) dummynet-iso
+ (*) dummynet-usb
+
Apart for the preview mode, this method generates a new node key for the
specified node, effectively invalidating any old boot medium.
Options: an optional array of keywords.
options are not supported for generic images
- Currently supported are
+ options are not supported for dummynet boxes
+ Currently supported are
- 'partition' - for USB actions only
- 'cramfs'
- 'serial' or 'serial:<console_spec>'
it is expected to be a colon separated string denoting
tty - baudrate - parity - bits
e.g. ttyS0:115200:n:8
-
+ - 'variant:<variantname>'
+ passed to build.sh as -V <variant>
+ variants are used to run a different kernel on the bootCD
+ see kvariant.sh for how to create a variant
+ - 'no-hangcheck' - disable hangcheck
+
+ Tags: the following tags are taken into account when attached to the node:
+ 'serial', 'cramfs', 'kvariant', 'kargs', 'no-hangcheck'
+
Security:
- Non-admins can only generate files for nodes at their sites.
- Non-admins, when they provide a filename, *must* specify it in the %d area
Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname']),
- Parameter (str, "Action mode, expected in " + "|".join(boot_medium_actions)),
+ Parameter (str, "Action mode, expected value depends of the type of node"),
Parameter (str, "Empty string for verbatim result, resulting file full path otherwise"),
Parameter ([str], "Options"),
]
returns = Parameter(str, "Node boot medium, either inlined, or filename, depending on the filename parameter")
+ # define globals for regular nodes, override later for other types
BOOTCDDIR = "/usr/share/bootcd-@NODEFAMILY@/"
BOOTCDBUILD = "/usr/share/bootcd-@NODEFAMILY@/build.sh"
GENERICDIR = "/var/www/html/download-@NODEFAMILY@/"
raise PLCInvalidArgument, "Node hostname %s is invalid"%node['hostname']
return parts
- # plnode.txt content
+ # Generate the node (plnode.txt) configuration content.
+ #
+ # This function will create the configuration file a node
+ # composed by:
+ # - a common part, regardless of the 'node_type' tag
+ # - XXX a special part, depending on the 'node_type' tag value.
def floppy_contents (self, node, renew_key):
+ # Do basic checks
if node['peer_id'] is not None:
raise PLCInvalidArgument, "Not a local node"
if node['site_id'] not in self.caller['site_ids']:
raise PLCPermissionDenied, "Not allowed to generate a configuration file for %s"%node['hostname']
- # Get node networks for this node
+ # Get interface for this node
primary = None
- nodenetworks = NodeNetworks(self.api, node['nodenetwork_ids'])
- for nodenetwork in nodenetworks:
- if nodenetwork['is_primary']:
- primary = nodenetwork
+ interfaces = Interfaces(self.api, node['interface_ids'])
+ for interface in interfaces:
+ if interface['is_primary']:
+ primary = interface
break
if primary is None:
raise PLCInvalidArgument, "No primary network configured on %s"%node['hostname']
( host, domain ) = self.split_hostname (node)
+ # renew the key and save it on the database
if renew_key:
node['key'] = compute_key()
- # Save it
node.sync()
# Generate node configuration file suitable for BootCD
if renew_key:
file += 'NODE_ID="%d"\n' % node['node_id']
file += 'NODE_KEY="%s"\n' % node['key']
+ # not used anywhere, just a note for operations people
+ file += 'KEY_RENEWAL_DATE="%s"\n' % time.strftime('%Y/%m/%d at %H:%M +0000',time.gmtime())
if primary['mac']:
file += 'NET_DEVICE="%s"\n' % primary['mac'].lower()
file += 'HOST_NAME="%s"\n' % host
file += 'DOMAIN_NAME="%s"\n' % domain
- # define various nodenetwork settings attached to the primary nodenetwork
- settings = NodeNetworkSettings (self.api, {'nodenetwork_id':nodenetwork['nodenetwork_id']})
+ # define various interface settings attached to the primary interface
+ settings = InterfaceTags (self.api, {'interface_id':interface['interface_id']})
categories = set()
for setting in settings:
categories.add(setting['category'])
for category in categories:
- category_settings = NodeNetworkSettings(self.api,{'nodenetwork_id':nodenetwork['nodenetwork_id'],
+ category_settings = InterfaceTags(self.api,{'interface_id':interface['interface_id'],
'category':category})
if category_settings:
file += '### Category : %s\n'%category
for setting in category_settings:
- file += '%s_%s="%s"\n'%(category.upper(),setting['name'].upper(),setting['value'])
+ file += '%s_%s="%s"\n'%(category.upper(),setting['tagname'].upper(),setting['value'])
- for nodenetwork in nodenetworks:
- if nodenetwork['method'] == 'ipmi':
- file += 'IPMI_ADDRESS="%s"\n' % nodenetwork['ip']
- if nodenetwork['mac']:
- file += 'IPMI_MAC="%s"\n' % nodenetwork['mac'].lower()
+ for interface in interfaces:
+ if interface['method'] == 'ipmi':
+ file += 'IPMI_ADDRESS="%s"\n' % interface['ip']
+ if interface['mac']:
+ file += 'IPMI_MAC="%s"\n' % interface['mac'].lower()
break
return file
# see also InstallBootstrapFS in bootmanager that does similar things
def get_nodefamily (self, node):
+ # get defaults from the myplc build
try:
(pldistro,arch) = file("/etc/planetlab/nodefamily").read().strip().split("-")
except:
(pldistro,arch) = ("planetlab","i386")
+ # with no valid argument, return system-wide defaults
if not node:
return (pldistro,arch)
- known_archs = [ 'i386', 'x86_64' ]
- nodegroupnames = [ ng['name'] for ng in NodeGroups (self.api, node['nodegroup_ids'],['name'])]
- # (1) if groupname == arch, nodefamily becomes pldistro-groupname
- # (2) else if groupname looks like pldistro-arch, it is taken as a nodefamily
- # (3) otherwise groupname is taken as an extension
- for nodegroupname in nodegroupnames:
- if nodegroupname in known_archs:
- arch = nodegroupname
- else:
- for known_arch in known_archs:
- try:
- (api_pldistro,api_arch)=nodegroupname.split("-")
- # sanity check
- if api_arch != known_arch: raise Exception,"mismatch"
- (pldistro,arch) = (api_pldistro, api_arch)
- break
- except:
- pass
+ node_id=node['node_id']
+
+ tag=Nodes(self.api,[node_id],['arch'])[0]['arch']
+ if tag: arch=tag
+ tag=Nodes(self.api,[node_id],['pldistro'])[0]['pldistro']
+ if tag: pldistro=tag
+
return (pldistro,arch)
def bootcd_version (self):
else:
os.unlink(file)
+ ### handle filename
+ # build the filename string
+ # check for permissions and concurrency
+ # returns the filename
+ def handle_filename (self, filename, nodename, suffix, arch):
+ # allow to set filename to None or any other empty value
+ if not filename: filename=''
+ filename = filename.replace ("%d",self.WORKDIR)
+ filename = filename.replace ("%n",nodename)
+ filename = filename.replace ("%s",suffix)
+ filename = filename.replace ("%p",self.api.config.PLC_NAME)
+ # let's be cautious
+ try: filename = filename.replace ("%f", self.nodefamily)
+ except: pass
+ try: filename = filename.replace ("%a", arch)
+ except: pass
+ try: filename = filename.replace ("%v",self.bootcd_version())
+ except: pass
+
+ ### Check filename location
+ if filename != '':
+ if 'admin' not in self.caller['roles']:
+ if ( filename.index(self.WORKDIR) != 0):
+ raise PLCInvalidArgument, "File %s not under %s"%(filename,self.WORKDIR)
+
+ ### output should not exist (concurrent runs ..)
+ if os.path.exists(filename):
+ raise PLCInvalidArgument, "Resulting file %s already exists"%filename
+
+ ### we can now safely create the file,
+ ### either we are admin or under a controlled location
+ filedir=os.path.dirname(filename)
+ # dirname does not return "." for a local filename like its shell counterpart
+ if filedir:
+ if not os.path.exists(filedir):
+ try:
+ os.makedirs (filedir,0777)
+ except:
+ raise PLCPermissionDenied, "Could not create dir %s"%filedir
+
+ return filename
+
+ # Build the command line to be executed
+ # according the node type
+ def build_command(self, node_type, build_sh_spec, node_image, type, floppy_file, log_file):
+
+ command = ""
+
+ # regular node, make build's arguments
+ # and build the full command line to be called
+ if node_type == 'regular':
+
+ build_sh_options=""
+ if "cramfs" in build_sh_spec:
+ type += "_cramfs"
+ if "serial" in build_sh_spec:
+ build_sh_options += " -s %s"%build_sh_spec['serial']
+ if "variant" in build_sh_spec:
+ build_sh_options += " -V %s"%build_sh_spec['variant']
+
+ for karg in build_sh_spec['kargs']:
+ build_sh_options += ' -k "%s"'%karg
+
+ log_file="%s.log"%node_image
+
+ command = '%s -f "%s" -o "%s" -t "%s" %s &> %s' % (self.BOOTCDBUILD,
+ floppy_file,
+ node_image,
+ type,
+ build_sh_options,
+ log_file)
+ # dummynet node
+ elif node_type == 'dummynet':
+ # the build script expect the following parameters:
+ # the package base directory
+ # the working directory
+ # the full path of the configuration file
+ # the name of the resulting image file
+ # the type of the generated image
+ # the name of the log file
+ command = "%s -b %s -w %s -f %s -o %s -t %s -l %s" \
+ % (self.BOOTCDBUILD, self.BOOTCDDIR, self.WORKDIR,
+ floppy_file, node_image, type, log_file)
+ command = "touch %s %s; echo 'dummynet build script not yet supported'" \
+ % (log_file, node_image)
+
+ if self.DEBUG:
+ print "The build command line is %s" % command
+
+ return command
+
def call(self, auth, node_id_or_hostname, action, filename, options = []):
self.trash=[]
- ### check action
- if action not in boot_medium_actions:
- raise PLCInvalidArgument, "Unknown action %s"%action
### compute file suffix and type
if action.find("-iso") >= 0 :
suffix=".txt"
type = "txt"
- # handle / caconicalize options
+ # check for node existence and get node_type
+ nodes = Nodes(self.api, [node_id_or_hostname])
+ if not nodes:
+ raise PLCInvalidArgument, "No such node %r"%node_id_or_hostname
+ node = nodes[0]
+
+ if self.DEBUG: print "%s required on node %s. Node type is: %s" \
+ % (action, node['node_id'], node['node_type'])
+
+ # check the required action against the node type
+ node_type = node['node_type']
+ if action not in allowed_actions[node_type]:
+ raise PLCInvalidArgument, "Action %s not valid for %s nodes, valid actions are %s" \
+ % (action, node_type, "|".join(allowed_actions[node_type]))
+
+ # handle / canonicalize options
if type == "txt":
if options:
raise PLCInvalidArgument, "Options are not supported for node configs"
else:
# create a dict for build.sh
- optdict={}
+ build_sh_spec={'kargs':[]}
+ # use node tags as defaults
+ # check for node tag equivalents
+ tags = NodeTags(self.api,
+ {'node_id': node['node_id'],
+ 'tagname': ['serial', 'cramfs', 'kvariant', 'kargs', 'no-hangcheck']},
+ ['tagname', 'value'])
+ if tags:
+ for tag in tags:
+ if tag['tagname'] == 'serial':
+ build_sh_spec['serial'] = tag['value']
+ if tag['tagname'] == 'cramfs':
+ build_sh_spec['cramfs'] = True
+ if tag['tagname'] == 'kvariant':
+ build_sh_spec['variant'] = tag['value']
+ if tag['tagname'] == 'kargs':
+ build_sh_spec['kargs'].append(tag['value'].split())
+ if tag['tagname'] == 'no-hangcheck':
+ build_sh_spec['kargs'].append('hcheck_reboot0')
+ # then options can override tags
for option in options:
if option == "cramfs":
- optdict['cramfs']=True
+ build_sh_spec['cramfs']=True
elif option == 'partition':
if type != "usb":
raise PLCInvalidArgument, "option 'partition' is for USB images only"
else:
type="usb_partition"
elif option == "serial":
- optdict['serial']='default'
+ build_sh_spec['serial']='default'
elif option.find("serial:") == 0:
- optdict['serial']=option.replace("serial:","")
+ build_sh_spec['serial']=option.replace("serial:","")
+ elif option.find("variant:") == 0:
+ build_sh_spec['variant']=option.replace("variant:","")
+ elif option == "no-hangcheck":
+ build_sh_spec['kargs'].append('hcheck_reboot0')
else:
raise PLCInvalidArgument, "unknown option %s"%option
- ### check node if needed
- if action.find("node-") == 0:
- nodes = Nodes(self.api, [node_id_or_hostname])
- if not nodes:
- raise PLCInvalidArgument, "No such node %r"%node_id_or_hostname
- node = nodes[0]
+ # compute nodename according the action
+ if action.find("node-") == 0 or action.find("dummynet-") == 0:
nodename = node['hostname']
-
else:
node = None
# compute a 8 bytes random number
def hexa2 (c): return chr((c>>4)+65) + chr ((c&16)+65)
nodename = "".join(map(hexa2,tempbytes))
+ # override some global definition, according node_type
+ if node_type == 'dummynet':
+ self.BOOTCDDIR = "/usr/share/dummynet" # the base installation dir
+ self.BOOTCDBUILD = "/usr/share/dummynet/build.sh" # dummynet build script
+ self.WORKDIR = "/var/tmp/DummynetBoxMedium" # temporary working dir
+
# get nodefamily
(pldistro,arch) = self.get_nodefamily(node)
self.nodefamily="%s-%s"%(pldistro,arch)
+
# apply on globals
for attr in [ "BOOTCDDIR", "BOOTCDBUILD", "GENERICDIR" ]:
setattr(self,attr,getattr(self,attr).replace("@NODEFAMILY@",self.nodefamily))
- ### handle filename
- # allow to set filename to None or any other empty value
- if not filename: filename=''
- filename = filename.replace ("%d",self.WORKDIR)
- filename = filename.replace ("%n",nodename)
- filename = filename.replace ("%s",suffix)
- filename = filename.replace ("%p",self.api.config.PLC_NAME)
- # let's be cautious
- try: filename = filename.replace ("%f", self.nodefamily)
- except: pass
- try: filename = filename.replace ("%a", arch)
- except: pass
- try: filename = filename.replace ("%v",self.bootcd_version())
- except: pass
-
- ### Check filename location
- if filename != '':
- if 'admin' not in self.caller['roles']:
- if ( filename.index(self.WORKDIR) != 0):
- raise PLCInvalidArgument, "File %s not under %s"%(filename,self.WORKDIR)
-
- ### output should not exist (concurrent runs ..)
- if os.path.exists(filename):
- raise PLCInvalidArgument, "Resulting file %s already exists"%filename
-
- ### we can now safely create the file,
- ### either we are admin or under a controlled location
- filedir=os.path.dirname(filename)
- # dirname does not return "." for a local filename like its shell counterpart
- if filedir:
- if not os.path.exists(filedir):
- try:
- os.makedirs (dirname,0777)
- except:
- raise PLCPermissionDenied, "Could not create dir %s"%dirname
-
+ filename = self.handle_filename(filename, nodename, suffix, arch)
+ # log call
+ if node:
+ self.message='GetBootMedium on node %s - action=%s'%(nodename,action)
+ self.event_objects={'Node': [ node ['node_id'] ]}
+ else:
+ self.message='GetBootMedium - generic - action=%s'%action
+
### generic media
if action == 'generic-iso' or action == 'generic-usb':
if options:
generic_path = "%s/%s" % (self.GENERICDIR,generic_name)
if filename:
- ret=os.system ("cp %s %s"%(generic_path,filename))
+ ret=os.system ('cp "%s" "%s"'%(generic_path,filename))
if ret==0:
return filename
else:
- raise PLCPermissionDenied, "Could not copy %s into"%(generic_path,filename)
+ raise PLCPermissionDenied, "Could not copy %s into %s"%(generic_path,filename)
else:
### return the generic medium content as-is, just base64 encoded
return base64.b64encode(file(generic_path).read())
- ### config file preview or regenerated
- if action == 'node-preview' or action == 'node-floppy':
+ ### config file preview or regenerated
+ if action == 'node-preview' or action == 'node-floppy':
renew_key = (action == 'node-floppy')
floppy = self.floppy_contents (node,renew_key)
- if filename:
- try:
- file(filename,'w').write(floppy)
- except:
- raise PLCPermissionDenied, "Could not write into %s"%filename
- return filename
- else:
- return floppy
+ if filename:
+ try:
+ file(filename,'w').write(floppy)
+ except:
+ raise PLCPermissionDenied, "Could not write into %s"%filename
+ return filename
+ else:
+ return floppy
### we're left with node-iso and node-usb
- if action == 'node-iso' or action == 'node-usb':
+ # the steps involved in the image creation are:
+ # - create and test the working environment
+ # - generate the configuration file
+ # - build and invoke the build command
+ # - delivery the resulting image file
+
+ if action == 'node-iso' or action == 'node-usb' \
+ or action == 'dummynet-iso' or action == 'dummynet-usb':
### check we've got required material
version = self.bootcd_version()
self.trash.append(floppy_file)
node_image = "%s/%s%s"%(self.WORKDIR,nodename,suffix)
-
- # make build's arguments
- serial_arg=""
- if "cramfs" in optdict: type += "_cramfs"
- if "serial" in optdict: serial_arg = "-s %s"%optdict['serial']
log_file="%s.log"%node_image
- # invoke build.sh
- build_command = '%s -f "%s" -o "%s" -t "%s" %s &> %s' % (self.BOOTCDBUILD,
- floppy_file,
- node_image,
- type,
- serial_arg,
- log_file)
- if self.DEBUG:
- print 'build command:',build_command
- ret=os.system(build_command)
+
+ command = self.build_command(node_type, build_sh_spec, node_image, type, floppy_file, log_file)
+
+ # invoke the image build script
+ if command != "":
+ ret=os.system(command)
+
if ret != 0:
- raise PLCAPIError,"bootcd/build.sh failed\n%s\n%s"%(
- build_command,file(log_file).read())
+ raise PLCAPIError, "%s failed Command line was: %s Error logs: %s" % \
+ (self.BOOTCDBUILD, command, file(log_file).read())
self.trash.append(log_file)
+
if not os.path.isfile (node_image):
raise PLCAPIError,"Unexpected location of build.sh output - %s"%node_image
# handle result
if filename:
- ret=os.system("mv %s %s"%(node_image,filename))
+ ret=os.system('mv "%s" "%s"'%(node_image,filename))
if ret != 0:
self.trash.append(node_image)
self.cleantrash()
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Filter import Filter
+from PLC.Auth import Auth
+
+from PLC.Ilinks import Ilink, Ilinks
+from PLC.Sites import Site, Sites
+from PLC.Nodes import Node, Nodes
+
+class GetIlinks(Method):
+ """
+ Returns an array of structs containing details about
+ nodes and related tags.
+
+ If ilink_filter is specified and is an array of
+ ilink identifiers, only ilinks matching
+ the filter will be returned. If return_fields is specified, only
+ the specified details will be returned.
+ """
+
+ roles = ['admin', 'pi', 'user', 'node']
+
+ accepts = [
+ Auth(),
+ Mixed([Ilink.fields['ilink_id']],
+ Parameter(int,"ilink id"),
+ Filter(Ilink.fields)),
+ Parameter([str], "List of fields to return", nullok = True)
+ ]
+
+ returns = [Ilink.fields]
+
+
+ def call(self, auth, ilink_filter = None, return_fields = None):
+
+ ilinks = Ilinks(self.api, ilink_filter, return_fields)
+
+ return ilinks
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision$
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Filter import Filter
+from PLC.Auth import Auth
+
+from PLC.InterfaceTags import InterfaceTag, InterfaceTags
+from PLC.Sites import Site, Sites
+from PLC.Interfaces import Interface, Interfaces
+
+class GetInterfaceTags(Method):
+ """
+ Returns an array of structs containing details about
+ interfaces and related settings.
+
+ If interface_tag_filter is specified and is an array of
+ interface setting identifiers, only interface settings matching
+ the filter will be returned. If return_fields is specified, only
+ the specified details will be returned.
+ """
+
+ roles = ['admin', 'pi', 'user', 'node']
+
+ accepts = [
+ Auth(),
+ Mixed([InterfaceTag.fields['interface_tag_id']],
+ Parameter(int,"Interface setting id"),
+ Filter(InterfaceTag.fields)),
+ Parameter([str], "List of fields to return", nullok = True)
+ ]
+
+ returns = [InterfaceTag.fields]
+
+
+ def call(self, auth, interface_tag_filter = None, return_fields = None):
+
+ interface_tags = InterfaceTags(self.api, interface_tag_filter, return_fields)
+
+ return interface_tags
--- /dev/null
+# $Id$
+# $URL$
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Filter import Filter
+from PLC.Interfaces import Interface, Interfaces
+from PLC.Auth import Auth
+
+class GetInterfaces(Method):
+ """
+ Returns an array of structs containing details about network
+ interfaces. If interfaces_filter is specified and is an array of
+ interface identifiers, or a struct of interface fields and
+ values, only interfaces matching the filter will be
+ returned.
+
+ If return_fields is given, only the specified details will be returned.
+ """
+
+ roles = ['admin', 'pi', 'user', 'tech', 'node', 'anonymous']
+
+ accepts = [
+ Auth(),
+ Mixed([Mixed(Interface.fields['interface_id'],
+ Interface.fields['ip'])],
+ Parameter (int, "interface id"),
+ Parameter (str, "ip address"),
+ Filter(Interface.fields)),
+ Parameter([str], "List of fields to return", nullok = True)
+ ]
+
+ returns = [Interface.fields]
+
+ def call(self, auth, interface_filter = None, return_fields = None):
+ return Interfaces(self.api, interface_filter, return_fields)
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth
from PLC.NodeGroups import NodeGroup, NodeGroups
-class GetNodeGroups(Method):
+class v43GetNodeGroups(Method):
"""
Returns an array of structs containing details about node groups.
If nodegroup_filter is specified and is an array of node group
accepts = [
Auth(),
Mixed([Mixed(NodeGroup.fields['nodegroup_id'],
- NodeGroup.fields['name'])],
+ NodeGroup.fields['groupname'])],
Filter(NodeGroup.fields)),
Parameter([str], "List of fields to return", nullok = True)
]
def call(self, auth, nodegroup_filter = None, return_fields = None):
return NodeGroups(self.api, nodegroup_filter, return_fields)
+
+
+nodegroup_fields = NodeGroup.fields.copy()
+nodegroup_fields['name'] = Parameter(str, "Legacy version of groupname", max = 50),
+
+class v42GetNodeGroups(v43GetNodeGroups):
+ """
+ Legacy wrapper for v42GetNodeGroups.
+ """
+
+ accepts = [
+ Auth(),
+ Mixed([Mixed(NodeGroup.fields['nodegroup_id'],
+ NodeGroup.fields['groupname'])],
+ Filter(nodegroup_fields)),
+ Parameter([str], "List of fields to return", nullok = True)
+ ]
+
+ returns = [nodegroup_fields]
+
+ def call(self, auth, nodegroup_filter = None, return_fields = None):
+ # convert name -> groupname in both filters
+ if isinstance(nodegroup_filter, dict):
+ if nodegroup_filter.has_key('name'):
+ groupname = nodegroup_filter.pop('name')
+ if not nodegroup_filter.has_key('groupname'):
+ nodegroup_filter['groupname']=groupname
+
+ if isinstance(return_fields, list):
+ if 'name' in return_fields:
+ return_fields.remove('name')
+ if 'groupname' not in return_fields:
+ return_fields.append('groupname')
+
+ nodegroups = NodeGroups(self.api, nodegroup_filter, return_fields)
+ # if groupname is present, then create a name mapping
+ for nodegroup in nodegroups:
+ if nodegroup.has_key('groupname'):
+ nodegroup['name']=nodegroup['groupname']
+ return nodegroups
+
+class GetNodeGroups(v42GetNodeGroups):
+ """
+ Returns an array of structs containing details about node groups.
+ If nodegroup_filter is specified and is an array of node group
+ identifiers or names, or a struct of node group attributes, only
+ node groups matching the filter will be returned. If return_fields
+ is specified, only the specified details will be returned.
+ """
+
+ pass
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Filter import Filter
-from PLC.Auth import Auth
-from PLC.NodeNetworkSettingTypes import NodeNetworkSettingType, NodeNetworkSettingTypes
-
-class GetNodeNetworkSettingTypes(Method):
- """
- Returns an array of structs containing details about
- nodenetwork setting types.
-
- The usual filtering scheme applies on this method.
- """
-
- roles = ['admin', 'pi', 'user', 'tech', 'node']
-
- accepts = [
- Auth(),
- Mixed([Mixed(NodeNetworkSettingType.fields['nodenetwork_setting_type_id'],
- NodeNetworkSettingType.fields['name'])],
- Filter(NodeNetworkSettingType.fields)),
- Parameter([str], "List of fields to return", nullok = True)
- ]
-
- returns = [NodeNetworkSettingType.fields]
-
- def call(self, auth, nodenetwork_setting_type_filter = None, return_fields = None):
- return NodeNetworkSettingTypes(self.api, nodenetwork_setting_type_filter, return_fields)
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Filter import Filter
-from PLC.Persons import Person, Persons
-from PLC.Auth import Auth
-
-from PLC.NodeNetworkSettings import NodeNetworkSetting, NodeNetworkSettings
-from PLC.Sites import Site, Sites
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-
-class GetNodeNetworkSettings(Method):
- """
- Returns an array of structs containing details about
- nodenetworks and related settings.
-
- If nodenetwork_setting_filter is specified and is an array of
- nodenetwork setting identifiers, only nodenetwork settings matching
- the filter will be returned. If return_fields is specified, only
- the specified details will be returned.
- """
-
- roles = ['admin', 'pi', 'user', 'node']
-
- accepts = [
- Auth(),
- Mixed([NodeNetworkSetting.fields['nodenetwork_setting_id']],
- Parameter(int,"Nodenetwork setting id"),
- Filter(NodeNetworkSetting.fields)),
- Parameter([str], "List of fields to return", nullok = True)
- ]
-
- returns = [NodeNetworkSetting.fields]
-
-
- def call(self, auth, nodenetwork_setting_filter = None, return_fields = None):
-
- nodenetwork_settings = NodeNetworkSettings(self.api, nodenetwork_setting_filter, return_fields)
-
- return nodenetwork_settings
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Filter import Filter
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import Auth
-
-class GetNodeNetworks(Method):
- """
- Returns an array of structs containing details about node network
- interfacess. If nodenetworks_filter is specified and is an array
- of node network identifiers, or a struct of node network
- fields and values, only node network interfaces matching the filter
- will be returned.
-
- If return_fields is given, only the specified details will be returned.
- """
-
- roles = ['admin', 'pi', 'user', 'tech', 'node', 'anonymous']
-
- accepts = [
- Auth(),
- Mixed([NodeNetwork.fields['nodenetwork_id']],
- Parameter (int, "nodenetwork id"),
- Filter(NodeNetwork.fields)),
- Parameter([str], "List of fields to return", nullok = True)
- ]
-
- returns = [NodeNetwork.fields]
-
- def call(self, auth, nodenetwork_filter = None, return_fields = None):
- return NodeNetworks(self.api, nodenetwork_filter, return_fields)
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Filter import Filter
+from PLC.Auth import Auth
+
+from PLC.NodeTags import NodeTag, NodeTags
+from PLC.Sites import Site, Sites
+from PLC.Nodes import Node, Nodes
+
+class GetNodeTags(Method):
+ """
+ Returns an array of structs containing details about
+ nodes and related tags.
+
+ If node_tag_filter is specified and is an array of
+ node tag identifiers, only node tags matching
+ the filter will be returned. If return_fields is specified, only
+ the specified details will be returned.
+ """
+
+ roles = ['admin', 'pi', 'user', 'node']
+
+ accepts = [
+ Auth(),
+ Mixed([NodeTag.fields['node_tag_id']],
+ Parameter(int,"Node tag id"),
+ Filter(NodeTag.fields)),
+ Parameter([str], "List of fields to return", nullok = True)
+ ]
+
+ returns = [NodeTag.fields]
+
+
+ def call(self, auth, node_tag_filter = None, return_fields = None):
+
+ node_tags = NodeTags(self.api, node_tag_filter, return_fields)
+
+ return node_tags
--- /dev/null
+# $Id$
+# $URL$
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.NodeTypes import NodeType, NodeTypes
+from PLC.Auth import Auth
+
+class GetNodeTypes(Method):
+ """
+ Returns an array of all valid node node types.
+ """
+
+ roles = ['admin', 'pi', 'user', 'tech', 'node']
+
+ accepts = [
+ Auth()
+ ]
+
+ returns = [NodeType.fields['node_type']]
+
+
+ def call(self, auth):
+ return [node_type['node_type'] for node_type in NodeTypes(self.api)]
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Auth import Auth
-class GetNodes(Method):
+admin_only = ['key', 'session', 'boot_nonce' ]
+
+class v43GetNodes(Method):
"""
Returns an array of structs containing details about nodes. If
node_filter is specified and is an array of node identifiers or
hostnames, or a struct of node attributes, only nodes matching the
- filter will be returned. If return_fields is specified, only the
- specified details will be returned.
+ filter will be returned.
+
+ If return_fields is specified, only the specified details will be
+ returned. NOTE that if return_fields is unspecified, the complete
+ set of native fields are returned, which DOES NOT include tags at
+ this time.
Some fields may only be viewed by admins.
"""
# remove remaining admin only fields
for node in nodes:
- for field in ['boot_nonce', 'key', 'session', 'root_person_ids']:
+ for field in admin_only:
if field in node:
del node[field]
del node[field]
return nodes
+
+node_fields = Node.fields.copy()
+node_fields['nodenetwork_ids']=Parameter([int], "Legacy version of interface_ids")
+
+class v42GetNodes(v43GetNodes):
+ """
+ Legacy wrapper for v43GetNodes.
+ """
+
+ accepts = [
+ Auth(),
+ Mixed([Mixed(Node.fields['node_id'],
+ Node.fields['hostname'])],
+ Parameter(str,"hostname"),
+ Parameter(int,"node_id"),
+ Filter(node_fields)),
+ Parameter([str], "List of fields to return", nullok = True),
+ ]
+ returns = [node_fields]
+
+ def call(self, auth, node_filter = None, return_fields = None):
+ # convert nodenetwork_ids -> interface_ids
+ if isinstance(node_filter, dict):
+ if node_filter.has_key('nodenetwork_ids'):
+ interface_ids = node_filter.pop('nodenetwork_ids')
+ if not node_filter.has_key('interface_ids'):
+ node_filter['interface_ids']=interface_ids
+
+ if isinstance(return_fields, list):
+ if 'nodenetwork_ids' in return_fields:
+ return_fields.remove('nodenetwork_ids')
+ if 'interface_ids' not in return_fields:
+ return_fields.append('interface_ids')
+ nodes = v43GetNodes.call(self,auth,node_filter,return_fields)
+ # if interface_ids are present, then create a nodenetwork_ids mapping
+ for node in nodes:
+ if node.has_key('interface_ids'):
+ node['nodenetwork_ids']=node['interface_ids']
+ return nodes
+
+class GetNodes(v42GetNodes):
+ """
+ Returns an array of structs containing details about nodes. If
+ node_filter is specified and is an array of node identifiers or
+ hostnames, or a struct of node attributes, only nodes matching the
+ filter will be returned. If return_fields is specified, only the
+ specified details will be returned.
+
+ Some fields may only be viewed by admins.
+ """
+
+ pass
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
# Thierry Parmentelat - INRIA
#
# $Id$
+# $URL$
import time
from PLC.Nodes import Node, Nodes
from PLC.Persons import Person, Persons
from PLC.Slices import Slice, Slices
-from PLC.SliceAttributes import SliceAttributes
+from PLC.SliceTags import SliceTags
class GetPeerData(Method):
"""
'peer_id': None}, person_fields)
# filter out system slices
- system_slice_ids = SliceAttributes(self.api, {'name': 'system', 'value': '1'}).dict('slice_id')
+ system_slice_ids = SliceTags(self.api, {'name': 'system', 'value': '1'}).dict('slice_id')
slices = Slices(self.api, {'peer_id': None,
'~slice_id':system_slice_ids.keys()})
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter
from PLC.Auth import Auth
+# $Id$
+# $URL$
#
# Thierry Parmentelat - INRIA
#
--- /dev/null
+# $Id: GetPersonTags.py 14587 2009-07-19 13:18:50Z thierry $
+# $URL: http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.3-27/PLC/Methods/GetPersonTags.py $
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 14587 $
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Filter import Filter
+from PLC.Auth import Auth
+
+from PLC.PersonTags import PersonTag, PersonTags
+
+class GetPersonTags(Method):
+ """
+ Returns an array of structs containing details about
+ persons and related settings.
+
+ If person_tag_filter is specified and is an array of
+ person setting identifiers, only person settings matching
+ the filter will be returned. If return_fields is specified, only
+ the specified details will be returned.
+ """
+
+ roles = ['admin', 'pi', 'user', 'node']
+
+ accepts = [
+ Auth(),
+ Mixed([PersonTag.fields['person_tag_id']],
+ Parameter(int,"Person setting id"),
+ Filter(PersonTag.fields)),
+ Parameter([str], "List of fields to return", nullok = True)
+ ]
+
+ returns = [PersonTag.fields]
+
+
+ def call(self, auth, person_tag_filter = None, return_fields = None):
+
+ person_tags = PersonTags(self.api, person_tag_filter, return_fields)
+
+ return person_tags
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
# Must query at least person_id, site_ids, and role_ids (see
# Person.can_view() and below).
if return_fields is not None:
- added_fields = set(['person_id', 'site_ids', 'role_ids']).difference(return_fields)
+ added_fields = set(['person_id', 'site_ids', 'role_ids','roles']).difference(return_fields)
return_fields += added_fields
else:
added_fields = []
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Auth import Auth
from PLC.Faults import *
regexps = { 'build' : '\A[bB]uild\s+(?P<key>[^:]+)\s*:\s*(?P<value>.*)\Z',
'tags' : '\A(?P<key>[^:]+)\s*:=\s*(?P<value>.*)\Z',
- 'rpms' : '\A(?P<key>[^:]+)\s*::\s*(?P<value>.*)\Z',
+# spaces not part of key : ungreedy
+ 'rpms' : '\A(?P<key>[^:]+?)\s*::\s*(?P<value>.*)\Z',
}
class GetPlcRelease(Method):
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
import time
from PLC.Method import Method
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
--- /dev/null
+# $Id: GetSiteTags.py 14587 2009-07-19 13:18:50Z thierry $
+# $URL: http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.3-27/PLC/Methods/GetSiteTags.py $
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 14587 $
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Filter import Filter
+from PLC.Auth import Auth
+
+from PLC.SiteTags import SiteTag, SiteTags
+from PLC.Sites import Site, Sites
+
+class GetSiteTags(Method):
+ """
+ Returns an array of structs containing details about
+ sites and related settings.
+
+ If site_tag_filter is specified and is an array of
+ site setting identifiers, only site settings matching
+ the filter will be returned. If return_fields is specified, only
+ the specified details will be returned.
+ """
+
+ roles = ['admin', 'pi', 'user', 'node']
+
+ accepts = [
+ Auth(),
+ Mixed([SiteTag.fields['site_tag_id']],
+ Parameter(int,"Site setting id"),
+ Filter(SiteTag.fields)),
+ Parameter([str], "List of fields to return", nullok = True)
+ ]
+
+ returns = [SiteTag.fields]
+
+
+ def call(self, auth, site_tag_filter = None, return_fields = None):
+
+ site_tags = SiteTags(self.api, site_tag_filter, return_fields)
+
+ return site_tags
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
+++ /dev/null
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Filter import Filter
-from PLC.Auth import Auth
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-
-class GetSliceAttributeTypes(Method):
- """
- Returns an array of structs containing details about slice
- attribute types. If attribute_type_filter is specified and
- is an array of slice attribute type identifiers, or a
- struct of slice attribute type attributes, only slice attribute
- types matching the filter will be returned. If return_fields is
- specified, only the specified details will be returned.
- """
-
- roles = ['admin', 'pi', 'user', 'tech', 'node']
-
- accepts = [
- Auth(),
- Mixed([Mixed(SliceAttributeType.fields['attribute_type_id'],
- SliceAttributeType.fields['name'])],
- Filter(SliceAttributeType.fields)),
- Parameter([str], "List of fields to return", nullok = True)
- ]
-
- returns = [SliceAttributeType.fields]
-
- def call(self, auth, attribute_type_filter = None, return_fields = None):
- return SliceAttributeTypes(self.api, attribute_type_filter, return_fields)
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
-from PLC.SliceAttributes import SliceAttribute, SliceAttributes
+from PLC.SliceTags import SliceTag, SliceTags
from PLC.Persons import Person, Persons
from PLC.Sites import Site, Sites
from PLC.Slices import Slice, Slices
from PLC.Auth import Auth
-class GetSliceAttributes(Method):
+class GetSliceTags(Method):
"""
Returns an array of structs containing details about slice and
sliver attributes. An attribute is a sliver attribute if the
- node_id field is set. If slice_attribute_filter is specified and
+ node_id field is set. If slice_tag_filter is specified and
is an array of slice attribute identifiers, or a struct of slice
attribute attributes, only slice attributes matching the filter
will be returned. If return_fields is specified, only the
accepts = [
Auth(),
- Mixed([SliceAttribute.fields['slice_attribute_id']],
- Filter(SliceAttribute.fields)),
+ Mixed([SliceTag.fields['slice_tag_id']],
+ Filter(SliceTag.fields)),
Parameter([str], "List of fields to return", nullok = True)
]
- returns = [SliceAttribute.fields]
+ returns = [SliceTag.fields]
- def call(self, auth, slice_attribute_filter = None, return_fields = None):
+ def call(self, auth, slice_tag_filter = None, return_fields = None):
# If we are not admin, make sure to only return our own slice
# and sliver attributes.
if isinstance(self.caller, Person) and \
return []
# Get slice attributes that we are able to view
- valid_slice_attribute_ids = []
+ valid_slice_tag_ids = []
slices = Slices(self.api, valid_slice_ids)
for slice in slices:
- valid_slice_attribute_ids += slice['slice_attribute_ids']
+ valid_slice_tag_ids += slice['slice_tag_ids']
- if not valid_slice_attribute_ids:
+ if not valid_slice_tag_ids:
return []
- if slice_attribute_filter is None:
- slice_attribute_filter = valid_slice_attribute_ids
+ if slice_tag_filter is None:
+ slice_tag_filter = valid_slice_tag_ids
- # Must query at least slice_attribute_id (see below)
- if return_fields is not None and 'slice_attribute_id' not in return_fields:
- return_fields.append('slice_attribute_id')
+ # Must query at least slice_tag_id (see below)
+ if return_fields is not None and 'slice_tag_id' not in return_fields:
+ return_fields.append('slice_tag_id')
added_fields = True
else:
added_fields = False
- slice_attributes = SliceAttributes(self.api, slice_attribute_filter, return_fields)
+ slice_tags = SliceTags(self.api, slice_tag_filter, return_fields)
# Filter out slice attributes that are not viewable
if isinstance(self.caller, Person) and \
'admin' not in self.caller['roles']:
- slice_attributes = filter(lambda slice_attribute: \
- slice_attribute['slice_attribute_id'] in valid_slice_attribute_ids,
- slice_attributes)
+ slice_tags = filter(lambda slice_tag: \
+ slice_tag['slice_tag_id'] in valid_slice_tag_ids,
+ slice_tags)
- # Remove slice_attribute_id if not specified
+ # Remove slice_tag_id if not specified
if added_fields:
- for slice_attribute in slice_attributes:
- if 'slice_attribute_id' in slice_attribute:
- del slice_attribute['slice_attribute_id']
+ for slice_tag in slice_tags:
+ if 'slice_tag_id' in slice_tag:
+ del slice_tag['slice_tag_id']
- return slice_attributes
+ return slice_tags
+# $Id$
+# $URL$
+
import time
from PLC.Faults import *
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
from PLC.Sites import Site, Sites
from PLC.Slices import Slice, Slices
-class GetSlices(Method):
+class v43GetSlices(Method):
"""
Returns an array of structs containing details about slices. If
slice_filter is specified and is an array of slice identifiers or
del slice['slice_id']
return slices
+
+slice_fields = Slice.fields.copy()
+slice_fields['slice_attribute_ids']=Parameter([int], "Legacy version of slice_tag_ids")
+
+class v42GetSlices(v43GetSlices):
+ """
+ Legacy wrapper for v43GetSlices.
+ """
+
+ accepts = [
+ Auth(),
+ Mixed([Mixed(Slice.fields['slice_id'],
+ Slice.fields['name'])],
+ Parameter(str,"name"),
+ Parameter(int,"slice_id"),
+ Filter(slice_fields)),
+ Parameter([str], "List of fields to return", nullok = True)
+ ]
+
+ returns = [slice_fields]
+
+ def call(self, auth, slice_filter = None, return_fields = None):
+ # convert nodenetwork_ids -> interface_ids
+ if isinstance(slice_filter, dict):
+ if slice_filter.has_key('slice_attribute_ids'):
+ slice_tag_ids = slice_filter.pop('slice_attribute_ids')
+ if not slice_filter.has_key('slice_tag_ids'):
+ slice_filter['slice_tag_ids']=slice_tag_ids
+ if isinstance(return_fields, list):
+ if 'slice_attribute_ids' in return_fields:
+ return_fields.remove('slice_attribute_ids')
+ if 'slice_tag_ids' not in return_fields:
+ return_fields.append('slice_tag_ids')
+ slices = v43GetSlices.call(self,auth,slice_filter,return_fields)
+ # add in a slice_tag_ids -> slice_attribute_ids
+ for slice in slices:
+ if slice.has_key('slice_tag_ids'):
+ slice['slice_attribute_ids']=slice['slice_tag_ids']
+ return slices
+
+class GetSlices(v42GetSlices):
+ """
+ Returns an array of structs containing details about slices. If
+ slice_filter is specified and is an array of slice identifiers or
+ slice names, or a struct of slice attributes, only slices matching
+ the filter will be returned. If return_fields is specified, only the
+ specified details will be returned.
+
+ Users may only query slices of which they are members. PIs may
+ query any of the slices at their sites. Admins and nodes may query
+ any slice. If a slice that cannot be queried is specified in
+ slice_filter, details about that slice will not be returned.
+ """
+
+ pass
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import Auth
-
-class GetSlicesMD5(Method):
- """
- Returns the current md5 hash of slices.xml file
- (slices-0.5.xml.md5)
- """
-
- roles = ['admin', 'pi', 'user', 'tech', 'node']
-
- accepts = [
- Auth(),
- ]
-
- returns = Parameter(str, "MD5 hash of slices.xml")
-
-
- def call(self, auth):
- try:
- file_path = '/var/www/html/xml/slices-0.5.xml.md5'
- slices_md5 = file(file_path).readline().strip()
- if slices_md5 <> "":
- return slices_md5
- raise PLCInvalidArgument, "File is empty"
- except IOError:
- raise PLCInvalidArgument, "No such file"
-
+# $Id$
+# $URL$
import time
from PLC.Faults import *
from PLC.Filter import Filter
from PLC.Auth import Auth
from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
+from PLC.Interfaces import Interface, Interfaces
from PLC.NodeGroups import NodeGroup, NodeGroups
from PLC.ConfFiles import ConfFile, ConfFiles
from PLC.Slices import Slice, Slices
from PLC.Persons import Person, Persons
+from PLC.Sites import Sites
+from PLC.Roles import Roles
from PLC.Keys import Key, Keys
-from PLC.SliceAttributes import SliceAttribute, SliceAttributes
+from PLC.SliceTags import SliceTag, SliceTags
from PLC.InitScripts import InitScript, InitScripts
+# XXX used to check if slice expiration time is sane
+MAXINT = 2L**31-1
+
def get_slivers(api, slice_filter, node = None):
# Get slice information
- slices = Slices(api, slice_filter, ['slice_id', 'name', 'instantiation', 'expires', 'person_ids', 'slice_attribute_ids'])
+ slices = Slices(api, slice_filter, ['slice_id', 'name', 'instantiation', 'expires', 'person_ids', 'slice_tag_ids'])
# Build up list of users and slice attributes
person_ids = set()
- slice_attribute_ids = set()
+ slice_tag_ids = set()
for slice in slices:
person_ids.update(slice['person_ids'])
- slice_attribute_ids.update(slice['slice_attribute_ids'])
+ slice_tag_ids.update(slice['slice_tag_ids'])
# Get user information
all_persons = Persons(api, {'person_id':person_ids,'enabled':True}, ['person_id', 'enabled', 'key_ids']).dict()
all_keys = Keys(api, key_ids, ['key_id', 'key', 'key_type']).dict()
# Get slice attributes
- all_slice_attributes = SliceAttributes(api, slice_attribute_ids).dict()
+ all_slice_tags = SliceTags(api, slice_tag_ids).dict()
slivers = []
for slice in slices:
attributes = []
# All (per-node and global) attributes for this slice
- slice_attributes = []
- for slice_attribute_id in slice['slice_attribute_ids']:
- if slice_attribute_id in all_slice_attributes:
- slice_attributes.append(all_slice_attributes[slice_attribute_id])
+ slice_tags = []
+ for slice_tag_id in slice['slice_tag_ids']:
+ if slice_tag_id in all_slice_tags:
+ slice_tags.append(all_slice_tags[slice_tag_id])
# Per-node sliver attributes take precedence over global
# slice attributes, so set them first.
sliver_attributes = []
if node is not None:
- for sliver_attribute in filter(lambda a: a['node_id'] == node['node_id'], slice_attributes):
- sliver_attributes.append(sliver_attribute['name'])
- attributes.append({'name': sliver_attribute['name'],
+ for sliver_attribute in filter(lambda a: a['node_id'] == node['node_id'], slice_tags):
+ sliver_attributes.append(sliver_attribute['tagname'])
+ attributes.append({'tagname': sliver_attribute['tagname'],
'value': sliver_attribute['value']})
# set nodegroup slice attributes
- for slice_attribute in filter(lambda a: a['nodegroup_id'] in node['nodegroup_ids'], slice_attributes):
+ for slice_tag in filter(lambda a: a['nodegroup_id'] in node['nodegroup_ids'], slice_tags):
# Do not set any nodegroup slice attributes for
# which there is at least one sliver attribute
# already set.
- if slice_attribute['name'] not in slice_attributes:
- attributes.append({'name': slice_attribute['name'],
- 'value': slice_attribute['value']})
+ if slice_tag not in slice_tags:
+ attributes.append({'tagname': slice_tag['tagname'],
+ 'value': slice_tag['value']})
- for slice_attribute in filter(lambda a: a['node_id'] is None, slice_attributes):
+ for slice_tag in filter(lambda a: a['node_id'] is None, slice_tags):
# Do not set any global slice attributes for
# which there is at least one sliver attribute
# already set.
- if slice_attribute['name'] not in sliver_attributes:
- attributes.append({'name': slice_attribute['name'],
- 'value': slice_attribute['value']})
+ if slice_tag['tagname'] not in sliver_attributes:
+ attributes.append({'tagname': slice_tag['tagname'],
+ 'value': slice_tag['value']})
+
+ # XXX Sanity check; though technically this should be a system invariant
+ # checked with an assertion
+ if slice['expires'] > MAXINT: slice['expires']= MAXINT
slivers.append({
'name': slice['name'],
return slivers
-class GetSlivers(Method):
+class v43GetSlivers(Method):
"""
Returns a struct containing information about the specified node
(or calling node, if called by a node and node_id_or_hostname is
node.
All of the information returned by this call can be gathered from
- other calls, e.g. GetNodes, GetNodeNetworks, GetSlices, etc. This
+ other calls, e.g. GetNodes, GetInterfaces, GetSlices, etc. This
function exists almost solely for the benefit of Node Manager.
"""
'timestamp': Parameter(int, "Timestamp of this call, in seconds since UNIX epoch"),
'node_id': Node.fields['node_id'],
'hostname': Node.fields['hostname'],
- 'networks': [NodeNetwork.fields],
- 'groups': [NodeGroup.fields['name']],
+ 'networks': [Interface.fields],
+ 'groups': [NodeGroup.fields['groupname']],
'conf_files': [ConfFile.fields],
'initscripts': [InitScript.fields],
+ 'accounts': [{
+ 'name': Parameter(str, "unix style account name", max = 254),
+ 'keys': [{
+ 'key_type': Key.fields['key_type'],
+ 'key': Key.fields['key']
+ }],
+ }],
'slivers': [{
'name': Slice.fields['name'],
'slice_id': Slice.fields['slice_id'],
'key': Key.fields['key']
}],
'attributes': [{
- 'name': SliceAttribute.fields['name'],
- 'value': SliceAttribute.fields['value']
+ 'tagname': SliceTag.fields['tagname'],
+ 'value': SliceTag.fields['value']
}]
}]
}
if node['peer_id'] is not None:
raise PLCInvalidArgument, "Not a local node"
- # Get nodenetwork information
- networks = NodeNetworks(self.api, node['nodenetwork_ids'])
+ # Get interface information
+ networks = Interfaces(self.api, node['interface_ids'])
# Get node group information
- nodegroups = NodeGroups(self.api, node['nodegroup_ids']).dict('name')
+ nodegroups = NodeGroups(self.api, node['nodegroup_ids']).dict('groupname')
groups = nodegroups.keys()
# Get all (enabled) configuration files
initscripts = InitScripts(self.api, {'enabled': True})
# Get system slices
- system_slice_attributes = SliceAttributes(self.api, {'name': 'system', 'value': '1'}).dict('slice_id')
- system_slice_ids = system_slice_attributes.keys()
+ system_slice_tags = SliceTags(self.api, {'tagname': 'system', 'value': '1'}).dict('slice_id')
+ system_slice_ids = system_slice_tags.keys()
# Get nm-controller slices
controller_and_delegated_slices = Slices(self.api, {'instantiation': ['nm-controller', 'delegated']}, ['slice_id']).dict('slice_id')
slivers = get_slivers(self.api, slice_ids, node)
+ # get the special accounts and keys needed for the node
+ # root
+ # site_admin
+ accounts = []
+ if False and 'site_id' not in node:
+ nodes = Nodes(self.api, node['node_id'])
+ node = nodes[0]
+
+ # used in conjunction with reduce to flatten lists, like in
+ # reduce ( reduce_flatten_list, [ [1] , [2,3] ], []) => [ 1,2,3 ]
+ def reduce_flatten_list (x,y): return x+y
+
+ # power users are pis and techs
+ def get_site_power_user_keys(api,site_id_or_name):
+ site = Sites (api,site_id_or_name,['person_ids'])[0]
+ key_ids = reduce (reduce_flatten_list,
+ [ p['key_ids'] for p in \
+ Persons(api,{ 'person_id':site['person_ids'],
+ 'enabled':True, '|role_ids' : [20, 40] },
+ ['key_ids']) ],
+ [])
+ return [ key['key'] for key in Keys (api, key_ids) if key['key_type']=='ssh']
+
+ # all admins regardless of their site
+ def get_all_admin_keys(api):
+ key_ids = reduce (reduce_flatten_list,
+ [ p['key_ids'] for p in \
+ Persons(api, {'peer_id':None, 'enabled':True, '|role_ids':[10] },
+ ['key_ids']) ],
+ [])
+ return [ key['key'] for key in Keys (api, key_ids) if key['key_type']=='ssh']
+
+ # 'site_admin' account setup
+ personsitekeys=get_site_power_user_keys(self.api,node['site_id'])
+ accounts.append({'name':'site_admin','keys':personsitekeys})
+
+ # 'root' account setup on nodes from all 'admin' users
+ personsitekeys=get_all_admin_keys(self.api)
+ accounts.append({'name':'root','keys':personsitekeys})
+
node.update_last_contact()
return {
'groups': groups,
'conf_files': conf_files.values(),
'initscripts': initscripts,
- 'slivers': slivers
+ 'slivers': slivers,
+ 'accounts': accounts
}
+
+class v42GetSlivers(v43GetSlivers):
+ """
+ Legacy wrapper for v43GetSlivers.
+ """
+
+ def call(self, auth, node_id_or_hostname = None):
+ result = v43GetSlivers.call(self,auth,node_id_or_hostname)
+ networks = result['networks']
+
+ for i in range(0,len(networks)):
+ network = networks[i]
+ if network.has_key("interface_id"):
+ network['nodenetwork_id']=network['interface_id']
+ if network.has_key("interface_tag_ids"):
+ network['nodenetwork_setting_ids']=network['interface_tag_ids']
+ networks[i]=network
+
+ result['networks']=networks
+ return result
+
+class GetSlivers(v42GetSlivers):
+ """
+ Returns a struct containing information about the specified node
+ (or calling node, if called by a node and node_id_or_hostname is
+ not specified), including the current set of slivers bound to the
+ node.
+
+ All of the information returned by this call can be gathered from
+ other calls, e.g. GetNodes, GetInterfaces, GetSlices, etc. This
+ function exists almost solely for the benefit of Node Manager.
+ """
+
+ pass
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Filter import Filter
+from PLC.Auth import Auth
+from PLC.TagTypes import TagType, TagTypes
+
+class GetTagTypes(Method):
+ """
+ Returns an array of structs containing details about
+ node tag types.
+
+ The usual filtering scheme applies on this method.
+ """
+
+ roles = ['admin', 'pi', 'user', 'tech', 'node']
+
+ accepts = [
+ Auth(),
+ Mixed([Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname'])],
+ Filter(TagType.fields)),
+ Parameter([str], "List of fields to return", nullok = True)
+ ]
+
+ returns = [TagType.fields]
+
+ def call(self, auth, tag_type_filter = None, return_fields = None):
+ return TagTypes(self.api, tag_type_filter, return_fields)
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth
+# $Id$
+# $URL$
import socket
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
+from PLC.Interfaces import Interface, Interfaces
from PLC.Auth import Auth
from PLC.POD import udp_pod
# Only use the hostname as a backup, try to use the primary ID
# address instead.
host = node['hostname']
- nodenetworks = NodeNetworks(self.api, node['nodenetwork_ids'])
- for nodenetwork in nodenetworks:
- if nodenetwork['is_primary'] == 1:
- host = nodenetwork['ip']
+ interfaces = Interfaces(self.api, node['interface_ids'])
+ for interface in interfaces:
+ if interface['is_primary'] == 1:
+ host = interface['ip']
break
try:
--- /dev/null
+# $Id$
+# $URL$
+import socket
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.Nodes import Node, Nodes
+from PLC.PCUs import PCU, PCUs
+
+try:
+ from pcucontrol import reboot
+ external_dependency = True
+except:
+ external_dependency = False
+
+class RebootNodeWithPCU(Method):
+ """
+ Uses the associated PCU to attempt to reboot the given Node.
+
+ Admins can reboot any node. Techs and PIs can only reboot nodes at
+ their site.
+
+ Returns 1 if the reboot proceeded without error (Note: this does not guarantee
+ that the reboot is successful).
+ Returns -1 if external dependencies for this call are not available.
+ Returns "error string" if the reboot failed with a specific message.
+ """
+
+ roles = ['admin', 'pi', 'tech']
+
+ accepts = [
+ Auth(),
+ Mixed(Node.fields['node_id'],
+ Node.fields['hostname'])
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ def call(self, auth, node_id_or_hostname):
+ # Get account information
+ nodes = Nodes(self.api, [node_id_or_hostname])
+ if not nodes:
+ raise PLCInvalidArgument, "No such node"
+
+ node = nodes[0]
+
+ # Authenticated function
+ assert self.caller is not None
+
+ # If we are not an admin, make sure that the caller is a
+ # member of the site at which the node is located.
+ if 'admin' not in self.caller['roles']:
+ if node['site_id'] not in self.caller['site_ids']:
+ raise PLCPermissionDenied, "Not allowed to reboot nodes from specified site"
+
+ # Verify that the node has pcus associated with it.
+ pcus = PCUs(self.api, {'pcu_id' : node['pcu_ids']} )
+ if not pcus:
+ raise PLCInvalidArgument, "No PCUs associated with Node"
+
+ pcu = pcus[0]
+
+ if not external_dependency:
+ raise PLCNotImplemented, "Could not load external module to attempt reboot"
+
+ # model, hostname, port,
+ # i = pcu['node_ids'].index(node['node_id'])
+ # p = pcu['ports'][i]
+ ret = reboot.reboot_api(node, pcu)
+
+ self.event_objects = {'Node': [node['node_id']]}
+ self.message = "RebootNodeWithPCU called"
+
+ return ret
# Thierry Parmentelat - INRIA
#
# $Id$
+# $URL$
+import os
+import sys
+import fcntl
import time
from PLC.Debug import log
verbose=False
+# initial version was doing only one final commit
+# * set commit_mode to False to get that behaviour
+# * set comit_mode to True to get everything synced at once
+commit_mode=True
+
+def message (to_print=None,verbose_only=False):
+ if verbose_only and not verbose:
+ return
+ print >> log, time.strftime("%m-%d-%H-%M-%S:"),
+ if to_print:
+ print >>log, to_print
+
+def message_verbose(to_print=None):
+ message(to_print,verbose_only=True)
+
+
+class FileLock:
+ """
+ Lock/Unlock file
+ """
+ def __init__(self, file_path, expire = 60 * 60 * 2):
+ self.expire = expire
+ self.fpath = file_path
+ self.fd = None
+
+ def lock(self):
+ if os.path.exists(self.fpath):
+ if (time.time() - os.stat(self.fpath).st_ctime) > self.expire:
+ try:
+ os.unlink(self.fpath)
+ except Exception, e:
+ message('FileLock.lock(%s) : %s' % (self.fpath, e))
+ return False
+ try:
+ self.fd = open(self.fpath, 'w')
+ fcntl.flock(self.fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
+ except IOError, e:
+ message('FileLock.lock(%s) : %s' % (self.fpath, e))
+ return False
+ return True
+
+ def unlock(self):
+ try:
+ fcntl.flock(self.fd, fcntl.LOCK_UN | fcntl.LOCK_NB)
+ self.fd.close()
+ except IOError, e:
+ message('FileLock.unlock(%s) : %s' % (self.fpath, e))
+
+
class RefreshPeer(Method):
"""
Fetches site, node, slice, person and key data from the specified peer
returns = Parameter(int, "1 if successful")
def call(self, auth, peer_id_or_peername):
+ ret_val = None
+ peername = Peers(self.api, [peer_id_or_peername], ['peername'])[0]['peername']
+ file_lock = FileLock("/tmp/refresh-peer-%s.lock" % peername)
+ if not file_lock.lock():
+ raise Exception, "Another instance of RefreshPeer is running."
+ try:
+ ret_val = self.real_call(auth, peer_id_or_peername)
+ except Exception, e:
+ file_lock.unlock()
+ raise Exception, e
+ file_lock.unlock()
+ return ret_val
+
+
+ def real_call(self, auth, peer_id_or_peername):
# Get peer
peers = Peers(self.api, [peer_id_or_peername])
if not peers:
# Get peer data
start = time.time()
- print >>log, 'Issuing GetPeerData'
+ message('RefreshPeer starting up (commit_mode=%r)'%commit_mode)
+ message('Issuing GetPeerData')
peer_tables = peer.GetPeerData()
+ # for smooth federation with 4.2 - ignore fields that are useless anyway, and rewrite boot_state
+ boot_state_rewrite={'dbg':'safeboot','diag':'safeboot','disable':'disabled',
+ 'inst':'reinstall','rins':'reinstall','new':'reinstall','rcnf':'reinstall'}
+ for node in peer_tables['Nodes']:
+ for key in ['nodenetwork_ids','dummybox_id']:
+ if key in node:
+ del node[key]
+ if node['boot_state'] in boot_state_rewrite: node['boot_state']=boot_state_rewrite[node['boot_state']]
+ for slice in peer_tables['Slices']:
+ for key in ['slice_attribute_ids']:
+ if key in slice:
+ del slice[key]
timers['transport'] = time.time() - start - peer_tables['db_time']
timers['peer_db'] = peer_tables['db_time']
- if verbose:
- print >>log, 'GetPeerData returned -> db=%d transport=%d'%(timers['peer_db'],timers['transport'])
+ message_verbose('GetPeerData returned -> db=%d transport=%d'%(timers['peer_db'],timers['transport']))
def sync(objects, peer_objects, classobj):
"""
keyed on their foreign identifiers.
"""
- if verbose:
- print >>log, 'Entering sync on',classobj(self.api).__class__.__name__
+ classname=classobj(self.api).__class__.__name__
+ message_verbose('Entering sync on %s'%classname)
synced = {}
# Delete stale objects
for peer_object_id, object in objects.iteritems():
if peer_object_id not in peer_objects:
- object.delete(commit = False)
- print >> log, peer['peername'],classobj(self.api).__class__.__name__, object[object.primary_key],"deleted"
-
+ object.delete(commit = commit_mode)
+ message("%s %s %s deleted"%(peer['peername'],classname, object[object.primary_key]))
+
+ total = len(peer_objects)
+ count=1
+ # set this to something realistic to trace down a given object(s)
+ trace_type="Node"
+ trace_ids=[]
+ def trace (message):
+ if classname == trace_type and peer_object_id in trace_ids:
+ message_verbose('TRACE>>'+message)
+
# Add/update new/existing objects
for peer_object_id, peer_object in peer_objects.iteritems():
+ message_verbose ('DBG %s peer_object_id=%d (%d/%d)'%(classname,peer_object_id,count,total))
+ count += 1
+ if peer_object_id in synced:
+ message("Warning: %s Skipping already added %s: %r"%(
+ peer['peername'], classname, peer_object))
+ continue
+ if classname == 'Node':
+ message_verbose ('DBG>> hostname=%s'%peer_object['hostname'])
+ elif classname == "Slice":
+ message_verbose ('DBG>> slicename=%s'%peer_object['name'])
if peer_object_id in objects:
# Update existing object
object = objects[peer_object_id]
# Must use __eq__() instead of == since
# peer_object may be a raw dict instead of a Peer
# object.
+ trace ("in objects : comparing")
if not object.__eq__(peer_object):
# Only update intrinsic fields
+ trace ("updating")
object.update(object.db_fields(peer_object))
+ trace ("updated")
sync = True
dbg = "changed"
else:
+ trace ("intact")
sync = False
dbg = None
# Restore foreign identifier
peer_object[object.primary_key] = peer_object_id
else:
+ trace ("not in objects -- creating")
# Add new object
object = classobj(self.api, peer_object)
+ trace ("created")
# Replace foreign identifier with new local identifier
del object[object.primary_key]
+ trace ("forced clean id")
sync = True
dbg = "added"
if sync:
+ message_verbose("DBG>> syncing %s %d - commit_mode=%r"%(classname,peer_object_id,commit_mode))
try:
- object.sync(commit = False)
+ object.sync(commit = commit_mode)
except PLCInvalidArgument, err:
# Skip if validation fails
# XXX Log an event instead of printing to logfile
- print >> log, "Warning: Skipping invalid", \
- peer['peername'], object.__class__.__name__, \
- ":", peer_object, ":", err
+ message("Warning: %s Skipping invalid %s %r : %r"%(\
+ peer['peername'], classname, peer_object, err))
continue
synced[peer_object_id] = object
if dbg:
- print >> log, peer['peername'], classobj(self.api).__class__.__name__, object[object.primary_key], dbg
+ message("%s: %s %d %s"%(peer['peername'], classname, object[object.primary_key], dbg))
- if verbose:
- print >>log, 'Exiting sync on',classobj(self.api).__class__.__name__
+ message_verbose("Exiting sync on %s"%classname)
return synced
start = time.time()
- print >>log, 'Dealing with Sites'
+ message('Dealing with Sites')
# Compare only the columns returned by the GetPeerData() call
if peer_tables['Sites']:
for peer_site_id, site in peer_sites.iteritems():
# Bind any newly cached sites to peer
if peer_site_id not in old_peer_sites:
- peer.add_site(site, peer_site_id, commit = False)
+ peer.add_site(site, peer_site_id, commit = commit_mode)
site['peer_id'] = peer_id
site['peer_site_id'] = peer_site_id
# XXX Synchronize foreign key types
#
- print >>log, 'Dealing with Keys'
+ message('Dealing with Keys')
key_types = KeyTypes(self.api).dict()
for peer_key_id, key in keys_at_peer.items():
if key['key_type'] not in key_types:
# XXX Log an event instead of printing to logfile
- print >> log, "Warning: Skipping invalid %s key:" % peer['peername'], \
- key, ": invalid key type", key['key_type']
+ message("Warning: Skipping invalid %s key %r" % ( peer['peername'], key))
del keys_at_peer[peer_key_id]
continue
for peer_key_id, key in peer_keys.iteritems():
# Bind any newly cached keys to peer
if peer_key_id not in old_peer_keys:
- peer.add_key(key, peer_key_id, commit = False)
+ peer.add_key(key, peer_key_id, commit = commit_mode)
key['peer_id'] = peer_id
key['peer_key_id'] = peer_key_id
start = time.time()
- print >>log, 'Dealing with Persons'
+ message('Dealing with Persons')
# Compare only the columns returned by the GetPeerData() call
if peer_tables['Persons']:
for peer_person_id, person in peer_persons.iteritems():
# Bind any newly cached users to peer
if peer_person_id not in old_peer_persons:
- peer.add_person(person, peer_person_id, commit = False)
+ peer.add_person(person, peer_person_id, commit = commit_mode)
person['peer_id'] = peer_id
person['peer_person_id'] = peer_person_id
person['key_ids'] = []
# Remove stale keys from user
for key_id in (set(old_person_key_ids) - set(person_key_ids)):
- person.remove_key(peer_keys[key_id], commit = False)
- print >> log, peer['peername'], 'Key', key_id, 'removed from', person['email']
+ person.remove_key(peer_keys[key_id], commit = commit_mode)
+ message ("%s Key %d removed from person %s"%(peer['peername'], key_id, person['email']))
# Add new keys to user
for key_id in (set(person_key_ids) - set(old_person_key_ids)):
- person.add_key(peer_keys[key_id], commit = False)
- print >> log, peer['peername'], 'Key', key_id, 'added into', person['email']
+ person.add_key(peer_keys[key_id], commit = commit_mode)
+ message ("%s Key %d added into person %s"%(peer['peername'],key_id, person['email']))
timers['persons'] = time.time() - start
start = time.time()
- print >>log, 'Dealing with Nodes'
+ message('Dealing with Nodes (1)')
# Compare only the columns returned by the GetPeerData() call
if peer_tables['Nodes']:
columns = peer_tables['Nodes'][0].keys()
else:
- columns = None
+ # smooth federation with a 4.2 peer - ignore these fields that are useless anyway
+ columns = Node.fields
+ if 'interface_ids' in columns: columns.remove('interface_ids')
+ if 'dummybox_id' in columns: columns.remove('dummybox_id')
# Keyed on foreign node_id
old_peer_nodes = Nodes(self.api, {'peer_id': peer_id}, columns).dict('peer_node_id')
errors.append("invalid boot state %s" % node['boot_state'])
if errors:
# XXX Log an event instead of printing to logfile
- print >> log, "Warning: Skipping invalid %s node:" % peer['peername'], \
- node, ":", ", ".join(errors)
+ message ("Warning: Skipping invalid %s node %r : " % (peer['peername'], node)\
+ + ", ".join(errors))
del nodes_at_peer[peer_node_id]
continue
else:
for peer_node_id, node in peer_nodes.iteritems():
# Bind any newly cached foreign nodes to peer
if peer_node_id not in old_peer_nodes:
- peer.add_node(node, peer_node_id, commit = False)
+ peer.add_node(node, peer_node_id, commit = commit_mode)
node['peer_id'] = peer_id
node['peer_node_id'] = peer_node_id
#
start = time.time()
+ message('Dealing with Nodes (2)')
# Keyed on local node_id
local_nodes = Nodes(self.api).dict()
start = time.time()
- print >>log, 'Dealing with Slices'
+ message('Dealing with Slices (1)')
# Compare only the columns returned by the GetPeerData() call
if peer_tables['Slices']:
else:
slice['creator_person_id'] = peer_persons[slice['creator_person_id']]['person_id']
if errors:
- print >> log, "Warning: Skipping invalid %s slice:" % peer['peername'], \
- slice, ":", ", ".join(errors)
+ message("Warning: Skipping invalid %s slice %r : " % (peer['peername'], slice) \
+ + ", ".join(errors))
del slices_at_peer[peer_slice_id]
continue
else:
# Synchronize new set
peer_slices = sync(old_peer_slices, slices_at_peer, Slice)
+ message('Dealing with Slices (2)')
# transcoder : retrieve a local node_id from a peer_node_id
node_transcoder = dict ( [ (node['node_id'],peer_node_id) \
for peer_node_id,node in peer_nodes.iteritems()])
for peer_slice_id, slice in peer_slices.iteritems():
# Bind any newly cached foreign slices to peer
if peer_slice_id not in old_peer_slices:
- peer.add_slice(slice, peer_slice_id, commit = False)
+ peer.add_slice(slice, peer_slice_id, commit = commit_mode)
slice['peer_id'] = peer_id
slice['peer_slice_id'] = peer_slice_id
slice['node_ids'] = []
# Nodes that are currently part of the slice
old_slice_node_ids = [ node_transcoder[node_id] for node_id in slice['node_ids'] \
- if node_transcoder[node_id] in peer_nodes]
+ if node_id in node_transcoder and node_transcoder[node_id] in peer_nodes]
# Nodes that should be part of the slice
slice_node_ids = [ node_id for node_id in peer_slice['node_ids'] if node_id in peer_nodes]
# Remove stale nodes from slice
for node_id in (set(old_slice_node_ids) - set(slice_node_ids)):
- slice.remove_node(peer_nodes[node_id], commit = False)
- print >> log, peer['peername'], 'Node', peer_nodes[node_id]['hostname'], 'removed from', slice['name']
+ slice.remove_node(peer_nodes[node_id], commit = commit_mode)
+ message ("%s node %s removed from slice %s"%(peer['peername'], peer_nodes[node_id]['hostname'], slice['name']))
# Add new nodes to slice
for node_id in (set(slice_node_ids) - set(old_slice_node_ids)):
- slice.add_node(peer_nodes[node_id], commit = False)
- print >> log, peer['peername'], 'Node', peer_nodes[node_id]['hostname'], 'added into', slice['name']
+ slice.add_node(peer_nodes[node_id], commit = commit_mode)
+ message ("%s node %s added into slice %s"%(peer['peername'], peer_nodes[node_id]['hostname'], slice['name']))
# N.B.: Local nodes that may have been added to the slice
# by hand, are removed. In other words, don't do this.
old_slice_person_ids = []
for person_id in slice['person_ids']:
if not person_transcoder.has_key(person_id):
- print >> log, 'WARNING : person_id %d in %s not transcodable (1) - skipped'%(person_id,slice['name'])
+ message ('WARNING : person_id %d in %s not transcodable (1) - skipped'%(person_id,slice['name']))
elif person_transcoder[person_id] not in peer_persons:
- print >> log, 'WARNING : person_id %d in %s not transcodable (2) - skipped'%(person_id,slice['name'])
+ message('WARNING : person_id %d in %s not transcodable (2) - skipped'%(person_id,slice['name']))
else:
old_slice_person_ids += [person_transcoder[person_id]]
# Remove stale users from slice
for person_id in (set(old_slice_person_ids) - set(slice_person_ids)):
- slice.remove_person(peer_persons[person_id], commit = False)
- print >> log, peer['peername'], 'User', peer_persons[person_id]['email'], 'removed from', slice['name']
+ slice.remove_person(peer_persons[person_id], commit = commit_mode)
+ message ("%s user %s removed from slice %s"%(peer['peername'],peer_persons[person_id]['email'], slice['name']))
# Add new users to slice
for person_id in (set(slice_person_ids) - set(old_slice_person_ids)):
- slice.add_person(peer_persons[person_id], commit = False)
- print >> log, peer['peername'], 'User', peer_persons[person_id]['email'], 'added into', slice['name']
+ slice.add_person(peer_persons[person_id], commit = commit_mode)
+ message ("%s user %s added into slice %s"%(peer['peername'],peer_persons[person_id]['email'], slice['name']))
# N.B.: Local users that may have been added to the slice
# by hand, are not touched.
# Update peer itself and commit
peer.sync(commit = True)
-
+
return timers
--- /dev/null
+# $Id$
+# $URL$
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth, BootAuth, SessionAuth
+from PLC.Nodes import Node, Nodes
+
+can_update = ['run_level']
+
+class ReportRunlevel(Method):
+ """
+ report runlevel
+ """
+ roles = ['node', 'admin']
+
+ accepts = [
+ Mixed(BootAuth(), SessionAuth(), Auth()),
+ {'run_level': Node.fields['run_level'],
+ },
+ Mixed(Node.fields['node_id'],
+ Node.fields['hostname'])
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ def call(self, auth, report_fields, node_id_or_hostname=None):
+
+ if not isinstance(self.caller, Node):
+ # check admin
+ if 'admin' not in self.caller['roles']:
+ raise PLCPermissionDenied, "Not allowed to update node run_level"
+
+ nodes = Nodes(self.api, [node_id_or_hostname])
+ if not nodes:
+ raise PLCInvalidArgument, "No such node"
+ else:
+ nodes = [self.caller]
+
+ node = nodes[0]
+ # avoid logging this even too often
+ # avoid logging occurrences where run_level does not change
+ former_level=None
+ if 'run_level' in node: former_level=node['run_level']
+
+ node.update_last_contact()
+ for field in can_update:
+ if field in report_fields:
+ node.update({field : report_fields[field]})
+
+ node.sync(commit=True)
+
+ # skip logging in this case
+ if former_level and 'run_level' in node and node['run_level'] == former_level:
+ pass
+ else:
+ # handle the 'run_level' key
+ message="run level " + node['hostname'] + ":"
+ if 'run_level' in report_fields:
+ message += str(former_level) + "->" + report_fields['run_level']
+ message += ", ".join( [ k + "->" + v for (k,v) in report_fields.items() if k not in ['run_level'] ] )
+
+ return 1
+# $Id$
+# $URL$
import random
import base64
import time
--- /dev/null
+# $Id$
+# $URL$
+
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Filter import Filter
+from PLC.Auth import Auth
+from PLC.Slices import Slice, Slices
+
+class ResolveSlices(Method):
+ """
+ This method is similar to GetSlices, except that (1) the returned
+ columns are restricted to 'name' and 'slice_id', and (2) it
+ returns expired slices too. This method is designed to help
+ third-party software solve slice names from their slice_id
+ (e.g. PlanetFlow Central). For this reason it is accessible with
+ anonymous authentication (among others).
+ """
+
+ roles = ['admin', 'pi', 'user', 'tech', 'anonymous' ]
+
+ applicable_fields = {
+ 'slice_id' : Slice.fields['slice_id'],
+ 'name' : Slice.fields['name'],
+ }
+
+ accepts = [
+ Auth(),
+ Mixed([Mixed(Slice.fields['slice_id'],
+ Slice.fields['name'])],
+ Parameter(str,"name"),
+ Parameter(int,"slice_id"),
+ Filter(applicable_fields))
+ ]
+
+ returns = [applicable_fields]
+
+ def call(self, auth, slice_filter = None):
+
+ # Must query at least slice_id (see below)
+ return_fields = self.applicable_fields.keys()
+ # pass expires=0
+ slices = Slices(self.api, slice_filter, return_fields, 0)
+ return slices
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
import re
from PLC.Faults import *
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
from PLC.Auth import Auth
from PLC.Slices import Slice, Slices
-from PLC.SliceAttributes import SliceAttribute, SliceAttributes
+from PLC.SliceTags import SliceTag, SliceTags
from PLC.Sites import Site, Sites
from PLC.Nodes import Node, Nodes
from PLC.Persons import Person, Persons
index = slices.index(slice)
node_ids = slices[index].pop('node_ids')
person_ids = slices[index].pop('person_ids')
- attribute_ids = slices[index].pop('slice_attribute_ids')
+ attribute_ids = slices[index].pop('slice_tag_ids')
if return_users or return_users is None:
persons = Persons(self.api, person_ids)
person_info = [{'email': person['email'],
for node in nodes]
slices[index]['nodes'] = node_info
if return_attributes or return_attributes is None:
- attributes = SliceAttributes(self.api, attribute_ids)
+ attributes = SliceTags(self.api, attribute_ids)
attribute_info = [{'name': attribute['name'],
'value': attribute['value']} \
for attribute in attributes]
+# $Id$
+# $URL$
import os
import sys
from subprocess import Popen, PIPE, call
from PLC.Slices import Slice, Slices
from PLC.Nodes import Node, Nodes
from PLC.Persons import Person, Persons
-from PLC.SliceAttributes import SliceAttribute, SliceAttributes
+from PLC.SliceTags import SliceTag, SliceTags
from PLC.Methods.GetSliceTicket import GetSliceTicket
nodes = Nodes(self.api, slice['node_ids']).dict()
persons = Persons(self.api, slice['person_ids']).dict()
- slice_attributes = SliceAttributes(self.api, slice['slice_attribute_ids']).dict()
+ slice_tags = SliceTags(self.api, slice['slice_tag_ids']).dict()
ticket = NamedTemporaryFile()
# <rspec>
xml.startElement('rspec', {})
- for slice_attribute_id in slice['slice_attribute_ids']:
- if not slice_attributes.has_key(slice_attribute_id):
+ for slice_tag_id in slice['slice_tag_ids']:
+ if not slice_tags.has_key(slice_tag_id):
continue
- slice_attribute = slice_attributes[slice_attribute_id]
+ slice_tag = slice_tags[slice_tag_id]
- name = slice_attribute['name']
- value = slice_attribute['value']
+ name = slice_tag['name']
+ value = slice_tag['value']
def kbps_to_bps(kbps):
bps = int(kbps) * 1000
if name == 'initscript':
(attribute_name, value_name, type) = ('initscript', 'initscript_id', 'integer')
- value = slice_attribute['slice_attribute_id']
+ value = slice_tag['slice_tag_id']
elif name in name_type_cast:
(attribute_name, value_name, type, cast) = name_type_cast[name]
value = cast(value)
attribute_name = value_name = name
type = "string"
- # <resource name="slice_attribute_type">
+ # <resource name="tag_type">
xml.startElement('resource', {'name': unicode(attribute_name)})
# <value name="element_name" type="element_type">
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Faults import *
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
+# $Id$
+# $URL$
import time
from PLC.Faults import *
+# $Id$
+# $URL$
from PLC.Methods.SliceGetTicket import SliceGetTicket
class SliceTicketGet(SliceGetTicket):
+# $Id$
+# $URL$
import time
from PLC.Faults import *
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
--- /dev/null
+# $Id: UnBindObjectFromPeer.py 14587 2009-07-19 13:18:50Z thierry $
+# $URL: svn+ssh://svn.planet-lab.org/svn/PLCAPI/trunk/PLC/Methods/BindObjectToPeer.py $
+
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Filter import Filter
+from PLC.Auth import Auth
+from PLC.Persons import Persons
+from PLC.Sites import Sites
+from PLC.Nodes import Nodes
+from PLC.Slices import Slices
+from PLC.Keys import Keys
+from PLC.Peers import Peers
+from PLC.Faults import *
+
+class UnBindObjectFromPeer(Method):
+ """
+ This method is a hopefully temporary hack to let the sfa correctly
+ detach the objects it creates from a remote peer object. This is
+ needed so that the sfa federation link can work in parallel with
+ RefreshPeer, as RefreshPeer depends on remote objects being
+ correctly marked.
+
+ UnBindObjectFromPeer is allowed to admins only.
+ """
+
+ roles = ['admin']
+
+ known_types = ['site','person','slice','node','key']
+ types_doc = ",".join(["'%s'"%type for type in known_types])
+
+ accepts = [
+ Auth(),
+ Parameter(str,"Object type, among "+types_doc),
+ Parameter(int,"object_id"),
+ Parameter(str,"peer shortname"),
+ Parameter(int,"remote object_id, set to 0 if unknown"),
+ ]
+
+ returns = Parameter (int, '1 if successful')
+
+ def locate_object (self, object_type, object_id):
+ # locate e.g. the Nodes symbol
+ class_obj = globals()[object_type.capitalize()+'s']
+ id_name=object_type+'_id'
+ # invoke e.g. Nodes ({'node_id':node_id})
+ objs=class_obj(self.api,{id_name:object_id})
+ if len(objs) != 1:
+ raise PLCInvalidArgument,"Cannot locate object, type=%s id=%d"%\
+ (type,object_id)
+ return objs[0]
+
+
+ def call(self, auth, object_type, object_id, shortname):
+
+ object_type = object_type.lower()
+ if object_type not in self.known_types:
+ raise PLCInvalidArgument, 'Unrecognized object type %s'%object_type
+
+ peers=Peers(self.api,{'shortname':shortname.upper()})
+ if len(peers) !=1:
+ raise PLCInvalidArgument, 'No such peer with shortname %s'%shortname
+
+ peer=peers[0]
+ object = self.locate_object (object_type, object_id)
+ remover_name = 'remove_'+object_type
+ remove_function = getattr(type(peer),remover_name)
+ remove_function(peer,object)
+
+ return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
--- /dev/null
+# Connect a Node with a Dummynet box, using Accessors
+#
+# Marta Carbone - unipi
+# $Id$
+# $URL$
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Nodes import Node, Nodes
+from PLC.NodeGroups import NodeGroup, NodeGroups
+from PLC.Sites import Site, Sites
+from PLC.Auth import Auth
+from PLC.Accessors.Accessors_dummynetbox import * # import dummynet accessors
+
+class UpdateEmulationLink(Method):
+ """
+ Connect a Node with a Dummynet box.
+ Takes as input two node_id, the first should be a regular node,
+ the second a dummynet box.
+
+ This operation is restricted to PIs and techs owner of the site
+ on which the Dummynet box and the Node are located.
+ Admins may create emulation links for any site, but the Dummynet
+ and the Node must belong to the same site.
+
+ XXX Dummynet accessors should not be called directly, since they can
+ be used to create connection whitout checks.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech']
+
+ accepts = [
+ Auth(),
+ Parameter(int, 'node_id'), # a node
+ Mixed(Parameter(int, 'node_id'), # a dummynet box, or None to delete the entry
+ None),
+ ]
+
+ returns = Parameter(int, '1 is successful, fault otherwise')
+
+ # Before to create the link we do the following checks:
+ # - node existence,
+ # - dummnet box existence,
+ # - right roles (admin, pi, tech),
+ # - node and dummynet box site should match.
+
+ def call(self, auth, node_id, dummynet_id):
+
+ assert self.caller is not None
+
+ # check for node existence
+ # Retrieve nodes from database
+ # We do not fetch both node and dummynet
+ # since we need to preserve the order of returned objects
+ nodes= Nodes(self.api, {'node_id':node_id, 'node_type':'regular'})
+ if not nodes:
+ raise PLCInvalidArgument, "Node %s not found" % node_id
+ node = nodes[0]
+
+ # check for dummynet box existence
+ nodes = Nodes(self.api, {'node_id':dummynet_id, 'node_type':'dummynet'})
+ if (dummynet_id != None) and not nodes:
+ raise PLCInvalidArgument, "Dummynet box %s not found" % dummynet_id
+
+ # check for site matching when create a link
+ if (dummynet_id != None):
+ dummynet = nodes[0]
+
+ # check if the node and the dummynet_id
+ # belong to the same site
+ if (node['site_id'] != dummynet['site_id']):
+ raise PLCInvalidArgument, \
+ "The Dummynet box must belog to the same site of the Node"
+
+ # check for roles permission to call this method
+ if 'admin' not in self.caller['roles']:
+ if site not in self.caller['site_ids']:
+ raise PLCPermissionDenied, "Not allowed to manage on this link"
+
+ # Add the dummynetbox
+ emulation_link = SetNodeDummynetBox(self.api)
+ emulation_link.call(auth, node_id, dummynet_id)
+
+ return 1
+
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.Ilinks import Ilink, Ilinks
+from PLC.Interfaces import Interface, Interfaces
+
+from PLC.Sites import Sites
+
+class UpdateIlink(Method):
+ """
+ Updates the value of an existing ilink
+
+ Access rights depend on the tag type.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech', 'user']
+
+ accepts = [
+ Auth(),
+ Ilink.fields['ilink_id'],
+ Ilink.fields['value']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ object_type = 'Interface'
+
+ def call(self, auth, ilink_id, value):
+ ilinks = Ilinks(self.api, [ilink_id])
+ if not ilinks:
+ raise PLCInvalidArgument, "No such ilink %r"%ilink_id
+ ilink = ilinks[0]
+
+ # xxx see AddIlink for this - should be written once in the Ilink class I guess
+ # checks rights and stuff
+
+ ilink['value'] = value
+ ilink.sync()
+
+ self.object_ids = [ilink['src_interface_id'],ilink['dst_interface_id']]
+ return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
--- /dev/null
+# $Id$
+# $URL$
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Table import Row
+from PLC.Auth import Auth
+
+from PLC.Nodes import Node, Nodes
+from PLC.TagTypes import TagTypes
+from PLC.InterfaceTags import InterfaceTags
+from PLC.Interfaces import Interface, Interfaces
+from PLC.Methods.AddInterfaceTag import AddInterfaceTag
+from PLC.Methods.UpdateInterfaceTag import UpdateInterfaceTag
+
+cannot_update = ['interface_id','node_id']
+
+class UpdateInterface(Method):
+ """
+ Updates an existing interface network. Any values specified in
+ interface_fields are used, otherwise defaults are
+ used. Acceptable values for method are dhcp and static. If type is
+ static, then ip, gateway, network, broadcast, netmask, and dns1
+ must all be specified in interface_fields. If type is dhcp,
+ these parameters, even if specified, are ignored.
+
+ PIs and techs may only update interfaces associated with their own
+ nodes. Admins may update any interface network.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech']
+
+ accepted_fields = Row.accepted_fields(cannot_update, Interface.fields,exclude=True)
+ accepted_fields.update(Interface.tags)
+
+ accepts = [
+ Auth(),
+ Interface.fields['interface_id'],
+ accepted_fields
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ def call(self, auth, interface_id, interface_fields):
+
+ [native,tags,rejected] = Row.split_fields(interface_fields,[Interface.fields,Interface.tags])
+
+ # type checking
+ native= Row.check_fields (native, self.accepted_fields)
+ if rejected:
+ raise PLCInvalidArgument, "Cannot update Interface column(s) %r"%rejected
+
+ # Get interface information
+ interfaces = Interfaces(self.api, [interface_id])
+ if not interfaces:
+ raise PLCInvalidArgument, "No such interface"
+
+ interface = interfaces[0]
+
+ # Authenticated function
+ assert self.caller is not None
+
+ # If we are not an admin, make sure that the caller is a
+ # member of the site where the node exists.
+ if 'admin' not in self.caller['roles']:
+ nodes = Nodes(self.api, [interface['node_id']])
+ if not nodes:
+ raise PLCPermissionDenied, "Interface is not associated with a node"
+ node = nodes[0]
+ if node['site_id'] not in self.caller['site_ids']:
+ raise PLCPermissionDenied, "Not allowed to update interface"
+
+ interface.update(native)
+ interface.sync()
+
+ for (tagname,value) in tags.iteritems():
+ # the tagtype instance is assumed to exist, just check that
+ if not TagTypes(self.api,{'tagname':tagname}):
+ raise PLCInvalidArgument,"No such TagType %s"%tagname
+ interface_tags=InterfaceTags(self.api,{'tagname':tagname,'interface_id':interface['interface_id']})
+ if not interface_tags:
+ AddInterfaceTag(self.api).__call__(auth,interface['interface_id'],tagname,value)
+ else:
+ UpdateInterfaceTag(self.api).__call__(auth,interface_tags[0]['interface_tag_id'],value)
+
+ self.event_objects = {'Interface': [interface['interface_id']]}
+ if 'ip' in interface:
+ self.message = "Interface %s updated"%interface['ip']
+ else:
+ self.message = "Interface %d updated"%interface['interface_id']
+ self.message += "[%s]." % ", ".join(interface_fields.keys())
+
+ return 1
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision$
+#
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.InterfaceTags import InterfaceTag, InterfaceTags
+from PLC.Interfaces import Interface, Interfaces
+
+from PLC.Nodes import Nodes
+from PLC.Sites import Sites
+
+class UpdateInterfaceTag(Method):
+ """
+ Updates the value of an existing interface setting
+
+ Access rights depend on the tag type.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech', 'user']
+
+ accepts = [
+ Auth(),
+ InterfaceTag.fields['interface_tag_id'],
+ InterfaceTag.fields['value']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ object_type = 'Interface'
+
+ def call(self, auth, interface_tag_id, value):
+ interface_tags = InterfaceTags(self.api, [interface_tag_id])
+ if not interface_tags:
+ raise PLCInvalidArgument, "No such interface setting %r"%interface_tag_id
+ interface_tag = interface_tags[0]
+
+ ### reproducing a check from UpdateSliceTag, looks dumb though
+ interfaces = Interfaces(self.api, [interface_tag['interface_id']])
+ if not interfaces:
+ raise PLCInvalidArgument, "No such interface %r"%interface_tag['interface_id']
+ interface = interfaces[0]
+
+ assert interface_tag['interface_tag_id'] in interface['interface_tag_ids']
+
+ # check permission : it not admin, is the user affiliated with the right site
+ if 'admin' not in self.caller['roles']:
+ # locate node
+ node = Nodes (self.api,[interface['node_id']])[0]
+ # locate site
+ site = Sites (self.api, [node['site_id']])[0]
+ # check caller is affiliated with this site
+ if self.caller['person_id'] not in site['person_ids']:
+ raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified interface setting, requires role %d",required_min_role
+
+ interface_tag['value'] = value
+ interface_tag.sync()
+
+ self.object_ids = [interface_tag['interface_tag_id']]
+ return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Nodes import Node, Nodes
+from PLC.Table import Row
from PLC.Auth import Auth
-related_fields = Node.related_fields.keys()
-can_update = lambda (field, value): field in \
- ['hostname', 'boot_state', 'model', 'version',
- 'key', 'session', 'boot_nonce'] + \
- related_fields
+from PLC.Nodes import Node, Nodes
+from PLC.TagTypes import TagTypes
+from PLC.NodeTags import NodeTags
+from PLC.Methods.AddNodeTag import AddNodeTag
+from PLC.Methods.UpdateNodeTag import UpdateNodeTag
+
+admin_only = [ 'key', 'session', 'boot_nonce', 'site_id']
+can_update = ['hostname', 'node_type', 'boot_state', 'model', 'version'] + admin_only
class UpdateNode(Method):
"""
roles = ['admin', 'pi', 'tech']
- node_fields = dict(filter(can_update, Node.fields.items() + Node.related_fields.items()))
+ accepted_fields = Row.accepted_fields(can_update,Node.fields)
+ # xxx check the related_fields feature
+ accepted_fields.update(Node.related_fields)
+ accepted_fields.update(Node.tags)
accepts = [
Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname']),
- node_fields
+ accepted_fields
]
returns = Parameter(int, '1 if successful')
def call(self, auth, node_id_or_hostname, node_fields):
- node_fields = dict(filter(can_update, node_fields.items()))
+
+ # split provided fields
+ [native,related,tags,rejected] = Row.split_fields(node_fields,[Node.fields,Node.related_fields,Node.tags])
+
+ # type checking
+ native = Row.check_fields (native, self.accepted_fields)
+ if rejected:
+ raise PLCInvalidArgument, "Cannot update Node column(s) %r"%rejected
+
+ # Authenticated function
+ assert self.caller is not None
# Remove admin only fields
if 'admin' not in self.caller['roles']:
- for key in 'key', 'session', 'boot_nonce':
- if node_fields.has_key(key):
- del node_fields[key]
+ for key in admin_only:
+ if native.has_key(key):
+ del native[key]
# Get account information
nodes = Nodes(self.api, [node_id_or_hostname])
if not nodes:
- raise PLCInvalidArgument, "No such node"
+ raise PLCInvalidArgument, "No such node %r"%node_id_or_hostname
node = nodes[0]
if node['peer_id'] is not None:
- raise PLCInvalidArgument, "Not a local node"
-
- # Authenticated function
- assert self.caller is not None
+ raise PLCInvalidArgument, "Not a local node %r"%node_id_or_hostname
# If we are not an admin, make sure that the caller is a
# member of the site at which the node is located.
raise PLCPermissionDenied, "Not allowed to delete nodes from specified site"
# Make requested associations
- for field in related_fields:
- if field in node_fields:
- node.associate(auth, field, node_fields[field])
- node_fields.pop(field)
-
- node.update(node_fields)
- node.update_last_updated(False)
- node.sync()
+ for (k,v) in related.iteritems():
+ node.associate(auth, k,v)
+
+ node.update(native)
+ node.update_last_updated(commit=False)
+ node.sync(commit=True)
+ for (tagname,value) in tags.iteritems():
+ # the tagtype instance is assumed to exist, just check that
+ if not TagTypes(self.api,{'tagname':tagname}):
+ raise PLCInvalidArgument,"No such TagType %s"%tagname
+ node_tags=NodeTags(self.api,{'tagname':tagname,'node_id':node['node_id']})
+ if not node_tags:
+ AddNodeTag(self.api).__call__(auth,node['node_id'],tagname,value)
+ else:
+ UpdateNodeTag(self.api).__call__(auth,node_tags[0]['node_tag_id'],value)
+
# Logging variables
self.event_objects = {'Node': [node['node_id']]}
- self.message = 'Node %d updated: %s.' % \
- (node['node_id'], ", ".join(node_fields.keys()))
+ if 'hostname' in node:
+ self.message = 'Node %s updated'%node['hostname']
+ else:
+ self.message = 'Node %d updated'%node['node_id']
+ self.message += " [%s]." % (", ".join(node_fields.keys()),)
if 'boot_state' in node_fields.keys():
- self.message += ' boot_state updated to %s' % node_fields['boot_state']
+ self.message += ' boot_state updated to %s' % node_fields['boot_state']
return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NodeGroups import NodeGroup, NodeGroups
from PLC.Auth import Auth
-related_fields = NodeGroup.related_fields.keys()
-can_update = lambda (field, value): field in \
- ['name', 'description'] + \
- related_fields
+can_update = lambda (field, value): field in ['groupname','value']
class UpdateNodeGroup(Method):
"""
roles = ['admin']
- nodegroup_fields = dict(filter(can_update, NodeGroup.fields.items() + NodeGroup.related_fields.items()))
+ nodegroup_fields = dict(filter(can_update, NodeGroup.fields.items()))
accepts = [
Auth(),
Mixed(NodeGroup.fields['nodegroup_id'],
- NodeGroup.fields['name']),
+ NodeGroup.fields['groupname']),
nodegroup_fields
]
# Get nodegroup information
nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
if not nodegroups:
- raise PLCInvalidArgument, "No such nodegroup"
+ raise PLCInvalidArgument, "No such nodegroup %r"%nodegroup_id_or_name
nodegroup = nodegroups[0]
- # Make requested associations
- for field in related_fields:
- if field in nodegroup_fields:
- nodegroup.associate(auth, field, nodegroup_fields[field])
- nodegroup_fields.pop(field)
-
nodegroup.update(nodegroup_fields)
nodegroup.sync()
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Nodes import Node, Nodes
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field not in \
- ['nodenetwork_id','node_id']
-
-class UpdateNodeNetwork(Method):
- """
- Updates an existing node network. Any values specified in
- nodenetwork_fields are used, otherwise defaults are
- used. Acceptable values for method are dhcp and static. If type is
- static, then ip, gateway, network, broadcast, netmask, and dns1
- must all be specified in nodenetwork_fields. If type is dhcp,
- these parameters, even if specified, are ignored.
-
- PIs and techs may only update networks associated with their own
- nodes. Admins may update any node network.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin', 'pi', 'tech']
-
- nodenetwork_fields = dict(filter(can_update, NodeNetwork.fields.items()))
-
- accepts = [
- Auth(),
- NodeNetwork.fields['nodenetwork_id'],
- nodenetwork_fields
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, nodenetwork_id, nodenetwork_fields):
- nodenetwork_fields = dict(filter(can_update, nodenetwork_fields.items()))
-
- # Get node network information
- nodenetworks = NodeNetworks(self.api, [nodenetwork_id])
- if not nodenetworks:
- raise PLCInvalidArgument, "No such node network"
-
- nodenetwork = nodenetworks[0]
-
- # Authenticated function
- assert self.caller is not None
-
- # If we are not an admin, make sure that the caller is a
- # member of the site where the node exists.
- if 'admin' not in self.caller['roles']:
- nodes = Nodes(self.api, [nodenetwork['node_id']])
- if not nodes:
- raise PLCPermissionDenied, "Node network is not associated with a node"
- node = nodes[0]
- if node['site_id'] not in self.caller['site_ids']:
- raise PLCPermissionDenied, "Not allowed to update node network"
-
- # Update node network
- nodenetwork.update(nodenetwork_fields)
- nodenetwork.sync()
-
- self.event_objects = {'NodeNetwork': [nodenetwork['nodenetwork_id']]}
- self.message = "Node network %d updated: %s " % \
- (nodenetwork['nodenetwork_id'], ", ".join(nodenetwork_fields.keys()))
-
- return 1
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import Auth
-
-from PLC.NodeNetworkSettings import NodeNetworkSetting, NodeNetworkSettings
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
-
-from PLC.Nodes import Nodes
-from PLC.Sites import Sites
-
-class UpdateNodeNetworkSetting(Method):
- """
- Updates the value of an existing nodenetwork setting
-
- Access rights depend on the nodenetwork setting type.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin', 'pi', 'tech', 'user']
-
- accepts = [
- Auth(),
- NodeNetworkSetting.fields['nodenetwork_setting_id'],
- NodeNetworkSetting.fields['value']
- ]
-
- returns = Parameter(int, '1 if successful')
-
- object_type = 'NodeNetwork'
-
- def call(self, auth, nodenetwork_setting_id, value):
- nodenetwork_settings = NodeNetworkSettings(self.api, [nodenetwork_setting_id])
- if not nodenetwork_settings:
- raise PLCInvalidArgument, "No such nodenetwork setting %r"%nodenetwork_setting_id
- nodenetwork_setting = nodenetwork_settings[0]
-
- ### reproducing a check from UpdateSliceAttribute, looks dumb though
- nodenetworks = NodeNetworks(self.api, [nodenetwork_setting['nodenetwork_id']])
- if not nodenetworks:
- raise PLCInvalidArgument, "No such nodenetwork %r"%nodenetwork_setting['nodenetwork_id']
- nodenetwork = nodenetworks[0]
-
- assert nodenetwork_setting['nodenetwork_setting_id'] in nodenetwork['nodenetwork_setting_ids']
-
- # check permission : it not admin, is the user affiliated with the right site
- if 'admin' not in self.caller['roles']:
- # locate node
- node = Nodes (self.api,[nodenetwork['node_id']])[0]
- # locate site
- site = Sites (self.api, [node['site_id']])[0]
- # check caller is affiliated with this site
- if self.caller['person_id'] not in site['person_ids']:
- raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
-
- required_min_role = nodenetwork_setting_type ['min_role_id']
- if required_min_role is not None and \
- min(self.caller['role_ids']) > required_min_role:
- raise PLCPermissionDenied, "Not allowed to modify the specified nodenetwork setting, requires role %d",required_min_role
-
- nodenetwork_setting['value'] = value
- nodenetwork_setting.sync()
-
- self.object_ids = [nodenetwork_setting['nodenetwork_setting_id']]
- return 1
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.NodeNetworkSettingTypes import NodeNetworkSettingType, NodeNetworkSettingTypes
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field in \
- ['name', 'description', 'category', 'min_role_id']
-
-class UpdateNodeNetworkSettingType(Method):
- """
- Updates the parameters of an existing setting type
- with the values in nodenetwork_setting_type_fields.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- nodenetwork_setting_type_fields = dict(filter(can_update, NodeNetworkSettingType.fields.items()))
-
- accepts = [
- Auth(),
- Mixed(NodeNetworkSettingType.fields['nodenetwork_setting_type_id'],
- NodeNetworkSettingType.fields['name']),
- nodenetwork_setting_type_fields
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, nodenetwork_setting_type_id_or_name, nodenetwork_setting_type_fields):
- nodenetwork_setting_type_fields = dict(filter(can_update, nodenetwork_setting_type_fields.items()))
-
- nodenetwork_setting_types = NodeNetworkSettingTypes(self.api, [nodenetwork_setting_type_id_or_name])
- if not nodenetwork_setting_types:
- raise PLCInvalidArgument, "No such setting type"
- nodenetwork_setting_type = nodenetwork_setting_types[0]
-
- nodenetwork_setting_type.update(nodenetwork_setting_type_fields)
- nodenetwork_setting_type.sync()
- self.object_ids = [nodenetwork_setting_type['nodenetwork_setting_type_id']]
-
- return 1
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.Sites import Sites
+from PLC.Nodes import Node, Nodes
+from PLC.NodeTags import NodeTag, NodeTags
+
+class UpdateNodeTag(Method):
+ """
+ Updates the value of an existing node tag
+
+ Access rights depend on the node tag type.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech', 'user']
+
+ accepts = [
+ Auth(),
+ NodeTag.fields['node_tag_id'],
+ NodeTag.fields['value']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ object_type = 'Node'
+
+ def call(self, auth, node_tag_id, value):
+ node_tags = NodeTags(self.api, [node_tag_id])
+ if not node_tags:
+ raise PLCInvalidArgument, "No such node tag %r"%node_tag_id
+ node_tag = node_tags[0]
+
+ ### reproducing a check from UpdateSliceTag, looks dumb though
+ nodes = Nodes(self.api, [node_tag['node_id']])
+ if not nodes:
+ raise PLCInvalidArgument, "No such node %r"%node_tag['node_id']
+ node = nodes[0]
+
+ assert node_tag['node_tag_id'] in node['node_tag_ids']
+
+ # check permission : it not admin, is the user affiliated with the right site
+ if 'admin' not in self.caller['roles']:
+ # locate node
+ node = Nodes (self.api,[node['node_id']])[0]
+ # locate site
+ site = Sites (self.api, [node['site_id']])[0]
+ # check caller is affiliated with this site
+ if self.caller['person_id'] not in site['person_ids']:
+ raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified node tag, requires role %d",required_min_role
+
+ node_tag['value'] = value
+ node_tag.sync()
+
+ self.object_ids = [node_tag['node_tag_id']]
+ return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Peers import Peer, Peers
can_update = lambda (field, value): field in \
- ['peername', 'peer_url', 'key', 'cacert']
+ ['peername', 'peer_url', 'key', 'cacert', 'shortname', 'hrn_root']
class UpdatePeer(Method):
"""
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Auth import Auth
+from PLC.sendmail import sendmail
related_fields = Person.related_fields.keys()
can_update = lambda (field, value): field in \
person.update(person_fields)
person.update_last_updated(False)
person.sync()
-
+
+ if 'enabled' in person_fields:
+ To = [("%s %s" % (person['first_name'], person['last_name']), person['email'])]
+ Cc = []
+ if person['enabled']:
+ Subject = "%s account enabled" % (self.api.config.PLC_NAME)
+ Body = "Your %s account has been enabled. Please visit %s to access your account." % (self.api.config.PLC_NAME, self.api.config.PLC_WWW_HOST)
+ else:
+ Subject = "%s account disabled" % (self.api.config.PLC_NAME)
+ Body = "Your %s account has been disabled. Please contact your PI or PlanetLab support for more information" % (self.api.config.PLC_NAME)
+ sendmail(self.api, To = To, Cc = Cc, Subject = Subject, Body = Body)
+
+
# Logging variables
self.event_objects = {'Person': [person['person_id']]}
--- /dev/null
+# $Id: UpdatePersonTag.py 14587 2009-07-19 13:18:50Z thierry $
+# $URL: http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.3-27/PLC/Methods/UpdatePersonTag.py $
+#
+# $Revision: 14587 $
+#
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.PersonTags import PersonTag, PersonTags
+from PLC.Persons import Person, Persons
+
+from PLC.Nodes import Nodes
+from PLC.Persons import Persons
+
+class UpdatePersonTag(Method):
+ """
+ Updates the value of an existing person setting
+
+ Access rights depend on the tag type.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech', 'user']
+
+ accepts = [
+ Auth(),
+ PersonTag.fields['person_tag_id'],
+ PersonTag.fields['value']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ object_type = 'Person'
+
+ def call(self, auth, person_tag_id, value):
+ person_tags = PersonTags(self.api, [person_tag_id])
+ if not person_tags:
+ raise PLCInvalidArgument, "No such person setting %r"%person_tag_id
+ person_tag = person_tags[0]
+
+ ### reproducing a check from UpdateSliceTag, looks dumb though
+ persons = Persons(self.api, [person_tag['person_id']])
+ if not persons:
+ raise PLCInvalidArgument, "No such person %r"%person_tag['person_id']
+ person = persons[0]
+
+ assert person_tag['person_tag_id'] in person['person_tag_ids']
+
+ # check permission : it not admin, is the user affiliated with the right person
+ if 'admin' not in self.caller['roles']:
+ # check caller is affiliated with this person's person
+ if len(set(person['person_ids']) & set(self.caller['person_ids'])) == 0:
+ raise PLCPermissionDenied, "Not a member of the person's persons: %s"%person['person_ids']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified person setting, requires role %d",required_min_role
+
+ person_tag['value'] = value
+ person_tag.sync()
+
+ self.object_ids = [person_tag['person_tag_id']]
+ return 1
+# $Id$
+# $URL$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
--- /dev/null
+# $Id: UpdateSiteTag.py 14587 2009-07-19 13:18:50Z thierry $
+# $URL: http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.3-27/PLC/Methods/UpdateSiteTag.py $
+#
+# $Revision: 14587 $
+#
+
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+
+from PLC.SiteTags import SiteTag, SiteTags
+from PLC.Sites import Site, Sites
+
+from PLC.Nodes import Nodes
+from PLC.Sites import Sites
+
+class UpdateSiteTag(Method):
+ """
+ Updates the value of an existing site setting
+
+ Access rights depend on the tag type.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'tech', 'user']
+
+ accepts = [
+ Auth(),
+ SiteTag.fields['site_tag_id'],
+ SiteTag.fields['value']
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ object_type = 'Site'
+
+ def call(self, auth, site_tag_id, value):
+ site_tags = SiteTags(self.api, [site_tag_id])
+ if not site_tags:
+ raise PLCInvalidArgument, "No such site setting %r"%site_tag_id
+ site_tag = site_tags[0]
+
+ ### reproducing a check from UpdateSliceTag, looks dumb though
+ sites = Sites(self.api, [site_tag['site_id']])
+ if not sites:
+ raise PLCInvalidArgument, "No such site %r"%site_tag['site_id']
+ site = sites[0]
+
+ assert site_tag['site_tag_id'] in site['site_tag_ids']
+
+ # check permission : it not admin, is the user affiliated with the right site
+ if 'admin' not in self.caller['roles']:
+ # check caller is affiliated with this site
+ if self.caller['person_id'] not in site['person_ids']:
+ raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
+
+ required_min_role = tag_type ['min_role_id']
+ if required_min_role is not None and \
+ min(self.caller['role_ids']) > required_min_role:
+ raise PLCPermissionDenied, "Not allowed to modify the specified site setting, requires role %d",required_min_role
+
+ site_tag['value'] = value
+ site_tag.sync()
+
+ self.object_ids = [site_tag['site_tag_id']]
+ return 1
+# $Id$
+# $URL$
import time
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
-from PLC.Slices import Slice, Slices
+from PLC.Table import Row
from PLC.Auth import Auth
-from PLC.Sites import Site, Sites
-related_fields = Slice.related_fields.keys()
-can_update = lambda (field, value): field in \
- ['instantiation', 'url', 'description', 'max_nodes', 'expires'] + \
- related_fields
+from PLC.Slices import Slice, Slices
+from PLC.Sites import Site, Sites
+from PLC.TagTypes import TagTypes
+from PLC.SliceTags import SliceTags
+from PLC.Methods.AddSliceTag import AddSliceTag
+from PLC.Methods.UpdateSliceTag import UpdateSliceTag
+can_update = ['instantiation', 'url', 'description', 'max_nodes', 'expires']
class UpdateSlice(Method):
"""
roles = ['admin', 'pi', 'user']
- slice_fields = dict(filter(can_update, Slice.fields.items() + Slice.related_fields.items()))
+ accepted_fields = Row.accepted_fields(can_update, Slice.fields)
+ # xxx check the related_fields feature
+ accepted_fields.update(Slice.related_fields)
+ accepted_fields.update(Slice.tags)
accepts = [
Auth(),
Mixed(Slice.fields['slice_id'],
Slice.fields['name']),
- slice_fields
+ accepted_fields
]
returns = Parameter(int, '1 if successful')
def call(self, auth, slice_id_or_name, slice_fields):
- slice_fields = dict(filter(can_update, slice_fields.items()))
+
+ # split provided fields
+ [native,related,tags,rejected] = Row.split_fields(slice_fields,[Slice.fields,Slice.related_fields,Slice.tags])
+ # type checking
+ native = Row.check_fields (native, self.accepted_fields)
+ if rejected:
+ raise PLCInvalidArgument, "Cannot update Slice column(s) %r"%rejected
+
slices = Slices(self.api, [slice_id_or_name])
if not slices:
- raise PLCInvalidArgument, "No such slice"
+ raise PLCInvalidArgument, "No such slice %r"%slice_id_or_name
slice = slices[0]
if slice['peer_id'] is not None:
raise PLCInvalidArgument, "Not a local slice"
+ # Authenticated function
+ assert self.caller is not None
+
if 'admin' not in self.caller['roles']:
if self.caller['person_id'] in slice['person_ids']:
pass
raise PLCPermissionDenied, "Specified slice not associated with any of your sites"
# Renewing
+ renewing=False
if 'expires' in slice_fields and slice_fields['expires'] > slice['expires']:
sites = Sites(self.api, [slice['site_id']])
assert sites
site = sites[0]
- if site['max_slices'] < 0:
+ if site['max_slices'] <= 0:
raise PLCInvalidArgument, "Slice creation and renewal have been disabled for the site"
# Maximum expiration date is 8 weeks from now
if 'url' not in slice_fields or slice_fields['url'] is None or \
not slice_fields['url'].strip():
raise PLCInvalidArgument, "Cannot renew a slice with an empty description or URL"
+ renewing=True
if 'max_nodes' in slice_fields and slice_fields['max_nodes'] != slice['max_nodes']:
if 'admin' not in self.caller['roles'] and \
raise PLCInvalidArgument, "Only admins and PIs may update max_nodes"
# Make requested associations
- for field in related_fields:
- if field in slice_fields:
- slice.associate(auth, field, slice_fields[field])
- slice_fields.pop(field)
+ for (k,v) in related.iteritems():
+ slice.associate(auth,k,v)
slice.update(slice_fields)
- slice.sync()
+ slice.sync(commit=True)
+
+ for (tagname,value) in tags.iteritems():
+ # the tagtype instance is assumed to exist, just check that
+ if not TagTypes(self.api,{'tagname':tagname}):
+ raise PLCInvalidArgument,"No such TagType %s"%tagname
+ slice_tags=SliceTags(self.api,{'tagname':tagname,'slice_id':slice['slice_id']})
+ if not slice_tags:
+ AddSliceTag(self.api).__call__(auth,slice['slice_id'],tagname,value)
+ else:
+ UpdateSliceTag(self.api).__call__(auth,slice_tags[0]['slice_tag_id'],value)
self.event_objects = {'Slice': [slice['slice_id']]}
+ if 'name' in slice:
+ self.message='Slice %s updated'%slice['name']
+ else:
+ self.message='Slice %d updated'%slice['slice_id']
+ if renewing:
+ # it appears that slice['expires'] may be either an int, or a formatted string
+ try:
+ expire_date=time.strftime('%Y-%m-%d:%H:%M',time.localtime(float(slice['expires'])))
+ except:
+ expire_date=slice['expires']
+ self.message += ' renewed until %s'%expire_date
return 1
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.SliceAttributes import SliceAttribute, SliceAttributes
-from PLC.Slices import Slice, Slices
-from PLC.InitScripts import InitScript, InitScripts
-from PLC.Auth import Auth
-
-class UpdateSliceAttribute(Method):
- """
- Updates the value of an existing slice or sliver attribute.
-
- Users may only update attributes of slices or slivers of which
- they are members. PIs may only update attributes of slices or
- slivers at their sites, or of which they are members. Admins may
- update attributes of any slice or sliver.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin', 'pi', 'user']
-
- accepts = [
- Auth(),
- SliceAttribute.fields['slice_attribute_id'],
- Mixed(SliceAttribute.fields['value'],
- InitScript.fields['name'])
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, slice_attribute_id, value):
- slice_attributes = SliceAttributes(self.api, [slice_attribute_id])
- if not slice_attributes:
- raise PLCInvalidArgument, "No such slice attribute"
- slice_attribute = slice_attributes[0]
-
- slices = Slices(self.api, [slice_attribute['slice_id']])
- if not slices:
- raise PLCInvalidArgument, "No such slice"
- slice = slices[0]
-
- assert slice_attribute['slice_attribute_id'] in slice['slice_attribute_ids']
-
- if 'admin' not in self.caller['roles']:
- if self.caller['person_id'] in slice['person_ids']:
- pass
- elif 'pi' not in self.caller['roles']:
- raise PLCPermissionDenied, "Not a member of the specified slice"
- elif slice['site_id'] not in self.caller['site_ids']:
- raise PLCPermissionDenied, "Specified slice not associated with any of your sites"
-
- if slice_attribute['min_role_id'] is not None and \
- min(self.caller['role_ids']) > slice_attribute['min_role_id']:
- raise PLCPermissionDenied, "Not allowed to update the specified attribute"
-
- if slice_attribute['name'] in ['initscript']:
- initscripts = InitScripts(self.api, {'enabled': True, 'name': value})
- if not initscripts:
- raise PLCInvalidArgument, "No such plc initscript"
-
- slice_attribute['value'] = unicode(value)
- slice_attribute.sync()
- self.event_objects = {'SliceAttribute': [slice_attribute['slice_attribute_id']]}
- return 1
+++ /dev/null
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-from PLC.Auth import Auth
-
-can_update = lambda (field, value): field in \
- ['name', 'description', 'min_role_id']
-
-class UpdateSliceAttributeType(Method):
- """
- Updates the parameters of an existing attribute with the values in
- attribute_type_fields.
-
- Returns 1 if successful, faults otherwise.
- """
-
- roles = ['admin']
-
- attribute_type_fields = dict(filter(can_update, SliceAttributeType.fields.items()))
-
- accepts = [
- Auth(),
- Mixed(SliceAttributeType.fields['attribute_type_id'],
- SliceAttributeType.fields['name']),
- attribute_type_fields
- ]
-
- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, attribute_type_id_or_name, attribute_type_fields):
- attribute_type_fields = dict(filter(can_update, attribute_type_fields.items()))
-
- attribute_types = SliceAttributeTypes(self.api, [attribute_type_id_or_name])
- if not attribute_types:
- raise PLCInvalidArgument, "No such attribute"
- attribute_type = attribute_types[0]
-
- attribute_type.update(attribute_type_fields)
- attribute_type.sync()
- self.event_objects = {'AttributeType': [attribute_type['attribute_type_id']]}
-
- return 1
--- /dev/null
+# $Id$
+# $URL$
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.SliceTags import SliceTag, SliceTags
+from PLC.Nodes import Node
+from PLC.Slices import Slice, Slices
+from PLC.InitScripts import InitScript, InitScripts
+from PLC.Auth import Auth
+
+class UpdateSliceTag(Method):
+ """
+ Updates the value of an existing slice or sliver attribute.
+
+ Users may only update attributes of slices or slivers of which
+ they are members. PIs may only update attributes of slices or
+ slivers at their sites, or of which they are members. Admins may
+ update attributes of any slice or sliver.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin', 'pi', 'user', 'node']
+
+ accepts = [
+ Auth(),
+ SliceTag.fields['slice_tag_id'],
+ Mixed(SliceTag.fields['value'],
+ InitScript.fields['name'])
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ def call(self, auth, slice_tag_id, value):
+ slice_tags = SliceTags(self.api, [slice_tag_id])
+ if not slice_tags:
+ raise PLCInvalidArgument, "No such slice attribute"
+ slice_tag = slice_tags[0]
+
+ slices = Slices(self.api, [slice_tag['slice_id']])
+ if not slices:
+ raise PLCInvalidArgument, "No such slice"
+ slice = slices[0]
+
+ assert slice_tag['slice_tag_id'] in slice['slice_tag_ids']
+
+ if not isinstance(self.caller, Node):
+ if 'admin' not in self.caller['roles']:
+ if self.caller['person_id'] in slice['person_ids']:
+ pass
+ elif 'pi' not in self.caller['roles']:
+ raise PLCPermissionDenied, "Not a member of the specified slice"
+ elif slice['site_id'] not in self.caller['site_ids']:
+ raise PLCPermissionDenied, "Specified slice not associated with any of your sites"
+
+ if slice_tag['min_role_id'] is not None and \
+ min(self.caller['role_ids']) > slice_tag['min_role_id']:
+ raise PLCPermissionDenied, "Not allowed to update the specified attribute"
+ else:
+ ### make node's min_role_id == PI min_role_id
+ node_role_id = 20
+ if slice_tag['min_role_id'] is not None and node_role_id > slice_tag['min_role_id']:
+ raise PLCPermissionDenied, "Not allowed to update the specified slice attribute"
+
+ if slice_tag['tagname'] in ['initscript']:
+ initscripts = InitScripts(self.api, {'enabled': True, 'name': value})
+ if not initscripts:
+ raise PLCInvalidArgument, "No such plc initscript"
+
+ slice_tag['value'] = unicode(value)
+ slice_tag.sync()
+ self.event_objects = {'SliceTag': [slice_tag['slice_tag_id']]}
+ return 1
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.TagTypes import TagType, TagTypes
+from PLC.Auth import Auth
+
+can_update = lambda (field, value): field in \
+ ['tagname', 'description', 'category', 'min_role_id']
+
+class UpdateTagType(Method):
+ """
+ Updates the parameters of an existing tag type
+ with the values in tag_type_fields.
+
+ Returns 1 if successful, faults otherwise.
+ """
+
+ roles = ['admin']
+
+ tag_type_fields = dict(filter(can_update, TagType.fields.items()))
+
+ accepts = [
+ Auth(),
+ Mixed(TagType.fields['tag_type_id'],
+ TagType.fields['tagname']),
+ tag_type_fields
+ ]
+
+ returns = Parameter(int, '1 if successful')
+
+ def call(self, auth, tag_type_id_or_name, tag_type_fields):
+ tag_type_fields = dict(filter(can_update, tag_type_fields.items()))
+
+ tag_types = TagTypes(self.api, [tag_type_id_or_name])
+ if not tag_types:
+ raise PLCInvalidArgument, "No such tag type"
+ tag_type = tag_types[0]
+
+ tag_type.update(tag_type_fields)
+ tag_type.sync()
+ self.object_ids = [tag_type['tag_type_id']]
+
+ return 1
+# $Id$
+# $URL$
import random
import base64
import time
-methods = """
+## Please use make index to update this file
+native_methods = """
AddAddressType
AddAddressTypeToAddress
AddBootState
AddConfFile
-AddConfFileToNodeGroup
AddConfFileToNode
+AddConfFileToNodeGroup
+AddIlink
AddInitScript
+AddInterface
+AddInterfaceTag
AddKeyType
AddMessage
AddNetworkMethod
AddNetworkType
-AddNodeGroup
-AddNodeNetwork
-AddNodeNetworkSetting
-AddNodeNetworkSettingType
AddNode
-AddNodeToNodeGroup
+AddNodeGroup
+AddNodeTag
AddNodeToPCU
-AddPCUProtocolType
+AddNodeType
AddPCU
+AddPCUProtocolType
AddPCUType
AddPeer
-AddPersonKey
AddPerson
+AddPersonKey
+AddPersonTag
AddPersonToSite
AddPersonToSlice
AddRole
AddRoleToPerson
AddSession
-AddSiteAddress
AddSite
-AddSliceAttribute
-AddSliceAttributeType
-AddSliceInstantiation
+AddSiteAddress
+AddSiteTag
AddSlice
+AddSliceInstantiation
+AddSliceTag
AddSliceToNodes
AddSliceToNodesWhitelist
-AdmAddAddressType
-AdmAddNodeGroup
-AdmAddNodeNetwork
-AdmAddNode
-AdmAddNodeToNodeGroup
-AdmAddPersonKey
-AdmAddPerson
-AdmAddPersonToSite
-AdmAddSitePowerControlUnit
-AdmAddSite
-AdmAssociateNodeToPowerControlUnitPort
-AdmAuthCheck
-AdmDeleteAddressType
-AdmDeleteAllPersonKeys
-AdmDeleteNodeGroup
-AdmDeleteNodeNetwork
-AdmDeleteNode
-AdmDeletePersonKeys
-AdmDeletePerson
-AdmDeleteSitePowerControlUnit
-AdmDeleteSite
-AdmDisassociatePowerControlUnitPort
-AdmGenerateNodeConfFile
-AdmGetAllAddressTypes
-AdmGetAllKeyTypes
-AdmGetAllNodeNetworks
-AdmGetAllRoles
-AdmGetNodeGroupNodes
-AdmGetNodeGroups
-AdmGetNodes
-AdmGetPersonKeys
-AdmGetPersonRoles
-AdmGetPersonSites
-AdmGetPersons
-AdmGetPowerControlUnitNodes
-AdmGetPowerControlUnits
-AdmGetSiteNodes
-AdmGetSitePersons
-AdmGetSitePIs
-AdmGetSitePowerControlUnits
-AdmGetSites
-AdmGetSiteTechContacts
-AdmGrantRoleToPerson
-AdmIsPersonInRole
-AdmQueryConfFile
-AdmQueryNode
-AdmQueryPerson
-AdmQueryPowerControlUnit
-AdmQuerySite
-AdmRebootNode
-AdmRemoveNodeFromNodeGroup
-AdmRemovePersonFromSite
-AdmRevokeRoleFromPerson
-AdmSetPersonEnabled
-AdmSetPersonPrimarySite
-AdmUpdateNodeGroup
-AdmUpdateNodeNetwork
-AdmUpdateNode
-AdmUpdatePerson
-AdmUpdateSitePowerControlUnit
-AdmUpdateSite
-AnonAdmGetNodeGroups
+AddTagType
AuthCheck
+BindObjectToPeer
BlacklistKey
BootCheckAuthentication
BootGetNodeDetails
BootNotifyOwners
BootUpdateNode
DeleteAddress
-DeleteAddressTypeFromAddress
DeleteAddressType
+DeleteAddressTypeFromAddress
DeleteBootState
-DeleteConfFileFromNodeGroup
-DeleteConfFileFromNode
DeleteConfFile
+DeleteConfFileFromNode
+DeleteConfFileFromNodeGroup
+DeleteEmulationLink
+DeleteIlink
DeleteInitScript
+DeleteInterface
+DeleteInterfaceTag
DeleteKey
DeleteKeyType
DeleteMessage
DeleteNetworkMethod
DeleteNetworkType
-DeleteNodeFromNodeGroup
+DeleteNode
DeleteNodeFromPCU
DeleteNodeGroup
-DeleteNodeNetwork
-DeleteNodeNetworkSetting
-DeleteNodeNetworkSettingType
-DeleteNode
-DeletePCUProtocolType
+DeleteNodeTag
+DeleteNodeType
DeletePCU
+DeletePCUProtocolType
DeletePCUType
DeletePeer
+DeletePerson
DeletePersonFromSite
DeletePersonFromSlice
-DeletePerson
-DeleteRoleFromPerson
+DeletePersonTag
DeleteRole
+DeleteRoleFromPerson
DeleteSession
DeleteSite
-DeleteSliceAttribute
-DeleteSliceAttributeType
+DeleteSiteTag
+DeleteSlice
DeleteSliceFromNodes
DeleteSliceFromNodesWhitelist
DeleteSliceInstantiation
-DeleteSlice
+DeleteSliceTag
+DeleteTagType
GenerateNodeConfFile
-GetAddresses
GetAddressTypes
+GetAddresses
GetBootMedium
GetBootStates
GetConfFiles
GetEventObjects
GetEvents
+GetIlinks
GetInitScripts
-GetKeys
+GetInterfaceTags
+GetInterfaces
GetKeyTypes
+GetKeys
GetMessages
GetNetworkMethods
GetNetworkTypes
GetNodeGroups
-GetNodeNetworkSettings
-GetNodeNetworkSettingTypes
-GetNodeNetworks
+GetNodeTags
+GetNodeTypes
GetNodes
GetPCUProtocolTypes
-GetPCUs
GetPCUTypes
+GetPCUs
GetPeerData
GetPeerName
GetPeers
+GetPersonTags
GetPersons
GetPlcRelease
GetRoles
GetSession
GetSessions
+GetSiteTags
GetSites
-GetSliceAttributes
-GetSliceAttributeTypes
GetSliceInstantiations
GetSliceKeys
-GetSlicesMD5
-GetSlices
+GetSliceTags
GetSliceTicket
+GetSlices
GetSlivers
+GetTagTypes
GetWhitelist
NotifyPersons
NotifySupport
RebootNode
+RebootNodeWithPCU
RefreshPeer
+ReportRunlevel
ResetPassword
+ResolveSlices
SetPersonPrimarySite
SliceCreate
SliceDelete
SliceUserAdd
SliceUserDel
SliceUsersList
-system.listMethods
-system.methodHelp
-system.methodSignature
-system.multicall
+UnBindObjectFromPeer
UpdateAddress
UpdateAddressType
UpdateConfFile
+UpdateEmulationLink
+UpdateIlink
UpdateInitScript
+UpdateInterface
+UpdateInterfaceTag
UpdateKey
UpdateMessage
-UpdateNodeGroup
-UpdateNodeNetwork
-UpdateNodeNetworkSetting
-UpdateNodeNetworkSettingType
UpdateNode
-UpdatePCUProtocolType
+UpdateNodeGroup
+UpdateNodeTag
UpdatePCU
+UpdatePCUProtocolType
UpdatePCUType
UpdatePeer
UpdatePerson
+UpdatePersonTag
UpdateSite
-UpdateSliceAttribute
-UpdateSliceAttributeType
+UpdateSiteTag
UpdateSlice
+UpdateSliceTag
+UpdateTagType
VerifyPerson
+system.listMethods
+system.methodHelp
+system.methodSignature
+system.multicall
""".split()
self.name = "system.listMethods"
def call(self):
- return self.api.methods
+ return self.api.all_methods
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from PLC.Faults import *
table_name = 'network_methods'
primary_key = 'method'
- join_tables = ['nodenetworks']
+ join_tables = ['interfaces']
fields = {
'method': Parameter(str, "Network method", max = 20),
}
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from PLC.Faults import *
table_name = 'network_types'
primary_key = 'type'
- join_tables = ['nodenetworks']
+ join_tables = ['interfaces']
fields = {
'type': Parameter(str, "Network type", max = 20),
}
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from types import StringTypes
table_name = 'nodegroups'
primary_key = 'nodegroup_id'
- join_tables = ['nodegroup_node', 'conf_file_nodegroup']
+ join_tables = ['conf_file_nodegroup']
+ primary_field = 'nodegroup_id'
fields = {
'nodegroup_id': Parameter(int, "Node group identifier"),
- 'name': Parameter(str, "Node group name", max = 50),
- 'description': Parameter(str, "Node group description", max = 200, nullok = True),
- 'node_ids': Parameter([int], "List of nodes in this node group"),
+ 'groupname': Parameter(str, "Node group name", max = 50),
+ 'tag_type_id': Parameter (int, "Node tag type id"),
+ 'value' : Parameter(str, "value that the nodegroup definition is based upon"),
+ 'tagname' : Parameter(str, "Tag name that the nodegroup definition is based upon"),
'conf_file_ids': Parameter([int], "List of configuration files specific to this node group"),
- }
- related_fields = {
- 'conf_files': [Parameter(int, "ConfFile identifier")],
- 'nodes': [Mixed(Parameter(int, "Node identifier"),
- Parameter(str, "Fully qualified hostname"))]
+ 'node_ids' : Parameter([int], "List of node_ids that belong to this nodegroup"),
}
+ related_fields = {
+ }
def validate_name(self, name):
# Make sure name is not blank
return name
- def add_node(self, node, commit = True):
- """
- Add node to existing nodegroup.
- """
-
- assert 'nodegroup_id' in self
- assert isinstance(node, Node)
- assert 'node_id' in node
-
- node_id = node['node_id']
- nodegroup_id = self['nodegroup_id']
-
- if node_id not in self['node_ids']:
- assert nodegroup_id not in node['nodegroup_ids']
-
- self.api.db.do("INSERT INTO nodegroup_node (nodegroup_id, node_id)" \
- " VALUES(%(nodegroup_id)d, %(node_id)d)",
- locals())
-
- if commit:
- self.api.db.commit()
-
- self['node_ids'].append(node_id)
- node['nodegroup_ids'].append(nodegroup_id)
-
- def remove_node(self, node, commit = True):
- """
- Remove node from existing nodegroup.
- """
-
- assert 'nodegroup_id' in self
- assert isinstance(node, Node)
- assert 'node_id' in node
-
- node_id = node['node_id']
- nodegroup_id = self['nodegroup_id']
-
- if node_id in self['node_ids']:
- assert nodegroup_id in node['nodegroup_ids']
-
- self.api.db.do("DELETE FROM nodegroup_node" \
- " WHERE nodegroup_id = %(nodegroup_id)d" \
- " AND node_id = %(node_id)d",
- locals())
-
- if commit:
- self.api.db.commit()
-
- self['node_ids'].remove(node_id)
- node['nodegroup_ids'].remove(nodegroup_id)
-
- def associate_nodes(self, auth, field, value):
- """
- Adds nodes found in value list to this nodegroup (using AddNodeToNodeGroup).
- Deletes nodes not found in value list from this slice (using DeleteNodeFromNodeGroup).
- """
-
- assert 'node_ids' in self
- assert 'nodegroup_id' in self
- assert isinstance(value, list)
-
- (node_ids, hostnames) = self.separate_types(value)[0:2]
-
- # Translate hostnames into node_ids
- if hostnames:
- nodes = Nodes(self.api, hostnames, ['node_id']).dict('node_id')
- node_ids += nodes.keys()
-
- # Add new ids, remove stale ids
- if self['node_ids'] != node_ids:
- from PLC.Methods.AddNodeToNodeGroup import AddNodeToNodeGroup
- from PLC.Methods.DeleteNodeFromNodeGroup import DeleteNodeFromNodeGroup
- new_nodes = set(node_ids).difference(self['node_ids'])
- stale_nodes = set(self['node_ids']).difference(node_ids)
-
- for new_node in new_nodes:
- AddNodeToNodeGroup.__call__(AddNodeToNodeGroup(self.api), auth, new_node, self['nodegroup_id'])
- for stale_node in stale_nodes:
- DeleteNodeFromNodeGroup.__call__(DeleteNodeFromNodeGroup(self.api), auth, stale_node, self['nodegroup_id'])
-
def associate_conf_files(self, auth, field, value):
"""
Add conf_files found in value list (AddConfFileToNodeGroup)
stale_conf_files = set(self['conf_file_ids']).difference(conf_file_ids)
for new_conf_file in new_conf_files:
- AddConfFileToNodeGroup.__call__(AddConfFileToNodeGroup(self.api), auth, new_conf_file, self['nodegroup_id'])
+ AddConfFileToNodeGroup.__call__(AddConfFileToNodeGroup(self.api),
+ auth, new_conf_file, self['nodegroup_id'])
for stale_conf_file in stale_conf_files:
- DeleteConfFileFromNodeGroup.__call__(DeleteConfFileFromNodeGroup(self.api), auth, stale_conf_file, self['nodegroup_id'])
+ DeleteConfFileFromNodeGroup.__call__(DeleteConfFileFromNodeGroup(self.api),
+ auth, stale_conf_file, self['nodegroup_id'])
class NodeGroups(Table):
# Separate the list into integers and strings
ints = filter(lambda x: isinstance(x, (int, long)), nodegroup_filter)
strs = filter(lambda x: isinstance(x, StringTypes), nodegroup_filter)
- nodegroup_filter = Filter(NodeGroup.fields, {'nodegroup_id': ints, 'name': strs})
+ nodegroup_filter = Filter(NodeGroup.fields, {'nodegroup_id': ints, 'groupname': strs})
sql += " AND (%s) %s" % nodegroup_filter.sql(api, "OR")
elif isinstance(nodegroup_filter, dict):
nodegroup_filter = Filter(NodeGroup.fields, nodegroup_filter)
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision:$
-#
-from types import StringTypes
-
-from PLC.Faults import *
-from PLC.Parameter import Parameter
-from PLC.Filter import Filter
-from PLC.Table import Row, Table
-from PLC.Roles import Role, Roles
-
-class NodeNetworkSettingType (Row):
-
- """
- Representation of a row in the nodenetwork_setting_types table.
- """
-
- table_name = 'nodenetwork_setting_types'
- primary_key = 'nodenetwork_setting_type_id'
- join_tables = ['nodenetwork_setting']
- fields = {
- 'nodenetwork_setting_type_id': Parameter(int, "Nodenetwork setting type identifier"),
- 'name': Parameter(str, "Nodenetwork setting type name", max = 100),
- 'description': Parameter(str, "Nodenetwork setting type description", max = 254),
- 'category' : Parameter (str, "Nodenetwork setting category", max=64),
- 'min_role_id': Parameter(int, "Minimum (least powerful) role that can set or change this attribute"),
- }
-
- # for Cache
- class_key = 'name'
- foreign_fields = ['category','description','min_role_id']
- foreign_xrefs = []
-
- def validate_name(self, name):
- if not len(name):
- raise PLCInvalidArgument, "nodenetwork setting type name must be set"
-
- conflicts = NodeNetworkSettingTypes(self.api, [name])
- for setting_type in conflicts:
- if 'nodenetwork_setting_type_id' not in self or \
- self['nodenetwork_setting_type_id'] != setting_type['nodenetwork_setting_type_id']:
- raise PLCInvalidArgument, "nodenetwork setting type name already in use"
-
- return name
-
- def validate_min_role_id(self, role_id):
- roles = [row['role_id'] for row in Roles(self.api)]
- if role_id not in roles:
- raise PLCInvalidArgument, "Invalid role"
-
- return role_id
-
-class NodeNetworkSettingTypes(Table):
- """
- Representation of row(s) from the nodenetwork_setting_types table
- in the database.
- """
-
- def __init__(self, api, nodenetwork_setting_type_filter = None, columns = None):
- Table.__init__(self, api, NodeNetworkSettingType, columns)
-
- sql = "SELECT %s FROM nodenetwork_setting_types WHERE True" % \
- ", ".join(self.columns)
-
- if nodenetwork_setting_type_filter is not None:
- if isinstance(nodenetwork_setting_type_filter, (list, tuple, set)):
- # Separate the list into integers and strings
- ints = filter(lambda x: isinstance(x, (int, long)), nodenetwork_setting_type_filter)
- strs = filter(lambda x: isinstance(x, StringTypes), nodenetwork_setting_type_filter)
- nodenetwork_setting_type_filter = Filter(NodeNetworkSettingType.fields, {'nodenetwork_setting_type_id': ints, 'name': strs})
- sql += " AND (%s) %s" % nodenetwork_setting_type_filter.sql(api, "OR")
- elif isinstance(nodenetwork_setting_type_filter, dict):
- nodenetwork_setting_type_filter = Filter(NodeNetworkSettingType.fields, nodenetwork_setting_type_filter)
- sql += " AND (%s) %s" % nodenetwork_setting_type_filter.sql(api, "AND")
- elif isinstance (nodenetwork_setting_type_filter, StringTypes):
- nodenetwork_setting_type_filter = Filter(NodeNetworkSettingType.fields, {'name':[nodenetwork_setting_type_filter]})
- sql += " AND (%s) %s" % nodenetwork_setting_type_filter.sql(api, "AND")
- else:
- raise PLCInvalidArgument, "Wrong nodenetwork setting type filter %r"%nodenetwork_setting_type_filter
-
- self.selectall(sql)
+++ /dev/null
-#
-# Thierry Parmentelat - INRIA
-#
-# $Revision$
-#
-from PLC.Faults import *
-from PLC.Parameter import Parameter
-from PLC.Filter import Filter
-from PLC.Table import Row, Table
-from PLC.NodeNetworkSettingTypes import NodeNetworkSettingType, NodeNetworkSettingTypes
-
-class NodeNetworkSetting(Row):
- """
- Representation of a row in the nodenetwork_setting.
- To use, instantiate with a dict of values.
- """
-
- table_name = 'nodenetwork_setting'
- primary_key = 'nodenetwork_setting_id'
- fields = {
- 'nodenetwork_setting_id': Parameter(int, "Nodenetwork setting identifier"),
- 'nodenetwork_id': Parameter(int, "NodeNetwork identifier"),
- 'nodenetwork_setting_type_id': NodeNetworkSettingType.fields['nodenetwork_setting_type_id'],
- 'name': NodeNetworkSettingType.fields['name'],
- 'description': NodeNetworkSettingType.fields['description'],
- 'category': NodeNetworkSettingType.fields['category'],
- 'min_role_id': NodeNetworkSettingType.fields['min_role_id'],
- 'value': Parameter(str, "Nodenetwork setting value"),
- ### relations
-
- }
-
-class NodeNetworkSettings(Table):
- """
- Representation of row(s) from the nodenetwork_setting table in the
- database.
- """
-
- def __init__(self, api, nodenetwork_setting_filter = None, columns = None):
- Table.__init__(self, api, NodeNetworkSetting, columns)
-
- sql = "SELECT %s FROM view_nodenetwork_settings WHERE True" % \
- ", ".join(self.columns)
-
- if nodenetwork_setting_filter is not None:
- if isinstance(nodenetwork_setting_filter, (list, tuple, set)):
- nodenetwork_setting_filter = Filter(NodeNetworkSetting.fields, {'nodenetwork_setting_id': nodenetwork_setting_filter})
- elif isinstance(nodenetwork_setting_filter, dict):
- nodenetwork_setting_filter = Filter(NodeNetworkSetting.fields, nodenetwork_setting_filter)
- elif isinstance(nodenetwork_setting_filter, int):
- nodenetwork_setting_filter = Filter(NodeNetworkSetting.fields, {'nodenetwork_setting_id': [nodenetwork_setting_filter]})
- else:
- raise PLCInvalidArgument, "Wrong nodenetwork setting filter %r"%nodenetwork_setting_filter
- sql += " AND (%s) %s" % nodenetwork_setting_filter.sql(api)
-
-
- self.selectall(sql)
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+from PLC.Faults import *
+from PLC.Parameter import Parameter
+from PLC.Filter import Filter
+from PLC.Table import Row, Table
+from PLC.Nodes import Node, Nodes
+from PLC.TagTypes import TagType, TagTypes
+
+class NodeTag(Row):
+ """
+ Representation of a row in the node_tag.
+ To use, instantiate with a dict of values.
+ """
+
+ table_name = 'node_tag'
+ primary_key = 'node_tag_id'
+ fields = {
+ 'node_tag_id': Parameter(int, "Node tag identifier"),
+ 'node_id': Node.fields['node_id'],
+ 'hostname' : Node.fields['hostname'],
+ 'tag_type_id': TagType.fields['tag_type_id'],
+ 'value': Parameter(str, "Node tag value"),
+ 'tagname': TagType.fields['tagname'],
+ 'description': TagType.fields['description'],
+ 'category': TagType.fields['category'],
+ 'min_role_id': TagType.fields['min_role_id'],
+ }
+
+class NodeTags(Table):
+ """
+ Representation of row(s) from the node_tag table in the
+ database.
+ """
+
+ def __init__(self, api, node_tag_filter = None, columns = None):
+ Table.__init__(self, api, NodeTag, columns)
+
+ sql = "SELECT %s FROM view_node_tags WHERE True" % \
+ ", ".join(self.columns)
+
+ if node_tag_filter is not None:
+ if isinstance(node_tag_filter, (list, tuple, set)):
+ node_tag_filter = Filter(NodeTag.fields, {'node_tag_id': node_tag_filter})
+ elif isinstance(node_tag_filter, dict):
+ node_tag_filter = Filter(NodeTag.fields, node_tag_filter)
+ elif isinstance(node_tag_filter, int):
+ node_tag_filter = Filter(NodeTag.fields, {'node_tag_id': [node_tag_filter]})
+ else:
+ raise PLCInvalidArgument, "Wrong node tag filter %r"%node_tag_filter
+ sql += " AND (%s) %s" % node_tag_filter.sql(api)
+
+
+ self.selectall(sql)
--- /dev/null
+#
+# Functions for interacting with the node_types table in the database
+#
+# $Id$
+# $URL$
+#
+
+from PLC.Faults import *
+from PLC.Parameter import Parameter
+from PLC.Table import Row, Table
+
+class NodeType(Row):
+ """
+ Representation of a row in the node_types table. To use,
+ instantiate with a dict of values.
+ """
+
+ table_name = 'node_types'
+ primary_key = 'node_type'
+ join_tables = ['nodes']
+ fields = {
+ 'node_type': Parameter(str, "Node type", max = 20),
+ }
+
+ def validate_node_type(self, name):
+ # Make sure name is not blank
+ if not len(name):
+ raise PLCInvalidArgument, "Node type must be specified"
+
+ # Make sure node type does not alredy exist
+ conflicts = NodeTypes(self.api, [name])
+ if conflicts:
+ raise PLCInvalidArgument, "Node type name already in use"
+
+ return name
+
+class NodeTypes(Table):
+ """
+ Representation of the node_types table in the database.
+ """
+
+ def __init__(self, api, node_types = None):
+ Table.__init__(self, api, NodeType)
+
+ sql = "SELECT %s FROM node_types" % \
+ ", ".join(NodeType.fields)
+
+ if node_types:
+ sql += " WHERE node_type IN (%s)" % ", ".join(map(api.db.quote, node_types))
+
+ self.selectall(sql)
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from types import StringTypes
from PLC.Filter import Filter
from PLC.Debug import profile
from PLC.Table import Row, Table
-from PLC.NodeNetworks import NodeNetwork, NodeNetworks
+from PLC.NodeTypes import NodeTypes
from PLC.BootStates import BootStates
+from PLC.Interfaces import Interface, Interfaces
def valid_hostname(hostname):
# 1. Each part begins and ends with a letter or number.
table_name = 'nodes'
primary_key = 'node_id'
- # Thierry -- we use delete on nodenetworks so the related NodeNetworkSettings get deleted too
- join_tables = ['nodegroup_node', 'conf_file_node', 'pcu_node', 'slice_node', 'slice_attribute', 'node_session', 'peer_node','node_slice_whitelist']
+ join_tables = [ 'slice_node', 'peer_node', 'slice_tag',
+ 'node_session', 'node_slice_whitelist',
+ 'node_tag', 'conf_file_node', 'pcu_node', ]
fields = {
'node_id': Parameter(int, "Node identifier"),
+ 'node_type': Parameter(str,"Node type",max=20),
'hostname': Parameter(str, "Fully qualified hostname", max = 255),
'site_id': Parameter(int, "Site at which this node is located"),
'boot_state': Parameter(str, "Boot state", max = 20),
+ 'run_level': Parameter(str, "Run level", max = 20),
'model': Parameter(str, "Make and model of the actual machine", max = 255, nullok = True),
'boot_nonce': Parameter(str, "(Admin only) Random value generated by the node at last boot", max = 128),
'version': Parameter(str, "Apparent Boot CD version", max = 64),
'date_created': Parameter(int, "Date and time when node entry was created", ro = True),
'last_updated': Parameter(int, "Date and time when node entry was created", ro = True),
'last_contact': Parameter(int, "Date and time when node last contacted plc", ro = True),
+ 'verified': Parameter(bool, "Whether the node configuration is verified correct", ro=False),
'key': Parameter(str, "(Admin only) Node key", max = 256),
'session': Parameter(str, "(Admin only) Node session value", max = 256, ro = True),
- 'nodenetwork_ids': Parameter([int], "List of network interfaces that this node has"),
- 'nodegroup_ids': Parameter([int], "List of node groups that this node is in"),
+ 'interface_ids': Parameter([int], "List of network interfaces that this node has"),
'conf_file_ids': Parameter([int], "List of configuration files specific to this node"),
# 'root_person_ids': Parameter([int], "(Admin only) List of people who have root access to this node"),
'slice_ids': Parameter([int], "List of slices on this node"),
'ports': Parameter([int], "List of PCU ports that this node is connected to"),
'peer_id': Parameter(int, "Peer to which this node belongs", nullok = True),
'peer_node_id': Parameter(int, "Foreign node identifier at peer", nullok = True),
+ 'node_tag_ids' : Parameter ([int], "List of tags attached to this node"),
+ 'nodegroup_ids': Parameter([int], "List of node groups that this node is in"),
}
related_fields = {
- 'nodenetworks': [Mixed(Parameter(int, "NodeNetwork identifier"),
- Filter(NodeNetwork.fields))],
- 'nodegroups': [Mixed(Parameter(int, "NodeGroup identifier"),
- Parameter(str, "NodeGroup name"))],
+ 'interfaces': [Mixed(Parameter(int, "Interface identifier"),
+ Filter(Interface.fields))],
'conf_files': [Parameter(int, "ConfFile identifier")],
'slices': [Mixed(Parameter(int, "Slice identifier"),
Parameter(str, "Slice name"))],
'slices_whitelist': [Mixed(Parameter(int, "Slice identifier"),
Parameter(str, "Slice name"))]
}
- # for Cache
- class_key = 'hostname'
- foreign_fields = ['boot_state','model','version']
- # forget about these ones, they are read-only anyway
- # handling them causes Cache to re-sync all over again
- # 'date_created','last_updated'
- foreign_xrefs = [
- # in this case, we dont need the 'table' but Cache will look it up, so...
- {'field' : 'site_id' , 'class' : 'Site' , 'table' : 'unused-on-direct-refs' } ,
- ]
+
+ view_tags_name = "view_node_tags"
+ # tags are used by the Add/Get/Update methods to expose tags
+ # this is initialized here and updated by the accessors factory
+ tags = { }
def validate_hostname(self, hostname):
if not valid_hostname(hostname):
return hostname
+ def validate_node_type(self, node_type):
+ node_types = [row['node_type'] for row in NodeTypes(self.api)]
+ if node_type not in node_types:
+ raise PLCInvalidArgument, "Invalid node type %r"%node_type
+ return node_type
+
def validate_boot_state(self, boot_state):
boot_states = [row['boot_state'] for row in BootStates(self.api)]
if boot_state not in boot_states:
- raise PLCInvalidArgument, "Invalid boot state"
-
+ raise PLCInvalidArgument, "Invalid boot state %r"%boot_state
return boot_state
validate_date_created = Row.validate_timestamp
" where node_id = %d" % (self['node_id']) )
self.sync(commit)
- def associate_nodenetworks(self, auth, field, value):
+ def associate_interfaces(self, auth, field, value):
"""
- Delete nodenetworks not found in value list (using DeleteNodeNetwor)k
- Add nodenetworks found in value list (using AddNodeNetwork)
- Updates nodenetworks found w/ nodenetwork_id in value list (using UpdateNodeNetwork)
+ Delete interfaces not found in value list (using DeleteInterface)
+ Add interfaces found in value list (using AddInterface)
+ Updates interfaces found w/ interface_id in value list (using UpdateInterface)
"""
- assert 'nodenetworkp_ids' in self
+ assert 'interface_ids' in self
assert 'node_id' in self
assert isinstance(value, list)
- (nodenetwork_ids, blank, nodenetworks) = self.separate_types(value)
+ (interface_ids, blank, interfaces) = self.separate_types(value)
- if self['nodenetwork_ids'] != nodenetwork_ids:
- from PLC.Methods.DeleteNodeNetwork import DeleteNodeNetwork
+ if self['interface_ids'] != interface_ids:
+ from PLC.Methods.DeleteInterface import DeleteInterface
- stale_nodenetworks = set(self['nodenetwork_ids']).difference(nodenetwork_ids)
+ stale_interfaces = set(self['interface_ids']).difference(interface_ids)
- for stale_nodenetwork in stale_nodenetworks:
- DeleteNodeNetwork.__call__(DeleteNodeNetwork(self.api), auth, stale_nodenetwork['nodenetwork_id'])
-
- def associate_nodegroups(self, auth, field, value):
- """
- Add node to nodegroups found in value list (AddNodeToNodegroup)
- Delete node from nodegroup not found in value list (DeleteNodeFromNodegroup)
- """
-
- from PLC.NodeGroups import NodeGroups
-
- assert 'nodegroup_ids' in self
- assert 'node_id' in self
- assert isinstance(value, list)
-
- (nodegroup_ids, nodegroup_names) = self.separate_types(value)[0:2]
-
- if nodegroup_names:
- nodegroups = NodeGroups(self.api, nodegroup_names, ['nodegroup_id']).dict('nodegroup_id')
- nodegroup_ids += nodegroups.keys()
-
- if self['nodegroup_ids'] != nodegroup_ids:
- from PLC.Methods.AddNodeToNodeGroup import AddNodeToNodeGroup
- from PLC.Methods.DeleteNodeFromNodeGroup import DeleteNodeFromNodeGroup
-
- new_nodegroups = set(nodegroup_ids).difference(self['nodegroup_ids'])
- stale_nodegroups = set(self['nodegroup_ids']).difference(nodegroup_ids)
-
- for new_nodegroup in new_nodegroups:
- AddNodeToNodeGroup.__call__(AddNodeToNodeGroup(self.api), auth, self['node_id'], new_nodegroup)
- for stale_nodegroup in stale_nodegroups:
- DeleteNodeFromNodeGroup.__call__(DeleteNodeFromNodeGroup(self.api), auth, self['node_id'], stale_nodegroup)
-
+ for stale_interface in stale_interfaces:
+ DeleteInterface.__call__(DeleteInterface(self.api), auth, stale_interface['interface_id'])
-
def associate_conf_files(self, auth, field, value):
"""
Add conf_files found in value list (AddConfFileToNode)
for stale_conf_file in stale_conf_files:
DeleteConfFileFromNode.__call__(DeleteConfFileFromNode(self.api), auth, stale_conf_file, self['node_id'])
-
def associate_slices(self, auth, field, value):
"""
Add slices found in value list to (AddSliceToNode)
"""
assert 'node_id' in self
- assert 'nodenetwork_ids' in self
- # we need to clean up NodeNetworkSettings, so handling nodenetworks as part of join_tables does not work
- for nodenetwork in NodeNetworks(self.api,self['nodenetwork_ids']):
- nodenetwork.delete()
+ # we need to clean up InterfaceTags, so handling interfaces as part of join_tables does not work
+ # federated nodes don't have interfaces though so for smooth transition from 4.2 to 4.3
+ if 'peer_id' in self and self['peer_id']:
+ pass
+ else:
+ assert 'interface_ids' in self
+ for interface in Interfaces(self.api,self['interface_ids']):
+ interface.delete()
# Clean up miscellaneous join tables
for table in self.join_tables:
def __init__(self, api, node_filter = None, columns = None):
Table.__init__(self, api, Node, columns)
- sql = "SELECT %s FROM view_nodes WHERE deleted IS False" % \
- ", ".join(self.columns)
+ # the view that we're selecting upon: start with view_nodes
+ view = "view_nodes"
+ # as many left joins as requested tags
+ for tagname in self.tag_columns:
+ view= "%s left join %s using (%s)"%(view,Node.tagvalue_view_name(tagname),
+ Node.primary_key)
+
+ sql = "SELECT %s FROM %s WHERE deleted IS False" % \
+ (", ".join(self.columns.keys()+self.tag_columns.keys()),view)
if node_filter is not None:
if isinstance(node_filter, (list, tuple, set)):
node_filter = Filter(Node.fields, {'node_id': ints, 'hostname': strs})
sql += " AND (%s) %s" % node_filter.sql(api, "OR")
elif isinstance(node_filter, dict):
- node_filter = Filter(Node.fields, node_filter)
+ allowed_fields=dict(Node.fields.items()+Node.tags.items())
+ node_filter = Filter(allowed_fields, node_filter)
sql += " AND (%s) %s" % node_filter.sql(api, "AND")
elif isinstance (node_filter, StringTypes):
node_filter = Filter(Node.fields, {'hostname':[node_filter]})
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id:
+# $Id$
+# $URL$
#
from PLC.Faults import *
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id:
+# $Id$
+# $URL$
#
from types import StringTypes
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from PLC.Faults import *
from PLC.Filter import Filter
from PLC.Debug import profile
from PLC.Table import Row, Table
-from PLC.NodeNetworks import valid_ip, NodeNetwork, NodeNetworks
+from PLC.Interfaces import valid_ip, Interface, Interfaces
from PLC.Nodes import Node, Nodes
class PCU(Row):
+# $Id$
+# $URL$
# Marc E. Fiuczynski <mef@cs.princeton.edu>
# Copyright (C) 2004 The Trustees of Princeton University
#
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from types import *
sub-parameters (i.e., dict fields).
"""
- def __init__(self, type, doc = "",
+ def __init__(self, typeval, doc = "",
min = None, max = None,
optional = None,
ro = False,
nullok = False):
# Basic type of the parameter. Must be a builtin type
# that can be marshalled by XML-RPC.
- self.type = type
+ self.type = typeval
# Documentation string for the parameter
self.doc = doc
+# $Id$
+# $URL$
#
# Thierry Parmentelat - INRIA
#
from PLC.Persons import Person, Persons
from PLC.Keys import Key, Keys
from PLC.Nodes import Node, Nodes
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-from PLC.SliceAttributes import SliceAttribute, SliceAttributes
+from PLC.TagTypes import TagType, TagTypes
+from PLC.SliceTags import SliceTag, SliceTags
from PLC.Slices import Slice, Slices
class Peer(Row):
table_name = 'peers'
primary_key = 'peer_id'
- join_tables = ['peer_site', 'peer_person', 'peer_key', 'peer_node',
- 'peer_slice_attribute_type', 'peer_slice_attribute', 'peer_slice']
+ join_tables = ['peer_site', 'peer_person', 'peer_key', 'peer_node', 'peer_slice']
fields = {
- 'peer_id': Parameter (int, "Peer identifier"),
- 'peername': Parameter (str, "Peer name"),
- 'peer_url': Parameter (str, "Peer API URL"),
- 'key': Parameter(str, "Peer GPG public key"),
- 'cacert': Parameter(str, "Peer SSL public certificate"),
+ 'peer_id': Parameter (int, "Peer identifier"),
+ 'peername': Parameter (str, "Peer name"),
+ 'peer_url': Parameter (str, "Peer API URL"),
+ 'key': Parameter(str, "Peer GPG public key"),
+ 'cacert': Parameter(str, "Peer SSL public certificate"),
+ 'shortname' : Parameter(str, "Peer short name"),
+ 'hrn_root' : Parameter(str, "Root of this peer in a hierarchical naming space"),
### cross refs
'site_ids': Parameter([int], "List of sites for which this peer is authoritative"),
'person_ids': Parameter([int], "List of users for which this peer is authoritative"),
return peername
def validate_peer_url(self, url):
- """
- Validate URL. Must be HTTPS.
- """
+ """
+ Validate URL. Must be HTTPS.
+ """
(scheme, netloc, path, params, query, fragment) = urlparse(url)
if scheme != "https":
raise PLCInvalidArgument, "Peer URL scheme must be https"
-
+ if path[-1] != '/':
+ raise PLCInvalidArgument, "Peer URL should end with /"
+
return url
def delete(self, commit = True):
- """
- Deletes this peer and all related entities.
- """
+ """
+ Deletes this peer and all related entities.
+ """
- assert 'peer_id' in self
+ assert 'peer_id' in self
# Remove all related entities
for obj in \
obj.delete(commit = False)
# Mark as deleted
- self['deleted'] = True
- self.sync(commit)
+ self['deleted'] = True
+ self.sync(commit)
def add_site(self, site, peer_site_id, commit = True):
"""
'peer_site_id': peer_site_id},
commit = commit)
+ def remove_site(self, site, commit = True):
+ """
+ Unassociate a site with this peer.
+ """
+
+ remove = Row.remove_object(Site, 'peer_site')
+ remove(self, site, commit)
+
def add_person(self, person, peer_person_id, commit = True):
"""
Associate a local user entry with this peer.
'person_id': person['person_id'],
'peer_person_id': peer_person_id},
commit = commit)
+
+ def remove_person(self, person, commit = True):
+ """
+ Unassociate a site with this peer.
+ """
+
+ remove = Row.remove_object(Person, 'peer_person')
+ remove(self, person, commit)
def add_key(self, key, peer_key_id, commit = True):
"""
'peer_key_id': peer_key_id},
commit = commit)
+ def remove_key(self, key, commit = True):
+ """
+ Unassociate a key with this peer.
+ """
+
+ remove = Row.remove_object(Key, 'peer_key')
+ remove(self, key, commit)
+
def add_node(self, node, peer_node_id, commit = True):
"""
Associate a local node entry with this peer.
'peer_node_id': peer_node_id},
commit = commit)
+ def remove_node(self, node, commit = True):
+ """
+ Unassociate a node with this peer.
+ """
+
+ remove = Row.remove_object(Node, 'peer_node')
+ remove(self, node, commit)
+
def add_slice(self, slice, peer_slice_id, commit = True):
"""
Associate a local slice entry with this peer.
'peer_slice_id': peer_slice_id},
commit = commit)
+ def remove_slice(self, slice, commit = True):
+ """
+ Unassociate a slice with this peer.
+ """
+
+ remove = Row.remove_object(Slice, 'peer_slice')
+ remove(self, slice, commit)
+
def connect(self, **kwds):
"""
Connect to this peer via XML-RPC.
--- /dev/null
+# $Id: PersonTags.py 14587 2009-07-19 13:18:50Z thierry $
+# $URL: http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.3-27/PLC/PersonTags.py $
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 14587 $
+#
+from PLC.Faults import *
+from PLC.Parameter import Parameter
+from PLC.Filter import Filter
+from PLC.Table import Row, Table
+from PLC.TagTypes import TagType, TagTypes
+from PLC.Persons import Person
+
+class PersonTag(Row):
+ """
+ Representation of a row in the person_tag.
+ To use, instantiate with a dict of values.
+ """
+
+ table_name = 'person_tag'
+ primary_key = 'person_tag_id'
+ fields = {
+ 'person_tag_id': Parameter(int, "Person setting identifier"),
+ 'person_id': Person.fields['person_id'],
+ 'email': Person.fields['email'],
+ 'tag_type_id': TagType.fields['tag_type_id'],
+ 'tagname': TagType.fields['tagname'],
+ 'description': TagType.fields['description'],
+ 'category': TagType.fields['category'],
+ 'min_role_id': TagType.fields['min_role_id'],
+ 'value': Parameter(str, "Person setting value"),
+ ### relations
+
+ }
+
+class PersonTags(Table):
+ """
+ Representation of row(s) from the person_tag table in the
+ database.
+ """
+
+ def __init__(self, api, person_tag_filter = None, columns = None):
+ Table.__init__(self, api, PersonTag, columns)
+
+ sql = "SELECT %s FROM view_person_tags WHERE True" % \
+ ", ".join(self.columns)
+
+ if person_tag_filter is not None:
+ if isinstance(person_tag_filter, (list, tuple, set)):
+ person_tag_filter = Filter(PersonTag.fields, {'person_tag_id': person_tag_filter})
+ elif isinstance(person_tag_filter, dict):
+ person_tag_filter = Filter(PersonTag.fields, person_tag_filter)
+ elif isinstance(person_tag_filter, int):
+ person_tag_filter = Filter(PersonTag.fields, {'person_tag_id': [person_tag_filter]})
+ else:
+ raise PLCInvalidArgument, "Wrong person setting filter %r"%person_tag_filter
+ sql += " AND (%s) %s" % person_tag_filter.sql(api)
+
+
+ self.selectall(sql)
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from types import StringTypes
'slice_ids': Parameter([int], "List of slice identifiers"),
'peer_id': Parameter(int, "Peer to which this user belongs", nullok = True),
'peer_person_id': Parameter(int, "Foreign user identifier at peer", nullok = True),
+ 'person_tag_ids' : Parameter ([int], "List of tags attached to this person"),
}
related_fields = {
'roles': [Mixed(Parameter(int, "Role identifier"),
'slices': [Mixed(Parameter(int, "Slice identifier"),
Parameter(str, "Slice name"))]
}
-
-
-
- # for Cache
- class_key = 'email'
- foreign_fields = ['first_name', 'last_name', 'title', 'email', 'phone', 'url',
- 'bio', 'enabled', 'password', ]
- # forget about these ones, they are read-only anyway
- # handling them causes Cache to re-sync all over again
- # 'last_updated', 'date_created'
- foreign_xrefs = [
- {'field' : 'key_ids', 'class': 'Key', 'table' : 'person_key' } ,
- {'field' : 'site_ids', 'class': 'Site', 'table' : 'person_site'},
-# xxx this is not handled by Cache yet
-# 'role_ids': Parameter([int], "List of role identifiers"),
-]
+ view_tags_name = "view_person_tags"
+ # tags are used by the Add/Get/Update methods to expose tags
+ # this is initialized here and updated by the accessors factory
+ tags = { }
def validate_email(self, email):
"""
"""
invalid_email = PLCInvalidArgument("Invalid e-mail address")
- email_badchars = r'[][()<>|;^,\200-\377]'
- # Pretty minimal, cheesy check. We could do better...
- if not email or email.count(' ') > 0:
- raise invalid_email
- if re.search(email_badchars, email) or email[0] == '-':
+ if not email:
raise invalid_email
- email = email.lower()
- at_sign = email.find('@')
- if at_sign < 1:
- raise invalid_email
- user = email[:at_sign]
- rest = email[at_sign+1:]
- domain = rest.split('.')
-
- # This means local, unqualified addresses, are not allowed
- if not domain:
- raise invalid_email
- if len(domain) < 2:
+ email_re = re.compile('\A[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9._\-]+\.[a-zA-Z]+\Z')
+ if not email_re.match(email):
raise invalid_email
# check only against users on the same peer
if 'pi' in self['roles']:
if set(self['site_ids']).intersection(person['site_ids']):
- # Can update people with higher role IDs
- return min(self['role_ids']) < min(person['role_ids'])
+ # Can update person is neither a PI or ADMIN
+ return (not (('pi' in person['roles']) or ('admin' in person['roles'])))
return False
if 'pi' in self['roles']:
if set(self['site_ids']).intersection(person['site_ids']):
# Can view people with equal or higher role IDs
- return min(self['role_ids']) <= min(person['role_ids'])
+ return 'admin' not in person['roles']
return False
assert 'person_id' in self
assert isinstance(value, list)
- (role_ids, roles_names) = self.separate_types(value)[0:2]
+ (role_ids, role_names) = self.separate_types(value)[0:2]
# Translate roles into role_ids
- if roles_names:
- roles = Roles(self.api, role_names, ['role_id']).dict('role_id')
+ if role_names:
+ roles = Roles(self.api, role_names).dict('role_id')
role_ids += roles.keys()
# Add new ids, remove stale ids
def __init__(self, api, person_filter = None, columns = None):
Table.__init__(self, api, Person, columns)
- #sql = "SELECT %s FROM view_persons WHERE deleted IS False" % \
- # ", ".join(self.columns)
- foreign_fields = {'role_ids': ('role_id', 'person_role'),
- 'roles': ('name', 'roles'),
- 'site_ids': ('site_id', 'person_site'),
- 'key_ids': ('key_id', 'person_key'),
- 'slice_ids': ('slice_id', 'slice_person')
- }
- foreign_keys = {}
- db_fields = filter(lambda field: field not in foreign_fields.keys(), Person.fields.keys())
- all_fields = db_fields + [value[0] for value in foreign_fields.values()]
- fields = []
- _select = "SELECT "
- _from = " FROM persons "
- _join = " LEFT JOIN peer_person USING (person_id) "
- _where = " WHERE deleted IS False "
-
- if not columns:
- # include all columns
- fields = all_fields
- tables = [value[1] for value in foreign_fields.values()]
- tables.sort()
- for key in foreign_fields.keys():
- foreign_keys[foreign_fields[key][0]] = key
- for table in tables:
- if table in ['roles']:
- _join += " LEFT JOIN roles USING(role_id) "
- else:
- _join += " LEFT JOIN %s USING (person_id) " % (table)
- else:
- tables = set()
- columns = filter(lambda column: column in db_fields+foreign_fields.keys(), columns)
- columns.sort()
- for column in columns:
- if column in foreign_fields.keys():
- (field, table) = foreign_fields[column]
- foreign_keys[field] = column
- fields += [field]
- tables.add(table)
- if column in ['roles']:
- _join += " LEFT JOIN roles USING(role_id) "
- else:
- _join += " LEFT JOIN %s USING (person_id)" % \
- (foreign_fields[column][1])
-
- else:
- fields += [column]
-
- # postgres will return timestamps as datetime objects.
- # XMLPRC cannot marshal datetime so convert to int
- timestamps = ['date_created', 'last_updated', 'verification_expires']
- for field in fields:
- if field in timestamps:
- fields[fields.index(field)] = \
- "CAST(date_part('epoch', %s) AS bigint) AS %s" % (field, field)
-
- _select += ", ".join(fields)
- sql = _select + _from + _join + _where
-
- # deal with filter
+
+ view = "view_persons"
+ for tagname in self.tag_columns:
+ view= "%s left join %s using (%s)"%(view,Person.tagvalue_view_name(tagname),
+ Person.primary_key)
+
+ sql = "SELECT %s FROM %s WHERE deleted IS False" % \
+ (", ".join(self.columns.keys()+self.tag_columns.keys()),view)
+
if person_filter is not None:
if isinstance(person_filter, (list, tuple, set)):
# Separate the list into integers and strings
else:
raise PLCInvalidArgument, "Wrong person filter %r"%person_filter
- # aggregate data
- all_persons = {}
- for row in self.api.db.selectall(sql):
- person_id = row['person_id']
-
- if all_persons.has_key(person_id):
- for (key, key_list) in foreign_keys.items():
- data = row.pop(key)
- row[key_list] = [data]
- if data and data not in all_persons[person_id][key_list]:
- all_persons[person_id][key_list].append(data)
- else:
- for key in foreign_keys.keys():
- value = row.pop(key)
- if value:
- row[foreign_keys[key]] = [value]
- else:
- row[foreign_keys[key]] = []
- if row:
- all_persons[person_id] = row
-
- # populate self
- for row in all_persons.values():
- obj = self.classobj(self.api, row)
- self.append(obj)
-
+ self.selectall(sql)
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
import psycopg2
def __init__(self, api):
self.api = api
self.debug = False
+# self.debug = True
self.connection = None
def cursor(self):
self.connection.close()
self.connection = None
+ # join insists on getting strings
+ @classmethod
+ def quote_string(self, value):
+ return str(PostgreSQL.quote(value))
+
+ @classmethod
def quote(self, value):
"""
Returns quoted version of the specified value.
# The pgdb._quote function is good enough for general SQL
# quoting, except for array types.
if isinstance(value, (list, tuple, set)):
- return "ARRAY[%s]" % ", ".join(map, self.quote, value)
+ return "ARRAY[%s]" % ", ".join(map (PostgreSQL.quote_string, value))
else:
return pgdb._quote(value)
- quote = classmethod(quote)
-
+ @classmethod
def param(self, name, value):
# None is converted to the unquoted string NULL
if isinstance(value, NoneType):
return '%(' + name + ')' + conversion
- param = classmethod(param)
-
def begin_work(self):
# Implicit in pgdb.connect()
pass
cursor.close()
return self.rowcount
+ def next_id(self, table_name, primary_key):
+ sequence = "%(table_name)s_%(primary_key)s_seq" % locals()
+ sql = "SELECT nextval('%(sequence)s')" % locals()
+ rows = self.selectall(sql, hashref = False)
+ if rows:
+ return rows[0][0]
+
+ return None
+
def last_insert_id(self, table_name, primary_key):
if isinstance(self.lastrowid, int):
sql = "SELECT %s FROM %s WHERE oid = %d" % \
return None
+ # modified for psycopg2-2.0.7
+ # executemany is undefined for SELECT's
+ # see http://www.python.org/dev/peps/pep-0249/
+ # accepts either None, a single dict, a tuple of single dict - in which case it execute's
+ # or a tuple of several dicts, in which case it executemany's
def execute(self, query, params = None):
- return self.execute_array(query, (params,))
- def execute_array(self, query, param_seq):
cursor = self.cursor()
try:
- if self.debug:
- for params in param_seq:
- if params:
- print >> log, query % params
- else:
- print >> log, query
# psycopg2 requires %()s format for all parameters,
# regardless of type.
+ # this needs to be done carefully though as with pattern-based filters
+ # we might have percents embedded in the query
+ # so e.g. GetPersons({'email':'*fake*'}) was resulting in .. LIKE '%sake%'
if psycopg2:
query = re.sub(r'(%\([^)]*\)|%)[df]', r'\1s', query)
-
- cursor.executemany(query, param_seq)
+ # rewrite wildcards set by Filter.py as '***' into '%'
+ query = query.replace ('***','%')
+
+ if not params:
+ if self.debug:
+ print >> log,'execute0',query
+ cursor.execute(query)
+ elif isinstance(params,dict):
+ if self.debug:
+ print >> log,'execute-dict: params',params,'query',query%params
+ cursor.execute(query,params)
+ elif isinstance(params,tuple) and len(params)==1:
+ if self.debug:
+ print >> log,'execute-tuple',query%params[0]
+ cursor.execute(query,params[0])
+ else:
+ param_seq=(params,)
+ if self.debug:
+ for params in param_seq:
+ print >> log,'executemany',query%params
+ cursor.executemany(query, param_seq)
(self.rowcount, self.description, self.lastrowid) = \
(cursor.rowcount, cursor.description, cursor.lastrowid)
except Exception, e:
print >> log, "Query:"
print >> log, query
print >> log, "Params:"
- print >> log, pformat(param_seq[0])
+ print >> log, pformat(params)
raise PLCDBError("Please contact " + \
self.api.config.PLC_NAME + " Support " + \
"<" + self.api.config.PLC_MAIL_SUPPORT_ADDRESS + ">" + \
cursor = self.execute(query, params)
rows = cursor.fetchall()
cursor.close()
-
+ self.commit()
if hashref or key_field is not None:
# Return each row as a dictionary keyed on field name
# (like DBI selectrow_hashref()).
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
import os
class PyCurlTransport(xmlrpclib.Transport):
def __init__(self, uri, cert = None, timeout = 300):
- xmlrpclib.Transport.__init__(self)
+ if hasattr(xmlrpclib.Transport,'__init__'):
+ xmlrpclib.Transport.__init__(self)
self.curl = pycurl.Curl()
# Suppress signals
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from types import StringTypes
table_name = 'roles'
primary_key = 'role_id'
- join_tables = ['person_role', ('slice_attribute_types', 'min_role_id')]
+ join_tables = ['person_role', ('tag_types', 'min_role_id')]
fields = {
'role_id': Parameter(int, "Role identifier"),
'name': Parameter(str, "Role", max = 100),
+# $Id$
+# $URL$
from types import StringTypes
import random
import base64
# Copyright (C) 2005 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
import os
if role is not None:
self.auth['Role'] = role
- for method in PLC.Methods.methods:
+ for method in PLC.API.PLCAPI.all_methods:
api_function = self.api.callable(method)
if self.server is None:
--- /dev/null
+# $Id: SiteTags.py 14587 2009-07-19 13:18:50Z thierry $
+# $URL: http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.3-27/PLC/SiteTags.py $
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 14587 $
+#
+from PLC.Faults import *
+from PLC.Parameter import Parameter
+from PLC.Filter import Filter
+from PLC.Table import Row, Table
+from PLC.TagTypes import TagType, TagTypes
+from PLC.Sites import Site
+
+class SiteTag(Row):
+ """
+ Representation of a row in the site_tag.
+ To use, instantiate with a dict of values.
+ """
+
+ table_name = 'site_tag'
+ primary_key = 'site_tag_id'
+ fields = {
+ 'site_tag_id': Parameter(int, "Site setting identifier"),
+ 'site_id': Site.fields['site_id'],
+ 'login_base': Site.fields['login_base'],
+ 'tag_type_id': TagType.fields['tag_type_id'],
+ 'tagname': TagType.fields['tagname'],
+ 'description': TagType.fields['description'],
+ 'category': TagType.fields['category'],
+ 'min_role_id': TagType.fields['min_role_id'],
+ 'value': Parameter(str, "Site setting value"),
+ ### relations
+
+ }
+
+class SiteTags(Table):
+ """
+ Representation of row(s) from the site_tag table in the
+ database.
+ """
+
+ def __init__(self, api, site_tag_filter = None, columns = None):
+ Table.__init__(self, api, SiteTag, columns)
+
+ sql = "SELECT %s FROM view_site_tags WHERE True" % \
+ ", ".join(self.columns)
+
+ if site_tag_filter is not None:
+ if isinstance(site_tag_filter, (list, tuple, set)):
+ site_tag_filter = Filter(SiteTag.fields, {'site_tag_id': site_tag_filter})
+ elif isinstance(site_tag_filter, dict):
+ site_tag_filter = Filter(SiteTag.fields, site_tag_filter)
+ elif isinstance(site_tag_filter, int):
+ site_tag_filter = Filter(SiteTag.fields, {'site_tag_id': [site_tag_filter]})
+ else:
+ raise PLCInvalidArgument, "Wrong site setting filter %r"%site_tag_filter
+ sql += " AND (%s) %s" % site_tag_filter.sql(api)
+
+
+ self.selectall(sql)
+# $Id$
+# $URL$
from types import StringTypes
import string
'node_ids': Parameter([int], "List of site node identifiers"),
'peer_id': Parameter(int, "Peer to which this site belongs", nullok = True),
'peer_site_id': Parameter(int, "Foreign site identifier at peer", nullok = True),
+ 'site_tag_ids' : Parameter ([int], "List of tags attached to this site"),
'ext_consortium_id': Parameter(int, "external consortium id", nullok = True)
}
related_fields = {
'addresses': [Mixed(Parameter(int, "Address identifer"),
Filter(Address.fields))]
}
- # for Cache
- class_key = 'login_base'
- foreign_fields = ['abbreviated_name', 'name', 'is_public', 'latitude', 'longitude',
- 'url', 'max_slices', 'max_slivers',
- ]
- # forget about these ones, they are read-only anyway
- # handling them causes Cache to re-sync all over again
- # 'last_updated', 'date_created'
- foreign_xrefs = []
+ view_tags_name = "view_site_tags"
+ # tags are used by the Add/Get/Update methods to expose tags
+ # this is initialized here and updated by the accessors factory
+ tags = { }
def validate_name(self, name):
if not len(name):
def __init__(self, api, site_filter = None, columns = None):
Table.__init__(self, api, Site, columns)
-
- sql = "SELECT %s FROM view_sites WHERE deleted IS False" % \
- ", ".join(self.columns)
+
+ view = "view_sites"
+ for tagname in self.tag_columns:
+ view= "%s left join %s using (%s)"%(view,Site.tagvalue_view_name(tagname),
+ Site.primary_key)
+
+ sql = "SELECT %s FROM %s WHERE deleted IS False" % \
+ (", ".join(self.columns.keys()+self.tag_columns.keys()),view)
if site_filter is not None:
if isinstance(site_filter, (list, tuple, set)):
+++ /dev/null
-from types import StringTypes
-
-from PLC.Faults import *
-from PLC.Parameter import Parameter
-from PLC.Filter import Filter
-from PLC.Table import Row, Table
-from PLC.Roles import Role, Roles
-
-class SliceAttributeType(Row):
- """
- Representation of a row in the slice_attribute_types table. To
- use, instantiate with a dict of values.
- """
-
- table_name = 'slice_attribute_types'
- primary_key = 'attribute_type_id'
- join_tables = ['slice_attribute']
- fields = {
- 'attribute_type_id': Parameter(int, "Slice attribute type identifier"),
- 'name': Parameter(str, "Slice attribute type name", max = 100),
- 'description': Parameter(str, "Slice attribute type description", max = 254),
- 'min_role_id': Parameter(int, "Minimum (least powerful) role that can set or change this attribute"),
- }
-
- # for Cache
- class_key = 'name'
- foreign_fields = ['description','min_role_id']
- foreign_xrefs = []
-
- def validate_name(self, name):
- if not len(name):
- raise PLCInvalidArgument, "Slice attribute type name must be set"
-
- conflicts = SliceAttributeTypes(self.api, [name])
- for attribute in conflicts:
- if 'attribute_type_id' not in self or \
- self['attribute_type_id'] != attribute['attribute_type_id']:
- raise PLCInvalidArgument, "Slice attribute type name already in use"
-
- return name
-
- def validate_min_role_id(self, role_id):
- roles = [row['role_id'] for row in Roles(self.api)]
- if role_id not in roles:
- raise PLCInvalidArgument, "Invalid role"
-
- return role_id
-
-class SliceAttributeTypes(Table):
- """
- Representation of row(s) from the slice_attribute_types table in the
- database.
- """
-
- def __init__(self, api, attribute_type_filter = None, columns = None):
- Table.__init__(self, api, SliceAttributeType, columns)
-
- sql = "SELECT %s FROM slice_attribute_types WHERE True" % \
- ", ".join(self.columns)
-
- if attribute_type_filter is not None:
- if isinstance(attribute_type_filter, (list, tuple, set)):
- # Separate the list into integers and strings
- ints = filter(lambda x: isinstance(x, (int, long)), attribute_type_filter)
- strs = filter(lambda x: isinstance(x, StringTypes), attribute_type_filter)
- attribute_type_filter = Filter(SliceAttributeType.fields, {'attribute_type_id': ints, 'name': strs})
- sql += " AND (%s) %s" % attribute_type_filter.sql(api, "OR")
- elif isinstance(attribute_type_filter, dict):
- attribute_type_filter = Filter(SliceAttributeType.fields, attribute_type_filter)
- sql += " AND (%s) %s" % attribute_type_filter.sql(api, "AND")
-
- self.selectall(sql)
+++ /dev/null
-from PLC.Faults import *
-from PLC.Parameter import Parameter
-from PLC.Filter import Filter
-from PLC.Table import Row, Table
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-
-class SliceAttribute(Row):
- """
- Representation of a row in the slice_attribute table. To use,
- instantiate with a dict of values.
- """
-
- table_name = 'slice_attribute'
- primary_key = 'slice_attribute_id'
- fields = {
- 'slice_attribute_id': Parameter(int, "Slice attribute identifier"),
- 'slice_id': Parameter(int, "Slice identifier"),
- 'node_id': Parameter(int, "Node identifier, if a sliver attribute"),
- 'nodegroup_id': Parameter(int, "Nodegroup identifier, if a sliver attribute"),
- 'attribute_type_id': SliceAttributeType.fields['attribute_type_id'],
- 'name': SliceAttributeType.fields['name'],
- 'description': SliceAttributeType.fields['description'],
- 'min_role_id': SliceAttributeType.fields['min_role_id'],
- 'value': Parameter(str, "Slice attribute value"),
- }
-
-class SliceAttributes(Table):
- """
- Representation of row(s) from the slice_attribute table in the
- database.
- """
-
- def __init__(self, api, slice_attribute_filter = None, columns = None):
- Table.__init__(self, api, SliceAttribute, columns)
-
- sql = "SELECT %s FROM view_slice_attributes WHERE True" % \
- ", ".join(self.columns)
-
- if slice_attribute_filter is not None:
- if isinstance(slice_attribute_filter, (list, tuple, set)):
- slice_attribute_filter = Filter(SliceAttribute.fields, {'slice_attribute_id': slice_attribute_filter})
- elif isinstance(slice_attribute_filter, dict):
- slice_attribute_filter = Filter(SliceAttribute.fields, slice_attribute_filter)
- sql += " AND (%s) %s" % slice_attribute_filter.sql(api)
-
- self.selectall(sql)
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from PLC.Faults import *
--- /dev/null
+# $Id$
+# $URL$
+from PLC.Faults import *
+from PLC.Parameter import Parameter
+from PLC.Filter import Filter
+from PLC.Table import Row, Table
+# seems to cause import loops
+#from PLC.Slices import Slice, Slices
+from PLC.Nodes import Node, Nodes
+from PLC.NodeGroups import NodeGroup, NodeGroups
+from PLC.TagTypes import TagType, TagTypes
+
+class SliceTag(Row):
+ """
+ Representation of a row in the slice_tag table. To use,
+ instantiate with a dict of values.
+ """
+
+ table_name = 'slice_tag'
+ primary_key = 'slice_tag_id'
+ fields = {
+ 'slice_tag_id': Parameter(int, "Slice tag identifier"),
+ 'slice_id': Parameter(int, "Slice identifier"),
+ 'name': Parameter(str, "Slice name"),
+ 'node_id': Node.fields['node_id'],
+ 'nodegroup_id': NodeGroup.fields['nodegroup_id'],
+ 'tag_type_id': TagType.fields['tag_type_id'],
+ 'tagname': TagType.fields['tagname'],
+ 'description': TagType.fields['description'],
+ 'category': TagType.fields['category'],
+ 'min_role_id': TagType.fields['min_role_id'],
+ 'value': Parameter(str, "Slice attribute value"),
+ }
+
+class SliceTags(Table):
+ """
+ Representation of row(s) from the slice_tag table in the
+ database.
+ """
+
+ def __init__(self, api, slice_tag_filter = None, columns = None):
+ Table.__init__(self, api, SliceTag, columns)
+
+ sql = "SELECT %s FROM view_slice_tags WHERE True" % \
+ ", ".join(self.columns)
+
+ if slice_tag_filter is not None:
+ if isinstance(slice_tag_filter, (list, tuple, set)):
+ slice_tag_filter = Filter(SliceTag.fields, {'slice_tag_id': slice_tag_filter})
+ elif isinstance(slice_tag_filter, dict):
+ slice_tag_filter = Filter(SliceTag.fields, slice_tag_filter)
+ sql += " AND (%s) %s" % slice_tag_filter.sql(api)
+
+ self.selectall(sql)
+# $Id$
+# $URL$
from types import StringTypes
import time
import re
from PLC.SliceInstantiations import SliceInstantiation, SliceInstantiations
from PLC.Nodes import Node
from PLC.Persons import Person, Persons
-from PLC.SliceAttributes import SliceAttribute
+from PLC.SliceTags import SliceTag
class Slice(Row):
"""
table_name = 'slices'
primary_key = 'slice_id'
- join_tables = ['slice_node', 'slice_person', 'slice_attribute', 'peer_slice', 'node_slice_whitelist']
+ join_tables = ['slice_node', 'slice_person', 'slice_tag', 'peer_slice', 'node_slice_whitelist']
fields = {
'slice_id': Parameter(int, "Slice identifier"),
'site_id': Parameter(int, "Identifier of the site to which this slice belongs"),
'expires': Parameter(int, "Date and time when slice expires, in seconds since UNIX epoch"),
'node_ids': Parameter([int], "List of nodes in this slice", ro = True),
'person_ids': Parameter([int], "List of accounts that can use this slice", ro = True),
- 'slice_attribute_ids': Parameter([int], "List of slice attributes", ro = True),
+ 'slice_tag_ids': Parameter([int], "List of slice attributes", ro = True),
'peer_id': Parameter(int, "Peer to which this slice belongs", nullok = True),
'peer_slice_id': Parameter(int, "Foreign slice identifier at peer", nullok = True),
}
'nodes': [Mixed(Parameter(int, "Node identifier"),
Parameter(str, "Fully qualified hostname"))]
}
- # for Cache
- class_key = 'name'
- foreign_fields = ['instantiation', 'url', 'description', 'max_nodes', 'expires']
- foreign_xrefs = [
- {'field': 'node_ids' , 'class': 'Node', 'table': 'slice_node' },
- {'field': 'person_ids', 'class': 'Person', 'table': 'slice_person'},
- {'field': 'creator_person_id', 'class': 'Person', 'table': 'unused-on-direct-refs'},
- {'field': 'site_id', 'class': 'Site', 'table': 'unused-on-direct-refs'},
- ]
- # forget about this one, it is read-only anyway
- # handling it causes Cache to re-sync all over again
- # 'created'
+
+ view_tags_name="view_slice_tags"
+ tags = {}
def validate_name(self, name):
# N.B.: Responsibility of the caller to ensure that login_base
AddSliceToNodes.__call__(AddSliceToNodes(self.api), auth, self['slice_id'], list(new_nodes))
if stale_nodes:
DeleteSliceFromNodes.__call__(DeleteSliceFromNodes(self.api), auth, self['slice_id'], list(stale_nodes))
- def associate_slice_attributes(self, auth, fields, value):
+ def associate_slice_tags(self, auth, fields, value):
"""
- Deletes slice_attribute_ids not found in value list (using DeleteSliceAttribute).
- Adds slice_attributes if slice_fields w/o slice_id is found (using AddSliceAttribute).
- Updates slice_attribute if slice_fields w/ slice_id is found (using UpdateSlceiAttribute).
+ Deletes slice_tag_ids not found in value list (using DeleteSliceTag).
+ Adds slice_tags if slice_fields w/o slice_id is found (using AddSliceTag).
+ Updates slice_tag if slice_fields w/ slice_id is found (using UpdateSlceiAttribute).
"""
- assert 'slice_attribute_ids' in self
+ assert 'slice_tag_ids' in self
assert isinstance(value, list)
(attribute_ids, blank, attributes) = self.separate_types(value)
# There is no way to add attributes by id. They are
# associated with a slice when they are created.
# So we are only looking to delete here
- if self['slice_attribute_ids'] != attribute_ids:
- from PLC.Methods.DeleteSliceAttribute import DeleteSliceAttribute
- stale_attributes = set(self['slice_attribute_ids']).difference(attribute_ids)
+ if self['slice_tag_ids'] != attribute_ids:
+ from PLC.Methods.DeleteSliceTag import DeleteSliceTag
+ stale_attributes = set(self['slice_tag_ids']).difference(attribute_ids)
for stale_attribute in stale_attributes:
- DeleteSliceAttribute.__call__(DeleteSliceAttribute(self.api), auth, stale_attribute['slice_attribute_id'])
+ DeleteSliceTag.__call__(DeleteSliceTag(self.api), auth, stale_attribute['slice_tag_id'])
# If dictionary exists, we are either adding new
# attributes or updating existing ones.
if attributes:
- from PLC.Methods.AddSliceAttribute import AddSliceAttribute
- from PLC.Methods.UpdateSliceAttribute import UpdateSliceAttribute
+ from PLC.Methods.AddSliceTag import AddSliceTag
+ from PLC.Methods.UpdateSliceTag import UpdateSliceTag
- added_attributes = filter(lambda x: 'slice_attribute_id' not in x, attributes)
- updated_attributes = filter(lambda x: 'slice_attribute_id' in x, attributes)
+ added_attributes = filter(lambda x: 'slice_tag_id' not in x, attributes)
+ updated_attributes = filter(lambda x: 'slice_tag_id' in x, attributes)
for added_attribute in added_attributes:
- if 'attribute_type' in added_attribute:
- type = added_attribute['attribute_type']
- elif 'attribute_type_id' in added_attribute:
- type = added_attribute['attribute_type_id']
+ if 'tag_type' in added_attribute:
+ type = added_attribute['tag_type']
+ elif 'tag_type_id' in added_attribute:
+ type = added_attribute['tag_type_id']
else:
- raise PLCInvalidArgument, "Must specify attribute_type or attribute_type_id"
+ raise PLCInvalidArgument, "Must specify tag_type or tag_type_id"
if 'value' in added_attribute:
value = added_attribute['value']
else:
nodegroup_id = None
- AddSliceAttribute.__call__(AddSliceAttribute(self.api), auth, self['slice_id'], type, value, node_id, nodegroup_id)
+ AddSliceTag.__call__(AddSliceTag(self.api), auth, self['slice_id'], type, value, node_id, nodegroup_id)
for updated_attribute in updated_attributes:
- attribute_id = updated_attribute.pop('slice_attribute_id')
- if attribute_id not in self['slice_attribute_ids']:
+ attribute_id = updated_attribute.pop('slice_tag_id')
+ if attribute_id not in self['slice_tag_ids']:
raise PLCInvalidArgument, "Attribute doesnt belong to this slice"
else:
- UpdateSliceAttribute.__call__(UpdateSliceAttribute(self.api), auth, attribute_id, updated_attribute)
+ UpdateSliceTag.__call__(UpdateSliceTag(self.api), auth, attribute_id, updated_attribute)
def sync(self, commit = True):
"""
def __init__(self, api, slice_filter = None, columns = None, expires = int(time.time())):
Table.__init__(self, api, Slice, columns)
- sql = "SELECT %s FROM view_slices WHERE is_deleted IS False" % \
- ", ".join(self.columns)
+ # the view that we're selecting upon: start with view_slices
+ view = "view_slices"
+ # as many left joins as requested tags
+ for tagname in self.tag_columns:
+ view= "%s left join %s using (%s)"%(view,Slice.tagvalue_view_name(tagname),
+ Slice.primary_key)
+
+ sql = "SELECT %s FROM %s WHERE is_deleted IS False" % \
+ (", ".join(self.columns.keys()+self.tag_columns.keys()),view)
if expires is not None:
if expires >= 0:
-from types import StringTypes
+# $Id$
+# $URL$
+from types import StringTypes, IntType, LongType
import time
import calendar
"""
# Set this to the name of the table that stores the row.
+ # e.g. table_name = "nodes"
table_name = None
# Set this to the name of the primary key of the table. It is
# assumed that the this key is a sequence if it is not set when
# sync() is called.
+ # e.g. primary_key="node_id"
primary_key = None
# Set this to the names of tables that reference this table's
# sync().
fields = {}
+ # The name of the view that extends objects with tags
+ # e.g. view_tags_name = "view_node_tags"
+ view_tags_name = None
+
+ # Set this to the set of tags that can be returned by the Get function
+ tags = {}
+
def __init__(self, api, fields = {}):
dict.__init__(self, fields)
self.api = api
+ # run the class_init initializer once
+ cls=self.__class__
+ if not hasattr(cls,'class_inited'):
+ cls.class_init (api)
+ cls.class_inited=True # actual value does not matter
def validate(self):
"""
def associate(self, *args):
"""
- Provides a means for high lvl api calls to associate objects
- using low lvl calls.
+ Provides a means for high level api calls to associate objects
+ using low level calls.
"""
if len(args) < 3:
remove_object = classmethod(remove_object)
+ # convenience: check in dict (self.fields or self.tags) that a key is writable
+ @staticmethod
+ def is_writable (key,value,dict):
+ # if not mentioned, assume it's writable (e.g. deleted ...)
+ if key not in dict: return True
+ # if mentioned but not linked to a Parameter object, idem
+ if not isinstance(dict[key], Parameter): return True
+ # if not marked ro, it's writable
+ if not dict[key].ro: return True
+ return False
+
def db_fields(self, obj = None):
"""
Return only those fields that can be set or updated directly
for this object, and are not marked as a read-only Parameter.
"""
- if obj is None:
- obj = self
+ if obj is None: obj = self
db_fields = self.api.db.fields(self.table_name)
- return dict(filter(lambda (key, value): \
- key in db_fields and \
- (key not in self.fields or \
- not isinstance(self.fields[key], Parameter) or \
- not self.fields[key].ro),
- obj.items()))
+ return dict ( [ (key,value) for (key,value) in obj.items()
+ if key in db_fields and
+ Row.is_writable(key,value,self.fields) ] )
+
+ def tag_fields (self, obj=None):
+ """
+ Return the fields of obj that are mentioned in tags
+ """
+ if obj is None: obj=self
+
+ return dict ( [ (key,value) for (key,value) in obj.iteritems()
+ if key in self.tags and Row.is_writable(key,value,self.tags) ] )
+
+ # takes as input a list of columns, sort native fields from tags
+ # returns 2 dicts and one list : fields, tags, rejected
+ @classmethod
+ def parse_columns (cls, columns):
+ (fields,tags,rejected)=({},{},[])
+ for column in columns:
+ if column in cls.fields: fields[column]=cls.fields[column]
+ elif column in cls.tags: tags[column]=cls.tags[column]
+ else: rejected.append(column)
+ return (fields,tags,rejected)
+
+ # compute the 'accepts' part of a method, from a list of column names, and a fields dict
+ # use exclude=True to exclude the column names instead
+ # typically accepted_fields (Node.fields,['hostname','model',...])
+ @staticmethod
+ def accepted_fields (update_columns, fields_dict, exclude=False):
+ result={}
+ for (k,v) in fields_dict.iteritems():
+ if (not exclude and k in update_columns) or (exclude and k not in update_columns):
+ result[k]=v
+ return result
+
+ # filter out user-provided fields that are not part of the declared acceptance list
+ # keep it separate from split_fields for simplicity
+ # typically check_fields (<user_provided_dict>,{'hostname':Parameter(str,...),'model':Parameter(..)...})
+ @staticmethod
+ def check_fields (user_dict, accepted_fields):
+# avoid the simple, but silent, version
+# return dict ([ (k,v) for (k,v) in user_dict.items() if k in accepted_fields ])
+ result={}
+ for (k,v) in user_dict.items():
+ if k in accepted_fields: result[k]=v
+ else: raise PLCInvalidArgument ('Trying to set/change unaccepted key %s'%k)
+ return result
+
+ # given a dict (typically passed to an Update method), we check and sort
+ # them against a list of dicts, e.g. [Node.fields, Node.related_fields]
+ # return is a list that contains n+1 dicts, last one has the rejected fields
+ @staticmethod
+ def split_fields (fields, dicts):
+ result=[]
+ for x in dicts: result.append({})
+ rejected={}
+ for (field,value) in fields.iteritems():
+ found=False
+ for i in range(len(dicts)):
+ candidate_dict=dicts[i]
+ if field in candidate_dict.keys():
+ result[i][field]=value
+ found=True
+ break
+ if not found: rejected[field]=value
+ result.append(rejected)
+ return result
+
+ ### class initialization : create tag-dependent cross view if needed
+ @classmethod
+ def tagvalue_view_name (cls, tagname):
+ return "tagvalue_view_%s_%s"%(cls.primary_key,tagname)
+
+ @classmethod
+ def tagvalue_view_create_sql (cls,tagname):
+ """
+ returns a SQL sentence that creates a view named after the primary_key and tagname,
+ with 2 columns
+ (*) column 1: primary_key
+ (*) column 2: actual tag value, renamed into tagname
+ """
+
+ if not cls.view_tags_name:
+ raise Exception, 'WARNING: class %s needs to set view_tags_name'%cls.__name__
+
+ table_name=cls.table_name
+ primary_key=cls.primary_key
+ view_tags_name=cls.view_tags_name
+ tagvalue_view_name=cls.tagvalue_view_name(tagname)
+ return 'CREATE OR REPLACE VIEW %(tagvalue_view_name)s ' \
+ 'as SELECT %(table_name)s.%(primary_key)s,%(view_tags_name)s.value as "%(tagname)s" ' \
+ 'from %(table_name)s right join %(view_tags_name)s using (%(primary_key)s) ' \
+ 'WHERE tagname = \'%(tagname)s\';'%locals()
+
+ @classmethod
+ def class_init (cls,api):
+ cls.tagvalue_views_create (api)
+
+ @classmethod
+ def tagvalue_views_create (cls,api):
+ if not cls.tags: return
+ for tagname in cls.tags.keys():
+ api.db.do(cls.tagvalue_view_create_sql (tagname))
+ api.db.commit()
def __eq__(self, y):
"""
if not self.has_key(self.primary_key) or \
keys == [self.primary_key] or \
insert is True:
+
+ # If primary key id is a serial int and it isnt included, get next id
+ if self.fields[self.primary_key].type in (IntType, LongType) and \
+ self.primary_key not in self:
+ pk_id = self.api.db.next_id(self.table_name, self.primary_key)
+ self[self.primary_key] = pk_id
+ db_fields[self.primary_key] = pk_id
+ keys = db_fields.keys()
+ values = [self.api.db.param(key, value) for (key, value) in db_fields.items()]
# Insert new row
sql = "INSERT INTO %s (%s) VALUES (%s)" % \
(self.table_name, ", ".join(keys), ", ".join(values))
self.api.db.do(sql, db_fields)
- if not self.has_key(self.primary_key):
- self[self.primary_key] = self.api.db.last_insert_id(self.table_name, self.primary_key)
-
if commit:
self.api.db.commit()
if columns is None:
columns = classobj.fields
+ tag_columns={}
else:
- columns = filter(lambda x: x in classobj.fields, columns)
- if not columns:
- raise PLCInvalidArgument, "No valid return fields specified"
+ (columns,tag_columns,rejected) = classobj.parse_columns(columns)
+ if not columns and not tag_columns:
+ raise PLCInvalidArgument, "No valid return fields specified for class %s"%classobj.__name__
+ if rejected:
+ raise PLCInvalidArgument, "unknown column(s) specified %r in %s"%(rejected,classobj.__name__)
self.columns = columns
+ self.tag_columns = tag_columns
def sync(self, commit = True):
"""
--- /dev/null
+# $Id$
+# $URL$
+#
+# Thierry Parmentelat - INRIA
+#
+# $Revision: 9423 $
+#
+from types import StringTypes
+
+from PLC.Faults import *
+from PLC.Parameter import Parameter
+from PLC.Filter import Filter
+from PLC.Table import Row, Table
+from PLC.Roles import Role, Roles
+
+# xxx todo : deleting a tag type should delete the related nodegroup(s)
+
+class TagType (Row):
+
+ """
+ Representation of a row in the tag_types table.
+ """
+
+ table_name = 'tag_types'
+ primary_key = 'tag_type_id'
+ join_tables = ['node_tag', 'interface_tag', 'slice_tag', 'site_tag', 'person_tag' ]
+ fields = {
+ 'tag_type_id': Parameter(int, "Node tag type identifier"),
+ 'tagname': Parameter(str, "Node tag type name", max = 100),
+ 'description': Parameter(str, "Node tag type description", max = 254),
+ 'category' : Parameter (str, "Node tag category", max=64, optional=True),
+ 'min_role_id': Parameter(int, "Minimum (least powerful) role that can set or change this attribute"),
+ }
+
+ def validate_name(self, name):
+ if not len(name):
+ raise PLCInvalidArgument, "node tag type name must be set"
+
+ conflicts = TagTypes(self.api, [name])
+ for tag_type in conflicts:
+ if 'tag_type_id' not in self or \
+ self['tag_type_id'] != tag_type['tag_type_id']:
+ raise PLCInvalidArgument, "node tag type name already in use"
+
+ return name
+
+ def validate_min_role_id(self, role_id):
+ roles = [row['role_id'] for row in Roles(self.api)]
+ if role_id not in roles:
+ raise PLCInvalidArgument, "Invalid role"
+
+ return role_id
+
+class TagTypes(Table):
+ """
+ Representation of row(s) from the tag_types table
+ in the database.
+ """
+
+ def __init__(self, api, tag_type_filter = None, columns = None):
+ Table.__init__(self, api, TagType, columns)
+
+ sql = "SELECT %s FROM tag_types WHERE True" % \
+ ", ".join(self.columns)
+
+ if tag_type_filter is not None:
+ if isinstance(tag_type_filter, (list, tuple, set)):
+ # Separate the list into integers and strings
+ ints = filter(lambda x: isinstance(x, (int, long)), tag_type_filter)
+ strs = filter(lambda x: isinstance(x, StringTypes), tag_type_filter)
+ tag_type_filter = Filter(TagType.fields, {'tag_type_id': ints, 'tagname': strs})
+ sql += " AND (%s) %s" % tag_type_filter.sql(api, "OR")
+ elif isinstance(tag_type_filter, dict):
+ tag_type_filter = Filter(TagType.fields, tag_type_filter)
+ sql += " AND (%s) %s" % tag_type_filter.sql(api, "AND")
+ elif isinstance (tag_type_filter, StringTypes):
+ tag_type_filter = Filter(TagType.fields, {'tagname':[tag_type_filter]})
+ sql += " AND (%s) %s" % tag_type_filter.sql(api, "AND")
+ else:
+ raise PLCInvalidArgument, "Wrong node tag type filter %r"%tag_type_filter
+
+ self.selectall(sql)
+++ /dev/null
-#!/usr/bin/python
-#
-# Test script utility class
-#
-# Mark Huang <mlhuang@cs.princeton.edu>
-# Copyright (C) 2006 The Trustees of Princeton University
-#
-# $Id$
-#
-
-from pprint import pprint
-from string import letters, digits, punctuation
-from traceback import print_exc
-from optparse import OptionParser
-import socket
-import base64
-import struct
-import os
-import xmlrpclib
-
-from PLC.Shell import Shell
-
-from random import Random
-random = Random()
-
-def randfloat(min = 0.0, max = 1.0):
- return float(min) + (random.random() * (float(max) - float(min)))
-
-def randint(min = 0, max = 1):
- return int(randfloat(min, max + 1))
-
-# See "2.2 Characters" in the XML specification:
-#
-# #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
-# avoiding
-# [#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDDF]
-#
-
-ascii_xml_chars = map(unichr, [0x9, 0xA])
-# xmlrpclib uses xml.parsers.expat, which always converts either '\r'
-# (#xD) or '\n' (#xA) to '\n'. So avoid using '\r', too, if this is
-# still the case.
-if xmlrpclib.loads(xmlrpclib.dumps(('\r',)))[0][0] == '\r':
- ascii_xml_chars.append('\r')
-ascii_xml_chars += map(unichr, xrange(0x20, 0x7F - 1))
-low_xml_chars = list(ascii_xml_chars)
-low_xml_chars += map(unichr, xrange(0x84 + 1, 0x86 - 1))
-low_xml_chars += map(unichr, xrange(0x9F + 1, 0xFF))
-valid_xml_chars = list(low_xml_chars)
-valid_xml_chars += map(unichr, xrange(0xFF + 1, 0xD7FF))
-valid_xml_chars += map(unichr, xrange(0xE000, 0xFDD0 - 1))
-valid_xml_chars += map(unichr, xrange(0xFDDF + 1, 0xFFFD))
-
-def randstr(length, pool = valid_xml_chars, encoding = "utf-8"):
- sample = random.sample(pool, min(length, len(pool)))
- while True:
- s = u''.join(sample)
- bytes = len(s.encode(encoding))
- if bytes > length:
- sample.pop()
- elif bytes < length:
- sample += random.sample(pool, min(length - bytes, len(pool)))
- random.shuffle(sample)
- else:
- break
- return s
-
-def randhostname():
- # 1. Each part begins and ends with a letter or number.
- # 2. Each part except the last can contain letters, numbers, or hyphens.
- # 3. Each part is between 1 and 64 characters, including the trailing dot.
- # 4. At least two parts.
- # 5. Last part can only contain between 2 and 6 letters.
- hostname = 'a' + randstr(61, letters + digits + '-') + '1.' + \
- 'b' + randstr(61, letters + digits + '-') + '2.' + \
- 'c' + randstr(5, letters)
- return hostname
-
-def randpath(length):
- parts = []
- for i in range(randint(1, 10)):
- parts.append(randstr(randint(1, 30), ascii_xml_chars))
- return u'/'.join(parts)[0:length]
-
-def randemail():
- return (randstr(100, letters + digits) + "@" + randhostname()).lower()
-
-def randkey(bits = 2048):
- ssh_key_types = ["ssh-dss", "ssh-rsa"]
- key_type = random.sample(ssh_key_types, 1)[0]
- return ' '.join([key_type,
- base64.b64encode(''.join(randstr(bits / 8).encode("utf-8"))),
- randemail()])
-
-def random_site():
- return {
- 'name': randstr(254),
- 'abbreviated_name': randstr(50),
- 'login_base': randstr(20, letters).lower(),
- 'latitude': int(randfloat(-90.0, 90.0) * 1000) / 1000.0,
- 'longitude': int(randfloat(-180.0, 180.0) * 1000) / 1000.0,
- }
-
-def random_address_type():
- return {
- 'name': randstr(20),
- 'description': randstr(254),
- }
-
-def random_address():
- return {
- 'line1': randstr(254),
- 'line2': randstr(254),
- 'line3': randstr(254),
- 'city': randstr(254),
- 'state': randstr(254),
- 'postalcode': randstr(64),
- 'country': randstr(128),
- }
-
-def random_person():
- return {
- 'first_name': randstr(128),
- 'last_name': randstr(128),
- 'email': randemail(),
- 'bio': randstr(254),
- # Accounts are disabled by default
- 'enabled': False,
- 'password': randstr(254),
- }
-
-def random_key(key_types):
- return {
- 'key_type': random.sample(key_types, 1)[0],
- 'key': randkey()
- }
-
-def random_nodegroup():
- return {
- 'name': randstr(50),
- 'description': randstr(200),
- }
-
-def random_node(boot_states):
- return {
- 'hostname': randhostname(),
- 'boot_state': random.sample(boot_states, 1)[0],
- 'model': randstr(255),
- 'version': randstr(64),
- }
-
-def random_nodenetwork(method, type):
- nodenetwork_fields = {
- 'method': method,
- 'type': type,
- 'bwlimit': randint(500000, 10000000),
- }
-
- if method != 'dhcp':
- ip = randint(0, 0xffffffff)
- netmask = (0xffffffff << randint(2, 31)) & 0xffffffff
- network = ip & netmask
- broadcast = ((ip & netmask) | ~netmask) & 0xffffffff
- gateway = randint(network + 1, broadcast - 1)
- dns1 = randint(0, 0xffffffff)
-
- for field in 'ip', 'netmask', 'network', 'broadcast', 'gateway', 'dns1':
- nodenetwork_fields[field] = socket.inet_ntoa(struct.pack('>L', locals()[field]))
-
- return nodenetwork_fields
-
-def random_pcu():
- return {
- 'hostname': randhostname(),
- 'ip': socket.inet_ntoa(struct.pack('>L', randint(0, 0xffffffff))),
- 'protocol': randstr(16),
- 'username': randstr(254),
- 'password': randstr(254),
- 'notes': randstr(254),
- 'model': randstr(32),
- }
-
-def random_conf_file():
- return {
- 'enabled': bool(randint()),
- 'source': randpath(255),
- 'dest': randpath(255),
- 'file_permissions': "%#o" % randint(0, 512),
- 'file_owner': randstr(32, letters + '_' + digits),
- 'file_group': randstr(32, letters + '_' + digits),
- 'preinstall_cmd': randpath(100),
- 'postinstall_cmd': randpath(100),
- 'error_cmd': randpath(100),
- 'ignore_cmd_errors': bool(randint()),
- 'always_update': bool(randint()),
- }
-
-def random_attribute_type(role_ids):
- return {
- 'name': randstr(100),
- 'description': randstr(254),
- 'min_role_id': random.sample(role_ids, 1)[0],
- }
-
-def random_slice(login_base):
- return {
- 'name': login_base + "_" + randstr(11, letters).lower(),
- 'url': "http://" + randhostname() + "/",
- 'description': randstr(2048),
- }
-
-class Test:
- tiny = {
- 'sites': 1,
- 'address_types': 1,
- 'addresses_per_site': 1,
- 'persons_per_site': 1,
- 'keys_per_person': 1,
- 'nodegroups': 1,
- 'nodes_per_site': 1,
- 'nodenetworks_per_node': 1,
- 'pcus_per_site': 1,
- 'conf_files': 1,
- 'attribute_types': 1,
- 'slices_per_site': 1,
- 'attributes_per_slice': 1,
- }
-
- default = {
- 'sites': 10,
- 'address_types': 2,
- 'addresses_per_site': 2,
- 'persons_per_site': 10,
- 'keys_per_person': 2,
- 'nodegroups': 10,
- 'nodes_per_site': 2,
- 'nodenetworks_per_node': 1,
- 'pcus_per_site': 1,
- 'conf_files': 10,
- 'attribute_types': 10,
- 'slices_per_site': 10,
- 'attributes_per_slice': 2,
- }
-
- def __init__(self, api, check = True, verbose = True):
- self.api = api
- self.check = check
- self.verbose = verbose
-
- self.site_ids = []
- self.address_type_ids = []
- self.address_ids = []
- self.person_ids = []
- self.key_ids = []
- self.nodegroup_ids = []
- self.node_ids = []
- self.nodenetwork_ids = []
- self.pcu_ids = []
- self.conf_file_ids = []
- self.attribute_type_ids = []
- self.slice_ids = []
- self.slice_attribute_ids = []
-
- def Run(self, **kwds):
- """
- Run a complete database and API consistency test. Populates
- the database with a set of random entities, updates them, then
- deletes them. Examples:
-
- test.Run() # Defaults
- test.Run(**Test.default) # Defaults
- test.Run(**Test.tiny) # Tiny set
- test.Run(sites = 123, slices_per_site = 4) # Defaults with overrides
- """
-
- try:
- self.Add(**kwds)
- self.Update()
- finally:
- self.Delete()
-
- def Add(self, **kwds):
- """
- Populate the database with a set of random entities. Examples:
-
- test.populate() # Defaults
- test.populate(Test.tiny) # Tiny set
- test.populate(sites = 123, slices_per_site = 4) # Defaults with overrides
- """
-
- params = self.default.copy()
- params.update(kwds)
-
- self.AddSites(params['sites'])
- self.AddAddressTypes(params['address_types'])
- self.AddAddresses(params['addresses_per_site'])
- self.AddPersons(params['persons_per_site'])
- self.AddKeys(params['keys_per_person'])
- self.AddNodeGroups(params['nodegroups'])
- self.AddNodes(params['nodes_per_site'])
- self.AddNodeNetworks(params['nodenetworks_per_node'])
- self.AddPCUs(params['pcus_per_site'])
- self.AddConfFiles(params['conf_files'])
- self.AddSliceAttributeTypes(params['attribute_types'])
- self.AddSlices(params['slices_per_site'])
- self.AddSliceAttributes(params['attributes_per_slice'])
-
- def Update(self):
- self.UpdateSites()
- self.UpdateAddressTypes()
- self.UpdateAddresses()
- self.UpdatePersons()
- self.UpdateKeys()
- self.UpdateNodeGroups()
- self.UpdateNodes()
- self.UpdateNodeNetworks()
- self.UpdatePCUs()
- self.UpdateConfFiles()
- self.UpdateSliceAttributeTypes()
- self.UpdateSlices()
- self.UpdateSliceAttributes()
-
- def Delete(self):
- self.DeleteSliceAttributes()
- self.DeleteSlices()
- self.DeleteSliceAttributeTypes()
- self.DeleteKeys()
- self.DeleteConfFiles()
- self.DeletePCUs()
- self.DeleteNodeNetworks()
- self.DeleteNodes()
- self.DeletePersons()
- self.DeleteNodeGroups()
- self.DeleteAddresses()
- self.DeleteAddressTypes()
- self.DeleteSites()
-
- def AddSites(self, n = 10):
- """
- Add a number of random sites.
- """
-
- for i in range(n):
- # Add site
- site_fields = random_site()
- site_id = self.api.AddSite(site_fields)
-
- # Should return a unique site_id
- assert site_id not in self.site_ids
- self.site_ids.append(site_id)
-
- # Enable slice creation
- site_fields['max_slices'] = randint(1, 10)
- self.api.UpdateSite(site_id, site_fields)
-
- if self.check:
- # Check site
- site = self.api.GetSites([site_id])[0]
- for field in site_fields:
- assert site[field] == site_fields[field]
-
- if self.verbose:
- print "Added site", site_id
-
- def UpdateSites(self):
- """
- Make random changes to any sites we may have added.
- """
-
- for site_id in self.site_ids:
- # Update site
- site_fields = random_site()
- # Do not change login_base
- if 'login_base' in site_fields:
- del site_fields['login_base']
- self.api.UpdateSite(site_id, site_fields)
-
- if self.check:
- # Check site
- site = self.api.GetSites([site_id])[0]
- for field in site_fields:
- assert site[field] == site_fields[field]
-
- if self.verbose:
- print "Updated site", site_id
-
- def DeleteSites(self):
- """
- Delete any random sites we may have added.
- """
-
- for site_id in self.site_ids:
- self.api.DeleteSite(site_id)
-
- if self.check:
- assert not self.api.GetSites([site_id])
-
- if self.verbose:
- print "Deleted site", site_id
-
- if self.check:
- assert not self.api.GetSites(self.site_ids)
-
- self.site_ids = []
-
- def AddAddressTypes(self, n = 2):
- """
- Add a number of random address types.
- """
-
- for i in range(n):
- address_type_fields = random_address_type()
- address_type_id = self.api.AddAddressType(address_type_fields)
-
- # Should return a unique address_type_id
- assert address_type_id not in self.address_type_ids
- self.address_type_ids.append(address_type_id)
-
- if self.check:
- # Check address type
- address_type = self.api.GetAddressTypes([address_type_id])[0]
- for field in address_type_fields:
- assert address_type[field] == address_type_fields[field]
-
- if self.verbose:
- print "Added address type", address_type_id
-
- def UpdateAddressTypes(self):
- """
- Make random changes to any address types we may have added.
- """
-
- for address_type_id in self.address_type_ids:
- # Update address_type
- address_type_fields = random_address_type()
- self.api.UpdateAddressType(address_type_id, address_type_fields)
-
- if self.check:
- # Check address type
- address_type = self.api.GetAddressTypes([address_type_id])[0]
- for field in address_type_fields:
- assert address_type[field] == address_type_fields[field]
-
- if self.verbose:
- print "Updated address_type", address_type_id
-
- def DeleteAddressTypes(self):
- """
- Delete any random address types we may have added.
- """
-
- for address_type_id in self.address_type_ids:
- self.api.DeleteAddressType(address_type_id)
-
- if self.check:
- assert not self.api.GetAddressTypes([address_type_id])
-
- if self.verbose:
- print "Deleted address type", address_type_id
-
- if self.check:
- assert not self.api.GetAddressTypes(self.address_type_ids)
-
- self.address_type_ids = []
-
- def AddAddresses(self, per_site = 2):
- """
- Add a number of random addresses to each site.
- """
-
- for site_id in self.site_ids:
- for i in range(per_site):
- address_fields = random_address()
- address_id = self.api.AddSiteAddress(site_id, address_fields)
-
- # Should return a unique address_id
- assert address_id not in self.address_ids
- self.address_ids.append(address_id)
-
- # Add random address type
- if self.address_type_ids:
- for address_type_id in random.sample(self.address_type_ids, 1):
- self.api.AddAddressTypeToAddress(address_type_id, address_id)
-
- if self.check:
- # Check address
- address = self.api.GetAddresses([address_id])[0]
- for field in address_fields:
- assert address[field] == address_fields[field]
-
- if self.verbose:
- print "Added address", address_id, "to site", site_id
-
- def UpdateAddresses(self):
- """
- Make random changes to any addresses we may have added.
- """
-
- for address_id in self.address_ids:
- # Update address
- address_fields = random_address()
- self.api.UpdateAddress(address_id, address_fields)
-
- if self.check:
- # Check address
- address = self.api.GetAddresses([address_id])[0]
- for field in address_fields:
- assert address[field] == address_fields[field]
-
- if self.verbose:
- print "Updated address", address_id
-
- def DeleteAddresses(self):
- """
- Delete any random addresses we may have added.
- """
-
- for address_id in self.address_ids:
- # Remove address types
- address = self.api.GetAddresses([address_id])[0]
- for address_type_id in address['address_type_ids']:
- self.api.DeleteAddressTypeFromAddress(address_type_id, address_id)
-
- if self.check:
- address = self.api.GetAddresses([address_id])[0]
- assert not address['address_type_ids']
-
- self.api.DeleteAddress(address_id)
-
- if self.check:
- assert not self.api.GetAddresses([address_id])
-
- if self.verbose:
- print "Deleted address", address_id
-
- if self.check:
- assert not self.api.GetAddresses(self.address_ids)
-
- self.address_ids = []
-
- def AddPersons(self, per_site = 10):
- """
- Add a number of random users to each site.
- """
-
- for site_id in self.site_ids:
- for i in range(per_site):
- # Add user
- person_fields = random_person()
- person_id = self.api.AddPerson(person_fields)
-
- # Should return a unique person_id
- assert person_id not in self.person_ids
- self.person_ids.append(person_id)
-
- if self.check:
- # Check user
- person = self.api.GetPersons([person_id])[0]
- for field in person_fields:
- if field != 'password':
- assert person[field] == person_fields[field]
-
- auth = {'AuthMethod': "password",
- 'Username': person_fields['email'],
- 'AuthString': person_fields['password']}
-
- if self.check:
- # Check that user is disabled
- try:
- assert not self.api.AuthCheck(auth)
- except:
- pass
-
- # Add random set of roles
- role_ids = random.sample([20, 30, 40], randint(1, 3))
- for role_id in role_ids:
- self.api.AddRoleToPerson(role_id, person_id)
-
- if self.check:
- person = self.api.GetPersons([person_id])[0]
- assert set(role_ids) == set(person['role_ids'])
-
- # Enable user
- self.api.UpdatePerson(person_id, {'enabled': True})
-
- if self.check:
- # Check that user is enabled
- assert self.api.AuthCheck(auth)
-
- # Associate user with site
- self.api.AddPersonToSite(person_id, site_id)
- self.api.SetPersonPrimarySite(person_id, site_id)
-
- if self.check:
- person = self.api.GetPersons([person_id])[0]
- assert person['site_ids'][0] == site_id
-
- if self.verbose:
- print "Added user", person_id, "to site", site_id
-
- def UpdatePersons(self):
- """
- Make random changes to any users we may have added.
- """
-
- for person_id in self.person_ids:
- # Update user
- person_fields = random_person()
- # Keep them enabled
- person_fields['enabled'] = True
- self.api.UpdatePerson(person_id, person_fields)
-
- if self.check:
- # Check user
- person = self.api.GetPersons([person_id])[0]
- for field in person_fields:
- if field != 'password':
- assert person[field] == person_fields[field]
-
- if self.verbose:
- print "Updated person", person_id
-
- person = self.api.GetPersons([person_id])[0]
-
- # Associate user with a random set of sites
- site_ids = random.sample(self.site_ids, randint(0, len(self.site_ids)))
- for site_id in (set(site_ids) - set(person['site_ids'])):
- self.api.AddPersonToSite(person_id, site_id)
- for site_id in (set(person['site_ids']) - set(site_ids)):
- self.api.DeletePersonFromSite(person_id, site_id)
-
- if site_ids:
- self.api.SetPersonPrimarySite(person_id, site_ids[0])
-
- if self.check:
- person = self.api.GetPersons([person_id])[0]
- assert set(site_ids) == set(person['site_ids'])
-
- if self.verbose:
- print "Updated person", person_id, "to sites", site_ids
-
- def DeletePersons(self):
- """
- Delete any random users we may have added.
- """
-
- for person_id in self.person_ids:
- # Remove from site
- person = self.api.GetPersons([person_id])[0]
- for site_id in person['site_ids']:
- self.api.DeletePersonFromSite(person_id, site_id)
-
- if self.check:
- person = self.api.GetPersons([person_id])[0]
- assert not person['site_ids']
-
- # Revoke roles
- for role_id in person['role_ids']:
- self.api.DeleteRoleFromPerson(role_id, person_id)
-
- if self.check:
- person = self.api.GetPersons([person_id])[0]
- assert not person['role_ids']
-
- # Disable account
- self.api.UpdatePerson(person_id, {'enabled': False})
-
- if self.check:
- person = self.api.GetPersons([person_id])[0]
- assert not person['enabled']
-
- # Delete account
- self.api.DeletePerson(person_id)
-
- if self.check:
- assert not self.api.GetPersons([person_id])
-
- if self.verbose:
- print "Deleted user", person_id
-
- if self.check:
- assert not self.api.GetPersons(self.person_ids)
-
- self.person_ids = []
-
- def AddKeys(self, per_person = 2):
- """
- Add a number of random keys to each user.
- """
-
- key_types = self.api.GetKeyTypes()
- if not key_types:
- raise Exception, "No key types"
-
- for person_id in self.person_ids:
- for i in range(per_person):
- # Add key
- key_fields = random_key(key_types)
- key_id = self.api.AddPersonKey(person_id, key_fields)
-
- # Should return a unique key_id
- assert key_id not in self.key_ids
- self.key_ids.append(key_id)
-
- if self.check:
- # Check key
- key = self.api.GetKeys([key_id])[0]
- for field in key_fields:
- assert key[field] == key_fields[field]
-
- # Add and immediately blacklist a key
- key_fields = random_key(key_types)
- key_id = self.api.AddPersonKey(person_id, key_fields)
-
- self.api.BlacklistKey(key_id)
-
- # Is effectively deleted
- assert not self.api.GetKeys([key_id])
-
- # Cannot be added again
- try:
- key_id = self.api.AddPersonKey(person_id, key_fields)
- assert False
- except Exception, e:
- pass
-
- if self.verbose:
- print "Added key", key_id, "to user", person_id
-
- def UpdateKeys(self):
- """
- Make random changes to any keys we may have added.
- """
-
- key_types = self.api.GetKeyTypes()
- if not key_types:
- raise Exception, "No key types"
-
- for key_id in self.key_ids:
- # Update key
- key_fields = random_key(key_types)
- self.api.UpdateKey(key_id, key_fields)
-
- if self.check:
- # Check key
- key = self.api.GetKeys([key_id])[0]
- for field in key_fields:
- assert key[field] == key_fields[field]
-
- if self.verbose:
- print "Updated key", key_id
-
- def DeleteKeys(self):
- """
- Delete any random keys we may have added.
- """
-
- for key_id in self.key_ids:
- self.api.DeleteKey(key_id)
-
- if self.check:
- assert not self.api.GetKeys([key_id])
-
- if self.verbose:
- print "Deleted key", key_id
-
- if self.check:
- assert not self.api.GetKeys(self.key_ids)
-
- self.key_ids = []
-
- def AddNodeGroups(self, n = 10):
- """
- Add a number of random node groups.
- """
-
- for i in range(n):
- # Add node group
- nodegroup_fields = random_nodegroup()
- nodegroup_id = self.api.AddNodeGroup(nodegroup_fields)
-
- # Should return a unique nodegroup_id
- assert nodegroup_id not in self.nodegroup_ids
- self.nodegroup_ids.append(nodegroup_id)
-
- if self.check:
- # Check node group
- nodegroup = self.api.GetNodeGroups([nodegroup_id])[0]
- for field in nodegroup_fields:
- assert nodegroup[field] == nodegroup_fields[field]
-
- if self.verbose:
- print "Added node group", nodegroup_id
-
- def UpdateNodeGroups(self):
- """
- Make random changes to any node groups we may have added.
- """
-
- for nodegroup_id in self.nodegroup_ids:
- # Update nodegroup
- nodegroup_fields = random_nodegroup()
- self.api.UpdateNodeGroup(nodegroup_id, nodegroup_fields)
-
- if self.check:
- # Check nodegroup
- nodegroup = self.api.GetNodeGroups([nodegroup_id])[0]
- for field in nodegroup_fields:
- assert nodegroup[field] == nodegroup_fields[field]
-
- if self.verbose:
- print "Updated node group", nodegroup_id
-
- def DeleteNodeGroups(self):
- """
- Delete any random node groups we may have added.
- """
-
- for nodegroup_id in self.nodegroup_ids:
- self.api.DeleteNodeGroup(nodegroup_id)
-
- if self.check:
- assert not self.api.GetNodeGroups([nodegroup_id])
-
- if self.verbose:
- print "Deleted node group", nodegroup_id
-
- if self.check:
- assert not self.api.GetNodeGroups(self.nodegroup_ids)
-
- self.nodegroup_ids = []
-
- def AddNodes(self, per_site = 2):
- """
- Add a number of random nodes to each site. Each node will also
- be added to a random node group if AddNodeGroups() was
- previously run.
- """
-
- boot_states = self.api.GetBootStates()
- if not boot_states:
- raise Exception, "No boot states"
-
- for site_id in self.site_ids:
- for i in range(per_site):
- # Add node
- node_fields = random_node(boot_states)
- node_id = self.api.AddNode(site_id, node_fields)
-
- # Should return a unique node_id
- assert node_id not in self.node_ids
- self.node_ids.append(node_id)
-
- # Add to a random set of node groups
- nodegroup_ids = random.sample(self.nodegroup_ids, randint(0, len(self.nodegroup_ids)))
- for nodegroup_id in nodegroup_ids:
- self.api.AddNodeToNodeGroup(node_id, nodegroup_id)
-
- if self.check:
- # Check node
- node = self.api.GetNodes([node_id])[0]
- for field in node_fields:
- assert node[field] == node_fields[field]
-
- if self.verbose:
- print "Added node", node_id
-
- def UpdateNodes(self):
- """
- Make random changes to any nodes we may have added.
- """
-
- boot_states = self.api.GetBootStates()
- if not boot_states:
- raise Exception, "No boot states"
-
- for node_id in self.node_ids:
- # Update node
- node_fields = random_node(boot_states)
- self.api.UpdateNode(node_id, node_fields)
-
- node = self.api.GetNodes([node_id])[0]
-
- # Add to a random set of node groups
- nodegroup_ids = random.sample(self.nodegroup_ids, randint(0, len(self.nodegroup_ids)))
- for nodegroup_id in (set(nodegroup_ids) - set(node['nodegroup_ids'])):
- self.api.AddNodeToNodeGroup(node_id, nodegroup_id)
- for nodegroup_id in (set(node['nodegroup_ids']) - set(nodegroup_ids)):
- self.api.DeleteNodeFromNodeGroup(node_id, nodegroup_id)
-
- if self.check:
- # Check node
- node = self.api.GetNodes([node_id])[0]
- for field in node_fields:
- assert node[field] == node_fields[field]
- assert set(nodegroup_ids) == set(node['nodegroup_ids'])
-
- if self.verbose:
- print "Updated node", node_id
- print "Added node", node_id, "to node groups", nodegroup_ids
-
- def DeleteNodes(self):
- """
- Delete any random nodes we may have added.
- """
-
- for node_id in self.node_ids:
- # Remove from node groups
- node = self.api.GetNodes([node_id])[0]
- for nodegroup_id in node['nodegroup_ids']:
- self.api.DeleteNodeFromNodeGroup(node_id, nodegroup_id)
-
- if self.check:
- node = self.api.GetNodes([node_id])[0]
- assert not node['nodegroup_ids']
-
- self.api.DeleteNode(node_id)
-
- if self.check:
- assert not self.api.GetNodes([node_id])
-
- if self.verbose:
- print "Deleted node", node_id
-
- if self.check:
- assert not self.api.GetNodes(self.node_ids)
-
- self.node_ids = []
-
- def AddNodeNetworks(self, per_node = 1):
- """
- Add a number of random network interfaces to each node.
- """
-
- network_methods = self.api.GetNetworkMethods()
- if not network_methods:
- raise Exception, "No network methods"
-
- network_types = self.api.GetNetworkTypes()
- if not network_types:
- raise Exception, "No network types"
-
- for node_id in self.node_ids:
- for i in range(per_node):
- method = random.sample(network_methods, 1)[0]
- type = random.sample(network_types, 1)[0]
-
- # Add node network
- nodenetwork_fields = random_nodenetwork(method, type)
- nodenetwork_id = self.api.AddNodeNetwork(node_id, nodenetwork_fields)
-
- # Should return a unique nodenetwork_id
- assert nodenetwork_id not in self.nodenetwork_ids
- self.nodenetwork_ids.append(nodenetwork_id)
-
- if self.check:
- # Check node network
- nodenetwork = self.api.GetNodeNetworks([nodenetwork_id])[0]
- for field in nodenetwork_fields:
- assert nodenetwork[field] == nodenetwork_fields[field]
-
- if self.verbose:
- print "Added node network", nodenetwork_id, "to node", node_id
-
- def UpdateNodeNetworks(self):
- """
- Make random changes to any network interfaces we may have added.
- """
-
- network_methods = self.api.GetNetworkMethods()
- if not network_methods:
- raise Exception, "No network methods"
-
- network_types = self.api.GetNetworkTypes()
- if not network_types:
- raise Exception, "No network types"
-
- for nodenetwork_id in self.nodenetwork_ids:
- method = random.sample(network_methods, 1)[0]
- type = random.sample(network_types, 1)[0]
-
- # Update nodenetwork
- nodenetwork_fields = random_nodenetwork(method, type)
- self.api.UpdateNodeNetwork(nodenetwork_id, nodenetwork_fields)
-
- if self.check:
- # Check nodenetwork
- nodenetwork = self.api.GetNodeNetworks([nodenetwork_id])[0]
- for field in nodenetwork_fields:
- assert nodenetwork[field] == nodenetwork_fields[field]
-
- if self.verbose:
- print "Updated node network", nodenetwork_id
-
- def DeleteNodeNetworks(self):
- """
- Delete any random network interfaces we may have added.
- """
-
- for nodenetwork_id in self.nodenetwork_ids:
- self.api.DeleteNodeNetwork(nodenetwork_id)
-
- if self.check:
- assert not self.api.GetNodeNetworks([nodenetwork_id])
-
- if self.verbose:
- print "Deleted node network", nodenetwork_id
-
- if self.check:
- assert not self.api.GetNodeNetworks(self.nodenetwork_ids)
-
- self.nodenetwork_ids = []
-
- def AddPCUs(self, per_site = 1):
- """
- Add a number of random PCUs to each site. Each node at the
- site will be added to a port on the PCU if AddNodes() was
- previously run.
- """
-
- for site_id in self.site_ids:
- for i in range(per_site):
- # Add PCU
- pcu_fields = random_pcu()
- pcu_id = self.api.AddPCU(site_id, pcu_fields)
-
- # Should return a unique pcu_id
- assert pcu_id not in self.pcu_ids
- self.pcu_ids.append(pcu_id)
-
- # Add each node at this site to a different port on this PCU
- site = self.api.GetSites([site_id])[0]
- port = randint(1, 10)
- for node_id in site['node_ids']:
- self.api.AddNodeToPCU(node_id, pcu_id, port)
- port += 1
-
- if self.check:
- # Check PCU
- pcu = self.api.GetPCUs([pcu_id])[0]
- for field in pcu_fields:
- assert pcu[field] == pcu_fields[field]
-
- if self.verbose:
- print "Added PCU", pcu_id, "to site", site_id
-
- def UpdatePCUs(self):
- """
- Make random changes to any PCUs we may have added.
- """
-
- for pcu_id in self.pcu_ids:
- # Update PCU
- pcu_fields = random_pcu()
- self.api.UpdatePCU(pcu_id, pcu_fields)
-
- if self.check:
- # Check PCU
- pcu = self.api.GetPCUs([pcu_id])[0]
- for field in pcu_fields:
- assert pcu[field] == pcu_fields[field]
-
- if self.verbose:
- print "Updated PCU", pcu_id
-
- def DeletePCUs(self):
- """
- Delete any random nodes we may have added.
- """
-
- for pcu_id in self.pcu_ids:
- # Remove nodes from PCU
- pcu = self.api.GetPCUs([pcu_id])[0]
- for node_id in pcu['node_ids']:
- self.api.DeleteNodeFromPCU(node_id, pcu_id)
-
- if self.check:
- pcu = self.api.GetPCUs([pcu_id])[0]
- assert not pcu['node_ids']
-
- self.api.DeletePCU(pcu_id)
-
- if self.check:
- assert not self.api.GetPCUs([pcu_id])
-
- if self.verbose:
- print "Deleted PCU", pcu_id
-
- if self.check:
- assert not self.api.GetPCUs(self.pcu_ids)
-
- self.pcu_ids = []
-
- def AddConfFiles(self, n = 10):
- """
- Add a number of random global configuration files.
- """
-
- conf_files = []
-
- for i in range(n):
- # Add a random configuration file
- conf_files.append(random_conf_file())
-
- if n:
- # Add a nodegroup override file
- nodegroup_conf_file = conf_files[0].copy()
- nodegroup_conf_file['source'] = randpath(255)
- conf_files.append(nodegroup_conf_file)
-
- # Add a node override file
- node_conf_file = conf_files[0].copy()
- node_conf_file['source'] = randpath(255)
- conf_files.append(node_conf_file)
-
- for conf_file_fields in conf_files:
- conf_file_id = self.api.AddConfFile(conf_file_fields)
-
- # Should return a unique conf_file_id
- assert conf_file_id not in self.conf_file_ids
- self.conf_file_ids.append(conf_file_id)
-
- # Add to nodegroup
- if conf_file_fields == nodegroup_conf_file and self.nodegroup_ids:
- nodegroup_id = random.sample(self.nodegroup_ids, 1)[0]
- self.api.AddConfFileToNodeGroup(conf_file_id, nodegroup_id)
- else:
- nodegroup_id = None
-
- # Add to node
- if conf_file_fields == node_conf_file and self.node_ids:
- node_id = random.sample(self.node_ids, 1)[0]
- self.api.AddConfFileToNode(conf_file_id, node_id)
- else:
- node_id = None
-
- if self.check:
- # Check configuration file
- conf_file = self.api.GetConfFiles([conf_file_id])[0]
- for field in conf_file_fields:
- assert conf_file[field] == conf_file_fields[field]
-
- if self.verbose:
- print "Added configuration file", conf_file_id,
- if nodegroup_id is not None:
- print "to node group", nodegroup_id,
- elif node_id is not None:
- print "to node", node_id,
- print
-
- def UpdateConfFiles(self):
- """
- Make random changes to any configuration files we may have added.
- """
-
- for conf_file_id in self.conf_file_ids:
- # Update configuration file
- conf_file_fields = random_conf_file()
- # Do not update dest so that it remains an override if set
- if 'dest' in conf_file_fields:
- del conf_file_fields['dest']
- self.api.UpdateConfFile(conf_file_id, conf_file_fields)
-
- if self.check:
- # Check configuration file
- conf_file = self.api.GetConfFiles([conf_file_id])[0]
- for field in conf_file_fields:
- assert conf_file[field] == conf_file_fields[field]
-
- if self.verbose:
- print "Updated configuration file", conf_file_id
-
- def DeleteConfFiles(self):
- """
- Delete any random configuration files we may have added.
- """
-
- for conf_file_id in self.conf_file_ids:
- self.api.DeleteConfFile(conf_file_id)
-
- if self.check:
- assert not self.api.GetConfFiles([conf_file_id])
-
- if self.verbose:
- print "Deleted configuration file", conf_file_id
-
- if self.check:
- assert not self.api.GetConfFiles(self.conf_file_ids)
-
- self.conf_file_ids = []
-
- def AddSliceAttributeTypes(self, n = 10):
- """
- Add a number of random slice attribute types.
- """
-
- roles = self.api.GetRoles()
- if not roles:
- raise Exception, "No roles"
- role_ids = [role['role_id'] for role in roles]
-
- for i in range(n):
- attribute_type_fields = random_attribute_type(role_ids)
- attribute_type_id = self.api.AddSliceAttributeType(attribute_type_fields)
-
- # Should return a unique attribute_type_id
- assert attribute_type_id not in self.attribute_type_ids
- self.attribute_type_ids.append(attribute_type_id)
-
- if self.check:
- # Check slice attribute type
- attribute_type = self.api.GetSliceAttributeTypes([attribute_type_id])[0]
- for field in attribute_type_fields:
- assert attribute_type[field] == attribute_type_fields[field]
-
- if self.verbose:
- print "Added slice attribute type", attribute_type_id
-
- def UpdateSliceAttributeTypes(self):
- """
- Make random changes to any slice attribute types we may have added.
- """
-
- roles = self.api.GetRoles()
- if not roles:
- raise Exception, "No roles"
- role_ids = [role['role_id'] for role in roles]
-
- for attribute_type_id in self.attribute_type_ids:
- # Update slice attribute type
- attribute_type_fields = random_attribute_type(role_ids)
- self.api.UpdateSliceAttributeType(attribute_type_id, attribute_type_fields)
-
- if self.check:
- # Check slice attribute type
- attribute_type = self.api.GetSliceAttributeTypes([attribute_type_id])[0]
- for field in attribute_type_fields:
- assert attribute_type[field] == attribute_type_fields[field]
-
- if self.verbose:
- print "Updated slice attribute type", attribute_type_id
-
- def DeleteSliceAttributeTypes(self):
- """
- Delete any random slice attribute types we may have added.
- """
-
- for attribute_type_id in self.attribute_type_ids:
- self.api.DeleteSliceAttributeType(attribute_type_id)
-
- if self.check:
- assert not self.api.GetSliceAttributeTypes([attribute_type_id])
-
- if self.verbose:
- print "Deleted slice attribute type", attribute_type_id
-
- if self.check:
- assert not self.api.GetSliceAttributeTypes(self.attribute_type_ids)
-
- self.attribute_type_ids = []
-
- def AddSlices(self, per_site = 10):
- """
- Add a number of random slices per site.
- """
-
- for site in self.api.GetSites(self.site_ids):
- for i in range(min(per_site, site['max_slices'])):
- # Add slice
- slice_fields = random_slice(site['login_base'])
- slice_id = self.api.AddSlice(slice_fields)
-
- # Should return a unique slice_id
- assert slice_id not in self.slice_ids
- self.slice_ids.append(slice_id)
-
- # Add slice to a random set of nodes
- node_ids = random.sample(self.node_ids, randint(0, len(self.node_ids)))
- if node_ids:
- self.api.AddSliceToNodes(slice_id, node_ids)
-
- # Add random set of site users to slice
- person_ids = random.sample(site['person_ids'], randint(0, len(site['person_ids'])))
- for person_id in person_ids:
- self.api.AddPersonToSlice(person_id, slice_id)
-
- if self.check:
- # Check slice
- slice = self.api.GetSlices([slice_id])[0]
- for field in slice_fields:
- assert slice[field] == slice_fields[field]
-
- assert set(node_ids) == set(slice['node_ids'])
- assert set(person_ids) == set(slice['person_ids'])
-
- if self.verbose:
- print "Added slice", slice_id, "to site", site['site_id'],
- if node_ids:
- print "and nodes", node_ids,
- print
- if person_ids:
- print "Added users", site['person_ids'], "to slice", slice_id
-
- def UpdateSlices(self):
- """
- Make random changes to any slices we may have added.
- """
-
- for slice_id in self.slice_ids:
- # Update slice
- slice_fields = random_slice("unused")
- # Cannot change slice name
- if 'name' in slice_fields:
- del slice_fields['name']
- self.api.UpdateSlice(slice_id, slice_fields)
-
- slice = self.api.GetSlices([slice_id])[0]
-
- # Add slice to a random set of nodes
- node_ids = random.sample(self.node_ids, randint(0, len(self.node_ids)))
- self.api.AddSliceToNodes(slice_id, list(set(node_ids) - set(slice['node_ids'])))
- self.api.DeleteSliceFromNodes(slice_id, list(set(slice['node_ids']) - set(node_ids)))
-
- # Add random set of users to slice
- person_ids = random.sample(self.person_ids, randint(0, len(self.person_ids)))
- for person_id in (set(person_ids) - set(slice['person_ids'])):
- self.api.AddPersonToSlice(person_id, slice_id)
- for person_id in (set(slice['person_ids']) - set(person_ids)):
- self.api.DeletePersonFromSlice(person_id, slice_id)
-
- if self.check:
- slice = self.api.GetSlices([slice_id])[0]
- for field in slice_fields:
- assert slice[field] == slice_fields[field]
- assert set(node_ids) == set(slice['node_ids'])
- assert set(person_ids) == set(slice['person_ids'])
-
- if self.verbose:
- print "Updated slice", slice_id
- print "Added nodes", node_ids, "to slice", slice_id
- print "Added persons", person_ids, "to slice", slice_id
-
- def DeleteSlices(self):
- """
- Delete any random slices we may have added.
- """
-
- for slice_id in self.slice_ids:
- self.api.DeleteSlice(slice_id)
-
- if self.check:
- assert not self.api.GetSlices([slice_id])
-
- if self.verbose:
- print "Deleted slice", slice_id
-
- if self.check:
- assert not self.api.GetSlices(self.slice_ids)
-
- self.slice_ids = []
-
- def AddSliceAttributes(self, per_slice = 2):
- """
- Add a number of random slices per site.
- """
-
- if not self.attribute_type_ids:
- return
-
- for slice_id in self.slice_ids:
- slice = self.api.GetSlices([slice_id])[0]
-
- for i in range(per_slice):
- # Set a random slice/sliver attribute
- for attribute_type_id in random.sample(self.attribute_type_ids, 1):
- value = randstr(16, letters + '_' + digits)
- # Make it a sliver attribute with 50% probability
- if slice['node_ids']:
- node_id = random.sample(slice['node_ids'] + [None] * len(slice['node_ids']), 1)[0]
- else:
- node_id = None
-
- # Add slice attribute
- if node_id is None:
- slice_attribute_id = self.api.AddSliceAttribute(slice_id, attribute_type_id, value)
- else:
- slice_attribute_id = self.api.AddSliceAttribute(slice_id, attribute_type_id, value, node_id)
-
- # Should return a unique slice_attribute_id
- assert slice_attribute_id not in self.slice_attribute_ids
- self.slice_attribute_ids.append(slice_attribute_id)
-
- if self.check:
- # Check slice attribute
- slice_attribute = self.api.GetSliceAttributes([slice_attribute_id])[0]
- for field in 'attribute_type_id', 'slice_id', 'node_id', 'slice_attribute_id', 'value':
- assert slice_attribute[field] == locals()[field]
-
- if self.verbose:
- print "Added slice attribute", slice_attribute_id, "of type", attribute_type_id,
- if node_id is not None:
- print "to node", node_id,
- print
-
- def UpdateSliceAttributes(self):
- """
- Make random changes to any slice attributes we may have added.
- """
-
- for slice_attribute_id in self.slice_attribute_ids:
- # Update slice attribute
- value = randstr(16, letters + '_' + digits)
- self.api.UpdateSliceAttribute(slice_attribute_id, value)
-
- # Check slice attribute again
- slice_attribute = self.api.GetSliceAttributes([slice_attribute_id])[0]
- assert slice_attribute['value'] == value
-
- if self.verbose:
- print "Updated slice attribute", slice_attribute_id
-
- def DeleteSliceAttributes(self):
- """
- Delete any random slice attributes we may have added.
- """
-
- for slice_attribute_id in self.slice_attribute_ids:
- self.api.DeleteSliceAttribute(slice_attribute_id)
-
- if self.check:
- assert not self.api.GetSliceAttributes([slice_attribute_id])
-
- if self.verbose:
- print "Deleted slice attribute", slice_attribute_id
-
- if self.check:
- assert not self.api.GetSliceAttributes(self.slice_attribute_ids)
-
- self.slice_attribute_ids = []
-
-def main():
- parser = OptionParser()
- parser.add_option("-c", "--check", action = "store_true", default = False, help = "Check most actions (default: %default)")
- parser.add_option("-q", "--quiet", action = "store_true", default = False, help = "Be quiet (default: %default)")
- parser.add_option("-t", "--tiny", action = "store_true", default = False, help = "Run a tiny test (default: %default)")
- (options, args) = parser.parse_args()
-
- test = Test(api = Shell(),
- check = options.check,
- verbose = not options.quiet)
-
- if options.tiny:
- params = Test.tiny
- else:
- params = Test.default
-
- test.Run(**params)
-
-if __name__ == "__main__":
- main()
+## Please use make index to update this file
all = """
-Addresses
-AddressTypes
API
+AddressTypes
+Addresses
Auth
Boot
BootStates
Faults
Filter
GPG
+Ilinks
InitScripts
-Keys
+InterfaceTags
+Interfaces
KeyTypes
+Keys
Messages
Method
NetworkMethods
NetworkTypes
NodeGroups
-NodeNetworkSettings
-NodeNetworkSettingTypes
-NodeNetworks
+NodeTags
+NodeTypes
Nodes
-Parameter
PCUProtocolTypes
-PCUs
PCUTypes
+PCUs
+POD
+Parameter
Peers
+PersonTags
Persons
-POD
PostgreSQL
PyCurl
Roles
-sendmail
Sessions
Shell
+SiteTags
Sites
-SliceAttributes
-SliceAttributeTypes
SliceInstantiations
+SliceTags
Slices
Table
-Test
+TagTypes
+sendmail
+v42Legacy
+v42LegacyNodeNetworkSettingTypes
+v42LegacyNodeNetworkSettings
+v42LegacyNodeNetworks
+v42LegacySliceAttributeTypes
+v42LegacySliceAttributes
""".split()
+# $Id$
+# $URL$
import os
import sys
import pprint
--- /dev/null
+# $Id$
+# $URL$
+
+# apply rename on list (columns) or dict (filter) args
+def patch (arg,rename):
+ if isinstance(arg,list):
+ for i in range(0,len(arg)):
+ arg[i] = patch(arg[i],rename)
+ return arg
+ if isinstance(arg,dict):
+ return dict ( [ (rename(k),v) for (k,v) in arg.iteritems() ] )
+ return rename(arg)
+
--- /dev/null
+# $Id$
+# $URL$
+
+# mapping of argument/return names for *NodeNetworkSettingType*
+v42_to_v43_argmap = { "name":"tagname",
+ "nodenetwork_setting_type_id": "tag_type_id",
+ }
+v43_to_v42_argmap = dict([ (v,k) for k,v in v42_to_v43_argmap.iteritems()])
+
+def v42rename (x): return v42_to_v43_argmap.get(x,x)
+def v43rename (x): return v43_to_v42_argmap.get(x,x)
--- /dev/null
+# $Id$
+# $URL$
+
+# mapping of argument/return names for *NodeNetworkSettings* and *InterfaceTags* calls
+v42_to_v43_argmap = {
+ "nodenetwork_id":"interface_id",
+ "nodenetwork_ids":"interface_ids",
+ "nodenetwork_setting_id":"interface_tag_id",
+ "nodenetwork_setting_ids":"interface_tag_ids",
+ "nodenetwork_setting_type_id":"tag_type_id",
+ "name":"tagname"
+ }
+v43_to_v42_argmap = dict([ (v,k) for k,v in v42_to_v43_argmap.iteritems()])
+
+def v42rename (x): return v42_to_v43_argmap.get(x,x)
+def v43rename (x): return v43_to_v42_argmap.get(x,x)
--- /dev/null
+# $Id$
+# $URL$
+
+# mapping of argument/return names for *NodeNetwork* and *Interface* calls
+v42_to_v43_argmap = {
+ "nodenetwork_id":"interface_id",
+ "nodenetwork_ids":"interface_ids",
+ "nodenetwork_setting_ids":"interface_tag_ids",
+}
+v43_to_v42_argmap = dict([ (v,k) for k,v in v42_to_v43_argmap.iteritems()])
+
+def v42rename (x): return v42_to_v43_argmap.get(x,x)
+def v43rename (x): return v43_to_v42_argmap.get(x,x)
--- /dev/null
+# $Id$
+# $URL$
+
+# mapping of argument/return names for *SliceAttributeType* calls
+
+v42_to_v43_argmap = { "name":"tagname",
+ "slice_attribute_id":"slice_tag_id",
+ "attribute_type_id":"tag_type_id",
+ }
+v43_to_v42_argmap = dict([ (v,k) for k,v in v42_to_v43_argmap.iteritems()])
+
+def v42rename (x): return v42_to_v43_argmap.get(x,x)
+def v43rename (x): return v43_to_v42_argmap.get(x,x)
--- /dev/null
+# $Id$
+# $URL$
+
+# mapping of argument/return names for *{SliceAttribute,NetworkSetting}Type* and *TagType* calls
+
+v42_to_v43_argmap = { "name":"tagname",
+ "slice_attribute_id":"slice_tag_id",
+ }
+v43_to_v42_argmap = dict([ (v,k) for k,v in v42_to_v43_argmap.iteritems()])
+
+def v42rename (x): return v42_to_v43_argmap.get(x,x)
+def v43rename (x): return v43_to_v42_argmap.get(x,x)
%define url $URL$
%define name PLCAPI
-%define version 5.0
-%define taglevel 0
+%define version 4.3
+%define taglevel 32
%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
# We use set everywhere
Requires: python >= 2.4
+Requires: postgresql >= 8.2, postgresql-server >= 8.2
+Requires: postgresql-python
+Requires: python-psycopg2
+Requires: python-pycurl
+Requires: httpd
+Requires: mod_python
+Requires: mod_ssl
+Requires: SOAPpy
# We use psycopg2
BuildRequires: postgresql-devel
%build
# python-pycurl and python-psycopg2 avail. from fedora 5
-# make sure to check build/<pldistro>/plc.pkgs
-if [ "%{distrorelease}" -le 4 ] ; then
- modules="psycopg2 pycurl"
-else
- modules=""
-fi
+# we used to ship our own version of psycopg2 and pycurl, for fedora4
+# starting with 4.3, support for these two modules is taken out
+#
# Build __init__.py metafiles and PHP API.
-%{__make} %{?_smp_mflags} subdirs="php php/xmlrpc" modules="$modules"
+%{__make} %{?_smp_mflags}
+%{__make} -C wsdl
%install
rm -rf $RPM_BUILD_ROOT
-if [ "%{distrorelease}" -le 4 ] ; then
- modules="psycopg2 pycurl"
-else
- modules=""
-fi
-%{__make} %{?_smp_mflags} install DESTDIR="$RPM_BUILD_ROOT" datadir="%{_datadir}" bindir="%{_bindir}" modules="$modules"
+%{__make} %{?_smp_mflags} install DESTDIR="$RPM_BUILD_ROOT" datadir="%{_datadir}" bindir="%{_bindir}"
+install -D -m 644 wsdl/plcapi.wsdl $RPM_BUILD_ROOT/var/www/html/wsdl/plcapi.wsdl
# Install shell symlink
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
%{_bindir}/plcsh
%{php_extension_dir}/xmlrpc.so
%{_sysconfdir}/php.d/xmlrpc.ini
-%{_bindir}/refresh-peer.py*
+%config (noreplace) %{_datadir}/plc_api/PLC/Accessors/Accessors_site.py
+/var/www/html/wsdl/plcapi.wsdl
%changelog
+* Sat Jan 09 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-32
+- support for fedora 12
+- fix subtle bug in filering with ] and quotes
+
+* Fri Dec 18 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - PLCAPI-4.3-31
+- * patch for php-5.3 (the one in f12)
+- * validate email addresses with regex
+- * add PersonTags and SiteTags
+- * add additional accessors for node tags (kvariant, serial, ..)
+
+* Tue Nov 03 2009 Marc Fiuczynski <mef@cs.princeton.edu> - PLCAPI-4.3-30
+- Redacting password, session, and authstring values from the event log.
+
+* Mon Oct 19 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-29
+- let AddSite set ext_consortium_id - required for the poorman registration pages
+- drop version constraint on Requires: postgresql-python
+- don't log system calls nor ReportRunLevel
+
+* Thu Oct 15 2009 Daniel Hokka Zakrisson <daniel@hozac.com> - PLCAPI-4.3-28
+- Fix requires for CentOS.
+
+* Fri Oct 09 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - PLCAPI-4.3-27
+- Require postgresql 8.2 (for array operators && and @>)
+
+* Thu Oct 08 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-26
+- Filter now supports the | and & features to match in sequence values
+- bugfix in the postgresql wrapper for sequence filter values
+- reviewed GetSlivers to export admin keys more efficiently
+- fix checking roles in UpdateSliceTag
+
+* Sat Sep 26 2009 Marc Fiuczynski <mef@cs.princeton.edu> - PLCAPI-4.3-25
+- - Some typos in the documentation were fixed.
+- - UpdateSliceTag check if a node's min_role_id is >= (rather than >)
+- to the tag's min_role_id.
+
+* Fri Sep 18 2009 anil vengalil <avengali@sophia.inria.fr> - PLCAPI-4.3-24
+
+* Mon Sep 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-23
+- Ongoing work to add upcalls, using new SFA class
+- new methods BindObjectToPeer, UnBindObjectFromPeer, still for SFA
+- reviewed type-checking for the 3 taggable classes node-interface-slice
+- cleanup ald dummynet stuff
+- expose the 'extensions' accessors to the API
+- tweaked checks in AddSliceTag
+- GetPersons exposes roles by default
+- bugfix in ReportRunLevel for non-string levels
+- tweaks in GetSlivers ( seems that it now exposes the keys for the root context )
+
+* Fri Jul 10 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-22
+- new BindObjectToPeer method for sfa
+- AddSliceTag and UpdateSliceTag open to the 'node' auth method with restrictions
+
+* Wed Jul 01 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-21
+- getbootmedium supports options as tags (serial, cramfs, kvariant, kargs, no-hangcheck )
+- reportrunlevel logs its calls only when run_level changes
+- pycurl more robust wrt to xmlrpclib.Transport
+
+* Tue Jun 16 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-20
+- produce a wsdl interface
+- bugfix in getbootmedium for nodes with interface tags
+
+* Sun Jun 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-19
+- bugfix for some rare pattern-based filters
+
+* Wed Jun 03 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-18
+- improvements in the 4.2 legacy layer
+
+* Sat May 30 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-17
+- bugfix required for slice tags set on nodegroups
+
+* Thu May 28 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-16
+- more complete compatibility layer - second iteration, with legacy code isolated in Legacy/
+
+* Tue May 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-15
+- more powerful legacy layer with 4.2
+
+* Fri May 15 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-14
+- RefreshPeer sets lock per-peer to avoid multiple concurent instances
+- migration script has an option for running interactively
+
+* Wed May 06 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-13
+- skips already added entries
+
+* Tue Apr 28 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-12
+- yet another set of fixes for external dummynet boxes
+
+* Wed Apr 22 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-11
+- GetDummyBoxMedium returns a base64-encoded boot image, doc is updated
+- and tmp file is cleaned up
+
+* Wed Apr 22 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-10
+- restore missing ResolveSlices
+
+* Mon Apr 20 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-9
+- new method GetDummyBoxMedium
+
+* Fri Apr 17 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-8
+- remove duplicate in Methods/__init__ that was breaking build of myplc-docs
+
+* Fri Apr 17 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-7
+- support for external dummynet boxes back in 4.3 - first draft
+
+* Thu Apr 09 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-6
+- fixes for smooth federation between 4.2 and 4.3
+- peername is not UNIQUE in schema anymore, was preventing delete/recreate
+
+* Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-5
+- support for BootCD variants (GetBootMedium ['variant:centos5'])
+- fix corner case with filters like {'~slice_id':[]}
+- fix transaction leak that caused the db connections pool to exhaust
+- properly expose all methods, including Legacy/, and not only Methods/
+
+* Tue Mar 24 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-4
+- renumbered as 4.3
+- nodes have new fields run_level (in addition to boot_state) and verified
+- tweaked migration from 4.2
+- tuned rpm dependencies
+- doc generation more explicit about errors like missing python modules
+- removed obsolete method GetSlicesMD5
+
+* Wed Jan 28 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-3
+- unified all tags
+- renamed interface settings into interface tags and slice attributes into slice tags
+- nodes have a node_type
+- various changes on the way to 4.3
+
+* Thu Nov 27 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-2
+- Checkpointing : this version still has interface settings and slice attributes
+
+* Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.3-1
+- first iteration with taggable nodes/interfaces/slices
+- embryo for ilinks
+- cleaned up boot states
+- migration script moslty complete
+
* Wed May 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCAPI-4.2-8
- fixed doc build by locating locally installed DTDs at build-time
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
import os
+++ /dev/null
-#!/usr/bin/python
-#
-# Test script for peer caching
-#
-# Mark Huang <mlhuang@cs.princeton.edu>
-# Copyright (C) 2006 The Trustees of Princeton University
-#
-# $Id$
-#
-
-"""
-Test script for peer caching. Intended for testing multiple PLCs
-running on the same machine in different chroots. Here is how I set
-things up after installing and configuring MyPLC:
-
-# Shut down MyPLC
-service plc stop
-
-# Copy to /plc2
-cp -ra /plc /plc2
-ln -sf plc /etc/init.d/plc2
-echo 'PLC_ROOT=/plc2/root' > /etc/sysconfig/plc2
-echo 'PLC_DATA=/plc2/data' >> /etc/sysconfig/plc2
-
-# Edit /plc2/data/etc/planetlab/plc_config.xml and change at least the
-# following so that they do not conflict with the defaults:
-#
-# PLC_NAME (e.g., PlanetLab Two)
-# PLC_SLICE_PREFIX (e.g., two)
-# PLC_ROOT_USER (e.g., root@planetlab.two)
-# PLC_API_MAINTENANCE_USER (e.g., maint@planetlab.two)
-# PLC_DB_PORT (e.g., 5433)
-# PLC_WWW_PORT (e.g., 81)
-# PLC_WWW_SSL_PORT (e.g., 444)
-# PLC_API_PORT (must be the same as PLC_WWW_SSL_PORT, e.g., 444)
-# PLC_BOOT_SSL_PORT (must be the same as PLC_WWW_SSL_PORT, e.g., 444)
-# PLC_BOOT_PORT (may be the same as PLC_WWW_PORT, e.g., 81)
-
-# Start up both MyPLC instances
-service plc start
-service plc2 start
-
-# Run test
-./Test.py -f /etc/planetlab/plc_config -f /plc2/data/etc/planetlab/plc_config
-
-# If the test fails and your databases are corrupt and/or you want to
-# start over, you can always just blow the databases away.
-service plc stop
-rm -rf /plc/data/var/lib/pgsql/data
-service plc start
-
-service plc2 stop
-rm -rf /plc2/data/var/lib/pgsql/data
-service plc2 start
-"""
-
-import re
-from optparse import OptionParser
-
-from PLC.Config import Config
-from PLC.GPG import gpg_export
-from PLC.Shell import Shell
-from PLC.Test import Test
-
-def todict(list_of_dicts, key):
- """
- Turn a list of dicts into a dict keyed on key.
- """
-
- return dict([(d[key], d) for d in list_of_dicts])
-
-def RefreshPeers(plcs):
- """
- Refresh each peer with each other.
- """
-
- for plc in plcs:
- for peer in plcs:
- if peer == plc:
- continue
-
- print plc.config.PLC_NAME, "refreshing", peer.config.PLC_NAME
- plc.RefreshPeer(peer.config.PLC_NAME)
-
- peer_id = plc.GetPeers([peer.config.PLC_NAME])[0]['peer_id']
-
- peer_sites = todict(plc.GetSites({'peer_id': peer_id}), 'site_id')
- sites_at_peer = todict(peer.GetSites(), 'site_id')
-
- peer_keys = todict(plc.GetKeys({'peer_id': peer_id}), 'key_id')
- keys_at_peer = todict(peer.GetKeys(), 'key_id')
-
- peer_persons = todict(plc.GetPersons({'peer_id': peer_id}), 'person_id')
- persons_at_peer = todict(peer.GetPersons(), 'person_id')
-
- peer_nodes = todict(plc.GetNodes({'peer_id': peer_id}), 'node_id')
- nodes_at_peer = todict(peer.GetNodes(), 'node_id')
-
- our_nodes = todict(plc.GetNodes({'peer_id': None}), 'node_id')
- our_peer_id_at_peer = peer.GetPeers([plc.config.PLC_NAME])[0]['peer_id']
- our_nodes_at_peer = todict(peer.GetNodes({'peer_id': our_peer_id_at_peer,
- 'peer_node_id': our_nodes.keys()}), 'peer_node_id')
-
- peer_slices = todict(plc.GetSlices({'peer_id': peer_id}), 'peer_slice_id')
- slices_at_peer = todict(peer.GetSlices(), 'slice_id')
-
- for site_id, site in peer_sites.iteritems():
- # Verify that this site exists at the peer
- peer_site_id = site['peer_site_id']
- assert peer_site_id in sites_at_peer
- peer_site = sites_at_peer[peer_site_id]
-
- # And is the same
- for field in ['name', 'abbreviated_name', 'login_base', 'is_public',
- 'latitude', 'longitude', 'url',
- 'max_slices', 'max_slivers',]:
- assert site[field] == peer_site[field]
-
- for key_id, key in peer_keys.iteritems():
- # Verify that this key exists at the peer
- peer_key_id = key['peer_key_id']
- assert peer_key_id in keys_at_peer
- peer_key = keys_at_peer[peer_key_id]
-
- # And is the same
- for field in ['key_type', 'key']:
- assert key[field] == peer_key[field]
-
- for person_id, person in peer_persons.iteritems():
- # Verify that this user exists at the peer
- peer_person_id = person['peer_person_id']
- assert peer_person_id in persons_at_peer
- peer_person = persons_at_peer[peer_person_id]
-
- # And is the same
- for field in ['first_name', 'last_name', 'title', 'email', 'phone',
- 'url', 'bio', 'enabled']:
- assert person[field] == peer_person[field]
-
- for key_id in person['key_ids']:
- # Verify that the user is not associated with any local keys
- assert key_id in peer_keys
- key = peer_keys[key_id]
- peer_key_id = key['peer_key_id']
-
- # Verify that this key exists at the peer
- assert peer_key_id in keys_at_peer
- peer_key = keys_at_peer[peer_key_id]
-
- # And is related to the same user at the peer
- assert peer_key['key_id'] in peer_person['key_ids']
-
- for node_id, node in peer_nodes.iteritems():
- # Verify that this node exists at the peer
- peer_node_id = node['peer_node_id']
- assert peer_node_id in nodes_at_peer
- peer_node = nodes_at_peer[peer_node_id]
-
- # And is the same
- for field in ['boot_state', 'ssh_rsa_key', 'hostname',
- 'version', 'model']:
- assert node[field] == peer_node[field]
-
- # Verify that the node is not associated with any local sites
- assert node['site_id'] in peer_sites
- site = peer_sites[node['site_id']]
-
- # Verify that this site exists at the peer
- peer_site_id = site['peer_site_id']
- assert peer_site_id in sites_at_peer
- peer_site = sites_at_peer[peer_site_id]
-
- # And is related to the same node at the peer
- assert peer_site['site_id'] == peer_node['site_id']
-
- for slice_id, slice in peer_slices.iteritems():
- # Verify that this slice exists at the peer
- peer_slice_id = slice['peer_slice_id']
- assert peer_slice_id in slices_at_peer
- peer_slice = slices_at_peer[peer_slice_id]
-
- # And is the same
- for field in ['name', 'instantiation', 'url', 'description',
- 'max_nodes', 'expires']:
- assert slice[field] == peer_slice[field]
-
- for node_id in slice['node_ids']:
- # Verify that the slice is associated only with
- # the peer's own nodes, or with our nodes as
- # last cached by the peer.
- assert node_id in peer_nodes or node_id in our_nodes_at_peer
- if node_id in peer_nodes:
- node = peer_nodes[node_id]
- peer_node_id = node['peer_node_id']
- elif node_id in our_nodes_at_peer:
- peer_node = our_nodes_at_peer[node_id]
- peer_node_id = peer_node['node_id']
-
- # Verify that this node exists at the peer
- assert peer_node_id in nodes_at_peer
-
- # And is related to the same slice at the peer
- assert peer_node_id in peer_slice['node_ids']
-
-def TestPeers(plcs, check = True, verbose = True, tiny = False):
- # Register each peer with each other
- for plc in plcs:
- for peer in plcs:
- if peer == plc:
- continue
-
- key = gpg_export(peer.chroot + peer.config.PLC_ROOT_GPG_KEY_PUB)
- cacert = file(peer.chroot + peer.config.PLC_API_CA_SSL_CRT).read()
-
- if plc.GetPeers([peer.config.PLC_NAME]):
- print plc.config.PLC_NAME, "updating peer", peer.config.PLC_NAME
- plc.UpdatePeer(peer.config.PLC_NAME,
- {'peer_url': peer.url, 'key': key, 'cacert': cacert})
- else:
- print plc.config.PLC_NAME, "adding peer", peer.config.PLC_NAME
- plc.AddPeer({'peername': peer.config.PLC_NAME,
- 'peer_url': peer.url, 'key': key, 'cacert': cacert})
-
- # Populate the DB
- plc.test = Test(api = plc, check = check, verbose = verbose)
-
- if tiny:
- params = Test.tiny
- else:
- params = Test.default
-
- print "Populating", plc.config.PLC_NAME
- plc.test.Add(**params)
-
- # Refresh each other
- RefreshPeers(plcs)
-
- # Change some things
- for plc in plcs:
- print "Updating", plc.config.PLC_NAME
- plc.test.Update()
-
- # Refresh each other again
- RefreshPeers(plcs)
-
-def main():
- parser = OptionParser()
- parser.add_option("-f", "--config", dest = "configs", action = "append", default = [], help = "Configuration file (default: %default)")
- parser.add_option("-c", "--check", action = "store_true", default = False, help = "Verify actions (default: %default)")
- parser.add_option("-q", "--quiet", action = "store_true", default = False, help = "Be quiet (default: %default)")
- parser.add_option("-t", "--tiny", action = "store_true", default = False, help = "Run a tiny test (default: %default)")
- (options, args) = parser.parse_args()
-
- # Test single peer by default
- if not options.configs:
- options.configs = ["/etc/planetlab/plc_config"]
-
- plcs = []
- for path in options.configs:
- # Load configuration file
- config = Config(path)
-
- # Determine path to chroot
- m = re.match(r'(.*)/etc/planetlab', path)
- if m is not None:
- chroot = m.group(1)
- else:
- chroot = ""
-
- # Fix up path to SSL certificate
- cacert = chroot + config.PLC_API_CA_SSL_CRT
-
- # Always connect with XML-RPC
- plc = Shell(config = path, cacert = cacert, xmlrpc = True)
- plc.chroot = chroot
- plcs.append(plc)
-
- TestPeers(plcs, check = options.check, verbose = not options.quiet, tiny = options.tiny)
-
-if __name__ == "__main__":
- main()
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
import xml.dom.minidom
#!/usr/bin/env python
from PLC.API import PLCAPI
+from PLC.Faults import PLCInvalidAPIMethod
from DocBook import DocBook
+import sys
-def api_methods():
- api = PLCAPI(None)
- methods = api.methods
- return [api.callable(method) for method in methods]
+api = PLCAPI(None)
+methods = api.all_methods
+good_apis = []
+bad_apis = []
+for method in methods:
+ try:
+ good_api = api.callable(method)
+ good_apis.append(good_api)
+ except PLCInvalidAPIMethod, e:
+ bad_apis.append((method,e))
-DocBook(api_methods ()).Process()
+DocBook(good_apis).Process()
+
+if len(bad_apis):
+ sys.stderr.write("UNEXPECTED: There are %d non-callable methods:\n")
+ for bad_api,e in bad_apis:
+ sys.stderr.write("\t%s:%s\n" % (bad_api,e))
+ sys.exit(-1)
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
all: PLCAPI.html
$(if $(local-docbook-43), \
echo Using locally installed DTD $(local-docbook-43), \
echo WARNING - could not locate local DTD - using remote $(remote-docbook-43))
- sed -e s:@DOCBOOK-43@:$(docbook-43): $< > $@
+ sed -e "s:@DOCBOOK-43@:$(docbook-43):" $< > $@
.PLCAPI.xml.valid: Methods.xml
<?xml version="1.0" encoding="UTF-8"?>
+<!-- -*-xml-*- -->
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"@DOCBOOK-43@" [
<!ENTITY Methods SYSTEM "Methods.xml">
<section id="Filters">
<title>Filters</title>
- <para>Most of the <function>Get</function> functions take a
+ <para>Most of the <function>Get</function> methods take a
filter argument. Filters may be arrays of integer (and sometimes
string) identifiers, or a struct representing a filter on the
- attributes of the entities being queried. For example,</para>
+ attributes of the entities being queried. For example,
<programlisting>
-# plcsh code fragment (see below)
-GetNodes([1,2,3])
-GetNodes({'node_id': [1,2,3]})
+>>> GetNodes([1,2,3])
+>>> GetNodes({'node_id': [1,2,3]})
</programlisting>
+</para>
<para>Would be equivalent queries. Attributes that are
- themselves arrays (such as <literal>nodenetwork_ids</literal>
+ themselves arrays (such as <literal>interface_ids</literal>
and <literal>slice_ids</literal> for nodes) cannot be used in
filters.</para>
<para> Filters support a few extra features illustrated in the following examples.</para>
+
+ <section id="pattern-matching">
+ <title> Pattern Matching</title>
+ <para> <literal>*</literal> can be used in a text value and have the usual meaning, so all nodes in the <emphasis>fr</emphasis> can be obtained with:
+ <programlisting>GetNodes ( { 'hostname' : '*.fr' } ) </programlisting>
+ </para>
+ </section>
+
+ <section id="negation">
+ <title> Negation </title>
+ <para> Fields starting with a <literal>~</literal> are negated, so non-local nodes can be fetched with:
+ <programlisting>GetNodes( { '~peer_id' : None } ) </programlisting>
+ </para>
+ </section>
+
+ <section id="numeric">
+ <title> Numeric comparisons </title>
+ <para> Strictly greater/smaller operations are achieved by prepending the field name like in:
+ <programlisting>GetEvents( { '>time' : 1178531418 } ) </programlisting>
+ </para>
+ <para> Greater/smaller or equal:
+ <programlisting>GetEvents( { ']event_id' : 2305 } ) </programlisting>
+ </para>
+ </section>
+
+ <section id="sort-clip">
+ <title> Sorting and Clipping </title>
+ <para> The following 3 special fields can be used to extract only a subset of the results for pagination:
+ <programlisting> GetNodes( { '-SORT' : 'hostname' , '-OFFSET' : 30 , '-LIMIT' : 25 }</programlisting>
+ </para>
+ </section>
+ </section>
+
+ <section id="tags">
+ <title>Tags</title>
+
+ <para> The PLC API comes with a feature called
+ <emphasis>tags</emphasis>, that basically aims at supporting an
+ extensible data model. A few classes (as of this writing, Nodes,
+ Interfaces and Slices) are eligible for being dynamically
+ extended beyond the basic set of fields that are built into the
+ database schema.</para>
+
+ <para> Historically, this is a generalization of the concept of
+ <emphasis> SliceAttribute </emphasis>, and the more recent
+ concept of <emphasis> InterfaceSetting </emphasis>, that with
+ release 5.0 have been renamed into <emphasis> SliceTag
+ </emphasis> and <emphasis> InterfaceTag </emphasis>,
+ respectively. </para>
+
+ <section id="tags-low-level">
+ <title> Low level </title>
+ <para> The low level interface to tags relies on the following items:
<itemizedlist>
<listitem>
- <para> <emphasis> Pattern Matching </emphasis> </para>
- <programlisting>GetNodes ( { 'hostname' : '*.fr' } ) </programlisting>
+ <para>
+ A <emphasis> TagType </emphasis> object basically models a
+ new column that needs to be added to other objects. In
+ much the same way as nodes are named through a <emphasis>
+ hostname </emphasis>, tagtypes are named with a
+ <emphasis>tagname</emphasis>, plus additional information
+ (category, description) that is mostly informative. The
+ convention is to use a category that depicts the type of
+ objects that the tag type, like e.g. <emphasis>
+ node/config </emphasis>
+ </para>
</listitem>
<listitem>
- <para> <emphasis> Negation </emphasis> </para>
- <programlisting>GetNodes( { '~peer_id' : None } ) </programlisting>
+ <para> You would then be allowed to attach a value to, say,
+ a Node, by calling <emphasis> AddNodeTag </emphasis>, and
+ then as usual change this value with <emphasis>
+ UpdateNodeTag </emphasis>, or delete it with <emphasis>
+ DeleteNodeTag </emphasis>. </para>
</listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id="accessors">
+ <title> Accessors </title>
+ <para> A rather more convenient way to use tags is through
+ Accessors. This convenience is located in <emphasis>
+ PLC/Accessors </emphasis>, and allows you to easily define Get
+ or Set methods dedicated to a given tag. This is for instance
+ how the <emphasis> GetNodeArch </emphasis> and <emphasis>
+ SetNodeArch </emphasis> methods are implemented. These methods
+ greatly simplify tags manipulation as they take care of
+ <itemizedlist>
<listitem>
- <para> <emphasis> Numeric comparisons </emphasis> </para>
- <programlisting>GetEvents( { '>time' : 1178531418 } ) </programlisting>
- <programlisting>GetEvents( { ']event_id' : 2305 } ) </programlisting>
+ <para> Lazily create <emphasis> TagTypes </emphasis> when
+ needed,</para>
</listitem>
<listitem>
- <para> <emphasis> Sorting and Clipping </emphasis> </para>
- <programlisting> GetNodes( { '-SORT' : 'hostname' , '-OFFSET' : 30 , '-LIMIT' : 25 }</programlisting>
+ <para> Create or update the, say, <emphasis> NodeTag
+ </emphasis> object, as needed.</para>
</listitem>
</itemizedlist>
+ </para>
+ <para> <emphasis> Site-specific </emphasis> accessors can be
+ defined in <emphasis>
+ /usr/share/plc_api/PLC/Accessors/Accessors_site.py </emphasis>
+ that will be preserved across updates of the PLCAPI rpm.
+ </para>
+ <para>
+ This mechanism does not currently support setting slice
+ tags that apply only on a given node or nodegroup.
+ </para>
+ </section>
+
+ <section id="expose-in-api">
+ <title> Through regular Add/Get/Update methods </title>
+ <para>
+ Finally, tags may also get manipulated through the
+ <emphasis>AddNode</emphasis>, <emphasis>GetNodes</emphasis>,
+ and <emphasis>UpdateNode</emphasis> methods:
+
+ <itemizedlist>
+ <listitem> <para>
+ The <literal>define_accessors</literal> function in the
+ Accessors factory has an optional argument named <literal>
+ expose_in_api </literal>. When this is set, the
+ corresponding tag becomes visible from the Add/Get/Update
+ methods almost as if it was a native tag.
+ </para> </listitem>
+
+ <listitem><para>
+ So for instance the following code would be legal and do as expected:
+<programlisting>
+# create a x86_64 node
+>>> AddNode({'hostname':'pl1.foo.com','arch':'x86_64'})
+# get details for pl1.foo.com including tag 'arch' tag
+>>> GetNodes(['pl1.foo.com'],['boot_state','node_type','arch'])
+# set the 'deployment' tag
+>>> UpdateNode('pl1.foo.com',{'deployment':'beta'})
+# get all alpha and beta nodes
+>>> GetNodes({'deployment':'*a'},['hostname','deployment'])
+</programlisting>
+ </para></listitem>
+
+ <listitem><para>
+ The current limitation about tags as opposed to native
+ fields is that, for performance, tags won't get returned
+ when using the implicit set of columns. So for instance:
+<programlisting>
+# get all details for 'pl1.foo.com'
+>>> node=GetNodes(['pl1.foo.com'])[0]
+# this did not return the 'arch' tag
+>>> 'arch' in node
+False
+</programlisting>
+ </para></listitem>
+
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id="nodegroups">
+ <title>Nodegroups</title>
+
+ <para> In earlier versions up to v4.2, <emphasis> NodeGroups
+ </emphasis> used to be defined extensively. So you would,
+ basically, create an empty nodegroup instance, and then use
+ <emphasis> AddNodeToNodeGroup </emphasis> or <emphasis>
+ DeleteNodeFromNodeGroup </emphasis> to manage the nodegroup's
+ contents. </para>
+
+ <para> The new model has been redefined as follows. You now define
+ a nodegroup as the set of nodes for which a given <emphasis> Tag
+ </emphasis> has a given value, which are defined once and for good
+ when creating the <emphasis> NodeGroup </emphasis> object. </para>
+
+ <para> So for instance for managing the set of nodes that are
+ running various levels of software code, PLC has defined two
+ <emphasis> NodeGroups </emphasis> named <literal> alpha </literal>
+ and <literal> beta </literal>. With the new model, we would now do
+ something like the following, using the built-in <literal>
+ deployment </literal> tag that is created for that purpose:
+<programlisting>
+>>> AddNodeGroup('alphanodes','deployment','alpha')
+21
+>>> AddNodeGroup('betanodes','deployment','beta')
+21
+>>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print ng
+{'groupname': u'alphanodes', 'node_ids': []}
+{'groupname': u'betanodes', 'node_ids': []}
+>>> SetNodeDeployment('vnode01.inria.fr','alpha')
+>>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print ng
+{'groupname': u'alphanodes', 'node_ids': [1]}
+{'groupname': u'betanodes', 'node_ids': []}
+>>> SetNodeDeployment('vnode01.inria.fr','beta')
+>>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print ng
+{'groupname': u'alphanodes', 'node_ids': []}
+{'groupname': u'betanodes', 'node_ids': [1]}
+</programlisting>
+</para>
+
</section>
- <section>
+ <section id="plcsh">
<title>PlanetLab shell</title>
<para>A command-line program called <command>plcsh</command>
nodes = plc.GetNodes([121], ['node_id', 'hostname'])
</programlisting>
</section>
+
+ <section id='standalone'>
+ <title>Using regular python</title>
+
+ <para>It is also possible to write simple regular-python scripts,
+ as illustrated in the example below. The only difference with the
+ examples above is that all API calls need to be passed a first
+ argument for authentication. This example would write in a file
+ the name of all the hosts attached to a given slice.</para>
+
+<programlisting>
+#!/usr/bin/env python
+
+import xmlrpclib
+
+plc_host='www.planet-lab.eu'
+login='thierry.parmentelat@sophia.inria.fr'
+password='xxxxxxxx'
+
+slice_name='inria_heartbeat'
+
+auth = { 'AuthMethod' : 'password',
+ 'Username' : login,
+ 'AuthString' : password,
+}
+
+api_url="https://%s:443/PLCAPI/"%plc_host
+
+plc_api = xmlrpclib.ServerProxy(api_url,allow_none=True)
+
+# the slice's node ids
+node_ids = plc_api.GetSlices(auth,slice_name,['node_ids'])[0]['node_ids']
+
+# get hostname for these nodes
+slice_nodes = plc_api.GetNodes(auth,node_ids,['hostname'])
+
+# store in a file
+f=open('mynodes.txt','w')
+for node in slice_nodes:
+ print >>f,node['hostname']
+f.close()
+</programlisting>
+ </section>
+
</chapter>
<chapter id="Methods">
--- /dev/null
+--
+-- purpose: provide a way to delete the additions added by the up script.
+-- NOTE: this does not leave the DB in a usable state, since it drops the view_sites and view_persons;
+--
+
+DROP VIEW view_site_tags;
+DROP VIEW view_sites;
+DROP VIEW site_tags;
+DROP TABLE site_tag;
+
+DROP VIEW view_person_tags;
+DROP VIEW view_persons;
+DROP VIEW person_tags;
+DROP TABLE person_tag;
+
+UPDATE plc_db_version SET subversion = 0;
+++ /dev/null
--- you may also write downgrader scripts, though they are not - yet - supported
-
-ALTER TABLE plc_db_version DROP subversion;
--- /dev/null
+--
+-- PlanetLab
+--
+-- migration 001
+--
+-- purpose: provide tags on site and person objects in db
+--
+--
+
+-- SITES
+
+CREATE TABLE site_tag (
+ site_tag_id serial PRIMARY KEY, -- ID
+ site_id integer REFERENCES sites NOT NULL, -- site id
+ tag_type_id integer REFERENCES tag_types, -- tag type id
+ value text -- value attached
+) WITH OIDS;
+
+CREATE OR REPLACE VIEW site_tags AS
+SELECT site_id,
+array_accum(site_tag_id) AS site_tag_ids
+FROM site_tag
+GROUP BY site_id;
+
+CREATE OR REPLACE VIEW view_site_tags AS
+SELECT
+site_tag.site_tag_id,
+site_tag.site_id,
+sites.login_base,
+tag_types.tag_type_id,
+tag_types.tagname,
+tag_types.description,
+tag_types.category,
+tag_types.min_role_id,
+site_tag.value
+FROM site_tag
+INNER JOIN tag_types USING (tag_type_id)
+INNER JOIN sites USING (site_id);
+
+DROP VIEW view_sites;
+CREATE OR REPLACE VIEW view_sites AS
+SELECT
+sites.site_id,
+sites.login_base,
+sites.name,
+sites.abbreviated_name,
+sites.deleted,
+sites.enabled,
+sites.is_public,
+sites.max_slices,
+sites.max_slivers,
+sites.latitude,
+sites.longitude,
+sites.url,
+sites.ext_consortium_id,
+CAST(date_part('epoch', sites.date_created) AS bigint) AS date_created,
+CAST(date_part('epoch', sites.last_updated) AS bigint) AS last_updated,
+peer_site.peer_id,
+peer_site.peer_site_id,
+COALESCE((SELECT person_ids FROM site_persons WHERE site_persons.site_id = sites.site_id), '{}') AS person_ids,
+COALESCE((SELECT node_ids FROM site_nodes WHERE site_nodes.site_id = sites.site_id), '{}') AS node_ids,
+COALESCE((SELECT address_ids FROM site_addresses WHERE site_addresses.site_id = sites.site_id), '{}') AS address_ids,
+COALESCE((SELECT slice_ids FROM site_slices WHERE site_slices.site_id = sites.site_id), '{}') AS slice_ids,
+COALESCE((SELECT pcu_ids FROM site_pcus WHERE site_pcus.site_id = sites.site_id), '{}') AS pcu_ids,
+COALESCE((SELECT site_tag_ids FROM site_tags WHERE site_tags.site_id = sites.site_id), '{}') AS site_tag_ids
+FROM sites
+LEFT JOIN peer_site USING (site_id);
+
+-- PERSONS
+
+CREATE TABLE person_tag (
+ person_tag_id serial PRIMARY KEY, -- ID
+ person_id integer REFERENCES persons NOT NULL, -- person id
+ tag_type_id integer REFERENCES tag_types, -- tag type id
+ value text -- value attached
+) WITH OIDS;
+
+CREATE OR REPLACE VIEW person_tags AS
+SELECT person_id,
+array_accum(person_tag_id) AS person_tag_ids
+FROM person_tag
+GROUP BY person_id;
+
+CREATE OR REPLACE VIEW view_person_tags AS
+SELECT
+person_tag.person_tag_id,
+person_tag.person_id,
+persons.email,
+tag_types.tag_type_id,
+tag_types.tagname,
+tag_types.description,
+tag_types.category,
+tag_types.min_role_id,
+person_tag.value
+FROM person_tag
+INNER JOIN tag_types USING (tag_type_id)
+INNER JOIN persons USING (person_id);
+
+DROP VIEW view_persons;
+CREATE OR REPLACE VIEW view_persons AS
+SELECT
+persons.person_id,
+persons.email,
+persons.first_name,
+persons.last_name,
+persons.deleted,
+persons.enabled,
+persons.password,
+persons.verification_key,
+CAST(date_part('epoch', persons.verification_expires) AS bigint) AS verification_expires,
+persons.title,
+persons.phone,
+persons.url,
+persons.bio,
+CAST(date_part('epoch', persons.date_created) AS bigint) AS date_created,
+CAST(date_part('epoch', persons.last_updated) AS bigint) AS last_updated,
+peer_person.peer_id,
+peer_person.peer_person_id,
+COALESCE((SELECT role_ids FROM person_roles WHERE person_roles.person_id = persons.person_id), '{}') AS role_ids,
+COALESCE((SELECT roles FROM person_roles WHERE person_roles.person_id = persons.person_id), '{}') AS roles,
+COALESCE((SELECT site_ids FROM person_sites WHERE person_sites.person_id = persons.person_id), '{}') AS site_ids,
+COALESCE((SELECT key_ids FROM person_keys WHERE person_keys.person_id = persons.person_id), '{}') AS key_ids,
+COALESCE((SELECT slice_ids FROM person_slices WHERE person_slices.person_id = persons.person_id), '{}') AS slice_ids,
+COALESCE((SELECT person_tag_ids FROM person_tags WHERE person_tags.person_id = persons.person_id), '{}') AS person_tag_ids
+FROM persons
+LEFT JOIN peer_person USING (person_id);
+
+
+UPDATE plc_db_version SET subversion = 1;
+++ /dev/null
--- Add plc_db_version.subversion field
-ALTER TABLE plc_db_version ADD subversion integer NOT NULL DEFAULT 0;
-
--- Bump subversion
-UPDATE plc_db_version SET subversion = 1;
+++ /dev/null
--- Remove NOT NULL constraint from creator_person_id in case the
--- creator is deleted.
-ALTER TABLE slices ALTER creator_person_id DROP NOT NULL;
-
--- Bump subversion
-UPDATE plc_db_version SET subversion = 2;
+++ /dev/null
--- IMPORTANT NOTICE
---
--- this down script is provided for convenience only
--- DO NOT USE on an operational site
--- the change in migration 003 involves creating
--- the new view view_nodenetworks for fetching instances
--- of NodeNetworks
--- AND to alter NodeNetworks.py accordingly
--- so this change cannot be easily undone
--- unless you also revert the API itself
-
-DROP VIEW view_nodenetworks;
-
-DROP VIEW view_nodenetwork_settings;
-
-DROP VIEW nodenetwork_settings;
-
-DROP TABLE nodenetwork_setting;
-
-DROP TABLE nodenetwork_setting_types;
-
--- deflate subversion
-UPDATE plc_db_version SET subversion = 2;
-SELECT subversion from plc_db_version;
+++ /dev/null
-#!/usr/bin/env plcsh
-
-nnst = GetNodeNetworkSettingTypes(['interface_name'])
-if nnst:
- print 'NodeNetworkSettingType interface_name already defined'
-else:
- AddNodeNetworkSettingType({
- 'category':'general',
- 'min_role_id':30,
- 'name':'interface_name',
- 'description':'allows to specify a custom interface name'
- })
-nnst_ifname_id = GetNodeNetworkSettingTypes(['interface_name'])[0]['nodenetwork_setting_type_id']
-
-
-nnst = GetNodeNetworkSettingTypes(['ssid'])
-if nnst:
- print 'NodeNetworkSettingType ssid already defined'
-else:
- AddNodeNetworkSettingType({
- 'category':'wifi',
- 'min_role_id':30,
- 'name':'ssid',
- 'description':'allows to set ESSID'
- })
-nnst_ssid_id = GetNodeNetworkSettingTypes(['ssid'])[0]['nodenetwork_setting_type_id']
-
-nodename = 'onelab2.inria.fr'
-
-nodenetwork_id=GetNodes(nodename)[0]['nodenetwork_ids'][0]
-
-#######
-nns_ifname = GetNodeNetworkSettings ({'nodenetwork_id':nodenetwork_id,
- 'nodenetwork_setting_type_id':nnst_ifname_id})
-if nns_ifname:
- print "interface name for %s already set (got %s - cat=%s)" %\
- (nodename,nns_ifname[0]['value'],nns_ifname[0]['category'])
-else:
- AddNodeNetworkSetting(nodenetwork_id, 'interface_name', 'custom-eth0')
-
-nns_ifname_id = GetNodeNetworkSettings ({'nodenetwork_id':nodenetwork_id,
- 'nodenetwork_setting_type_id':nnst_ifname_id})[0]['nodenetwork_setting_id']
-#######
-nns_ssid = GetNodeNetworkSettings ({'nodenetwork_id':nodenetwork_id,
- 'nodenetwork_setting_type_id':nnst_ssid_id})
-if nns_ssid:
- print "ssid for %s already set (got %s - cat=%s)" %\
- (nodename,nns_ifname[0]['value'],nns_ifname[0]['category'])
-else:
- AddNodeNetworkSetting(nodenetwork_id, 'ssid', 'init-onelab-g')
-
-nns_ssid_id = GetNodeNetworkSettings ({'nodenetwork_id':nodenetwork_id,
- 'nodenetwork_setting_type_id':nnst_ssid_id})[0]['nodenetwork_setting_id']
-
-#######
-
-UpdateNodeNetworkSetting (nns_ssid_id,'onelab-g')
-
-DeleteNodeNetworkSetting (nns_ifname_id)
-
+++ /dev/null
---
--- Thierry Parmentelat -- INRIA
---
--- migration 003
---
--- purpose : provide a generic mechanism for assigning
--- nodenetworks (read, network interfaces) with
--- custom settings
---
--- design
--- mimicks the way slice attributes are being handled,
--- not that this design is particularly attractive
--- but let's not add confusion here
--- i.e:
--- (*) nodenetwork_setting_types (see slice_attribute_types)
--- allows to define a new setting
--- e.g, define one such object for storing wifi SSID
---
--- (*) nodenetwork_setting (see slice_attribute)
--- allow to associate a nodenetwork, a nodenetwork_setting_type, and a value
---
--- NOTE. with slice_attributes there is a trick that allows to define
--- the attribute either on the slice globally or on a particular node only.
--- of course we do not need such a trick
-
-CREATE TABLE nodenetwork_setting_types (
- nodenetwork_setting_type_id serial PRIMARY KEY,
- -- Setting Type Identifier
- name text UNIQUE NOT NULL, -- Setting Name
- description text, -- Optional Description
- category text NOT NULL, -- Category, e.g. Wifi, or whatever
- min_role_id integer references roles -- If set, minimal role required
-) WITH OIDS;
-
-CREATE TABLE nodenetwork_setting (
- nodenetwork_setting_id serial PRIMARY KEY, -- Nodenetwork Setting Identifier
- nodenetwork_id integer REFERENCES nodenetworks NOT NULL,
- -- the nodenetwork this applies to
- nodenetwork_setting_type_id integer REFERENCES nodenetwork_setting_types NOT NULL,
- -- the setting type
- value text
-) WITH OIDS;
-
-
-CREATE OR REPLACE VIEW nodenetwork_settings AS
-SELECT nodenetwork_id,
-array_accum(nodenetwork_setting_id) AS nodenetwork_setting_ids
-FROM nodenetwork_setting
-GROUP BY nodenetwork_id;
-
-CREATE OR REPLACE VIEW view_nodenetwork_settings AS
-SELECT
-nodenetwork_setting.nodenetwork_setting_id,
-nodenetwork_setting.nodenetwork_id,
-nodenetwork_setting_types.nodenetwork_setting_type_id,
-nodenetwork_setting_types.name,
-nodenetwork_setting_types.description,
-nodenetwork_setting_types.category,
-nodenetwork_setting_types.min_role_id,
-nodenetwork_setting.value
-FROM nodenetwork_setting
-INNER JOIN nodenetwork_setting_types USING (nodenetwork_setting_type_id);
-
-CREATE VIEW view_nodenetworks AS
-SELECT
-nodenetworks.nodenetwork_id,
-nodenetworks.node_id,
-nodenetworks.is_primary,
-nodenetworks.type,
-nodenetworks.method,
-nodenetworks.ip,
-nodenetworks.mac,
-nodenetworks.gateway,
-nodenetworks.network,
-nodenetworks.broadcast,
-nodenetworks.netmask,
-nodenetworks.dns1,
-nodenetworks.dns2,
-nodenetworks.bwlimit,
-nodenetworks.hostname,
-COALESCE((SELECT nodenetwork_setting_ids FROM nodenetwork_settings WHERE nodenetwork_settings.nodenetwork_id = nodenetworks.nodenetwork_id), '{}') AS nodenetwork_setting_ids
-FROM nodenetworks;
-
--- Bump subversion
-UPDATE plc_db_version SET subversion = 3;
-SELECT subversion from plc_db_version;
+++ /dev/null
---
--- bugfix
--- the site_nodes should restrict to nodes where deleted is false
---
-
-CREATE OR REPLACE VIEW site_nodes AS
-SELECT site_id,
-array_accum(node_id) AS node_ids
-FROM nodes
-WHERE deleted is false
-GROUP BY site_id;
-
--- Bump subversion
-UPDATE plc_db_version SET subversion = 4;
-SELECT subversion from plc_db_version;
-
+++ /dev/null
--- revert migration 005
---
--- this is a rather complex example, so for next times, make sure that you
--- * first restore old columns or tables
--- * then create or replace views
--- * and only finally drop new columns and tables
--- otherwise the columns may refuse to get dropped if they are still used by views
---
-
----------- creations
-
-ALTER TABLE events ADD object_type text NOT NULL Default 'Unknown';
-
----------- view changes
-
--- for some reason these views require to be dropped first
-DROP VIEW view_events;
-DROP VIEW event_objects;
-DROP VIEW view_nodes;
-DROP VIEW view_sites;
-
-CREATE OR REPLACE VIEW event_objects AS
-SELECT event_id,
-array_accum(object_id) AS object_ids
-FROM event_object
-GROUP BY event_id;
-
-CREATE OR REPLACE VIEW view_events AS
-SELECT
-events.event_id,
-events.person_id,
-events.node_id,
-events.fault_code,
-events.call_name,
-events.call,
-events.object_type,
-events.message,
-events.runtime,
-CAST(date_part('epoch', events.time) AS bigint) AS time,
-COALESCE((SELECT object_ids FROM event_objects WHERE event_objects.event_id = events.event_id), '{}') AS object_ids
-FROM events;
-
-CREATE OR REPLACE VIEW view_nodes AS
-SELECT
-nodes.node_id,
-nodes.hostname,
-nodes.site_id,
-nodes.boot_state,
-nodes.deleted,
-nodes.model,
-nodes.boot_nonce,
-nodes.version,
-nodes.ssh_rsa_key,
-nodes.key,
-CAST(date_part('epoch', nodes.date_created) AS bigint) AS date_created,
-CAST(date_part('epoch', nodes.last_updated) AS bigint) AS last_updated,
-peer_node.peer_id,
-peer_node.peer_node_id,
-COALESCE((SELECT nodenetwork_ids FROM node_nodenetworks WHERE node_nodenetworks.node_id = nodes.node_id), '{}') AS nodenetwork_ids,
-COALESCE((SELECT nodegroup_ids FROM node_nodegroups WHERE node_nodegroups.node_id = nodes.node_id), '{}') AS nodegroup_ids,
-COALESCE((SELECT slice_ids FROM node_slices WHERE node_slices.node_id = nodes.node_id), '{}') AS slice_ids,
-COALESCE((SELECT pcu_ids FROM node_pcus WHERE node_pcus.node_id = nodes.node_id), '{}') AS pcu_ids,
-COALESCE((SELECT ports FROM node_pcus WHERE node_pcus.node_id = nodes.node_id), '{}') AS ports,
-COALESCE((SELECT conf_file_ids FROM node_conf_files WHERE node_conf_files.node_id = nodes.node_id), '{}') AS conf_file_ids,
-node_session.session_id AS session
-FROM nodes
-LEFT JOIN peer_node USING (node_id)
-LEFT JOIN node_session USING (node_id);
-
-CREATE OR REPLACE VIEW view_sites AS
-SELECT
-sites.site_id,
-sites.login_base,
-sites.name,
-sites.abbreviated_name,
-sites.deleted,
-sites.enabled,
-sites.is_public,
-sites.max_slices,
-sites.max_slivers,
-sites.latitude,
-sites.longitude,
-sites.url,
-CAST(date_part('epoch', sites.date_created) AS bigint) AS date_created,
-CAST(date_part('epoch', sites.last_updated) AS bigint) AS last_updated,
-peer_site.peer_id,
-peer_site.peer_site_id,
-COALESCE((SELECT person_ids FROM site_persons WHERE site_persons.site_id = sites.site_id), '{}') AS person_ids,
-COALESCE((SELECT node_ids FROM site_nodes WHERE site_nodes.site_id = sites.site_id), '{}') AS node_ids,
-COALESCE((SELECT address_ids FROM site_addresses WHERE site_addresses.site_id = sites.site_id), '{}') AS address_ids,
-COALESCE((SELECT slice_ids FROM site_slices WHERE site_slices.site_id = sites.site_id), '{}') AS slice_ids,
-COALESCE((SELECT pcu_ids FROM site_pcus WHERE site_pcus.site_id = sites.site_id), '{}') AS pcu_ids
-FROM sites
-LEFT JOIN peer_site USING (site_id);
-
----------- deletions
-
-ALTER TABLE sites DROP COLUMN ext_consortium_id;
-
-ALTER TABLE nodes DROP COLUMN last_contact;
-
-DROP INDEX initscripts_name_idx;
-DROP TABLE initscripts;
-
-ALTER TABLE events DROP COLUMN auth_type;
-
-ALTER TABLE event_object DROP COLUMN object_type;
-
----------- revert subversion
-
-UPDATE plc_db_version SET subversion = 4;
-SELECT subversion from plc_db_version;
+++ /dev/null
---
--- to apply changes from import done in april 2007 from the
--- planetlab-4_0-branch tag
---
--- this is a rather complex example, so for next times, make sure that you
--- * first add new columns and new tables
--- * then create or replace views
--- * and only finally drop columns
--- otherwise the columns may refuse to get dropped if they are still used by views
---
-
----------- creations
-
-ALTER TABLE sites ADD ext_consortium_id integer;
-
-ALTER TABLE nodes ADD last_contact timestamp without time zone;
-
--- Initscripts
-CREATE TABLE initscripts (
- initscript_id serial PRIMARY KEY, -- Initscript identifier
- name text NOT NULL, -- Initscript name
- enabled bool NOT NULL DEFAULT true, -- Initscript is active
- script text NOT NULL, -- Initscript
- UNIQUE (name)
-) WITH OIDS;
-CREATE INDEX initscripts_name_idx ON initscripts (name);
-
--- rather drop the tables altogether,
--- ALTER TABLE events ADD auth_type text;
--- ALTER TABLE event_object ADD COLUMN object_type text NOT NULL Default 'Unknown';
--- CREATE INDEX event_object_object_type_idx ON event_object (object_type);
-
--- for some reason these views require to be dropped first
-DROP VIEW view_events;
-DROP VIEW event_objects;
-DROP VIEW view_nodes;
-DROP VIEW view_sites;
-
-----dropping tables must be preceded by dropping views using those tables
-----otherwise dependency problems
-DROP TABLE event_object;
-DROP TABLE events;
-
-CREATE TABLE events (
- event_id serial PRIMARY KEY, -- Event identifier
- person_id integer REFERENCES persons, -- Person responsible for event, if any
- node_id integer REFERENCES nodes, -- Node responsible for event, if any
- auth_type text, -- Type of auth used. i.e. AuthMethod
- fault_code integer NOT NULL DEFAULT 0, -- Did this event result in error
- call_name text NOT NULL, -- Call responsible for this event
- call text NOT NULL, -- Call responsible for this event, including parameters
- message text, -- High level description of this event
- runtime float DEFAULT 0, -- Event run time
- time timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP -- Event timestamp
-) WITH OIDS;
-
--- Database object(s) that may have been affected by a particular event
-CREATE TABLE event_object (
- event_id integer REFERENCES events NOT NULL, -- Event identifier
- object_id integer NOT NULL, -- Object identifier
- object_type text NOT NULL Default 'Unknown' -- What type of object is this event affecting
-) WITH OIDS;
-CREATE INDEX event_object_event_id_idx ON event_object (event_id);
-CREATE INDEX event_object_object_id_idx ON event_object (object_id);
-CREATE INDEX event_object_object_type_idx ON event_object (object_type);
-
----------- view changes
-
-CREATE OR REPLACE VIEW event_objects AS
-SELECT event_id,
-array_accum(object_id) AS object_ids,
-array_accum(object_type) AS object_types
-FROM event_object
-GROUP BY event_id;
-
-CREATE OR REPLACE VIEW view_events AS
-SELECT
-events.event_id,
-events.person_id,
-events.node_id,
-events.auth_type,
-events.fault_code,
-events.call_name,
-events.call,
-events.message,
-events.runtime,
-CAST(date_part('epoch', events.time) AS bigint) AS time,
-COALESCE((SELECT object_ids FROM event_objects WHERE event_objects.event_id = events.event_id), '{}') AS object_ids,
-COALESCE((SELECT object_types FROM event_objects WHERE event_objects.event_id = events.event_id), '{}') AS object_types
-FROM events;
-
-CREATE OR REPLACE VIEW view_nodes AS
-SELECT
-nodes.node_id,
-nodes.hostname,
-nodes.site_id,
-nodes.boot_state,
-nodes.deleted,
-nodes.model,
-nodes.boot_nonce,
-nodes.version,
-nodes.ssh_rsa_key,
-nodes.key,
-CAST(date_part('epoch', nodes.date_created) AS bigint) AS date_created,
-CAST(date_part('epoch', nodes.last_updated) AS bigint) AS last_updated,
-CAST(date_part('epoch', nodes.last_contact) AS bigint) AS last_contact,
-peer_node.peer_id,
-peer_node.peer_node_id,
-COALESCE((SELECT nodenetwork_ids FROM node_nodenetworks WHERE node_nodenetworks.node_id = nodes.node_id), '{}') AS nodenetwork_ids,
-COALESCE((SELECT nodegroup_ids FROM node_nodegroups WHERE node_nodegroups.node_id = nodes.node_id), '{}') AS nodegroup_ids,
-COALESCE((SELECT slice_ids FROM node_slices WHERE node_slices.node_id = nodes.node_id), '{}') AS slice_ids,
-COALESCE((SELECT pcu_ids FROM node_pcus WHERE node_pcus.node_id = nodes.node_id), '{}') AS pcu_ids,
-COALESCE((SELECT ports FROM node_pcus WHERE node_pcus.node_id = nodes.node_id), '{}') AS ports,
-COALESCE((SELECT conf_file_ids FROM node_conf_files WHERE node_conf_files.node_id = nodes.node_id), '{}') AS conf_file_ids,
-node_session.session_id AS session
-FROM nodes
-LEFT JOIN peer_node USING (node_id)
-LEFT JOIN node_session USING (node_id);
-
-CREATE OR REPLACE VIEW view_sites AS
-SELECT
-sites.site_id,
-sites.login_base,
-sites.name,
-sites.abbreviated_name,
-sites.deleted,
-sites.enabled,
-sites.is_public,
-sites.max_slices,
-sites.max_slivers,
-sites.latitude,
-sites.longitude,
-sites.url,
-sites.ext_consortium_id,
-CAST(date_part('epoch', sites.date_created) AS bigint) AS date_created,
-CAST(date_part('epoch', sites.last_updated) AS bigint) AS last_updated,
-peer_site.peer_id,
-peer_site.peer_site_id,
-COALESCE((SELECT person_ids FROM site_persons WHERE site_persons.site_id = sites.site_id), '{}') AS person_ids,
-COALESCE((SELECT node_ids FROM site_nodes WHERE site_nodes.site_id = sites.site_id), '{}') AS node_ids,
-COALESCE((SELECT address_ids FROM site_addresses WHERE site_addresses.site_id = sites.site_id), '{}') AS address_ids,
-COALESCE((SELECT slice_ids FROM site_slices WHERE site_slices.site_id = sites.site_id), '{}') AS slice_ids,
-COALESCE((SELECT pcu_ids FROM site_pcus WHERE site_pcus.site_id = sites.site_id), '{}') AS pcu_ids
-FROM sites
-LEFT JOIN peer_site USING (site_id);
-
----------- deletions
---dont need to drop this colum it doesn't exit anymore
------ALTER TABLE events DROP COLUMN object_type;
-
----------- bump subversion
-
-UPDATE plc_db_version SET subversion = 5;
-SELECT subversion from plc_db_version;
+++ /dev/null
----------- view changes
-
-DROP VIEW view_slice_attributes;
-
-CREATE OR REPLACE VIEW view_slice_attributes AS
-SELECT
-slice_attribute.slice_attribute_id,
-slice_attribute.slice_id,
-slice_attribute.node_id,
-slice_attribute_types.attribute_type_id,
-slice_attribute_types.name,
-slice_attribute_types.description,
-slice_attribute_types.min_role_id,
-slice_attribute.value
-FROM slice_attribute
-INNER JOIN slice_attribute_types USING (attribute_type_id);
-
----------- deletions
-DROP INDEX slice_attribute_nodegroup_id_idx;
-ALTER TABLE slice_attribute DROP COLUMN nodegroup_id;
-
----------- revert subversion
-
-UPDATE plc_db_version SET subversion = 5;
-SELECT subversion from plc_db_version;
+++ /dev/null
----------- creations
-
-ALTER TABLE slice_attribute ADD nodegroup_id integer REFERENCES nodegroups;
-
-CREATE INDEX slice_attribute_nodegroup_id_idx ON slice_attribute (nodegroup_id);
-
----------- view changes
-
-DROP VIEW view_slice_attributes;
-
-CREATE OR REPLACE VIEW view_slice_attributes AS
-SELECT
-slice_attribute.slice_attribute_id,
-slice_attribute.slice_id,
-slice_attribute.node_id,
-slice_attribute.nodegroup_id,
-slice_attribute_types.attribute_type_id,
-slice_attribute_types.name,
-slice_attribute_types.description,
-slice_attribute_types.min_role_id,
-slice_attribute.value
-FROM slice_attribute
-INNER JOIN slice_attribute_types USING (attribute_type_id);
-
-
----------- bump subversion
-
-UPDATE plc_db_version SET subversion = 6;
-SELECT subversion from plc_db_version;
+++ /dev/null
---
--- migration 007 - revert
---
-
-DROP VIEW view_event_objects;
-
----------- revert subversion
-
-UPDATE plc_db_version SET subversion = 6;
-SELECT subversion from plc_db_version;
-
+++ /dev/null
---
--- migration 007
--- change the way event objects are fetched, use a view for that purpose
---
-
-
-CREATE OR REPLACE VIEW view_event_objects AS
-SELECT
-events.event_id,
-events.person_id,
-events.node_id,
-events.fault_code,
-events.call_name,
-events.call,
-events.message,
-events.runtime,
-CAST(date_part('epoch', events.time) AS bigint) AS time,
-event_object.object_id,
-event_object.object_type
-FROM events LEFT JOIN event_object USING (event_id);
-
-
----------- bump subversion
-
-UPDATE plc_db_version SET subversion = 7;
-SELECT subversion from plc_db_version;
+++ /dev/null
-
-DELETE from slice_instantiations WHERE instantiation='nm-controller';
-
-
-
-DROP VIEW view_nodes;
-DROP VIEW node_slices_whitelist;
-DROP TABLE node_slice_whitelist;
-
-CREATE OR REPLACE VIEW view_nodes AS
-SELECT
-nodes.node_id,
-nodes.hostname,
-nodes.site_id,
-nodes.boot_state,
-nodes.deleted,
-nodes.model,
-nodes.boot_nonce,
-nodes.version,
-nodes.ssh_rsa_key,
-nodes.key,
-CAST(date_part('epoch', nodes.date_created) AS bigint) AS date_created,
-CAST(date_part('epoch', nodes.last_updated) AS bigint) AS last_updated,
-CAST(date_part('epoch', nodes.last_contact) AS bigint) AS last_contact,
-peer_node.peer_id,
-peer_node.peer_node_id,
-COALESCE((SELECT nodenetwork_ids FROM node_nodenetworks WHERE node_nodenetworks.node_id = nodes.node_id), '{}') AS nodenetwork_ids,
-COALESCE((SELECT nodegroup_ids FROM node_nodegroups WHERE node_nodegroups.node_id = nodes.node_id), '{}') AS nodegroup_ids,
-COALESCE((SELECT slice_ids FROM node_slices WHERE node_slices.node_id = nodes.node_id), '{}') AS slice_ids,
-COALESCE((SELECT pcu_ids FROM node_pcus WHERE node_pcus.node_id = nodes.node_id), '{}') AS pcu_ids,
-COALESCE((SELECT ports FROM node_pcus WHERE node_pcus.node_id = nodes.node_id), '{}') AS ports,
-COALESCE((SELECT conf_file_ids FROM node_conf_files WHERE node_conf_files.node_id = nodes.node_id), '{}') AS conf_file_ids,
-node_session.session_id AS session
-FROM nodes
-LEFT JOIN peer_node USING (node_id)
-LEFT JOIN node_session USING (node_id);
-
-
----------- revert subversion
-
-UPDATE plc_db_version SET subversion = 7;
-SELECT subversion from plc_db_version;
+++ /dev/null
---
--- migration 008
--- import from Princeton codebase on august 2007 28
--- slice instantiation 'nm-controller'
--- * white lists
---
-
-INSERT INTO slice_instantiations (instantiation) VALUES ('nm-controller'); -- NM Controller
-
---------------------------------------------------------------------------------
--- Slice whitelist
---------------------------------------------------------------------------------
--- slice whitelist on nodes
-CREATE TABLE node_slice_whitelist (
- node_id integer REFERENCES nodes NOT NULL, -- Node id of whitelist
- slice_id integer REFERENCES slices NOT NULL, -- Slice id thats allowd on this node
- PRIMARY KEY (node_id, slice_id)
-) WITH OIDS;
-CREATE INDEX node_slice_whitelist_node_id_idx ON node_slice_whitelist (node_id);
-CREATE INDEX node_slice_whitelist_slice_id_idx ON node_slice_whitelist (slice_id);
-
--- Slices on each node
-CREATE VIEW node_slices_whitelist AS
-SELECT node_id,
-array_accum(slice_id) AS slice_ids_whitelist
-FROM node_slice_whitelist
-GROUP BY node_id;
-
-DROP VIEW view_nodes;
-
-
-CREATE OR REPLACE VIEW view_nodes AS
-SELECT
-nodes.node_id,
-nodes.hostname,
-nodes.site_id,
-nodes.boot_state,
-nodes.deleted,
-nodes.model,
-nodes.boot_nonce,
-nodes.version,
-nodes.ssh_rsa_key,
-nodes.key,
-CAST(date_part('epoch', nodes.date_created) AS bigint) AS date_created,
-CAST(date_part('epoch', nodes.last_updated) AS bigint) AS last_updated,
-CAST(date_part('epoch', nodes.last_contact) AS bigint) AS last_contact,
-peer_node.peer_id,
-peer_node.peer_node_id,
-COALESCE((SELECT nodenetwork_ids FROM node_nodenetworks WHERE node_nodenetworks.node_id = nodes.node_id), '{}') AS nodenetwork_ids,
-COALESCE((SELECT nodegroup_ids FROM node_nodegroups WHERE node_nodegroups.node_id = nodes.node_id), '{}') AS nodegroup_ids,
-COALESCE((SELECT slice_ids FROM node_slices WHERE node_slices.node_id = nodes.node_id), '{}') AS slice_ids,
-COALESCE((SELECT slice_ids_whitelist FROM node_slices_whitelist WHERE node_slices_whitelist.node_id = nodes.node_id), '{}') AS slice_ids_whitelist,
-COALESCE((SELECT pcu_ids FROM node_pcus WHERE node_pcus.node_id = nodes.node_id), '{}') AS pcu_ids,
-COALESCE((SELECT ports FROM node_pcus WHERE node_pcus.node_id = nodes.node_id), '{}') AS ports,
-COALESCE((SELECT conf_file_ids FROM node_conf_files WHERE node_conf_files.node_id = nodes.node_id), '{}') AS conf_file_ids,
-node_session.session_id AS session
-FROM nodes
-LEFT JOIN peer_node USING (node_id)
-LEFT JOIN node_session USING (node_id);
-
----------- bump subversion
-
-UPDATE plc_db_version SET subversion = 8;
-SELECT subversion from plc_db_version;
+++ /dev/null
---
--- 009 revert
---
-
-DROP VIEW view_pcu_types;
-
-DROP VIEW pcu_type_ports;
-
-DROP TABLE pcu_type_port;
-
-DROP TABLE pcu_types;
-
-UPDATE plc_db_version SET subversion = 7;
+++ /dev/null
---
--- Tony Mack - PlanetLab
---
--- migration 009
---
--- purpose: provide a means for storing details about pcu models
---
---
-
-CREATE TABLE pcu_types (
- pcu_type_id serial PRIMARY KEY,
- model text NOT NULL, -- PCU model name
- name text -- Full PCU model name
-) WITH OIDS;
-CREATE INDEX pcu_types_model_idx ON pcu_types (model);
-
-CREATE TABLE pcu_protocol_type (
- pcu_protocol_type_id serial PRIMARY KEY,
- pcu_type_id integer REFERENCES pcu_types NOT NULL, -- PCU type identifier
- port integer NOT NULL, -- PCU port
- protocol text NOT NULL, -- Protocol
- supported boolean NOT NULL DEFAULT True -- Does PLC support
-) WITH OIDS;
-CREATE INDEX pcu_protocol_type_pcu_type_id ON pcu_protocol_type (pcu_type_id);
-
-
-CREATE OR REPLACE VIEW pcu_protocol_types AS
-SELECT pcu_type_id,
-array_accum(pcu_protocol_type_id) as pcu_protocol_type_ids
-FROM pcu_protocol_type
-GROUP BY pcu_type_id;
-
-CREATE OR REPLACE VIEW view_pcu_types AS
-SELECT
-pcu_types.pcu_type_id,
-pcu_types.model,
-pcu_types.name,
-COALESCE((SELECT pcu_protocol_type_ids FROM pcu_protocol_types WHERE pcu_protocol_types.pcu_type_id = pcu_types.pcu_type_id), '{}') AS pcu_protocol_type_ids
-FROM pcu_types;
-
-UPDATE plc_db_version SET subversion = 9;
<nnn>-up-any-text.<ext>
with contiguous indices starting with 001
-if the extension is .sql it is ran on the planetlab4 database
+if the extension is .sql it is ran on the planetlab5 database
otherwise it is run as is
See myplc/plc.d/db for how this is used
--- /dev/null
+#!/usr/bin/env python
+
+import sys
+import re
+
+class Schema:
+
+ def __init__ (self,input,output=None):
+ self.input=input
+ self.output=output
+
+ # left part is non-greedy
+ comment=re.compile("(.*?)--.*")
+ spaces=re.compile("^\s+(\S.*)")
+ view=re.compile("(?i)\s*create\s+(or\s+replace)?\s+view.*")
+
+ def parse (self):
+ if self.output:
+ outfile = open(self.output,"w")
+ else:
+ outfile = sys.stdout
+ contents = file(self.input).read()
+ parts=contents.split(";")
+ for part in parts:
+ # normalize: remove comments, linebreaks, trailing spaces..
+ normalized=''
+ lines=part.split('\n');
+ out_lines=[]
+ for line in lines:
+ # remove comment
+ match=Schema.comment.match(line)
+ if match:
+ line=match.group(1)
+ out_lines.append(line)
+ # get them together
+ out_line = " ".join(out_lines)
+ # remove trailing spaces
+ match=Schema.spaces.match(out_line)
+ if match:
+ out_line=match.group(1)
+ match=Schema.view.match(out_line)
+ if match:
+ print >>outfile, out_line,';'
+ if outfile != sys.stdout:
+ outfile.close()
+
+if __name__ == '__main__':
+ if len(sys.argv) not in [2,3]:
+ print 'Usage:',sys.argv[0],'input [output]'
+ sys.exit(1)
+ input=sys.argv[1]
+ try:
+ output=sys.argv[2]
+ except:
+ output=None
+ Schema(input,output).parse()
+
--- /dev/null
+s,slice_attribute_type,tag_type,g
+s,attribute_type_id,tag_type_id,g
+s,nodenetwork_setting,interface_tag,g
+s,slice_attribute,slice_tag,g
+s,nodenetwork,interface,g
--- /dev/null
+#!/bin/bash
+
+COMMAND=$(basename $0)
+BASENAME=$(basename $COMMAND .sh)
+DIRNAME=$(dirname $0)
+# normalize
+DIRNAME=$(cd ${DIRNAME}; /bin/pwd)
+
+MIGRATION_SED=$DIRNAME/${BASENAME}.sed
+MIGRATION_SQL=$DIRNAME/${BASENAME}.sql
+# look in ..
+UP=$(dirname $DIRNAME)
+UPUP=$(dirname $UP)
+SCHEMA_SQL=$UPUP/planetlab5.sql
+
+DATE=$(date +%Y-%m-%d-%H-%M)
+DATE_=$(date +%Y_%m_%d_%H_%M)
+LOG=${DIRNAME}/${DATE}.log
+DUMP=${DIRNAME}/pl4.sql
+RESTORE=${DIRNAME}/${DATE}-pl5.sql
+FAKE=${DIRNAME}/input-pl4.sql
+VIEWS_SQL=$DIRNAME/${DATE}-views5.sql
+NODEGROUPS_DEF=$DIRNAME/site-nodegroups.def
+NODEGROUPS_SQL=$DIRNAME/${DATE}-nodegroups.sql
+
+PGM_VIEWS=$UP/extract-views.py
+PGM_NODEGROUPS=$DIRNAME/parse-site-nodegroups.py
+
+INTERACTIVE_MODE="true"
+
+# load config
+. /etc/planetlab/plc_config
+
+function run () {
+ message=$1; shift
+
+ if [ -n "$DEBUG" ] ; then
+ echo -n "Type enter to run next step XXX $message XXX ... "
+ read _answer_
+ fi
+
+ echo -n "$message "
+ echo "==================================================" >> $LOG
+ echo $message >> $LOG
+ echo "$@" >> $LOG
+ "$@" >> $LOG 2>&1
+ echo Done
+}
+
+# return 0 (yes) or 1 (no) whether the database exists
+function check_for_database () {
+ dbname=$1; shift
+ psql --user=$PLC_DB_USER --quiet -c "SELECT datname from pg_database where datname= '$dbname' LIMIT 1" $dbname > /dev/null 2>&1
+ return $?
+}
+
+# when 'service plc start' gets run, the planetlab5 DB gets created
+# so this script will drop the planetlab5 DB and re-create it from scratch
+# with the contents of the planetlab4 DB that is epxected to exist
+function confirm_nodegroups () {
+ echo "========================================"
+ echo "$COMMAND"
+ echo "This script is designed to ease the migration from myplc 4.2 to 4.3"
+ echo "It attempts to (re)create the planetlab5 database from planetlab4"
+ echo ""
+ echo "You might wish to edit/review"
+ echo " $NODEGROUPS_DEF"
+ echo " to finetune your migration"
+ echo ""
+ echo "Please refer to http://svn.planet-lab.org/wiki/Migration4to5"
+ echo "========================================"
+ echo -n "Are you sure you want to proceed y/[n] ? "
+ if [ "$INTERACTIVE_MODE" = "true" ] ; then
+ read answer
+ case $answer in
+ y|Y) echo See log in $LOG ;;
+ *) echo "Bye" ; exit 1 ;;
+ esac
+ fi
+}
+
+function check_env () {
+ [ -f $MIGRATION_SED ] || { echo $MIGRATION_SED not found - exiting ; exit 1; }
+ [ -f $MIGRATION_SQL ] || { echo $MIGRATION_SQL not found - exiting ; exit 1; }
+ [ -f $SCHEMA_SQL ] || { echo $SCHEMA_SQL not found - exiting ; exit 1; }
+ [ -f $NODEGROUPS_DEF ] || { echo $NODEGROUPS_DEF not found - exiting ; exit 1; }
+}
+
+# connect to the former myplc, performs a local dump of planetlab4 and creates is locally
+function get_planetlab4 () {
+
+ # for faster tests ..
+ if [ -f $FAKE ] ; then
+ echo ''
+ echo 'xxxx WARNING WARNING WARNING WARNING WARNING xxx'
+ echo ''
+ echo Using fake input for tests $FAKE
+ echo ''
+ echo 'xxxx WARNING WARNING WARNING WARNING WARNING xxx'
+ echo ''
+ DUMP=$FAKE
+ elif [ -f $DUMP ] ; then
+ echo "Using planetlab4 from $DUMP"
+ else
+
+ echo -n "Enter the hostname for the former DB service : "
+ if [ "$INTERACTIVE_MODE" = "true" ] ; then
+ read hostname
+ echo "Running pg_dump on $hostname.."
+ pg_dump --ignore-version --host=$hostname --user=$PLC_DB_USER planetlab4 -f ${DUMP}
+ else
+ pg_dump --ignore-version --user=$PLC_DB_USER planetlab4 -f ${DUMP}
+ fi
+ DUMP=$DUMP
+ fi
+}
+
+function prepare_planetlab5 () {
+
+ # check if planetlab5 exists
+ if check_for_database planetlab5 ; then
+ rename=planetlab5_${DATE_}
+ echo -n "There is an existing DB named planetlab5, drop or rename into $rename d/[r] ? "
+ if [ "$INTERACTIVE_MODE" = "true" ] ; then
+ read _answer_
+ else
+ _answer_='r'
+ fi
+ case $_answer_ in
+ d|D)
+ run "Dropping planetlab5" psql --user=postgres template1 -c "DROP DATABASE planetlab5" || true
+ ;;
+ *)
+ if check_for_database $rename ; then
+ echo "$rename already exists - exiting"
+ exit 1
+ else
+ run "Renaming planetlab5 into $rename" \
+ psql --user=postgres template1 -c "ALTER DATABASE planetlab5 RENAME TO $rename"
+ fi
+ ;;
+ esac
+ fi
+
+ # again: now it should not exist
+ if check_for_database planetlab5 ; then
+ echo "ERROR : FOUND planetlab5 - should not happen - exiting"
+ exit 1
+ fi
+}
+
+
+
+function migrate () {
+ set -e
+ cd $DIRNAME
+
+ # dump planetlab4
+
+ run "Copying into $RESTORE" cp $DUMP $RESTORE
+ run "Renaming identifiers in $RESTORE" sed -f $MIGRATION_SED -i $RESTORE
+
+ run "Creating planetlab5 database" createdb --user=postgres --encoding=UNICODE --owner=$PLC_DB_USER planetlab5
+ run "Loading language plpgsql" createlang -U postgres plpgsql planetlab5 || true
+ run "Populating planetlab5 from $RESTORE" psql --user=postgres -f $RESTORE planetlab5
+ run "Parsing $NODEGROUPS_DEF" $PGM_NODEGROUPS $NODEGROUPS_DEF $NODEGROUPS_SQL
+ run "Loading $NODEGROUPS_SQL" psql --user=$PLC_DB_USER -f $NODEGROUPS_SQL planetlab5
+ run "Fine-tuning it with $MIGRATION_SQL" psql --user=$PLC_DB_USER -f $MIGRATION_SQL planetlab5
+ run "Extracting views definitions from $SCHEMA_SQL" $PGM_VIEWS $SCHEMA_SQL $VIEWS_SQL
+ run "Inserting views definitions in planetlab5" \
+ psql --user=$PLC_DB_USER -f $VIEWS_SQL planetlab5
+}
+
+function manage_link () {
+ dest=$1; shift
+ src=$1; shift
+ cd $DIRNAME
+ echo "Managing link $dest"
+ rm -f $dest
+ ln -s $src $dest
+}
+
+function links () {
+ # tmp
+ result=${DIRNAME}/${DATE}-output.sql
+ run "Dumping result in $result" pg_dump --user=$PLC_DB_USER -f $result planetlab5
+
+ manage_link latest.log $LOG
+ manage_link latest-pl4.sql $DUMP
+ manage_link latest-pl5.sql $RESTORE
+ manage_link latest-views5.sql $VIEWS_SQL
+ manage_link latest-output.sql $result
+
+}
+
+function main () {
+
+ while getopts "b" opt ; do
+ case $opt in
+ b) INTERACTIVE_MODE='false' ;;
+ *)
+ echo "migrate.sh [-b]"
+ echo " -b -- execute in batch mode without asking for user feedback"
+ exit
+ ;;
+ esac
+ done
+
+ check_env
+ confirm_nodegroups
+ echo "OK, we're clear, let's go"
+ set -e
+ get_planetlab4
+ prepare_planetlab5
+ migrate
+ links
+ echo "See logfile $LOG for detailed log"
+ echo "Checking for 'error' in the logfile"
+ grep -i error $LOG
+
+}
+
+main "$@"
--- /dev/null
+-- Thierry Parmentelat - INRIA
+--
+-- $Id$
+-- $URL$
+--
+-- this is part of the script to migrate from 4.2 to 4.3
+--
+-- most of the renamings have taken place already when this script is invoked
+--
+
+----------------------------------------
+-- views
+----------------------------------------
+-- we want the views to get out of our way, i.e. to drop all views;
+-- the views will be reinstantiated later upon loading of planetlab5.sql
+
+-- this lists all views
+CREATE OR REPLACE VIEW mgn_all_views AS
+ SELECT c.relname FROM pg_catalog.pg_class c
+ LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
+ WHERE c.relkind IN ('v','') AND n.nspname in ('public')
+ AND pg_catalog.pg_table_is_visible(c.oid);
+
+-- shows in logfile
+select * from mgn_all_views;
+
+-- this one version almost works, but somehow does not, could not figure why
+CREATE OR REPLACE FUNCTION mgn_drop_all_views () RETURNS INTEGER AS $$
+ DECLARE
+ row mgn_all_views%ROWTYPE;
+ BEGIN
+ FOR row IN SELECT * FROM mgn_all_views where relname != 'mgn_all_views' LOOP
+ RAISE NOTICE 'Dropping %',row.relname;
+ EXECUTE 'DROP VIEW ' || row.relname || ' CASCADE' ;
+ END LOOP;
+ RETURN 0;
+ END;
+$$ LANGUAGE 'plpgsql';
+
+-- SELECT mgn_drop_all_views();
+
+-- so let's have it the boring way
+DROP VIEW address_address_types CASCADE;
+DROP VIEW conf_file_nodegroups CASCADE;
+DROP VIEW conf_file_nodes CASCADE;
+DROP VIEW dummybox_nodes CASCADE;
+DROP VIEW event_objects CASCADE;
+DROP VIEW node_conf_files CASCADE;
+DROP VIEW node_nodegroups CASCADE;
+DROP VIEW interfaces_ordered CASCADE;
+-- caught by some previous cascade -- DROP VIEW node_interfaces CASCADE;
+DROP VIEW node_pcus CASCADE;
+DROP VIEW node_slices CASCADE;
+DROP VIEW node_slices_whitelist CASCADE;
+DROP VIEW nodegroup_conf_files CASCADE;
+DROP VIEW nodegroup_nodes CASCADE;
+DROP VIEW interface_tags CASCADE;
+DROP VIEW pcu_nodes CASCADE;
+DROP VIEW pcu_protocol_types CASCADE;
+DROP VIEW peer_keys CASCADE;
+DROP VIEW peer_nodes CASCADE;
+DROP VIEW peer_persons CASCADE;
+DROP VIEW peer_sites CASCADE;
+DROP VIEW peer_slices CASCADE;
+DROP VIEW person_keys CASCADE;
+DROP VIEW person_roles CASCADE;
+DROP VIEW person_site_ordered CASCADE;
+-- caught by some previous cascade -- DROP VIEW person_sites CASCADE;
+DROP VIEW person_slices CASCADE;
+DROP VIEW site_addresses CASCADE;
+DROP VIEW site_nodes CASCADE;
+DROP VIEW site_pcus CASCADE;
+DROP VIEW site_persons CASCADE;
+DROP VIEW site_slices CASCADE;
+DROP VIEW slice_tags CASCADE;
+DROP VIEW slice_nodes CASCADE;
+DROP VIEW slice_persons CASCADE;
+DROP VIEW slivers CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_addresses CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_conf_files CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_dummyboxes CASCADE;
+DROP VIEW view_event_objects CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_events CASCADE;
+DROP VIEW view_keys CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_nodegroups CASCADE;
+DROP VIEW view_interface_tags CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_interfaces CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_nodes CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_pcu_types CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_pcus CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_peers CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_persons CASCADE;
+DROP VIEW view_sessions CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_sites CASCADE;
+DROP VIEW view_slice_tags CASCADE;
+-- caught by some previous cascade -- DROP VIEW view_slices CASCADE;
+
+-- shows in logfile
+select * from mgn_all_views;
+
+-- cleanup migration utilities
+drop view mgn_all_views;
+drop function mgn_drop_all_views ();
+
+----------------------------------------
+-- peers
+----------------------------------------
+ALTER TABLE peers ADD COLUMN shortname TEXT;
+ALTER TABLE peers ADD COLUMN hrn_root TEXT;
+
+
+----------------------------------------
+-- run levels
+----------------------------------------
+CREATE TABLE run_levels (
+ run_level text PRIMARY KEY
+) WITH OIDS;
+INSERT INTO run_levels (run_level) VALUES ('boot');
+INSERT INTO run_levels (run_level) VALUES ('safeboot');
+INSERT INTO run_levels (run_level) VALUES ('failboot');
+INSERT INTO run_levels (run_level) VALUES ('reinstall');
+
+
+----------------------------------------
+-- node types
+----------------------------------------
+CREATE TABLE node_types (
+ node_type text PRIMARY KEY
+) WITH OIDS;
+INSERT INTO node_types (node_type) VALUES ('regular');
+INSERT INTO node_types (node_type) VALUES ('dummynet');
+
+----------------------------------------
+-- nodes
+----------------------------------------
+ALTER TABLE nodes ADD COLUMN node_type TEXT REFERENCES node_types DEFAULT 'regular'; -- node types
+ALTER TABLE nodes ALTER COLUMN boot_state SET DEFAULT 'reinstall'; -- boot_states changed in planetlab5.sql
+ALTER TABLE nodes ADD COLUMN verified boolean NOT NULL DEFAULT false; -- whether or not the node & pcu are verified
+ALTER TABLE nodes ADD COLUMN run_level TEXT REFERENCES run_levels DEFAULT NULL; -- Node Run Level
+
+----------------------------------------
+-- tag types
+----------------------------------------
+--- merge former slice attribute types and setting attribute types into tagtypes
+
+---------- slice attributes
+
+--- the tag_types table is obtained from the former slice_attribute_types table
+ALTER TABLE tag_types RENAME COLUMN name TO tagname;
+--- former slice_attribute_types had no 'category'
+ALTER TABLE tag_types ADD COLUMN category TEXT NOT NULL DEFAULT 'slice/legacy';
+
+--- append in tag_types the contents of former nodenetwork_setting_types
+INSERT INTO tag_types (tagname,description,min_role_id,category)
+ SELECT name,description,min_role_id,'interface/legacy' FROM interface_tag_types;
+
+---------- interface settings
+
+--- former nodenetwork_setting_type_id are now renumbered, need to fix interface_tag accordingly
+
+-- old_index -> new_index relation
+CREATE OR REPLACE VIEW mgn_setting_renumber AS
+ SELECT
+ interface_tag_types.interface_tag_type_id AS old_index,
+ tag_types.tag_type_id AS new_index
+ FROM
+ interface_tag_types INNER JOIN tag_types
+ ON interface_tag_types.name = tag_types.tagname;
+
+-- need to temporarily drop constraint on interface_tag_type_id
+ALTER TABLE interface_tag DROP CONSTRAINT interface_tag_interface_tag_type_id_fkey;
+
+-- do the transcoding
+UPDATE interface_tag
+ SET interface_tag_type_id =
+ (select new_index from mgn_setting_renumber where old_index=interface_tag_type_id);
+
+-- alter column name to reflect change
+ALTER TABLE interface_tag RENAME interface_tag_type_id TO tag_type_id;
+
+-- add constraint again
+ALTER TABLE interface_tag ADD CONSTRAINT interface_tag_tag_type_id_fkey
+ FOREIGN KEY (tag_type_id) references tag_types(tag_type_id) ;
+
+-- drop former interface_tag_types altogether
+drop view mgn_setting_renumber;
+drop table interface_tag_types;
+
+---------- node tags
+
+CREATE TABLE node_tag (
+ node_tag_id serial PRIMARY KEY, -- ID
+ node_id integer REFERENCES nodes NOT NULL, -- node id
+ tag_type_id integer REFERENCES tag_types, -- tag type id
+ value text -- value attached
+) WITH OIDS;
+
+
+----------------------------------------
+-- ilinks
+----------------------------------------
+CREATE TABLE ilink (
+ ilink_id serial PRIMARY KEY, -- id
+ tag_type_id integer REFERENCES tag_types, -- id of the tag type
+ src_interface_id integer REFERENCES interfaces not NULL, -- id of src interface
+ dst_interface_id integer REFERENCES interfaces NOT NULL, -- id of dst interface
+ value text -- optional value on the link
+) WITH OIDS;
+
+----------------------------------------
+-- nodegroups
+----------------------------------------
+
+---------- nodegroups table - start
+-- nodegroup_id is preserved for conf_files and other references
+-- former nodegroups table was (nodegroup_id,name,description)
+-- new table is now (nodegroup_id, groupname, tag_type_id, value)
+
+-- rename column
+ALTER TABLE nodegroups RENAME name TO groupname;
+
+---------- create missing tag types
+-- change default for the entries about to be created
+ALTER TABLE tag_types ALTER COLUMN category SET DEFAULT 'nodegroup/migration';
+
+-- do it
+INSERT INTO tag_types (tagname)
+ SELECT DISTINCT tagname FROM mgn_site_nodegroup
+ WHERE tagname NOT IN (SELECT tagname from tag_types);
+
+-- xxx drop description in former nodegroups for now,
+-- but could have been attached to newly created tag types first
+ALTER TABLE nodegroups DROP COLUMN description;
+
+---------- set the right tags so as to recover former nodegroups
+INSERT INTO node_tag (node_id, tag_type_id, value)
+ SELECT node_id, tag_type_id, value FROM
+ nodegroup_node LEFT JOIN nodegroups USING (nodegroup_id)
+ INNER JOIN mgn_site_nodegroup USING (groupname)
+ LEFT JOIN tag_types using (tagname);
+
+---------- nodegroups table - conclusion
+ALTER TABLE nodegroups ADD COLUMN tag_type_id INTEGER;
+ALTER TABLE nodegroups ADD COLUMN value TEXT;
+
+CREATE OR REPLACE VIEW mgn_nodegroups AS
+ SELECT groupname, tag_types.tag_type_id, mgn_site_nodegroup.value
+ FROM nodegroups INNER JOIN mgn_site_nodegroup USING (groupname)
+ INNER JOIN tag_types USING (tagname);
+
+UPDATE nodegroups SET tag_type_id = (SELECT tag_type_id FROM mgn_nodegroups WHERE nodegroups.groupname=mgn_nodegroups.groupname);
+UPDATE nodegroups SET value = (SELECT value FROM mgn_nodegroups WHERE nodegroups.groupname=mgn_nodegroups.groupname);
+
+-- install corresponding constraints
+ALTER TABLE nodegroups ADD CONSTRAINT nodegroups_tag_type_id_fkey
+ FOREIGN KEY (tag_type_id) REFERENCES tag_types (tag_type_id);
+
+--- change default now that the column is filled
+ALTER TABLE tag_types ALTER COLUMN category SET DEFAULT 'general';
+
+-- cleanup the nodegroup area
+drop view mgn_nodegroups;
+drop table mgn_site_nodegroup;
+drop table nodegroup_node;
+
+
+----------------------------------------
+-- boot states
+----------------------------------------
+-- create new ones
+INSERT INTO boot_states (boot_state) VALUES ('safeboot');
+INSERT INTO boot_states (boot_state) VALUES ('failboot');
+INSERT INTO boot_states (boot_state) VALUES ('disabled');
+INSERT INTO boot_states (boot_state) VALUES ('reinstall');
+
+-- map old ones
+-- b/c boot_states are declared by users not reported by node.
+UPDATE nodes SET boot_state='safeboot' WHERE boot_state='dbg';
+UPDATE nodes SET boot_state='safeboot' WHERE boot_state='diag';
+UPDATE nodes SET boot_state='disabled' WHERE boot_state='disable';
+UPDATE nodes SET boot_state='reinstall' WHERE boot_state='inst';
+UPDATE nodes SET boot_state='reinstall' WHERE boot_state='rins';
+UPDATE nodes SET boot_state='reinstall' WHERE boot_state='new';
+UPDATE nodes SET boot_state='reinstall' WHERE boot_state='rcnf';
+
+-- delete old ones
+DELETE FROM boot_states WHERE boot_state='dbg';
+DELETE FROM boot_states WHERE boot_state='diag';
+DELETE FROM boot_states WHERE boot_state='disable';
+DELETE FROM boot_states WHERE boot_state='install';
+DELETE FROM boot_states WHERE boot_state='inst';
+DELETE FROM boot_states WHERE boot_state='rins';
+DELETE FROM boot_states WHERE boot_state='new';
+DELETE FROM boot_states WHERE boot_state='rcnf';
+
+-- ----------------------------------------
+-- -- debug/information : display current constraints
+-- ----------------------------------------
+-- CREATE OR REPLACE VIEW mgn_all_constraints AS
+-- SELECT * FROM pg_catalog.pg_constraint c
+-- LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.connamespace
+-- LEFT JOIN pg_catalog.pg_class t ON t.oid = c.conrelid
+-- WHERE c.contype IN ('c','f','p','u') AND n.nspname in ('public')
+-- AND pg_catalog.pg_table_is_visible(c.oid);
+--
+-- select * from mgn_all_constraints;
+--
+-- drop view mgn_all_constraints;
+
+--- versioning (plc_db_version): ignore for now, so we keep both entries (v4 and v5)
--- /dev/null
+#!/usr/bin/env python
+
+import sys
+import re
+
+class Nodegroups:
+
+ def __init__ (self,input,output=None):
+ self.input=input
+ self.output=output
+
+ # strip off comments
+ comment=re.compile("\s*#.*")
+ id="[\w\.-]+|\'[^\']+\'"
+ id3="\s*(?P<groupname>%s)\s+(?P<tagname>%s)\s+(?P<value>%s\s*)"%(id,id,id)
+ line=re.compile(id3)
+
+ def parse (self):
+ if self.output:
+ outfile = open(self.output,"w")
+ else:
+ outfile = sys.stdout
+ lineno=0
+ print >> outfile, """
+CREATE TABLE mgn_site_nodegroup (groupname text, tagname text, value text);
+"""
+ for line in file(self.input).readlines():
+ lineno += 1
+ if Nodegroups.comment.match(line):
+ continue
+ match=Nodegroups.line.match(line)
+ if not match:
+ print "%s:%s:%d: syntax error %s"%(
+ sys.argv[0],self.input,lineno,line)
+ sys.exit(1)
+ def normalize (id):
+ if id.find("'")==0:
+ return id
+ return "'%s'"%id
+ [groupname,tagname,value]=[normalize(x) for x in match.groups()]
+
+ print >> outfile, \
+"INSERT INTO mgn_site_nodegroup (groupname,tagname,value) VALUES (%s,%s,%s);"%\
+(groupname,tagname,value)
+ if outfile != sys.stdout:
+ outfile.close()
+
+if __name__ == '__main__':
+ if len(sys.argv) not in [2,3]:
+ print 'Usage:',sys.argv[0],'input [output]'
+ sys.exit(1)
+ input=sys.argv[1]
+ try:
+ output=sys.argv[2]
+ except:
+ output=None
+ Nodegroups(input,output).parse()
--- /dev/null
+# this file allows you to plan the migration of your nodegroups
+#
+# groupname tagname value
+#
+# single quotes can be used
+# although tagnames can have spaces, it is not recommended
+# if use of accessors is planned
+#
+# catured on private.one-lab.org
+onelab-i386 arch i386
+x86_64 arch x86_64
+umts extension umts
+# ### captured on PLE
+# alpha deployment alpha
+# onelab-x86_64 arch x86_64
+# onelab-i386 arch i386
+# ### captured on PLC
+# Alpha deployment alpha
+# Beta deployment beta
+# Nightly Nightly true
+# Internet2 Internet2 true
+# V2 V2 true
+# v3 v3 true
+# Uppsala Uppsala true
+# LogWatch LogWatch true
+# DC7800Deployment DC7800Deployment true
+# AlphaDeployment AlphaDeployment true
+# debug.sh.sgn debug.sh.sgn true
+# hdboot-serial.sh.sgn hdboot-serial.sh.sgn true
+# 'Shark NFS' 'Shark NFS' true
+# cluster cluster true
+# IRIS IRIS true
+# 'NM prototype' 'NM prototype' true
+# 'IRIS + NM prototype' 'IRIS + NM prototype' true
+# 'JHU honeypot' 'JHU honeypot' true
+# chopstix chopstix true
+# PolishTelecom PolishTelecom true
+++ /dev/null
-methods.php
-plc_api.php
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
all: plc_api.php
// Copyright (C) 2005-2006 The Trustees of Princeton University
//
// $Id$
+// $URL$
//
//
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
// Set some miscellaneous options
- curl_setopt($curl, CURLOPT_TIMEOUT, 30);
+ curl_setopt($curl, CURLOPT_TIMEOUT, 180);
// Get the output of the request
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
# Copyright (C) 2005 The Trustess of Princeton University
#
# $Id$
+# $URL$
#
import os, sys
# Class functions
api = PLCAPI(None)
-api.methods.sort()
-for method in api.methods:
+api.all_methods.sort()
+for method in api.all_methods:
# Skip system. methods
if "system." in method:
continue
#define PHP_EXT_VERSION "0.51"
+/* ====================
+ * Thierry - Dec. 17 2009
+ * patch for php - bug first triggered on f12 with php-5.3
+ * http://pecl.php.net/bugs/bug.php?id=14369
+ * http://remi.fedorapeople.org/ncurses-1.0.0-php53.patch
+ * I'm taking out the 'static' stuff as after pre-processing it appears to be part of the macro expansion already
+ */
+#if ZEND_MODULE_API_NO >= 20071006
+// No more defined with PHP 5.3.0
+ ZEND_BEGIN_ARG_INFO(first_arg_force_ref, 0)
+ ZEND_ARG_PASS_INFO(1)
+ ZEND_END_ARG_INFO();
+
+ ZEND_BEGIN_ARG_INFO(second_arg_force_ref, 0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(1)
+ ZEND_END_ARG_INFO();
+#endif
+/* ==================== end patch */
+
+/* ========== additional notes
+ * in the process, I've also come across the following resources that might help
+ * if/when zend_get_parameters_ex gets deprecated (only generates warnings for now)
+ *
+ * http://developers.evrsoft.com/docs/php/zend.arguments.deprecated-retrieval.shtml
+ * explains how the old (our) stuff works
+ *
+ * http://www.hospedajeydominios.com/mambo/documentacion-manual_php-pagina-zend_arguments_retrieval.html
+ * gives info on the new scheme
+ *
+ * I'm taking tha risk as the changes seem to mean major surgery ...
+ */
+
/* You should tweak config.m4 so this symbol (or some else suitable)
gets defined. */
--
-- PlanetLab Central database schema
--- Version 4, PostgreSQL
+-- Version 5, PostgreSQL
--
-- Aaron Klingaman <alk@cs.princeton.edu>
-- Reid Moran <rmoran@cs.princeton.edu>
-- Mark Huang <mlhuang@cs.princeton.edu>
-- Tony Mack <tmack@cs.princeton.edu>
+-- Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
--
-- Copyright (C) 2006 The Trustees of Princeton University
--
+-- NOTE: this file was first created for version 4.3, the filename might be confusing
+--
-- $Id$
+-- $URL$
--
SET client_encoding = 'UNICODE';
+--------------------------------------------------------------------------------
+-- Version
+--------------------------------------------------------------------------------
+
+-- Database version
+CREATE TABLE plc_db_version (
+ version integer NOT NULL,
+ subversion integer NOT NULL DEFAULT 0
+) WITH OIDS;
+
+INSERT INTO plc_db_version (version, subversion) VALUES (5, 0);
+
--------------------------------------------------------------------------------
-- Aggregates and store procedures
--------------------------------------------------------------------------------
initcond = '{}'
);
---------------------------------------------------------------------------------
--- Version
---------------------------------------------------------------------------------
-
--- Database version
-CREATE TABLE plc_db_version (
- version integer NOT NULL,
- subversion integer NOT NULL DEFAULT 0
-) WITH OIDS;
-
-INSERT INTO plc_db_version (version, subversion) VALUES (4, 9);
-
--------------------------------------------------------------------------------
-- Accounts
--------------------------------------------------------------------------------
-- Accounts
CREATE TABLE persons (
-- Mandatory
- person_id serial PRIMARY KEY, -- Account identifier
- email text NOT NULL, -- E-mail address
- first_name text NOT NULL, -- First name
- last_name text NOT NULL, -- Last name
- deleted boolean NOT NULL DEFAULT false, -- Has been deleted
- enabled boolean NOT NULL DEFAULT false, -- Has been disabled
-
- -- Password
- password text NOT NULL DEFAULT 'nopass', -- Password (md5crypted)
- verification_key text, -- Reset password key
+ person_id serial PRIMARY KEY, -- Account identifier
+ email text NOT NULL, -- E-mail address
+ first_name text NOT NULL, -- First name
+ last_name text NOT NULL, -- Last name
+ deleted boolean NOT NULL DEFAULT false, -- Has been deleted
+ enabled boolean NOT NULL DEFAULT false, -- Has been disabled
+
+ password text NOT NULL DEFAULT 'nopass', -- Password (md5crypted)
+ verification_key text, -- Reset password key
verification_expires timestamp without time zone,
-- Optional
- title text, -- Honorific
- phone text, -- Telephone number
- url text, -- Home page
- bio text, -- Biography
+ title text, -- Honorific
+ phone text, -- Telephone number
+ url text, -- Home page
+ bio text, -- Biography
-- Timestamps
date_created timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
-- Sites
CREATE TABLE sites (
-- Mandatory
- site_id serial PRIMARY KEY, -- Site identifier
- login_base text NOT NULL, -- Site slice prefix
- name text NOT NULL, -- Site name
- abbreviated_name text NOT NULL, -- Site abbreviated name
- enabled boolean NOT NULL Default true, -- Is this site enabled
- deleted boolean NOT NULL DEFAULT false, -- Has been deleted
- is_public boolean NOT NULL DEFAULT true, -- Shows up in public lists
- max_slices integer NOT NULL DEFAULT 0, -- Maximum number of slices
- max_slivers integer NOT NULL DEFAULT 1000, -- Maximum number of instantiated slivers
+ site_id serial PRIMARY KEY, -- Site identifier
+ login_base text NOT NULL, -- Site slice prefix
+ name text NOT NULL, -- Site name
+ abbreviated_name text NOT NULL, -- Site abbreviated name
+ enabled boolean NOT NULL Default true, -- Is this site enabled
+ deleted boolean NOT NULL DEFAULT false, -- Has been deleted
+ is_public boolean NOT NULL DEFAULT true, -- Shows up in public lists
+ max_slices integer NOT NULL DEFAULT 0, -- Maximum number of slices
+ max_slivers integer NOT NULL DEFAULT 1000, -- Maximum number of instantiated slivers
-- Optional
latitude real,
longitude real,
url text,
- ext_consortium_id integer, -- external consortium id
+ ext_consortium_id integer, -- external consortium id
-- Timestamps
date_created timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
-- Account site membership
CREATE TABLE person_site (
- person_id integer REFERENCES persons NOT NULL, -- Account identifier
- site_id integer REFERENCES sites NOT NULL, -- Site identifier
- is_primary boolean NOT NULL DEFAULT false, -- Is the primary site for this account
+ person_id integer REFERENCES persons NOT NULL, -- Account identifier
+ site_id integer REFERENCES sites NOT NULL, -- Site identifier
+ is_primary boolean NOT NULL DEFAULT false, -- Is the primary site for this account
PRIMARY KEY (person_id, site_id)
);
CREATE INDEX person_site_person_id_idx ON person_site (person_id);
CREATE INDEX person_site_site_id_idx ON person_site (site_id);
-- Ordered by primary site first
-CREATE VIEW person_site_ordered AS
+CREATE OR REPLACE VIEW person_site_ordered AS
SELECT person_id, site_id
FROM person_site
ORDER BY is_primary DESC;
-- Sites that each person is a member of
-CREATE VIEW person_sites AS
+CREATE OR REPLACE VIEW person_sites AS
SELECT person_id,
array_accum(site_id) AS site_ids
FROM person_site_ordered
GROUP BY person_id;
-- Accounts at each site
-CREATE VIEW site_persons AS
+CREATE OR REPLACE VIEW site_persons AS
SELECT site_id,
array_accum(person_id) AS person_ids
FROM person_site
--------------------------------------------------------------------------------
CREATE TABLE address_types (
- address_type_id serial PRIMARY KEY, -- Address type identifier
- name text UNIQUE NOT NULL, -- Address type
- description text -- Address type description
+ address_type_id serial PRIMARY KEY, -- Address type identifier
+ name text UNIQUE NOT NULL, -- Address type
+ description text -- Address type description
) WITH OIDS;
+-- Multi-rows insertion "insert .. values (row1), (row2)" is not supported by pgsql-8.1
+-- 'Billing' Used to be 'Site'
INSERT INTO address_types (name) VALUES ('Personal');
INSERT INTO address_types (name) VALUES ('Shipping');
--- XXX Used to be Site
INSERT INTO address_types (name) VALUES ('Billing');
-- Mailing addresses
CREATE TABLE addresses (
- address_id serial PRIMARY KEY, -- Address identifier
- line1 text NOT NULL, -- Address line 1
- line2 text, -- Address line 2
- line3 text, -- Address line 3
- city text NOT NULL, -- City
- state text NOT NULL, -- State or province
- postalcode text NOT NULL, -- Postal code
- country text NOT NULL -- Country
+ address_id serial PRIMARY KEY, -- Address identifier
+ line1 text NOT NULL, -- Address line 1
+ line2 text, -- Address line 2
+ line3 text, -- Address line 3
+ city text NOT NULL, -- City
+ state text NOT NULL, -- State or province
+ postalcode text NOT NULL, -- Postal code
+ country text NOT NULL -- Country
) WITH OIDS;
-- Each mailing address can be one of several types
CREATE TABLE address_address_type (
- address_id integer REFERENCES addresses NOT NULL, -- Address identifier
- address_type_id integer REFERENCES address_types NOT NULL, -- Address type
+ address_id integer REFERENCES addresses NOT NULL, -- Address identifier
+ address_type_id integer REFERENCES address_types NOT NULL, -- Address type
PRIMARY KEY (address_id, address_type_id)
) WITH OIDS;
CREATE INDEX address_address_type_address_id_idx ON address_address_type (address_id);
CREATE INDEX address_address_type_address_type_id_idx ON address_address_type (address_type_id);
-CREATE VIEW address_address_types AS
+CREATE OR REPLACE VIEW address_address_types AS
SELECT address_id,
array_accum(address_type_id) AS address_type_ids,
array_accum(address_types.name) AS address_types
GROUP BY address_id;
CREATE TABLE site_address (
- site_id integer REFERENCES sites NOT NULL, -- Site identifier
- address_id integer REFERENCES addresses NOT NULL, -- Address identifier
+ site_id integer REFERENCES sites NOT NULL, -- Site identifier
+ address_id integer REFERENCES addresses NOT NULL, -- Address identifier
PRIMARY KEY (site_id, address_id)
) WITH OIDS;
CREATE INDEX site_address_site_id_idx ON site_address (site_id);
CREATE INDEX site_address_address_id_idx ON site_address (address_id);
-CREATE VIEW site_addresses AS
+CREATE OR REPLACE VIEW site_addresses AS
SELECT site_id,
array_accum(address_id) AS address_ids
FROM site_address
-- Valid key types
CREATE TABLE key_types (
- key_type text PRIMARY KEY -- Key type
+ key_type text PRIMARY KEY -- Key type
) WITH OIDS;
INSERT INTO key_types (key_type) VALUES ('ssh');
-- Authentication keys
CREATE TABLE keys (
- key_id serial PRIMARY KEY, -- Key identifier
- key_type text REFERENCES key_types NOT NULL, -- Key type
+ key_id serial PRIMARY KEY, -- Key identifier
+ key_type text REFERENCES key_types NOT NULL, -- Key type
key text NOT NULL, -- Key material
- is_blacklisted boolean NOT NULL DEFAULT false -- Has been blacklisted
+ is_blacklisted boolean NOT NULL DEFAULT false -- Has been blacklisted
) WITH OIDS;
-- Account authentication key(s)
CREATE TABLE person_key (
- key_id integer REFERENCES keys PRIMARY KEY, -- Key identifier
- person_id integer REFERENCES persons NOT NULL -- Account identifier
+ key_id integer REFERENCES keys PRIMARY KEY, -- Key identifier
+ person_id integer REFERENCES persons NOT NULL -- Account identifier
) WITH OIDS;
CREATE INDEX person_key_person_id_idx ON person_key (person_id);
-CREATE VIEW person_keys AS
+CREATE OR REPLACE VIEW person_keys AS
SELECT person_id,
array_accum(key_id) AS key_ids
FROM person_key
-- Valid account roles
CREATE TABLE roles (
- role_id integer PRIMARY KEY, -- Role identifier
- name text UNIQUE NOT NULL -- Role symbolic name
+ role_id integer PRIMARY KEY, -- Role identifier
+ name text UNIQUE NOT NULL -- Role symbolic name
) WITH OIDS;
INSERT INTO roles (role_id, name) VALUES (10, 'admin');
INSERT INTO roles (role_id, name) VALUES (20, 'pi');
INSERT INTO roles (role_id, name) VALUES (40, 'tech');
CREATE TABLE person_role (
- person_id integer REFERENCES persons NOT NULL, -- Account identifier
- role_id integer REFERENCES roles NOT NULL, -- Role identifier
+ person_id integer REFERENCES persons NOT NULL, -- Account identifier
+ role_id integer REFERENCES roles NOT NULL, -- Role identifier
PRIMARY KEY (person_id, role_id)
) WITH OIDS;
CREATE INDEX person_role_person_id_idx ON person_role (person_id);
-- Account roles
-CREATE VIEW person_roles AS
+CREATE OR REPLACE VIEW person_roles AS
SELECT person_id,
array_accum(role_id) AS role_ids,
array_accum(roles.name) AS roles
-- Nodes
--------------------------------------------------------------------------------
--- Valid node boot states
+-- Valid node boot states (Nodes.py expect max length to be 20)
CREATE TABLE boot_states (
boot_state text PRIMARY KEY
) WITH OIDS;
INSERT INTO boot_states (boot_state) VALUES ('boot');
-INSERT INTO boot_states (boot_state) VALUES ('dbg');
-INSERT INTO boot_states (boot_state) VALUES ('diag');
-INSERT INTO boot_states (boot_state) VALUES ('disable');
-INSERT INTO boot_states (boot_state) VALUES ('inst');
-INSERT INTO boot_states (boot_state) VALUES ('rins');
-INSERT INTO boot_states (boot_state) VALUES ('new');
+INSERT INTO boot_states (boot_state) VALUES ('safeboot');
+INSERT INTO boot_states (boot_state) VALUES ('reinstall');
+INSERT INTO boot_states (boot_state) VALUES ('disabled');
+
+CREATE TABLE run_levels (
+ run_level text PRIMARY KEY
+) WITH OIDS;
+INSERT INTO run_levels (run_level) VALUES ('boot');
+INSERT INTO run_levels (run_level) VALUES ('safeboot');
+INSERT INTO run_levels (run_level) VALUES ('failboot');
+INSERT INTO run_levels (run_level) VALUES ('reinstall');
+
+-- Known node types (Nodes.py expect max length to be 20)
+CREATE TABLE node_types (
+ node_type text PRIMARY KEY
+) WITH OIDS;
+INSERT INTO node_types (node_type) VALUES ('regular');
+INSERT INTO node_types (node_type) VALUES ('dummynet');
-- Nodes
CREATE TABLE nodes (
-- Mandatory
- node_id serial PRIMARY KEY, -- Node identifier
- hostname text NOT NULL, -- Node hostname
- site_id integer REFERENCES sites NOT NULL, -- At which site
+ node_id serial PRIMARY KEY, -- Node identifier
+ node_type text REFERENCES node_types -- node type
+ DEFAULT 'regular',
- boot_state text REFERENCES boot_states NOT NULL DEFAULT 'inst', -- Node boot state
- deleted boolean NOT NULL DEFAULT false, -- Is deleted
+ hostname text NOT NULL, -- Node hostname
+ site_id integer REFERENCES sites NOT NULL, -- At which site
+ boot_state text REFERENCES boot_states NOT NULL -- Node boot state
+ DEFAULT 'reinstall',
+ run_level text REFERENCES run_levels DEFAULT NULL, -- Node Run Level
+ deleted boolean NOT NULL DEFAULT false, -- Is deleted
-- Optional
- model text, -- Hardware make and model
- boot_nonce text, -- Random nonce updated by Boot Manager
- version text, -- Boot CD version string updated by Boot Manager
- ssh_rsa_key text, -- SSH host key updated by Boot Manager
- key text, -- Node key generated by API when configuration file is downloaded
+ model text, -- Hardware make and model
+ boot_nonce text, -- Random nonce updated by Boot Manager
+ version text, -- Boot CD version string updated by Boot Manager
+ ssh_rsa_key text, -- SSH host key updated by Boot Manager
+ key text, -- Node key generated when boot file is downloaded
+ verified boolean NOT NULL DEFAULT false, -- whether or not the node & pcu are verified
-- Timestamps
date_created timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
CREATE INDEX nodes_site_id_idx ON nodes (site_id);
-- Nodes at each site
-CREATE VIEW site_nodes AS
+CREATE OR REPLACE VIEW site_nodes AS
SELECT site_id,
array_accum(node_id) AS node_ids
FROM nodes
WHERE deleted IS false
GROUP BY site_id;
+--------------------------------------------------------------------------------
+-- node tags
+--------------------------------------------------------------------------------
+CREATE TABLE tag_types (
+
+ tag_type_id serial PRIMARY KEY, -- ID
+ tagname text UNIQUE NOT NULL, -- Tag Name
+ description text, -- Optional Description
+ min_role_id integer REFERENCES roles DEFAULT 10, -- set minimal role required
+ category text NOT NULL DEFAULT 'general' -- Free text for grouping tags together
+) WITH OIDS;
+
+CREATE TABLE node_tag (
+ node_tag_id serial PRIMARY KEY, -- ID
+ node_id integer REFERENCES nodes NOT NULL, -- node id
+ tag_type_id integer REFERENCES tag_types, -- tag type id
+ value text -- value attached
+) WITH OIDS;
+
+--------------------------------------------------------------------------------
+-- (network) interfaces
+--------------------------------------------------------------------------------
+
+-- Valid network addressing schemes
+CREATE TABLE network_types (
+ type text PRIMARY KEY -- Addressing scheme
+) WITH OIDS;
+INSERT INTO network_types (type) VALUES ('ipv4');
+
+-- Valid network configuration methods
+CREATE TABLE network_methods (
+ method text PRIMARY KEY -- Configuration method
+) WITH OIDS;
+
+INSERT INTO network_methods (method) VALUES ('static');
+INSERT INTO network_methods (method) VALUES ('dhcp');
+INSERT INTO network_methods (method) VALUES ('proxy');
+INSERT INTO network_methods (method) VALUES ('tap');
+INSERT INTO network_methods (method) VALUES ('ipmi');
+INSERT INTO network_methods (method) VALUES ('unknown');
+
+-- Network interfaces
+CREATE TABLE interfaces (
+ -- Mandatory
+ interface_id serial PRIMARY KEY, -- Network interface identifier
+ node_id integer REFERENCES nodes NOT NULL, -- Which node
+ is_primary boolean NOT NULL DEFAULT false, -- Is the primary interface for this node
+ type text REFERENCES network_types NOT NULL, -- Addressing scheme
+ method text REFERENCES network_methods NOT NULL, -- Configuration method
+
+ -- Optional, depending on type and method
+ ip text, -- IP address
+ mac text, -- MAC address
+ gateway text, -- Default gateway address
+ network text, -- Network address
+ broadcast text, -- Network broadcast address
+ netmask text, -- Network mask
+ dns1 text, -- Primary DNS server
+ dns2 text, -- Secondary DNS server
+ bwlimit integer, -- Bandwidth limit in bps
+ hostname text -- Hostname of this interface
+) WITH OIDS;
+CREATE INDEX interfaces_node_id_idx ON interfaces (node_id);
+
+-- Ordered by primary interface first
+CREATE OR REPLACE VIEW interfaces_ordered AS
+SELECT node_id, interface_id
+FROM interfaces
+ORDER BY is_primary DESC;
+
+-- Network interfaces on each node
+CREATE OR REPLACE VIEW node_interfaces AS
+SELECT node_id,
+array_accum(interface_id) AS interface_ids
+FROM interfaces_ordered
+GROUP BY node_id;
+
+--------------------------------------------------------------------------------
+-- Interface tags (formerly known as interface settings)
+--------------------------------------------------------------------------------
+
+CREATE TABLE interface_tag (
+ interface_tag_id serial PRIMARY KEY, -- Interface Setting Identifier
+ interface_id integer REFERENCES interfaces NOT NULL,-- the interface this applies to
+ tag_type_id integer REFERENCES tag_types NOT NULL, -- the setting type
+ value text -- value attached
+) WITH OIDS;
+
+CREATE OR REPLACE VIEW interface_tags AS
+SELECT interface_id,
+array_accum(interface_tag_id) AS interface_tag_ids
+FROM interface_tag
+GROUP BY interface_id;
+
+CREATE OR REPLACE VIEW view_interface_tags AS
+SELECT
+interface_tag.interface_tag_id,
+interface_tag.interface_id,
+interfaces.ip,
+tag_types.tag_type_id,
+tag_types.tagname,
+tag_types.description,
+tag_types.category,
+tag_types.min_role_id,
+interface_tag.value
+FROM interface_tag
+INNER JOIN tag_types USING (tag_type_id)
+INNER JOIN interfaces USING (interface_id);
+
+CREATE OR REPLACE VIEW view_interfaces AS
+SELECT
+interfaces.interface_id,
+interfaces.node_id,
+interfaces.is_primary,
+interfaces.type,
+interfaces.method,
+interfaces.ip,
+interfaces.mac,
+interfaces.gateway,
+interfaces.network,
+interfaces.broadcast,
+interfaces.netmask,
+interfaces.dns1,
+interfaces.dns2,
+interfaces.bwlimit,
+interfaces.hostname,
+COALESCE((SELECT interface_tag_ids FROM interface_tags WHERE interface_tags.interface_id = interfaces.interface_id), '{}') AS interface_tag_ids
+FROM interfaces;
+
+--------------------------------------------------------------------------------
+-- ilinks : links between interfaces
+--------------------------------------------------------------------------------
+CREATE TABLE ilink (
+ ilink_id serial PRIMARY KEY, -- id
+ tag_type_id integer REFERENCES tag_types, -- id of the tag type
+ src_interface_id integer REFERENCES interfaces not NULL, -- id of src interface
+ dst_interface_id integer REFERENCES interfaces NOT NULL, -- id of dst interface
+ value text -- optional value on the link
+) WITH OIDS;
+
+CREATE OR REPLACE VIEW view_ilinks AS
+SELECT * FROM tag_types
+INNER JOIN ilink USING (tag_type_id);
+
+-- xxx TODO : expose to view_interfaces the set of ilinks a given interface is part of
+-- this is needed for properly deleting these ilinks when an interface gets deleted
+-- as this is not done yet, it prevents DeleteInterface, thus DeleteNode, thus DeleteSite
+-- from working correctly when an iLink is set
+
--------------------------------------------------------------------------------
-- Node groups
--------------------------------------------------------------------------------
-- Node groups
CREATE TABLE nodegroups (
- nodegroup_id serial PRIMARY KEY, -- Group identifier
- name text UNIQUE NOT NULL, -- Group name
- description text -- Group description
+ nodegroup_id serial PRIMARY KEY, -- Group identifier
+ groupname text UNIQUE NOT NULL, -- Group name
+ tag_type_id integer REFERENCES tag_types, -- node is in nodegroup if it has this tag defined
+ -- can be null, make management faster & easier
+ value text -- with this value attached
) WITH OIDS;
--- Node group membership
-CREATE TABLE nodegroup_node (
- nodegroup_id integer REFERENCES nodegroups NOT NULL, -- Group identifier
- node_id integer REFERENCES nodes NOT NULL, -- Node identifier
- PRIMARY KEY (nodegroup_id, node_id)
-) WITH OIDS;
-CREATE INDEX nodegroup_node_nodegroup_id_idx ON nodegroup_node (nodegroup_id);
-CREATE INDEX nodegroup_node_node_id_idx ON nodegroup_node (node_id);
+-- xxx - first rough implem. similar to former semantics but might be slow
+CREATE OR REPLACE VIEW nodegroup_node AS
+SELECT nodegroup_id, node_id
+FROM tag_types
+JOIN node_tag
+USING (tag_type_id)
+JOIN nodegroups
+USING (tag_type_id,value);
--- Nodes in each node group
-CREATE VIEW nodegroup_nodes AS
+CREATE OR REPLACE VIEW nodegroup_nodes AS
SELECT nodegroup_id,
array_accum(node_id) AS node_ids
FROM nodegroup_node
GROUP BY nodegroup_id;
-- Node groups that each node is a member of
-CREATE VIEW node_nodegroups AS
+CREATE OR REPLACE VIEW node_nodegroups AS
SELECT node_id,
array_accum(nodegroup_id) AS nodegroup_ids
FROM nodegroup_node
--------------------------------------------------------------------------------
CREATE TABLE conf_files (
- conf_file_id serial PRIMARY KEY, -- Configuration file identifier
- enabled bool NOT NULL DEFAULT true, -- Configuration file is active
- source text NOT NULL, -- Relative path on the boot server where file can be downloaded
- dest text NOT NULL, -- Absolute path where file should be installed
- file_permissions text NOT NULL DEFAULT '0644', -- chmod(1) permissions
- file_owner text NOT NULL DEFAULT 'root', -- chown(1) owner
- file_group text NOT NULL DEFAULT 'root', -- chgrp(1) owner
- preinstall_cmd text, -- Shell command to execute prior to installing
- postinstall_cmd text, -- Shell command to execute after installing
- error_cmd text, -- Shell command to execute if any error occurs
- ignore_cmd_errors bool NOT NULL DEFAULT false, -- Install file anyway even if an error occurs
- always_update bool NOT NULL DEFAULT false -- Always attempt to install file even if unchanged
+ conf_file_id serial PRIMARY KEY, -- Configuration file identifier
+ enabled bool NOT NULL DEFAULT true, -- Configuration file is active
+ source text NOT NULL, -- Relative path on the boot server
+ -- where file can be downloaded
+ dest text NOT NULL, -- Absolute path where file should be installed
+ file_permissions text NOT NULL DEFAULT '0644', -- chmod(1) permissions
+ file_owner text NOT NULL DEFAULT 'root', -- chown(1) owner
+ file_group text NOT NULL DEFAULT 'root', -- chgrp(1) owner
+ preinstall_cmd text, -- Shell command to execute prior to installing
+ postinstall_cmd text, -- Shell command to execute after installing
+ error_cmd text, -- Shell command to execute if any error occurs
+ ignore_cmd_errors bool NOT NULL DEFAULT false, -- Install file anyway even if an error occurs
+ always_update bool NOT NULL DEFAULT false -- Always attempt to install file even if unchanged
) WITH OIDS;
CREATE TABLE conf_file_node (
- conf_file_id integer REFERENCES conf_files NOT NULL, -- Configuration file identifier
- node_id integer REFERENCES nodes NOT NULL, -- Node identifier
+ conf_file_id integer REFERENCES conf_files NOT NULL, -- Configuration file identifier
+ node_id integer REFERENCES nodes NOT NULL, -- Node identifier
PRIMARY KEY (conf_file_id, node_id)
);
CREATE INDEX conf_file_node_conf_file_id_idx ON conf_file_node (conf_file_id);
CREATE INDEX conf_file_node_node_id_idx ON conf_file_node (node_id);
-- Nodes linked to each configuration file
-CREATE VIEW conf_file_nodes AS
+CREATE OR REPLACE VIEW conf_file_nodes AS
SELECT conf_file_id,
array_accum(node_id) AS node_ids
FROM conf_file_node
GROUP BY conf_file_id;
-- Configuration files linked to each node
-CREATE VIEW node_conf_files AS
+CREATE OR REPLACE VIEW node_conf_files AS
SELECT node_id,
array_accum(conf_file_id) AS conf_file_ids
FROM conf_file_node
GROUP BY node_id;
CREATE TABLE conf_file_nodegroup (
- conf_file_id integer REFERENCES conf_files NOT NULL, -- Configuration file identifier
- nodegroup_id integer REFERENCES nodegroups NOT NULL, -- Node group identifier
+ conf_file_id integer REFERENCES conf_files NOT NULL, -- Configuration file identifier
+ nodegroup_id integer REFERENCES nodegroups NOT NULL, -- Node group identifier
PRIMARY KEY (conf_file_id, nodegroup_id)
);
CREATE INDEX conf_file_nodegroup_conf_file_id_idx ON conf_file_nodegroup (conf_file_id);
CREATE INDEX conf_file_nodegroup_nodegroup_id_idx ON conf_file_nodegroup (nodegroup_id);
-- Node groups linked to each configuration file
-CREATE VIEW conf_file_nodegroups AS
+CREATE OR REPLACE VIEW conf_file_nodegroups AS
SELECT conf_file_id,
array_accum(nodegroup_id) AS nodegroup_ids
FROM conf_file_nodegroup
GROUP BY conf_file_id;
-- Configuration files linked to each node group
-CREATE VIEW nodegroup_conf_files AS
+CREATE OR REPLACE VIEW nodegroup_conf_files AS
SELECT nodegroup_id,
array_accum(conf_file_id) AS conf_file_ids
FROM conf_file_nodegroup
GROUP BY nodegroup_id;
---------------------------------------------------------------------------------
--- Node network interfaces
---------------------------------------------------------------------------------
-
--- Valid network addressing schemes
-CREATE TABLE network_types (
- type text PRIMARY KEY -- Addressing scheme
-) WITH OIDS;
-INSERT INTO network_types (type) VALUES ('ipv4');
-
--- Valid network configuration methods
-CREATE TABLE network_methods (
- method text PRIMARY KEY -- Configuration method
-) WITH OIDS;
-INSERT INTO network_methods (method) VALUES ('static');
-INSERT INTO network_methods (method) VALUES ('dhcp');
-INSERT INTO network_methods (method) VALUES ('proxy');
-INSERT INTO network_methods (method) VALUES ('tap');
-INSERT INTO network_methods (method) VALUES ('ipmi');
-INSERT INTO network_methods (method) VALUES ('unknown');
-
--- Node network interfaces
-CREATE TABLE nodenetworks (
- -- Mandatory
- nodenetwork_id serial PRIMARY KEY, -- Network interface identifier
- node_id integer REFERENCES nodes NOT NULL, -- Which node
- is_primary boolean NOT NULL DEFAULT false, -- Is the primary interface for this node
- type text REFERENCES network_types NOT NULL, -- Addressing scheme
- method text REFERENCES network_methods NOT NULL, -- Configuration method
-
- -- Optional, depending on type and method
- ip text, -- IP address
- mac text, -- MAC address
- gateway text, -- Default gateway address
- network text, -- Network address
- broadcast text, -- Network broadcast address
- netmask text, -- Network mask
- dns1 text, -- Primary DNS server
- dns2 text, -- Secondary DNS server
- bwlimit integer, -- Bandwidth limit in bps
- hostname text -- Hostname of this interface
-) WITH OIDS;
-CREATE INDEX nodenetworks_node_id_idx ON nodenetworks (node_id);
-
--- Ordered by primary interface first
-CREATE VIEW nodenetworks_ordered AS
-SELECT node_id, nodenetwork_id
-FROM nodenetworks
-ORDER BY is_primary DESC;
-
--- Network interfaces on each node
-CREATE VIEW node_nodenetworks AS
-SELECT node_id,
-array_accum(nodenetwork_id) AS nodenetwork_ids
-FROM nodenetworks_ordered
-GROUP BY node_id;
-
---------------------------------------------------------------------------------
--- Nodenetwork setting types and nodenetworks settings
---------------------------------------------------------------------------------
-
-CREATE TABLE nodenetwork_setting_types (
- nodenetwork_setting_type_id serial PRIMARY KEY,
- -- Setting Type Identifier
- name text UNIQUE NOT NULL, -- Setting Name
- description text, -- Optional Description
- category text NOT NULL, -- Category, e.g. Wifi, or whatever
- min_role_id integer references roles -- If set, minimal role required
-) WITH OIDS;
-
-CREATE TABLE nodenetwork_setting (
- nodenetwork_setting_id serial PRIMARY KEY, -- Nodenetwork Setting Identifier
- nodenetwork_id integer REFERENCES nodenetworks NOT NULL,
- -- the nodenetwork this applies to
- nodenetwork_setting_type_id integer REFERENCES nodenetwork_setting_types NOT NULL,
- -- the setting type
- value text
-) WITH OIDS;
-
-CREATE OR REPLACE VIEW nodenetwork_settings AS
-SELECT nodenetwork_id,
-array_accum(nodenetwork_setting_id) AS nodenetwork_setting_ids
-FROM nodenetwork_setting
-GROUP BY nodenetwork_id;
-
-CREATE OR REPLACE VIEW view_nodenetwork_settings AS
-SELECT
-nodenetwork_setting.nodenetwork_setting_id,
-nodenetwork_setting.nodenetwork_id,
-nodenetwork_setting_types.nodenetwork_setting_type_id,
-nodenetwork_setting_types.name,
-nodenetwork_setting_types.description,
-nodenetwork_setting_types.category,
-nodenetwork_setting_types.min_role_id,
-nodenetwork_setting.value
-FROM nodenetwork_setting
-INNER JOIN nodenetwork_setting_types USING (nodenetwork_setting_type_id);
-
-CREATE OR REPLACE VIEW view_nodenetworks AS
-SELECT
-nodenetworks.nodenetwork_id,
-nodenetworks.node_id,
-nodenetworks.is_primary,
-nodenetworks.type,
-nodenetworks.method,
-nodenetworks.ip,
-nodenetworks.mac,
-nodenetworks.gateway,
-nodenetworks.network,
-nodenetworks.broadcast,
-nodenetworks.netmask,
-nodenetworks.dns1,
-nodenetworks.dns2,
-nodenetworks.bwlimit,
-nodenetworks.hostname,
-COALESCE((SELECT nodenetwork_setting_ids FROM nodenetwork_settings WHERE nodenetwork_settings.nodenetwork_id = nodenetworks.nodenetwork_id), '{}') AS nodenetwork_setting_ids
-FROM nodenetworks;
-
--------------------------------------------------------------------------------
-- Power control units (PCUs)
--------------------------------------------------------------------------------
CREATE TABLE pcus (
-- Mandatory
- pcu_id serial PRIMARY KEY, -- PCU identifier
- site_id integer REFERENCES sites NOT NULL, -- Site identifier
- hostname text, -- Hostname, not necessarily unique (multiple logical sites could use the same PCU)
- ip text NOT NULL, -- IP, not necessarily unique
+ pcu_id serial PRIMARY KEY, -- PCU identifier
+ site_id integer REFERENCES sites NOT NULL, -- Site identifier
+ hostname text, -- Hostname, not necessarily unique
+ -- (multiple logical sites could use the same PCU)
+ ip text NOT NULL, -- IP, not necessarily unique
-- Optional
- protocol text, -- Protocol, e.g. ssh or https or telnet
- username text, -- Username, if applicable
- "password" text, -- Password, if applicable
- model text, -- Model, e.g. BayTech or iPal
- notes text -- Random notes
+ protocol text, -- Protocol, e.g. ssh or https or telnet
+ username text, -- Username, if applicable
+ "password" text, -- Password, if applicable
+ model text, -- Model, e.g. BayTech or iPal
+ notes text -- Random notes
) WITH OIDS;
CREATE INDEX pcus_site_id_idx ON pcus (site_id);
-CREATE VIEW site_pcus AS
+CREATE OR REPLACE VIEW site_pcus AS
SELECT site_id,
array_accum(pcu_id) AS pcu_ids
FROM pcus
GROUP BY site_id;
CREATE TABLE pcu_node (
- pcu_id integer REFERENCES pcus NOT NULL, -- PCU identifier
- node_id integer REFERENCES nodes NOT NULL, -- Node identifier
- port integer NOT NULL, -- Port number
- PRIMARY KEY (pcu_id, node_id), -- The same node cannot be controlled by different ports
- UNIQUE (pcu_id, port) -- The same port cannot control multiple nodes
+ pcu_id integer REFERENCES pcus NOT NULL, -- PCU identifier
+ node_id integer REFERENCES nodes NOT NULL, -- Node identifier
+ port integer NOT NULL, -- Port number
+ PRIMARY KEY (pcu_id, node_id), -- The same node cannot be controlled by different ports
+ UNIQUE (pcu_id, port) -- The same port cannot control multiple nodes
);
CREATE INDEX pcu_node_pcu_id_idx ON pcu_node (pcu_id);
CREATE INDEX pcu_node_node_id_idx ON pcu_node (node_id);
-CREATE VIEW node_pcus AS
+CREATE OR REPLACE VIEW node_pcus AS
SELECT node_id,
array_accum(pcu_id) AS pcu_ids,
array_accum(port) AS ports
FROM pcu_node
GROUP BY node_id;
-CREATE VIEW pcu_nodes AS
+CREATE OR REPLACE VIEW pcu_nodes AS
SELECT pcu_id,
array_accum(node_id) AS node_ids,
array_accum(port) AS ports
CREATE TABLE slice_instantiations (
instantiation text PRIMARY KEY
) WITH OIDS;
-INSERT INTO slice_instantiations (instantiation) VALUES ('not-instantiated'); -- Placeholder slice
-INSERT INTO slice_instantiations (instantiation) VALUES ('plc-instantiated'); -- Instantiated by Node Manager
-INSERT INTO slice_instantiations (instantiation) VALUES ('delegated'); -- Manually instantiated
-INSERT INTO slice_instantiations (instantiation) VALUES ('nm-controller'); -- NM Controller
+INSERT INTO slice_instantiations (instantiation) VALUES ('not-instantiated'); -- Placeholder slice
+INSERT INTO slice_instantiations (instantiation) VALUES ('plc-instantiated'); -- Instantiated by Node Manager
+INSERT INTO slice_instantiations (instantiation) VALUES ('delegated'); -- Manually instantiated
+INSERT INTO slice_instantiations (instantiation) VALUES ('nm-controller'); -- NM Controller
-- Slices
CREATE TABLE slices (
- slice_id serial PRIMARY KEY, -- Slice identifier
- site_id integer REFERENCES sites NOT NULL, -- Site identifier
+ slice_id serial PRIMARY KEY, -- Slice identifier
+ site_id integer REFERENCES sites NOT NULL, -- Site identifier
- name text NOT NULL, -- Slice name
- instantiation text REFERENCES slice_instantiations NOT NULL DEFAULT 'plc-instantiated', -- Slice state, e.g. plc-instantiated
- url text, -- Project URL
- description text, -- Project description
+ name text NOT NULL, -- Slice name
+ instantiation text REFERENCES slice_instantiations -- Slice state, e.g. plc-instantiated
+ NOT NULL DEFAULT 'plc-instantiated',
+ url text, -- Project URL
+ description text, -- Project description
- max_nodes integer NOT NULL DEFAULT 100, -- Maximum number of nodes that can be assigned to this slice
+ max_nodes integer NOT NULL DEFAULT 100, -- Maximum number of nodes that can be assigned to this slice
- creator_person_id integer REFERENCES persons, -- Creator
- created timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, -- Creation date
- expires timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP + '2 weeks', -- Expiration date
+ creator_person_id integer REFERENCES persons, -- Creator
+ created timestamp without time zone NOT NULL -- Creation date
+ DEFAULT CURRENT_TIMESTAMP,
+ expires timestamp without time zone NOT NULL -- Expiration date
+ DEFAULT CURRENT_TIMESTAMP + '2 weeks',
is_deleted boolean NOT NULL DEFAULT false
) WITH OIDS;
-- Slivers
CREATE TABLE slice_node (
- slice_id integer REFERENCES slices NOT NULL, -- Slice identifier
- node_id integer REFERENCES nodes NOT NULL, -- Node identifier
+ slice_id integer REFERENCES slices NOT NULL, -- Slice identifier
+ node_id integer REFERENCES nodes NOT NULL, -- Node identifier
PRIMARY KEY (slice_id, node_id)
) WITH OIDS;
CREATE INDEX slice_node_slice_id_idx ON slice_node (slice_id);
CREATE INDEX slice_node_node_id_idx ON slice_node (node_id);
-- Synonym for slice_node
-CREATE VIEW slivers AS
+CREATE OR REPLACE VIEW slivers AS
SELECT * FROM slice_node;
-- Nodes in each slice
-CREATE VIEW slice_nodes AS
+CREATE OR REPLACE VIEW slice_nodes AS
SELECT slice_id,
array_accum(node_id) AS node_ids
FROM slice_node
GROUP BY slice_id;
-- Slices on each node
-CREATE VIEW node_slices AS
+CREATE OR REPLACE VIEW node_slices AS
SELECT node_id,
array_accum(slice_id) AS slice_ids
FROM slice_node
GROUP BY node_id;
-- Slices at each site
-CREATE VIEW site_slices AS
+CREATE OR REPLACE VIEW site_slices AS
SELECT site_id,
array_accum(slice_id) AS slice_ids
FROM slices
-- Slice membership
CREATE TABLE slice_person (
- slice_id integer REFERENCES slices NOT NULL, -- Slice identifier
- person_id integer REFERENCES persons NOT NULL, -- Account identifier
+ slice_id integer REFERENCES slices NOT NULL, -- Slice identifier
+ person_id integer REFERENCES persons NOT NULL, -- Account identifier
PRIMARY KEY (slice_id, person_id)
) WITH OIDS;
CREATE INDEX slice_person_slice_id_idx ON slice_person (slice_id);
CREATE INDEX slice_person_person_id_idx ON slice_person (person_id);
-- Members of the slice
-CREATE VIEW slice_persons AS
+CREATE OR REPLACE VIEW slice_persons AS
SELECT slice_id,
array_accum(person_id) AS person_ids
FROM slice_person
GROUP BY slice_id;
-- Slices of which each person is a member
-CREATE VIEW person_slices AS
+CREATE OR REPLACE VIEW person_slices AS
SELECT person_id,
array_accum(slice_id) AS slice_ids
FROM slice_person
--------------------------------------------------------------------------------
-- slice whitelist on nodes
CREATE TABLE node_slice_whitelist (
- node_id integer REFERENCES nodes NOT NULL, -- Node id of whitelist
- slice_id integer REFERENCES slices NOT NULL, -- Slice id thats allowd on this node
+ node_id integer REFERENCES nodes NOT NULL, -- Node id of whitelist
+ slice_id integer REFERENCES slices NOT NULL, -- Slice id thats allowd on this node
PRIMARY KEY (node_id, slice_id)
) WITH OIDS;
CREATE INDEX node_slice_whitelist_node_id_idx ON node_slice_whitelist (node_id);
CREATE INDEX node_slice_whitelist_slice_id_idx ON node_slice_whitelist (slice_id);
-- Slices on each node
-CREATE VIEW node_slices_whitelist AS
+CREATE OR REPLACE VIEW node_slices_whitelist AS
SELECT node_id,
array_accum(slice_id) AS slice_ids_whitelist
FROM node_slice_whitelist
GROUP BY node_id;
--------------------------------------------------------------------------------
--- Slice attributes
+-- Slice tags (formerly known as slice attributes)
--------------------------------------------------------------------------------
--- Slice attribute types
-CREATE TABLE slice_attribute_types (
- attribute_type_id serial PRIMARY KEY, -- Attribute type identifier
- name text UNIQUE NOT NULL, -- Attribute name
- description text, -- Attribute description
- min_role_id integer REFERENCES roles DEFAULT 10 -- If set, minimum (least powerful) role that can set or change this attribute
-) WITH OIDS;
-
-- Slice/sliver attributes
-CREATE TABLE slice_attribute (
- slice_attribute_id serial PRIMARY KEY, -- Slice attribute identifier
- slice_id integer REFERENCES slices NOT NULL, -- Slice identifier
- node_id integer REFERENCES nodes, -- Sliver attribute if set
- nodegroup_id integer REFERENCES nodegroups, -- Node group attribute if set
- attribute_type_id integer REFERENCES slice_attribute_types NOT NULL, -- Attribute type identifier
+CREATE TABLE slice_tag (
+ slice_tag_id serial PRIMARY KEY, -- Slice attribute identifier
+ slice_id integer REFERENCES slices NOT NULL, -- Slice identifier
+ node_id integer REFERENCES nodes, -- Sliver attribute if set
+ nodegroup_id integer REFERENCES nodegroups, -- Node group attribute if set
+ tag_type_id integer REFERENCES tag_types NOT NULL, -- Attribute type identifier
value text
) WITH OIDS;
-CREATE INDEX slice_attribute_slice_id_idx ON slice_attribute (slice_id);
-CREATE INDEX slice_attribute_node_id_idx ON slice_attribute (node_id);
-CREATE INDEX slice_attribute_nodegroup_id_idx ON slice_attribute (nodegroup_id);
-
-CREATE VIEW slice_attributes AS
-SELECT slice_id,
-array_accum(slice_attribute_id) AS slice_attribute_ids
-FROM slice_attribute
-GROUP BY slice_id;
+CREATE INDEX slice_tag_slice_id_idx ON slice_tag (slice_id);
+CREATE INDEX slice_tag_node_id_idx ON slice_tag (node_id);
+CREATE INDEX slice_tag_nodegroup_id_idx ON slice_tag (nodegroup_id);
--------------------------------------------------------------------------------
-- Initscripts
-- Initscripts
CREATE TABLE initscripts (
- initscript_id serial PRIMARY KEY, -- Initscript identifier
- name text NOT NULL, -- Initscript name
- enabled bool NOT NULL DEFAULT true, -- Initscript is active
- script text NOT NULL, -- Initscript
+ initscript_id serial PRIMARY KEY, -- Initscript identifier
+ name text NOT NULL, -- Initscript name
+ enabled bool NOT NULL DEFAULT true, -- Initscript is active
+ script text NOT NULL, -- Initscript body
UNIQUE (name)
) WITH OIDS;
CREATE INDEX initscripts_name_idx ON initscripts (name);
-- Peers
CREATE TABLE peers (
- peer_id serial PRIMARY KEY, -- Peer identifier
- peername text NOT NULL, -- Peer name
- peer_url text NOT NULL, -- (HTTPS) URL of the peer PLCAPI interface
- cacert text, -- (SSL) Public certificate of peer API server
- key text, -- (GPG) Public key used for authentication
+ peer_id serial PRIMARY KEY, -- Peer identifier
+ peername text NOT NULL, -- Peer name
+ peer_url text NOT NULL, -- (HTTPS) URL of the peer PLCAPI interface
+ cacert text, -- (SSL) Public certificate of peer API server
+ key text, -- (GPG) Public key used for authentication
+ shortname text, -- abbreviated name for displaying foreign objects
+ hrn_root text, -- root for this peer domain
deleted boolean NOT NULL DEFAULT false
) WITH OIDS;
CREATE INDEX peers_peername_idx ON peers (peername) WHERE deleted IS false;
+CREATE INDEX peers_shortname_idx ON peers (shortname) WHERE deleted IS false;
-- Objects at each peer
CREATE TABLE peer_site (
- site_id integer REFERENCES sites PRIMARY KEY, -- Local site identifier
- peer_id integer REFERENCES peers NOT NULL, -- Peer identifier
- peer_site_id integer NOT NULL, -- Foreign site identifier at peer
- UNIQUE (peer_id, peer_site_id) -- The same foreign site should not be cached twice
+ site_id integer REFERENCES sites PRIMARY KEY, -- Local site identifier
+ peer_id integer REFERENCES peers NOT NULL, -- Peer identifier
+ peer_site_id integer NOT NULL, -- Foreign site identifier at peer
+ UNIQUE (peer_id, peer_site_id) -- The same foreign site should not be cached twice
) WITH OIDS;
CREATE INDEX peer_site_peer_id_idx ON peers (peer_id);
-CREATE VIEW peer_sites AS
+CREATE OR REPLACE VIEW peer_sites AS
SELECT peer_id,
array_accum(site_id) AS site_ids,
array_accum(peer_site_id) AS peer_site_ids
GROUP BY peer_id;
CREATE TABLE peer_person (
- person_id integer REFERENCES persons PRIMARY KEY, -- Local user identifier
- peer_id integer REFERENCES peers NOT NULL, -- Peer identifier
- peer_person_id integer NOT NULL, -- Foreign user identifier at peer
- UNIQUE (peer_id, peer_person_id) -- The same foreign user should not be cached twice
+ person_id integer REFERENCES persons PRIMARY KEY, -- Local user identifier
+ peer_id integer REFERENCES peers NOT NULL, -- Peer identifier
+ peer_person_id integer NOT NULL, -- Foreign user identifier at peer
+ UNIQUE (peer_id, peer_person_id) -- The same foreign user should not be cached twice
) WITH OIDS;
CREATE INDEX peer_person_peer_id_idx ON peer_person (peer_id);
-CREATE VIEW peer_persons AS
+CREATE OR REPLACE VIEW peer_persons AS
SELECT peer_id,
array_accum(person_id) AS person_ids,
array_accum(peer_person_id) AS peer_person_ids
GROUP BY peer_id;
CREATE TABLE peer_key (
- key_id integer REFERENCES keys PRIMARY KEY, -- Local key identifier
- peer_id integer REFERENCES peers NOT NULL, -- Peer identifier
- peer_key_id integer NOT NULL, -- Foreign key identifier at peer
- UNIQUE (peer_id, peer_key_id) -- The same foreign key should not be cached twice
+ key_id integer REFERENCES keys PRIMARY KEY, -- Local key identifier
+ peer_id integer REFERENCES peers NOT NULL, -- Peer identifier
+ peer_key_id integer NOT NULL, -- Foreign key identifier at peer
+ UNIQUE (peer_id, peer_key_id) -- The same foreign key should not be cached twice
) WITH OIDS;
CREATE INDEX peer_key_peer_id_idx ON peer_key (peer_id);
-CREATE VIEW peer_keys AS
+CREATE OR REPLACE VIEW peer_keys AS
SELECT peer_id,
array_accum(key_id) AS key_ids,
array_accum(peer_key_id) AS peer_key_ids
GROUP BY peer_id;
CREATE TABLE peer_node (
- node_id integer REFERENCES nodes PRIMARY KEY, -- Local node identifier
- peer_id integer REFERENCES peers NOT NULL, -- Peer identifier
- peer_node_id integer NOT NULL, -- Foreign node identifier
- UNIQUE (peer_id, peer_node_id) -- The same foreign node should not be cached twice
+ node_id integer REFERENCES nodes PRIMARY KEY, -- Local node identifier
+ peer_id integer REFERENCES peers NOT NULL, -- Peer identifier
+ peer_node_id integer NOT NULL, -- Foreign node identifier
+ UNIQUE (peer_id, peer_node_id) -- The same foreign node should not be cached twice
) WITH OIDS;
CREATE INDEX peer_node_peer_id_idx ON peer_node (peer_id);
-CREATE VIEW peer_nodes AS
+CREATE OR REPLACE VIEW peer_nodes AS
SELECT peer_id,
array_accum(node_id) AS node_ids,
array_accum(peer_node_id) AS peer_node_ids
GROUP BY peer_id;
CREATE TABLE peer_slice (
- slice_id integer REFERENCES slices PRIMARY KEY, -- Local slice identifier
- peer_id integer REFERENCES peers NOT NULL, -- Peer identifier
- peer_slice_id integer NOT NULL, -- Slice identifier at peer
- UNIQUE (peer_id, peer_slice_id) -- The same foreign slice should not be cached twice
+ slice_id integer REFERENCES slices PRIMARY KEY, -- Local slice identifier
+ peer_id integer REFERENCES peers NOT NULL, -- Peer identifier
+ peer_slice_id integer NOT NULL, -- Slice identifier at peer
+ UNIQUE (peer_id, peer_slice_id) -- The same foreign slice should not be cached twice
) WITH OIDS;
CREATE INDEX peer_slice_peer_id_idx ON peer_slice (peer_id);
-CREATE VIEW peer_slices AS
+CREATE OR REPLACE VIEW peer_slices AS
SELECT peer_id,
array_accum(slice_id) AS slice_ids,
array_accum(peer_slice_id) AS peer_slice_ids
-- Authenticated sessions
CREATE TABLE sessions (
- session_id text PRIMARY KEY, -- Session identifier
+ session_id text PRIMARY KEY, -- Session identifier
expires timestamp without time zone
) WITH OIDS;
-- People can have multiple sessions
CREATE TABLE person_session (
- person_id integer REFERENCES persons NOT NULL, -- Account identifier
- session_id text REFERENCES sessions NOT NULL, -- Session identifier
+ person_id integer REFERENCES persons NOT NULL, -- Account identifier
+ session_id text REFERENCES sessions NOT NULL, -- Session identifier
PRIMARY KEY (person_id, session_id),
- UNIQUE (session_id) -- Sessions are unique
+ UNIQUE (session_id) -- Sessions are unique
) WITH OIDS;
CREATE INDEX person_session_person_id_idx ON person_session (person_id);
-- Nodes can have only one session
CREATE TABLE node_session (
- node_id integer REFERENCES nodes NOT NULL, -- Node identifier
- session_id text REFERENCES sessions NOT NULL, -- Session identifier
- UNIQUE (node_id), -- Nodes can have only one session
- UNIQUE (session_id) -- Sessions are unique
+ node_id integer REFERENCES nodes NOT NULL, -- Node identifier
+ session_id text REFERENCES sessions NOT NULL, -- Session identifier
+ UNIQUE (node_id), -- Nodes can have only one session
+ UNIQUE (session_id) -- Sessions are unique
) WITH OIDS;
-
-
-------------------------------------------------------------------------------
-- PCU Types
------------------------------------------------------------------------------
CREATE TABLE pcu_types (
pcu_type_id serial PRIMARY KEY,
- model text NOT NULL , -- PCU model name
- name text -- Full PCU model name
+ model text NOT NULL , -- PCU model name
+ name text -- Full PCU model name
) WITH OIDS;
CREATE INDEX pcu_types_model_idx ON pcu_types (model);
--------------------------------------------------------------------------------
CREATE TABLE messages (
- message_id text PRIMARY KEY, -- Message name
- subject text, -- Message summary
- template text, -- Message template
- enabled bool NOT NULL DEFAULT true -- Whether message is enabled
+ message_id text PRIMARY KEY, -- Message name
+ subject text, -- Message summary
+ template text, -- Message template
+ enabled bool NOT NULL DEFAULT true -- Whether message is enabled
) WITH OIDS;
--------------------------------------------------------------------------------
-- Events
CREATE TABLE events (
- event_id serial PRIMARY KEY, -- Event identifier
- person_id integer REFERENCES persons, -- Person responsible for event, if any
- node_id integer REFERENCES nodes, -- Node responsible for event, if any
- auth_type text, -- Type of auth used. i.e. AuthMethod
- fault_code integer NOT NULL DEFAULT 0, -- Did this event result in error
- call_name text NOT NULL, -- Call responsible for this event
- call text NOT NULL, -- Call responsible for this event, including parameters
- message text, -- High level description of this event
- runtime float DEFAULT 0, -- Event run time
- time timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP -- Event timestamp
+ event_id serial PRIMARY KEY, -- Event identifier
+ person_id integer REFERENCES persons, -- Person responsible for event, if any
+ node_id integer REFERENCES nodes, -- Node responsible for event, if any
+ auth_type text, -- Type of auth used. i.e. AuthMethod
+ fault_code integer NOT NULL DEFAULT 0, -- Did this event result in error
+ call_name text NOT NULL, -- Call responsible for this event
+ call text NOT NULL, -- Call responsible for this event, including parameters
+ message text, -- High level description of this event
+ runtime float DEFAULT 0, -- Event run time
+ time timestamp without time zone NOT NULL -- Event timestamp
+ DEFAULT CURRENT_TIMESTAMP
) WITH OIDS;
-- Database object(s) that may have been affected by a particular event
CREATE TABLE event_object (
- event_id integer REFERENCES events NOT NULL, -- Event identifier
- object_id integer NOT NULL, -- Object identifier
- object_type text NOT NULL Default 'Unknown' -- What type of object is this event affecting
+ event_id integer REFERENCES events NOT NULL, -- Event identifier
+ object_id integer NOT NULL, -- Object identifier
+ object_type text NOT NULL Default 'Unknown' -- What type of object is this event affecting
) WITH OIDS;
CREATE INDEX event_object_event_id_idx ON event_object (event_id);
CREATE INDEX event_object_object_id_idx ON event_object (object_id);
pcu_types.pcu_type_id,
pcu_types.model,
pcu_types.name,
-COALESCE((SELECT pcu_protocol_type_ids FROM pcu_protocol_types WHERE pcu_protocol_types.pcu_type_id = pcu_types.pcu_type_id), '{}') AS pcu_protocol_type_ids
+COALESCE((SELECT pcu_protocol_type_ids FROM pcu_protocol_types
+ WHERE pcu_protocol_types.pcu_type_id = pcu_types.pcu_type_id), '{}')
+AS pcu_protocol_type_ids
FROM pcu_types;
+--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW view_events AS
SELECT
events.event_id,
event_object.object_type
FROM events LEFT JOIN event_object USING (event_id);
+--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW view_persons AS
SELECT
persons.person_id,
FROM persons
LEFT JOIN peer_person USING (person_id);
+--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW view_peers AS
SELECT
peers.*,
COALESCE((SELECT peer_slice_ids FROM peer_slices WHERE peer_slices.peer_id = peers.peer_id), '{}') AS peer_slice_ids
FROM peers;
+--------------------------------------------------------------------------------
+CREATE OR REPLACE VIEW node_tags AS
+SELECT node_id,
+array_accum(node_tag_id) AS node_tag_ids
+FROM node_tag
+GROUP BY node_id;
+
+CREATE OR REPLACE VIEW view_node_tags AS
+SELECT
+node_tag.node_tag_id,
+node_tag.node_id,
+nodes.hostname,
+tag_types.tag_type_id,
+tag_types.tagname,
+tag_types.description,
+tag_types.category,
+tag_types.min_role_id,
+node_tag.value
+FROM node_tag
+INNER JOIN tag_types USING (tag_type_id)
+INNER JOIN nodes USING (node_id);
+
CREATE OR REPLACE VIEW view_nodes AS
SELECT
nodes.node_id,
+nodes.node_type,
nodes.hostname,
nodes.site_id,
nodes.boot_state,
+nodes.run_level,
nodes.deleted,
nodes.model,
nodes.boot_nonce,
nodes.version,
+nodes.verified,
nodes.ssh_rsa_key,
nodes.key,
CAST(date_part('epoch', nodes.date_created) AS bigint) AS date_created,
CAST(date_part('epoch', nodes.last_contact) AS bigint) AS last_contact,
peer_node.peer_id,
peer_node.peer_node_id,
-COALESCE((SELECT nodenetwork_ids FROM node_nodenetworks WHERE node_nodenetworks.node_id = nodes.node_id), '{}') AS nodenetwork_ids,
-COALESCE((SELECT nodegroup_ids FROM node_nodegroups WHERE node_nodegroups.node_id = nodes.node_id), '{}') AS nodegroup_ids,
-COALESCE((SELECT slice_ids FROM node_slices WHERE node_slices.node_id = nodes.node_id), '{}') AS slice_ids,
-COALESCE((SELECT slice_ids_whitelist FROM node_slices_whitelist WHERE node_slices_whitelist.node_id = nodes.node_id), '{}') AS slice_ids_whitelist,
-COALESCE((SELECT pcu_ids FROM node_pcus WHERE node_pcus.node_id = nodes.node_id), '{}') AS pcu_ids,
-COALESCE((SELECT ports FROM node_pcus WHERE node_pcus.node_id = nodes.node_id), '{}') AS ports,
-COALESCE((SELECT conf_file_ids FROM node_conf_files WHERE node_conf_files.node_id = nodes.node_id), '{}') AS conf_file_ids,
+COALESCE((SELECT interface_ids FROM node_interfaces
+ WHERE node_interfaces.node_id = nodes.node_id), '{}')
+AS interface_ids,
+COALESCE((SELECT nodegroup_ids FROM node_nodegroups
+ WHERE node_nodegroups.node_id = nodes.node_id), '{}')
+AS nodegroup_ids,
+COALESCE((SELECT slice_ids FROM node_slices
+ WHERE node_slices.node_id = nodes.node_id), '{}')
+AS slice_ids,
+COALESCE((SELECT slice_ids_whitelist FROM node_slices_whitelist
+ WHERE node_slices_whitelist.node_id = nodes.node_id), '{}')
+AS slice_ids_whitelist,
+COALESCE((SELECT pcu_ids FROM node_pcus
+ WHERE node_pcus.node_id = nodes.node_id), '{}')
+AS pcu_ids,
+COALESCE((SELECT ports FROM node_pcus
+ WHERE node_pcus.node_id = nodes.node_id), '{}')
+AS ports,
+COALESCE((SELECT conf_file_ids FROM node_conf_files
+ WHERE node_conf_files.node_id = nodes.node_id), '{}')
+AS conf_file_ids,
+COALESCE((SELECT node_tag_ids FROM node_tags
+ WHERE node_tags.node_id = nodes.node_id), '{}')
+AS node_tag_ids,
node_session.session_id AS session
FROM nodes
LEFT JOIN peer_node USING (node_id)
LEFT JOIN node_session USING (node_id);
+--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW view_nodegroups AS
SELECT
nodegroups.*,
-COALESCE((SELECT node_ids FROM nodegroup_nodes WHERE nodegroup_nodes.nodegroup_id = nodegroups.nodegroup_id), '{}') AS node_ids,
-COALESCE((SELECT conf_file_ids FROM nodegroup_conf_files WHERE nodegroup_conf_files.nodegroup_id = nodegroups.nodegroup_id), '{}') AS conf_file_ids
-FROM nodegroups;
+tag_types.tagname,
+COALESCE((SELECT conf_file_ids FROM nodegroup_conf_files
+ WHERE nodegroup_conf_files.nodegroup_id = nodegroups.nodegroup_id), '{}')
+AS conf_file_ids,
+COALESCE((SELECT node_ids FROM nodegroup_nodes
+ WHERE nodegroup_nodes.nodegroup_id = nodegroups.nodegroup_id), '{}')
+AS node_ids
+FROM nodegroups INNER JOIN tag_types USING (tag_type_id);
+--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW view_conf_files AS
SELECT
conf_files.*,
-COALESCE((SELECT node_ids FROM conf_file_nodes WHERE conf_file_nodes.conf_file_id = conf_files.conf_file_id), '{}') AS node_ids,
-COALESCE((SELECT nodegroup_ids FROM conf_file_nodegroups WHERE conf_file_nodegroups.conf_file_id = conf_files.conf_file_id), '{}') AS nodegroup_ids
+COALESCE((SELECT node_ids FROM conf_file_nodes
+ WHERE conf_file_nodes.conf_file_id = conf_files.conf_file_id), '{}')
+AS node_ids,
+COALESCE((SELECT nodegroup_ids FROM conf_file_nodegroups
+ WHERE conf_file_nodegroups.conf_file_id = conf_files.conf_file_id), '{}')
+AS nodegroup_ids
FROM conf_files;
+--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW view_pcus AS
SELECT
pcus.*,
COALESCE((SELECT ports FROM pcu_nodes WHERE pcu_nodes.pcu_id = pcus.pcu_id), '{}') AS ports
FROM pcus;
+--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW view_sites AS
SELECT
sites.site_id,
FROM sites
LEFT JOIN peer_site USING (site_id);
+--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW view_addresses AS
SELECT
addresses.*,
COALESCE((SELECT address_types FROM address_address_types WHERE address_address_types.address_id = addresses.address_id), '{}') AS address_types
FROM addresses;
+--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW view_keys AS
SELECT
keys.*,
LEFT JOIN person_key USING (key_id)
LEFT JOIN peer_key USING (key_id);
+--------------------------------------------------------------------------------
+CREATE OR REPLACE VIEW slice_tags AS
+SELECT slice_id,
+array_accum(slice_tag_id) AS slice_tag_ids
+FROM slice_tag
+GROUP BY slice_id;
+
CREATE OR REPLACE VIEW view_slices AS
SELECT
slices.slice_id,
peer_slice.peer_slice_id,
COALESCE((SELECT node_ids FROM slice_nodes WHERE slice_nodes.slice_id = slices.slice_id), '{}') AS node_ids,
COALESCE((SELECT person_ids FROM slice_persons WHERE slice_persons.slice_id = slices.slice_id), '{}') AS person_ids,
-COALESCE((SELECT slice_attribute_ids FROM slice_attributes WHERE slice_attributes.slice_id = slices.slice_id), '{}') AS slice_attribute_ids
+COALESCE((SELECT slice_tag_ids FROM slice_tags WHERE slice_tags.slice_id = slices.slice_id), '{}') AS slice_tag_ids
FROM slices
LEFT JOIN peer_slice USING (slice_id);
-CREATE OR REPLACE VIEW view_slice_attributes AS
+CREATE OR REPLACE VIEW view_slice_tags AS
SELECT
-slice_attribute.slice_attribute_id,
-slice_attribute.slice_id,
-slice_attribute.node_id,
-slice_attribute.nodegroup_id,
-slice_attribute_types.attribute_type_id,
-slice_attribute_types.name,
-slice_attribute_types.description,
-slice_attribute_types.min_role_id,
-slice_attribute.value
-FROM slice_attribute
-INNER JOIN slice_attribute_types USING (attribute_type_id);
+slice_tag.slice_tag_id,
+slice_tag.slice_id,
+slice_tag.node_id,
+slice_tag.nodegroup_id,
+tag_types.tag_type_id,
+tag_types.tagname,
+tag_types.description,
+tag_types.category,
+tag_types.min_role_id,
+slice_tag.value,
+slices.name
+FROM slice_tag
+INNER JOIN tag_types USING (tag_type_id)
+INNER JOIN slices USING (slice_id);
+--------------------------------------------------------------------------------
CREATE OR REPLACE VIEW view_sessions AS
SELECT
sessions.session_id,
-- Built-in maintenance account and default site
--------------------------------------------------------------------------------
-INSERT INTO persons
-(first_name, last_name, email, password, enabled)
-VALUES
-('Maintenance', 'Account', 'maint@localhost.localdomain', 'nopass', true);
+INSERT INTO persons (first_name, last_name, email, password, enabled)
+VALUES ('Maintenance', 'Account', 'maint@localhost.localdomain', 'nopass', true);
INSERT INTO person_role (person_id, role_id) VALUES (1, 10);
INSERT INTO person_role (person_id, role_id) VALUES (1, 20);
INSERT INTO person_role (person_id, role_id) VALUES (1, 30);
INSERT INTO person_role (person_id, role_id) VALUES (1, 40);
-INSERT INTO sites
-(login_base, name, abbreviated_name, max_slices)
-VALUES
-('pl', 'PlanetLab Central', 'PLC', 100);
+INSERT INTO sites (login_base, name, abbreviated_name, max_slices)
+VALUES ('pl', 'PlanetLab Central', 'PLC', 100);
+++ /dev/null
-Main authors:
- Federico Di Gregorio <fog@debian.org>
-
-For the win32 port:
- Jason Erickson <jerickso@indian.com> (most of his changes are still in 2.0)
-
-Additional Help:
-
+++ /dev/null
-2006-09-02 Federico Di Gregorio <fog@initd.org>
-
- * Release 2.0.5.1.
-
- * psycopg/cursor_type.c: applied patch from Jason Erickson to
- build on MSVC and older gcc.
-
-2006-09-01 Federico Di Gregorio <fog@initd.org>
-
- * Release 2.0.5.
-
- * Fixed patch from #119, see tracker for details.
-
- * Preparing release 2.0.5.
-
- * psycopg/psycopgmodule.c: fixed filling of connection errors
- to include OperationalError.
-
- * setup.py: removed pydatetime option from initialize_options
- to make sure that the value in setup.cfg is used.
-
- * psycopg/psycopgmodule.c: applied patch from jdahlin (#120)
- to have .connect() accept either a string or int as the port
- parameter.
-
- * psycopg/adapter_binary.c: applied patch from jdahlin (#119)
- to fix the segfault on empty binary buffers.
-
- * psycopg/connection_type.c: added .status attribute to expose
- the internal status.
-
- * psycopg/pqpath.c: applied patch from intgr (#117) to fix
- segfault on null queries.
-
- * psycopg/cursor_type.c: applied patch from intgr (#116) to
- fix bad keyword naming and segfault in .executemany().
-
- * ZPsycopgDA/DA.py: applied ImageFile patch from Charlie
- Clark.
-
- * lib/pool.py: applied logging patch from Charlie Clark.
- It will probably get a makeup and be moved to the top-level
- module later.
-
-2006-08-02 Federico Di Gregorio <fog@initd.org>
-
- * Release 2.0.4.
-
- * Fixed bug in float conversion (check for NULL string was
- erroneously removed in 2.0.3!)
-
-2006-07-31 Federico Di Gregorio <fog@initd.org>
-
- * Release 2.0.3.
-
- * psycopg/cursor_type.c: applied patch from jbellis (#113) to
- allow column selection in .copy_from().
-
- * psycopg/psycopgmodule.c: fixed memory leak in custom exceptions
- (applied patch from #114).
-
-2006-07-26 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/adapter_datetime.c (pydatetime_str): fixed error
- in conversion of microseconds for intervals and better algo
- (thanks to Mario Frasca.)
-
-2006-06-18 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/adapter_binary.c: same as below.
-
- * psycopg/adapter_qstring.c: does not segfault anymore if
- .getquoted() is called without preparing the qstring with
- the connection.
-
-2006-06-15 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/typecast_basic.c: fixed problem with bogus
- conversion when importing gtk (that was crazy, I didn't
- understand why it happened but the new code just fixes it.)
-
- * ZPsycopgDA/db.py: better type analisys, using an hash
- instead of a series of if (variation on patch from Charlie
- Clark.)
-
-2006-06-11 Federico Di Gregorio <fog@initd.org>
-
- * Release 2.0.2.
-
- * psycopg/typecast_array.c (typecast_array_cleanup): fixed a
- problem with typecast_array_cleanup always returning the new
- string length shorter by 1 (Closes: #93).
-
- * psycopg/adapter_binary.c: as below.
-
- * psycopg/adapter_qstring.c: wrapped #warning in #ifdef __GCC__
- because other compilers don't have it and it will just break
- compilation (patch from jason, our great win32 builder).
-
- * psycopg/adapter_list.c: applied patch to adapt an empty list
- into an empty array and not to NULL (from iGGy, closes: #108).
-
- * psycopg/cursor_type.c: applied patch from wkv to avoid
- under-allocating query space when the parameters are not of the
- right type (Closes: #110).
-
- * psycopg/connection_int.c: applied patch from wkv to avoid off
- by one allocation of connection encoding string (Closes: #109).
-
-2006-06-09 Federico Di Gregorio <fog@initd.org>
-
- * Release 2.0.1.
-
- * Fixed some buglets in ZPsycopgDA (was unable to load due
- to shorter version number in psycopg module.)
-
-2006-06-08 Federico Di Gregorio <fog@initd.org>
-
- * Release 2.0.
-
- * ZPsycopgDA/DA.py: removed Browse table for 2.0 release; we'll
- add it back later.
-
-2006-05-26 Federico Di Gregorio <fog@initd.org>
-
- * Applied better PostgreSQL patch from AA.
-
-2006-05-24 Federico Di Gregorio <fog@initd.org>
-
- * Enabled 8.1.4 security fix only when the version is >= 8.1.4, fall
- back to old code otherwise.
-
- * psycopg/adapter_qstring.c: now quote using PQescapeStringConn if
- available.
-
- * psycopg/adapter_binary.c: now quote using PQescapeByteaConn if
- available.
-
-2006-04-38 Federico Di Gregorio <fog@initd.org>
-
- * setup.py: fixed little problem with mx_include_dir as suggested
- by kvc (this closes #102).
-
-2006-04-24 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/adapter_pboolean.c: added the possibility to format boolean
- values as "true" and "false" instead of "'t'" and "'f'".
-
-2006-03-08 Federico Di Gregorio <fog@initd.org>
-
- * lib/extras.py: added .next() to DictCursot to support iteration.
-
-2006-03-02 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/typecast_array.c (typecast_array_tokenize): removed cast
- to build without warnings on 64 bit arches.
-
-2006-02-11 Federico Di Gregorio <fog@initd.org>
-
- * Release 2.0 beta 8.
-
- * psycopg/config.h: applied patch from Jason to fix handle leak on
- win32, as documented in #92.
-
-2006-02-11 Federico Di Gregorio <fog@initd.org>
-
- * Release 2.0 beta 7.
-
- * psycopg/psycopgmodule.c: applied fix for memory overflow in
- connect() (reported by solt, #91.)
-
- * setup.py: applied patch from lbruno.
-
-2006-01-11 Federico Di Gregorio <fog@initd.org>
-
- * setup.py: does not report an error in pg_config unless the pg_config
- was explicitly set (allows for building with old options.)
-
-2006-01-06 Daniele Varrazzo <daniele.varrazzo@gmail.com>
-
- * setup.py: libpq.dll not used anymore. win32 setup uses pg_config too.
-
-2006-01-05 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/psycopgmodule.c (psyco_set_error): added function to set extra
- parameters on ProgrammingError instances. Also modified all occurances of
- PyErr_SetString(ProgrammingError,...) to psycopg_set_error().
-
- * setup.{cfg,py}: we now use pg_config to locate PostgreSQL libraries
- and headers (modified patch from lbruno, see #70.)
-
-2006-01-01 Federico Di Gregorio <fog@initd.org>
-
- * Preparing release 2 beta 7.
-
- * MANIFEST.in: we now distrbute pre-built documentation (still need
- to add to setup.py the code necessary to build docs as part of the
- build process.)
-
- * psycopg/connection_int.c: PostgreSQL encoding names are now force
- uppercase (after all PostgreSQL documentation reports them this way.)
-
-2005-12-11 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/typecast_array.c (typecast_array_cleanup): added functio
- to cleanup the "[...]=" part of an array result. This probably will
- need some more work for nested arrays but it fixed every test I was
- able to write. (Closes: #80)
-
-2005-12-11 Federico Di Gregorio <fog@initd.org>
-
- * setup.py: half-applied patch from Tavis to specify mx_include_dir
- in setup.cfg.
-
- * psycopg/typecast.c (typecast_parse_time): cz limit in the while
- loop is 6, not 5. This solve the problem with "fractionary" time zones
- and fixes #78.
-
-2005-12-06 Federico Di Gregorio <fog@initd.org>
-
- * lib/extras.py: added .callproc() to DictCursor as suggested
- by Philip Semanchuk.
-
-2005-11-29 Federico Di Gregorio <fog@initd.org>
-
- * MANIFEST.in: added docs/async.txt. (Closes: #75)
-
-2005-11-26 Daniele Varrazzo <daniele.varrazzo@gmail.com>
-
- * psycopg/psycopgmodule.c: fixed exceptions refcount.
-
- * Fixed lots of doctrings and added Epydoc-generated docs support.
-
-2005-11-24 Federico Di Gregorio <fog@initd.org>
-
- * sandbox: added all the test and creash-me files to the repository.
-
- * psycopg/typecast.c (typecast_dealloc): now directly calls
- PyObject_Del to avoid to segfault.
-
-2005-11-20 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/typecast.c: fixed problem with microseconds conversion by
- applying slightly modified patch from Ronnie Mackay.
-
-2005-11-19 Federico Di Gregorio <fog@initd.org>
-
- * lib/extensions.py: COMMITED -> COMMITTED. (Closes: #73)
-
- * doc/extensions.rst: included Daniele's work after minor cosmetic changes
- like using the new constants instead of numbers for transaction isolation
- levels.
-
-2005-11-17 Federico Di Gregorio <fog@initd.org>
-
- * ZPsycopgDA/pool.py: fixed connections leak by using the new name
- (PersistentConnectionPool) for the old connection pool class.
-
-2005-11-16 Federico Di Gregorio <fog@initd.org>
-
- * Preparing release 2.0 beta 6.
-
- * psycopg/adapter_mxdatetime.c: fixed all problems with mx conversions.
-
- * psycopg/typecast.c: now the timezone is set correctly even if there
- are no microseconds and/or the offset is 0;
-
- * examples/encoding.py: fixed example by using python utf8 encoding for
- the whole file.
-
- * lib/__init__.py: very nice hack from Harald Armin Massa to allow
- py2exe and similar tools to do their work without problems.
-
-2005-11-15 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/psycopgmodule.c: now bails out with correct exception when one
- of the needed modules can't be imported (should fix #32.)
-
-2005-11-14 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/typecast.c: added typecast_parse_date and typecast_parse_time
- functions to do locale-safe date/time parsing. This would probably also
- speed-up psycopg a little bit.
-
-2005-11-07 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/pqpath.c: fixed problem with uninitialized value (all this was
- started by replacing calloc() calls with PyMem_Malloc().)
-
-2005-11-04 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/typecast.c: a lot of changes:
- - made typecast a new-style type
- - removed coerce code and implemented the richcompare protocol that
- allows to compare objects of different types
- - much better __cmp__ method that allows to compare two typecast
- objects and returns True if any two of the mapped oids match
- - any object that can be used as an int works as right-hand operand
- in __cmp__ operations
-
- * psycopg/typecast_datetime.c: now typecast_PYINTERVAL_cast limit the
- scan to 'len' characters in the string (should fix #65.)
-
-2005-11-03 Federico Di Gregorio <fog@initd.org>
-
- * Applied patch from Daniele Varazzo to enable Decimal on Python
- 2.3 when the module is available (run-time check, nice.)
-
-2005-10-26 Federico Di Gregorio <fog@initd.org>
-
- * setup.cfg: added include_dirs line for SUSE 9.3.
-
-2005-10-22 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/cursor_type.c: added support for named cursors:
- - .fetchXXX() methods now execute a FETCH if the cursor is named
- - .execute() executes a DECLARE if the cursor is named
- - .execute() fails if a named cursor is used in autocommit
- - .executemany() can't be called on named cursors
- - .scroll() executes a MOVE if the cursor is named
- - .close() executes a CLOSE if the cursor is named
- Also, a "transaction mark" was added to both the connection and the
- cursor and an exception is raised when using a named cursor unless the
- two marks correspond.
-
- * psycopg/connection_int.c: snprintf->PyOS_snprintf.
-
- * psycopg/psycopgmodule.c: snprintf->PyOS_snprintf.
-
- * psycopg/cursor_type.c: changed self->query type from C string to
- PyObject* to better manage queries in named cursors.
-
- * psycopg/psycopgmodule.c: cleaned up exception names (now the errors
- is printed as psycopg2.Error and not as the confusing
- psycopg2._psycopg.Error.)
-
-2005-10-20 Federico Di Gregorio <fog@initd.org>
-
- * lib/pool.py: renamed ThreadedConnectionPool to PersistentConnectionPool
- and added a connection pool that allows multiple connections per thread
- as ThreadedConnectionPool (courtesy of Daniele Varrazzo.)
-
-2005-10-19 Federico Di Gregorio <fog@initd.org>
-
- * Releasing 2.0 beta 5.
-
- * psycopg/adapter_mxdatetime.c: reverted to old strftime method to format
- mx.DateTime objects; the new method didn't worked in some corner-cases.
- This makes impossible to have more than 2 decimal places for seconds but
- at least we get the time right every time.
-
-2005-10-18 Federico Di Gregorio <fog@initd.org>
-
- * NOTIFY is back end working.
-
- * psycopg/connection_type.c: fixed problem with initialization of
- notifies list (also fixed small memory leak in connection dealloc.)
-
- * examples/notify.py: added NOTIFY example.
-
- * psycopg/cursor_type.c: added per-cursor type-casters dictionaries.
-
-2005-10-18 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/typecast.c: temporary fix to typecasting objects to return
- False for any comparaison except an integer in self.values (i.e., we
- don't raise an exception anymore on a coerce error.) Epydoc is now
- happy.
-
- * psycopg/config.h: ZETA config.h patch from Charlie Clark.
-
- * examples/threads.py: fixed small typo: psycopg -> psycopg2.
-
- * Big cleanup of unsigned chars to tame gcc 4.
-
- * Big cleanup of module names (i.e., psycopg2._psycopg everywhere.)
-
- * psycopg/config.h: added fake localtime_r for platforms missing it
-
- * psycopg/cursor_type.c: cursors now have a FixedOffsetTimezone
- tzinfo_factory by default.
-
- * psycopg/adapter_datetime.c: added tzinfo argument to psycopg2.Time and
- psycopg2.Timestamp. Also now TimestampFromTicks sets the tzinfo object
- to psycopg2.tz.LOCAL.
-
-2005-10-17 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/adapter_datetime.c: we now use localtime() instead of gmtime()
- to accound for the local time-zone in timestamps.
-
- * psycopg/connection_type.c: fixed docstring for .cursor().
-
- * psycopg/psycopgmodule.c: added useful docstring for .connect().
-
-2005-10-08 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/connection_type.c: isolation level upper bound set to 2.
-
- * lib/psycopg1.py: explicitly set isolation level to 2 on .connect()
- to mimic psycopg 1 behaviour.
-
- * psycopg/connection_int.c: now set isolation level from
- default_transaction_isolation backend environment value.
-
- * psycopg/pqpath.c: removed serialization level 3: now everybody
- (except me) has to use the mnemonics defined in psycopg2.extensions.
-
- * lib/extensions.py: Added mnemonics for serialization levels.
-
-2005-10-02 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor_type.c (psyco_curs_callproc): applied callproc
- patch from Matt Goodall (added a check on _psyco_curs_execute
- return value and substituted malloc/free with PyMem versions.)
-
-2005-10-01 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/connection_int.c: fixed segfault by moving PyErr_Format
- after GIL acquisition (closes: #50).
-
- * psycopg/connection_type.c: applied patch from Matt Goodall to
- fix some doc strings.
-
-2005-09-23 Federico Di Gregorio <fog@debian.org>
-
- * lib/pool.py: applied patch from piro to avoid the scan of the
- whole connection array on getconn().
-
-2005-09-12 Federico Di Gregorio <fog@initd.org>
-
- * lib/pool.py: Applied psycopg->psycopg2 patch to from bug #35.
-
- * ZpsycopgDA/db.py: fixed problem with OperationalError that
- resulted in cryptic message to Zope users ("'OperationalError' is
- not defined".)
-
-2005-08-23 Federico Di Gregorio <fog@debian.org>
-
- * setup.py: applied patch from Daniele Varrazzo to avoid segfaults
- when compiling with migw for Python 2.4.x.
-
- * psycopg/adapter_mxdatetime.c (mxdatetime_str): ported code from 1.1.x
- to convert mxDateTime object preserving the precision of fractional
- seconds.
-
-2005-08-22 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/*.py: psycopg -> psycopg2.
-
- * setup.py: modified to install the module components under
- psycopg2 on windows too (thanks to Daniele Varrazzo.)
-
-2005-08-07 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/config.h: added __sun__ to the symbols checked for round()
-
-2005-07-21 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/adapter_datetime.c (psyco_XXXFromTicks): fixed the 1900
- years offset reported by Jeroen van Dongen (see ticket #33).
-
-2005-07-17 Federico Di Gregorio <fog@debian.org>
-
- * Release 2.0 beta 4.
-
- * lib/extras.py (DictConnection.cursor): added DictConnection to
- make easier to retrieve data in DictRows.
-
-2005-06-24 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/typecast_datetime.c (typecast_PYINTERVAL_cast): applied patch
- from Geert Jansen to fix interval bug due to overflow.
-
-2005-06-18 Federico Di Gregorio <fog@initd.org>
-
- * setup.cfg: some clarifications and include_dirs example for Mandrake.
-
- * ZPsycopgDA/DA.py: DTMLFile -> HTMLFile everywhere to fix zope
- cut&paste problems.
-
- * MANIFEST.in: added missing files to do bdist_rpm.
-
- * lib/psycopg1.py: fixed .dictfetchrow() to return None if fetchone()
- returns None instead of raising an exception.
-
- * ZPsycopgDA/icons: replaced corrupted icons with good ones.
-
-2005-06-13 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/psycopgmodule.c (psyco_connect): changed the port keyword
- parameter type to int (instead of string); this should fix #23.
-
- * psycopg/cursor_type.c (_psyco_curs_execute): now checks for
- empty queries and raise a ProgrammingError if appropriate (closes:
- #24).
-
- * setup.py: psycopg module renamed to psycopg2.
-
-2005-06-02 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor_type.c (_psyco_curs_execute): fixed segfault when
- not passing string or unicode to .execute().
-
-2005-06-01 Federico Di Gregorio <fog@debian.org>
-
- * examples/fetch.py: added example about using DECLARE CURSOR.
-
- * psycopg/adapter_datetime.c (psyco_TimestampFromTicks): "Hmmm,
- looks like someone forgot that C expects months to start counting
- from 0, but the Python date routines start counting from 1." That
- was me: fixed.
-
-2005-05-31 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor_type.c (_psyco_curs_execute): if a
- UnicodeEncodeError is raised during the converion of a unicode
- query we let it propagate insead of segfaulting.
-
-2005-5-27 Federico Di Gregorio, <fog@lana.initd.org>
-
- * tests/types_basic.py: fixed float and binary tests.
-
-2005-05-26 Federico Di Gregorio <fog@debian.org>
-
- * Release 2.0b3.
-
- * ZPsycopgDA/db.py (DB.convert_description): isolated description
- conversion (and fixed the conversion as per #18).
-
- * ZPsycopgDA/DA.py: fixed again; this time Zope should work for
- real. :/ Also fixed the type-casters (psycopg 2 added the extra
- cursor parameter) as reported in #18.
-
- * psycopg/psycopgmodule.c (init_psycopg): fixed Python 2.2 build.
-
-2005-05-19 Federico Di Gregorio <fog@debian.org>
-
- * Release 2.0b2.
-
- * lib/extras.py (DictRow): Some extra methods for DictRow.
-
- * psycopg/cursor_type.c (_psyco_curs_execute): added explict check
- to avoid using None as bound variables (very importand for cursor
- subclasses calling cursor.execute(self, query, None).
-
-2005-05-18 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/DA.py (ALLOWED_PSYCOPG_VERSIONS): updated to work
- with 2.0b2 only (will support only the exact version untill final
- 2.0 release.)
-
- * setup.py: Applied combined patch from Daniele Varrazzo and Jason
- Erickson to build on win32 using MSVC or mingw.
-
-2005-05-15 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/microprotocols.c (microprotocols_adapt): fixed memory
- leak on None as suggested by gh (closes: #16).
-
-2005-05-10 Federico Di Gregorio <fog@debian.org>
-
- * lib/extras.py (DictRow): we now save a reference to the index
- itself and not to the cursor to avoid problems while accessing
- DictRow objects after reusing the cursor for a different query
- (using Kevin Jacobs db_row would be much better but DictRow is
- just an example, right?)
-
-2005-05-09 Federico Di Gregorio <fog@debian.org>
-
- * Release 2.0 beta 1.
-
- * psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): fixed a
- typo (pyDateTimeModuleP->pyDateTimeTypeP) that was causing errors
- with infinite datetime values.
-
- * psycopg/adapter_binary.c (binary_str): Py_XINCREF on the buffer
- that can be NULL on error.
-
- * psycopg/typecast_binary.*: applied slightly modified
- chunk/buffer object patch to allow round-trip of buffer objects
- (BYTEA columns.)
-
- * psycopg/cursor_type.c (psyco_curs_executemany): applied slightly
- fixed patch from wrobell to allow iterators in .executemany().
-
-2005-04-18 Federico Di Gregorio <fog@debian.org>
-
- * MANIFEST.in: included debian directory.
-
-2005-04-10 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/adapter_list.*: added list adapter.
-
- * psycopg/microprotocols.c (microprotocol_getquoted): moved
- _mogrify_getquoted into utility function in the microprotocols
- library.
-
- * setup.py: Added extensive error message on missing datetime
- headers.
-
- * Applied mingw patch from Daniele Varazzo.
-
-2005-04-03 Federico Di Gregorio <fog@debian.org>
-
- * lib/psycopg1.py (connection.autocommit): added compatibility
- .autocommit() method.
-
- * psycopg/psycopgmodule.c (psyco_connect): factory ->
- connection_factory.
-
- * lib/psycopg1.py: added psycopg 1.1.x compatibility module.
-
-2005-03-29 Federico Di Gregorio <fog@debian.org>
-
- * Applied patch to fix tuple count.
-
- * psycopg/pqpath.c (pq_is_busy): Staring from bug report from
- Jason Erickson fixed segfaults due to calling Python function
- without holding the GIL.
-
-2005-03-24 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/adapter_binary.c (binary_escape): propagated Andrea's
- fix to binary adapter.
-
- * psycopg/adapter_qstring.c (qstring_quote): applied patch from
- Andrea Arcangeli to fix allocation failures (>4Gb) on 64 bit
- arches.
-
- * psycopg/typecast_array.c (typecast_array_tokenize): much better
- tokenization code.
-
-2005-03-23 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/typecast_basic.c: all the basic casters now respect the
- passed string length.
-
- * psycopg/typecast.c (typecast_cast): set curs->caster to self
- during the type-casting.
-
- * psycopg/cursor_type.c: added "typecaster" attribute to the
- cursor (this is safe, cursors can't be shared among threads and
- the attribute is RO.)
-
-2005-03-22 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/typecast_array.c: added some more structure to implement
- array typecasting.
-
- * scripts/buildtypes.py: new version to include array data.
-
-2005-03-15 Federico Di Gregorio <fog@debian.org>
-
- * lib/extensions.py: Added AsIs import.
-
-2005-03-12 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor.h: removed "qattr", not used anymore and added
- "cast", holding the typecaster currently in use.
-
- * Release 1.99.13.
-
- * psycopg/cursor_type.c (psyco_curs_executemany): implemented as a
- wrapper to extract python arguments and then call
- _psyco_curs_execute().
-
- * psycopg/cursor_type.c (_psyco_curs_execute): splitted away
- python argument parsing from the real execute code, to later allow
- for .executemany().
-
- * psycopg/cursor_type.c (_psyco_curs_buildrow_fill): modified to
- call typecast_cast().
-
- * psycopg/typecast.c (typecast_call/typecast_cast): modified
- typecast_call to use the new typecast_cast that avoids one string
- conversion on every cast.
-
-2005-03-04 Federico Di Gregorio <fog@initd.org>
-
- * Release 1.99.12.1.
-
- * psycopg/adapter_asis.c (asis_str): changed call to PyObject_Repr
- to PyObject_Str to avoid problems with long integers.
-
-2005-03-03 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/typecast.h: added array casting functions.
-
- * scripts/maketypes.sh: does not generate pgversion.h anymore.
-
- * Updated all examples for the release.
-
-2005-03-02 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.99.12.
-
- * psycopg/adapter_*.c: added __conform__ to all adapters.
-
- * psycopg/adapter_qstring.c (qstring_quote): we now use
- PyString_AsStringAndSize() instead of strlen() that would stop at
- the first embedded \0 (but note that libpq quoting function will
- truncate the string anyway!)
-
- * COPY TO implemented using both old and new (v3) protocol.
-
- * psycopg/pqpath.c (_pq_copy_out_v3): implemented and working.
-
- * psycopg/cursor_type.c (psyco_curs_copy_to): added cursor object
- interface for copy_to.
-
- * COPY FROM implemented using both old and new (v3) protocol.
-
- * psycopg/config.h (Dprintf): declaration for asprintf is gone.
-
- * psycopg/pqpath.c (_pq_copy_in_v3): implemented.
-
-2005-03-01 Federico Di Gregorio <fog@debian.org>
-
- * setup.py: now we generate a slighly more verbose version string
- that embeds some of the compile options, to facilitate users' bug
- reports.
-
- * psycopg/cursor_type.c (psyco_curs_copy_from): we now use
- PyOS_snprintf instead of asprintf. On some platforms this can be
- bad (win32).. if that's your case, get a better platform. :/
-
- * psycopg/microprotocols.c (microprotocols_adapt): fixed small
- typo that made adaptation using __conform__ impossible.
-
-2005-02-28 Federico Di Gregorio <fog@debian.org>
-
- * lib/extras.py: removed AsIs adapter (now a built-in); also
- removed prepare() method from the adapters that don't use it to
- avoid an extra method call at mogrification time.
-
- * psycopg/psycopgmodule.c (psyco_adapters_init): added
- initialization of the AsIs adapter (adapts int, long, float and
- *wonder* None!)
-
- * psycopg/cursor_type.c (_mogrify_getquoted): reorganized the code
- to adapt and then call .getquoted() to obtain the quoted data into
- this new function.
-
-2005-2-27 Federico Di Gregorio <fog@initd.org>
-
- * examples/myfirstrecipe.py: fixed adapter registration.
-
-2005-2-7 Federico Di Gregorio <fog@initd.org>
-
- * setup.py: added patch by Valentino Volonghi to build on MacOS X.
-
-2005-01-29 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/pqpath.c (_pq_fetch_tuples): fixed scale-related
- segfault (*fourth* mail from Andrea. Another couple like this and
- psycopg 2 will exit alpha at warp speed.)
-
- * psycopg/pqpath.c (pq_fetch): _pq_copy_out_3 -> _pq_copy_out_v3
- (second and third mail from Andrea. :/)
-
- * psycopg/cursor_type.c (_psyco_curs_has_write_check): added check
- on .write() attribute, fixed compilation problems (first mail from
- Andrea Arcangeli.)
-
-2005-01-20 Federico Di Gregorio <fog@debian.org>
-
- * lib/extensions.py (register_adapter): added register_adapter
- function, exported ISQLQuote in psycopg.extensions.
-
-2005-01-18 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/pqpath.c (_pq_fetch_tuples): ported scale/precision fix
- from psycopg 1.1.
-
- * LICENSE: detailed licensing information. Re-licensed some parts
- under BSD-like to allow integration is pysqlite.
-
-2005-01-13 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/db.py (DB.query
- ): ported ZPsycopgDA connection fix
- from psycopg 1.1.
-
- * lib/*.py: added pydoc-friendly messages.
-
-2005-01-12 Federico Di Gregorio <fog@debian.org>
-
- * Added debian directory (thanks to W. Borgert who sent initial
- patch based on cdbs.)
-
-2004-12-20 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/pqpath.c (pq_execute): removed multiple calls to
- pq_fetch in syncronous DBAPI compatibility mode to solve rowcount
- problem.
-
-2004-12-14 Federico Di Gregorio <fog@debian.org>
-
- * Mm.. release 1.99.11.
-
- * psycopg/cursor_type.c (_psyco_curs_prefetch): fixed bug in
- interaction between the .isready() method and
- _psyco_curs_prefetch: isready now store away the pgres but leave
- prefetch do its work.
-
- * psycopg/*.c: changed the names of most of the psycopg's built-in
- types to replect their position in the psycopg._psycopg module.
-
-2004-12-10 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor_type.c: now *all* write or async accesses to the
- connection object are arbitrated using the connection lock.
-
- * psycopg/cursor_type.c (psyco_curs_isready): now we reset the
- current async cursor if it is ready, to allow other cursors to
- .execute() without raising the "transaction in progress" error.
-
- * psycopg/pqpath.c (pq_is_busy): gained status of high-level
- function with its own blocking and locking.
-
- * psycopg/cursor.h (EXC_IF_CURS_CLOSED): also checks the
- connection (a closed connection implies a closed cursor.)
-
- * psycopg/cursor_type.c: cursor's connection is correctly
- INCREFfed and DECREFfed.
-
- * psycopg/connection_type.c: removed the cursors list from the
- connection object. It is not necessary anymore for the connection
- to know about the cursors and the reference counting will keep the
- connection alive (but possibly closed) until all cursors are
- garbage collected.
-
-2004-11-20 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/cursor_type.c (_mogrify): ported %% fix from 1.1.15.
-
-2004-11-20 Federico Di Gregorio <fog@initd.org>
-
- * psycopg/cursor_type.c (psyco_curs_execute): added check to raise an
- exception if a cursor tries to .execute() while an async query is
- already in execution froma different cursor.
-
-2004-11-20 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/connection_type.c (psyco_conn_cursor): renamed 'cursor'
- argument to 'cursor_factory'.
-
-2004-11-19 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor_type.c (_psyco_curs_buildrow_fill): now standard
- tuples are filled using PyTuple_SET_ITEM while extended types
- (created via row_factory) are filled using PySequence_SetItem.
-
- * psycopg/cursor_type.c: changed cursor attribute name from
- tuple_factory to row_factory.
-
-2004-10-14 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor_type.c (_psyco_curs_buildrow_fill): now we use
- PySequence_SetItem to avoid problems with containers created from
- cursor's .tuple_factory attribute.
-
- * lib/extras.py (DictCursor.execute): fixed stupid bug with cursor
- setting self.tuplefactory instead of self.tuple_factory.
-
-2004-10-02 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.99.10.
-
- * psycopg/cursor_type.c (_psyco_curs_buildrow_*): unified normal
- and factory code into the _psyco_curs_buildrow_fill function; no
- more memory leaks here.
-
- * psycopg/config.h (round): added check for __FreeBSD__ (that
- should be defined when compiling with gcc, I hope.)
-
- * setup.py: removed a lot of code now in setup.cfg.
-
-2004-09-24 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor_type.c (cursor_dealloc): fixed small memory leak
- due to missing disposal of self->pgres.
-
-2004-9-14 Federico Di Gregorio <fog@initd.org>
-
- * examples/dialtone.py: Added adapt() example by Valentino
- Volonghi.
-
-2004-09-14 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/microprotocols.c (microprotocols_adapt): lots of changes
- to the microprotocols layer (it is not micro anymore);
- implementing almost all the PEP 246. The adapter registry is now
- indexed by (type, protocol) and not by type alone.
-
-2004-09-13 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor_type.c (_mogrify): and qattr is gone.
-
-2004-09-05 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.99.9 (or, the "twisting by the pool" release).
-
- * psycopg/pqpath.c (_pq_fetch_tuples): changed to "static void"
- instead of "static int", no ways for this function to fail.
-
-2004-09-04 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/pqpath.c (_pq_fetch_tuples): ported rowcount fix from
- 1.1.15.
-
- * ZPsycopgDA/*: ZPsycopgDA back in action, using the new pooling
- code.
-
-2004-08-29 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/typecast_basic.c (typecast_DECIMAL_cast): added DECIMAL
- typecaster; it even works :).
-
- * scripts/buildtypes.py (basic_types): added DECIMAL typecaster
- for the NUMERIC oid.
-
- * examples/threads.py: updated threads example to use pooling code.
-
- * lib/pool.py: added very simple and thread-safe connection
- pooling class.
-
- * psycopg/cursor_type.c (psyco_curs_fetchmany): fixed problem with
- .fetchall() and .fetchmany() returning None instead of [] on empty
- result sets.
-
- * Release 1.99.8.
-
-2004-08-28 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor_type.c (psyco_curs_execute): added processing of
- unicode queries.
-
- * examples/encoding.py: much better encoding example, also using
- the new UNICODE typecaster.
-
- * psycopg/typecast_basic.c (typecast_UNICODE_cast): added UNICODE
- typecaster.
-
- * lib/extensions.py: the encodings dictionary is not available by
- default but can be accessed from the psycopg.extensions module.
-
- * psycopg/adapter_qstring.h: remove encoding information from
- qstring adapter and moved it into psycopg module.
-
-2004-08-26 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor_type.c (_psyco_curs_prefetch): added check for
- asynchronous fetch by wrong cursor.
-
- * psycopg/pqpath.c (pq_fetch): fixed backend status message (bug
- reported by Daniele Varrazzo.)
-
-2004-07-29 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/typecast_basic.c (typecast_BINARY_cast): reverted to
- using strings instead of buffers when converting postgresql binary
- objects (should *temporarily* fix corruption bug reported on
- win32.)
-
-2004-07-21 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor_type.c: removed __iter__ and next methods from
- object methods and moved them where they do belong (tp_iter and
- tp_iternext.) Bug reported by Daniele Varrazzo (again!)
-
-2004-07-19 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/typecast_datetime.c (typecast_PYINTERVAL_cast): replaced
- round() with micro() when rounding seconds (fixes bugs reported by
- Daniele Varrazzo.)
-
-2004-07-16 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/pqpath.c (pq_set_critical): allow for a custom message
- insted of the one from PQerrorMessage.
- (pq_resolve_critical): added argument to specify if connection is
- to be closed (used to not close it during COPY FROM/TO criticals.)
-
- * psycopg/cursor_type.c (psyco_curs_fileno, psyco_curs_isready):
- added extension methods related to async queries.
-
-2004-07-15 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.99.7.
-
- * examples/tz.py: added example about time zones.
-
- * psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): create
- FixedOffsetTimezone for postgresql "timestamp with time zone"
- types.
-
- * lib/tz.py: added (even more than) needed tzinfo classes.
-
- * psycopg/typecast.c (typecast_call): changed typecast call code
- to take the additional cursor parameter, needed for
- cursor-dependent type casting (tzinfo & friends.)
-
- * psycopg/cursor_type.c (_psyco_curs_buildrow_with_factory): added
- use of tuple factories to fetcXXX methods.
-
- * lib/extras.py: little extra goodies for psycopg.
-
-2004-07-14 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.99.6.
-
- * psycopg/connection_type.c: added .dsn attribute to connection
- objects.
-
- * psycopg/cursor_type.c (psyco_curs_mogrify): added .mogrify()
- method.
-
- * psycopg/adapter_qstring.c: copy the connection encoding only if
- wrapped object is unicode and added table of encodings.
-
-2004-07-13 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/cursor_type.c (_mogrify): moved Dprintf statement to
- avoid dereferencing empty pointer (from 1.1.x)
- (psyco_curs_execute): now we save the query in self->query instead
- of freeing the memory ASAP.
- (cursorObject_members): and we finally export the saved query
- through the cursor members interface. that's all folks.
-
- * lib/extensions.py: added extensions module to clearly separate
- psycopg own extensions from DBAPI-2.0
-
-2004-07-10 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/typecast_datetime.c: ported interval fix from 1.1.x.
-
-2004-05-16 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/typecast_datetime.c (typecast_*_cast): fixed Value error
- when seconds > 59 by setting minutes += 1 and seconds -= 60
- (reported by Marcel Gsteiger.)
-
-2004-04-24 Federico Di Gregorio <fog@debian.org>
-
- * ported time interval patch by Ross Cohen from 1.1.12.
-
-2004-04-19 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/typecast_datetime.c (typecast_PYDATE_cast): applied
- patch from Jason Erickson: min and max taken from datetime.Date
- type.
-
-2004-04-18 Federico Di Gregorio <fog@debian.org>
-
- * Applied changes from Jason Erickson to build on win32; see his
- (slightly edited) entry below. (Still builds on Linux :)
-
- * psycopg/*.c: removed inclusion of pthread.h from all files
- except psycopg/config.h to build on win32 without faking the file.
-
-2004-04-15 Jason Erickson <jerickso@stickpeople.com>
-
- * setup.py: Various changes. The critical ones:
- - Make an empty pthread.h file so all the code doing an
- #include <pthread.h> will find something.
- - Appended the winsock2 library and the PostgreSQL library to
- the library path.
- - Setup the include path.
- - Have the PSYCOPG_VERSION macro be included with quotes.
-
- * config.h: Added/Cleaned up Win32 includes, defines, stub functions.
-
- * typecast.h: Removed ';' after PyObject_HEAD in the
- typecastObject structure since Microsoft Visual Studio does not
- like it.
-
-2004-04-15 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.99.5 (bug-fixing and reorganization)
-
- * setup.py et al.: moved psycopg to psycopg._psycopg to make
- easier to provide high level python-only utilities (like the
- promised pooling code). psycopg/__init__.py imports _psycopg and
- make all the default DBAPI-2.0 stuff available.
-
-2004-04-14 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/psycopgmodule.c (initpsycopg): wrapped initialization of
- date/time adapters in #ifdefs to have psycopg compile without mx
- or builtin datetime.
-
-2004-04-10 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.99.4.
-
-2004-04-09 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/typecast_builtins.c: changed DATE to not include
- DATETIME types anymore.
-
- * psycopg/adapter_datetime.c (pydatetime_str): switched from
- strftime to isoformat to preserve fractional seconds.
-
-2004-04-08 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/psycopgmodule.c (psyco_connect): ported sslmode
- parameter from 1.1 branch.
-
- * psycopg/adapter_datetime.*: added python built-in datetime
- adapters. also added the datetime typecasters (still using mx as
- default).
-
- * psycopg/typecast.h: removed aliases, they now live in the right
- typecast_xxx.c file.
-
-2004-03-08 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.99.3 (alpha 4).
-
- * examples/lastrowid.py: and the .lastrowid example is in.
-
- * psycopg/cursor_type.c (_mogrify): added call to .prepare()
- method in both dict and sequence path.
-
- * psycopg/connection_int.c (conn_set_client_encoding): added
- encoding-change code.
-
- * psycopg/adapter_qstring.c (qstring_quote): added hard-coded
- support for utf8 and latin1 encodings.
-
-2004-03-01 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/connection_int.c (conn_close): does not use libpq
- functions on NULL pgconn (this can happen when conn_close is
- called after a failed PQconnect.)
-
-2004-02-29 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.99.2 (alpha 3).
-
- * psycopg/cursor_type.c: added .rownumber and .connection
- attributes. Also added .scroll(), .next() and .__iter__() methods
- (see DBAPI2-.0 extensions on PEP.)
-
- * psycopg/connection_type.c (psyco_conn_set_isolation_level):
- added connection method .set_isolation_level(). Also added all
- error objects to the connection (see DBAPI2-.0 extensions on PEP.)
-
- * psycopg/connection_int.c (conn_switch_isolation_level): added
- isolation level switching code.
-
- * setup.py: removed all references to PSYCOPG_NEWSTYLE: support
- for python < 2.2 has been dropped.
-
- * typecast_basic.c (typecast_BINARY_cast): now binary objects are
- returned as true buffers.
-
- * adapter_binary.*: added adapter for buffers and binary (bytea)
- objects.
-
- * Release 1.99.1 (alpha 2).
-
- * adapter_mxdatetime.*: added adapters for all mx.DateTime types.
-
-2004-02-28 Federico Di Gregorio <fog@debian.org>
-
- * cursor_type.c (_mogrify): complete rework of the mogrification
- code to use the microprotocols_adapt function.
-
- * typecast_basic.c (typecast_BOOLEAN_cast): we now return real
- Py_True and Py_False values.
-
- * microprotocols.h: added very simple microprotocols
- implementation to allow for python->postgresql types registry.
-
-2004-01-05 Federico Di Gregorio <fog@debian.org>
-
- * connection_int.c (conn_commit/conn_rollback): added code to
- commit/rollback and connection methods.
-
-2004-01-04 Federico Di Gregorio <fog@debian.org>
-
- * cursor_type.c (psyco_curs_fetchone): added fetchone method.
-
-2004-01-03 Federico Di Gregorio <fog@debian.org>
-
- * added (empty) INSTALL file.
-
- * cursor_type.c (cursor_dealloc): added qattr for custom object
- quoting using a callable attribute.
- (_mogrify): ported new, fixed mogrification code from 1.1.12.
-
-2003-08-01 Federico Di Gregorio <fog@debian.org>
-
- * cursor_type.c (_mogrify_sequence): added sequence mogrification,
- can be done better, on the dict model.
-
-2003-07-28 Federico Di Gregorio <fog@debian.org>
-
- * typeobj_qstring.c: added quoted strings (can use both own code,
- like psycopg 1.x or PQescapeString from lipq.)
-
-2003-07-21 Federico Di Gregorio <fog@debian.org>
-
- * connection_type.c (psyco_conn_close): added .close()
- method. wow.
-
- * cursor_*.c: added basic cursor interface (new-style.)
-
-2003-07-20 Federico Di Gregorio <fog@debian.org>
-
- * psycopg/*: beginning of new source layout. if you think this
- changelog is somewhat empty, you're right. look at
- doc/ChangeLog-1.x for psycopg 1.x changelog just before the
- branch.
-
-
+++ /dev/null
-Compiling and installing psycopg
-********************************
-
-** Important note: if you plan to use psyopg2 in a multithreaed application
- make sure that your libpq has been compiled with the --with-thread-safety
- option. psycopg2 will work correctly even with a non-thread-safe libpq but
- libpq will leak memory.
-
-While psycopg 1.x used autoconf for its build process psycopg 2 switched to
-the more pythoning setup.py. Currently both psycopg's author and distutils
-have some limitations so the file setup.cfg is almost unused and most build
-options are hidden in setup.py. Before building psycopg look at setup.cfg file
-and change any settings to follow your system (or taste); then:
-
- python setup.py build
-
-to build in the local directory; and:
-
- python setup.py install
-
-to install system-wide.
-
-
-Using setuptools and EasyInstall
-================================
-
-If setuptools are installed on your system you can easily create an egg for
-psycopg and install it. Download the source distribution (if you're reading
-this file you probably already have) and then edit setup.cfg to your taste
-and build from the source distribution top-level directory using:
-
- easy_install .
-
-
-Compiling under Windows with mingw32
-====================================
-
-You can compile psycopg under Windows platform with mingw32
-(http://www.mingw.org/) compiler. MinGW is also shipped with IDEs such as
-Dev-C++ (http://www.bloodshed.net/devcpp.html) and Code::Blocks
-(http://www.codeblocks.org). gcc binaries should be in your PATH.
-
-You need a PostgreSQL with include and libary files installed. At least v8.0 is required.
-
-First you need to create a libpython2X.a as described in
-http://starship.python.net/crew/kernr/mingw32/Notes.html. Then run:
-
- python setup.py build_ext --compiler=mingw32 install
+++ /dev/null
-psycopg and the GPL
-===================
-
-psycopg is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version. See file COPYING for details.
-
-As a special exception, specific permission is granted for the GPLed
-code in this distribition to be linked to OpenSSL and PostgreSQL libpq
-without invoking GPL clause 2(b).
-
-Note that the GPL was chosen to avoid proprietary adapters based on
-psycopg code. Using psycopg in a proprietary product (even bundling
-psycopg with the proprietary product) is fine as long as:
-
- 1. psycopg is called from Python only using only the provided API
- (i.e., no linking with C code and no C modules based on it); and
-
- 2. all the other points of the GPL are respected (you offer a copy
- of psycopg's source code, and so on.)
-
-Alternative licenses
-====================
-
-If you prefer you can use the Zope Database Adapter ZPsycopgDA (i.e.,
-every file inside the ZPsycopgDA directory) user the ZPL license as
-published on the Zope web site, http://www.zope.org/Resources/ZPL.
-
-Also, the following BSD-like license applies (at your option) to the
-files following the pattern psycopg/adapter*.{h,c} and
-psycopg/microprotocol*.{h,c}:
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this
- software in a product, an acknowledgment in the product documentation
- would be appreciated but is not required.
-
- 2. Altered source versions must be plainly marked as such, and must not
- be misrepresented as being the original software.
-
- 3. This notice may not be removed or altered from any source distribution.
-
-psycopg is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Proprietary licenses
-====================
-
-A non-exclusive license is available for companies that want to include
-psycopg in their proprietary products without respecting the spirit of the
-GPL. The price of the license is one day of development done by the author,
-at the consulting fee he applies to his usual customers at the day of the
-request.
+++ /dev/null
-AUTHORS
-ChangeLog
-INSTALL
-LICENSE
-MANIFEST
-MANIFEST.in
-README
-setup.cfg
-setup.py
-ZPsycopgDA/DA.py
-ZPsycopgDA/__init__.py
-ZPsycopgDA/db.py
-ZPsycopgDA/pool.py
-ZPsycopgDA/dtml/add.dtml
-ZPsycopgDA/dtml/browse.dtml
-ZPsycopgDA/dtml/edit.dtml
-ZPsycopgDA/dtml/table_info.dtml
-ZPsycopgDA/icons/bin.gif
-ZPsycopgDA/icons/date.gif
-ZPsycopgDA/icons/datetime.gif
-ZPsycopgDA/icons/field.gif
-ZPsycopgDA/icons/float.gif
-ZPsycopgDA/icons/int.gif
-ZPsycopgDA/icons/stable.gif
-ZPsycopgDA/icons/table.gif
-ZPsycopgDA/icons/text.gif
-ZPsycopgDA/icons/time.gif
-ZPsycopgDA/icons/view.gif
-ZPsycopgDA/icons/what.gif
-debian/changelog
-debian/control
-debian/copyright
-debian/rules
-doc/ChangeLog-1.x
-doc/HACKING
-doc/SUCCESS
-doc/TODO
-doc/api-screen.css
-doc/async.txt
-doc/extensions.html
-doc/extensions.rst
-doc/api/epydoc.css
-doc/api/index.html
-doc/api/private/__builtin__.list-class.html
-doc/api/private/__builtin__.object-class.html
-doc/api/private/__builtin__.type-class.html
-doc/api/private/datetime.tzinfo-class.html
-doc/api/private/epydoc.css
-doc/api/private/exceptions.Exception-class.html
-doc/api/private/exceptions.StandardError-class.html
-doc/api/private/frames.html
-doc/api/private/help.html
-doc/api/private/index.html
-doc/api/private/indices.html
-doc/api/private/psycopg2-module.html
-doc/api/private/psycopg2.DataError-class.html
-doc/api/private/psycopg2.DatabaseError-class.html
-doc/api/private/psycopg2.Error-class.html
-doc/api/private/psycopg2.IntegrityError-class.html
-doc/api/private/psycopg2.InterfaceError-class.html
-doc/api/private/psycopg2.InternalError-class.html
-doc/api/private/psycopg2.NotSupportedError-class.html
-doc/api/private/psycopg2.OperationalError-class.html
-doc/api/private/psycopg2.ProgrammingError-class.html
-doc/api/private/psycopg2.Warning-class.html
-doc/api/private/psycopg2._psycopg-module.html
-doc/api/private/psycopg2._psycopg.ISQLQuote-class.html
-doc/api/private/psycopg2._psycopg.connection-class.html
-doc/api/private/psycopg2._psycopg.cursor-class.html
-doc/api/private/psycopg2.extensions-module.html
-doc/api/private/psycopg2.extras-module.html
-doc/api/private/psycopg2.extras.DictConnection-class.html
-doc/api/private/psycopg2.extras.DictCursor-class.html
-doc/api/private/psycopg2.extras.DictRow-class.html
-doc/api/private/psycopg2.extras.SQL_IN-class.html
-doc/api/private/psycopg2.pool-module.html
-doc/api/private/psycopg2.pool.AbstractConnectionPool-class.html
-doc/api/private/psycopg2.pool.PersistentConnectionPool-class.html
-doc/api/private/psycopg2.pool.PoolError-class.html
-doc/api/private/psycopg2.pool.SimpleConnectionPool-class.html
-doc/api/private/psycopg2.pool.ThreadedConnectionPool-class.html
-doc/api/private/psycopg2.psycopg1-module.html
-doc/api/private/psycopg2.psycopg1.connection-class.html
-doc/api/private/psycopg2.psycopg1.cursor-class.html
-doc/api/private/psycopg2.tz-module.html
-doc/api/private/psycopg2.tz.FixedOffsetTimezone-class.html
-doc/api/private/psycopg2.tz.LocalTimezone-class.html
-doc/api/private/toc-everything.html
-doc/api/private/toc-psycopg2-module.html
-doc/api/private/toc-psycopg2._psycopg-module.html
-doc/api/private/toc-psycopg2.extensions-module.html
-doc/api/private/toc-psycopg2.extras-module.html
-doc/api/private/toc-psycopg2.pool-module.html
-doc/api/private/toc-psycopg2.psycopg1-module.html
-doc/api/private/toc-psycopg2.tz-module.html
-doc/api/private/toc.html
-doc/api/private/trees.html
-doc/api/public/__builtin__.list-class.html
-doc/api/public/__builtin__.object-class.html
-doc/api/public/__builtin__.type-class.html
-doc/api/public/datetime.tzinfo-class.html
-doc/api/public/epydoc.css
-doc/api/public/exceptions.Exception-class.html
-doc/api/public/exceptions.StandardError-class.html
-doc/api/public/frames.html
-doc/api/public/help.html
-doc/api/public/index.html
-doc/api/public/indices.html
-doc/api/public/psycopg2-module.html
-doc/api/public/psycopg2.DataError-class.html
-doc/api/public/psycopg2.DatabaseError-class.html
-doc/api/public/psycopg2.Error-class.html
-doc/api/public/psycopg2.IntegrityError-class.html
-doc/api/public/psycopg2.InterfaceError-class.html
-doc/api/public/psycopg2.InternalError-class.html
-doc/api/public/psycopg2.NotSupportedError-class.html
-doc/api/public/psycopg2.OperationalError-class.html
-doc/api/public/psycopg2.ProgrammingError-class.html
-doc/api/public/psycopg2.Warning-class.html
-doc/api/public/psycopg2._psycopg-module.html
-doc/api/public/psycopg2.extensions-module.html
-doc/api/public/psycopg2.extras-module.html
-doc/api/public/psycopg2.extras.DictConnection-class.html
-doc/api/public/psycopg2.extras.DictCursor-class.html
-doc/api/public/psycopg2.extras.DictRow-class.html
-doc/api/public/psycopg2.extras.SQL_IN-class.html
-doc/api/public/psycopg2.pool-module.html
-doc/api/public/psycopg2.pool.AbstractConnectionPool-class.html
-doc/api/public/psycopg2.pool.PersistentConnectionPool-class.html
-doc/api/public/psycopg2.pool.PoolError-class.html
-doc/api/public/psycopg2.pool.SimpleConnectionPool-class.html
-doc/api/public/psycopg2.pool.ThreadedConnectionPool-class.html
-doc/api/public/psycopg2.psycopg1-module.html
-doc/api/public/psycopg2.psycopg1.connection-class.html
-doc/api/public/psycopg2.psycopg1.cursor-class.html
-doc/api/public/psycopg2.tz-module.html
-doc/api/public/psycopg2.tz.FixedOffsetTimezone-class.html
-doc/api/public/psycopg2.tz.LocalTimezone-class.html
-doc/api/public/toc-everything.html
-doc/api/public/toc-psycopg2-module.html
-doc/api/public/toc-psycopg2._psycopg-module.html
-doc/api/public/toc-psycopg2.extensions-module.html
-doc/api/public/toc-psycopg2.extras-module.html
-doc/api/public/toc-psycopg2.pool-module.html
-doc/api/public/toc-psycopg2.psycopg1-module.html
-doc/api/public/toc-psycopg2.tz-module.html
-doc/api/public/toc.html
-doc/api/public/trees.html
-examples/binary.py
-examples/copy_from.py
-examples/copy_to.py
-examples/cursor.py
-examples/dialtone.py
-examples/dict.py
-examples/dt.py
-examples/encoding.py
-examples/fetch.py
-examples/lastrowid.py
-examples/mogrify.py
-examples/myfirstrecipe.py
-examples/notify.py
-examples/simple.py
-examples/somehackers.jpg
-examples/threads.py
-examples/tz.py
-examples/usercast.py
-examples/whereareyou.jpg
-lib/__init__.py
-lib/extensions.py
-lib/extras.py
-lib/pool.py
-lib/psycopg1.py
-lib/tz.py
-psycopg/adapter_asis.c
-psycopg/adapter_asis.h
-psycopg/adapter_binary.c
-psycopg/adapter_binary.h
-psycopg/adapter_datetime.c
-psycopg/adapter_datetime.h
-psycopg/adapter_list.c
-psycopg/adapter_list.h
-psycopg/adapter_mxdatetime.c
-psycopg/adapter_mxdatetime.h
-psycopg/adapter_pboolean.c
-psycopg/adapter_pboolean.h
-psycopg/adapter_qstring.c
-psycopg/adapter_qstring.h
-psycopg/config.h
-psycopg/connection.h
-psycopg/connection_int.c
-psycopg/connection_type.c
-psycopg/cursor.h
-psycopg/cursor_int.c
-psycopg/cursor_type.c
-psycopg/microprotocols.c
-psycopg/microprotocols.h
-psycopg/microprotocols_proto.c
-psycopg/microprotocols_proto.h
-psycopg/pgtypes.h
-psycopg/pgversion.h
-psycopg/pqpath.c
-psycopg/pqpath.h
-psycopg/psycopg.h
-psycopg/psycopgmodule.c
-psycopg/python.h
-psycopg/typecast.c
-psycopg/typecast.h
-psycopg/typecast_array.c
-psycopg/typecast_basic.c
-psycopg/typecast_binary.c
-psycopg/typecast_binary.h
-psycopg/typecast_builtins.c
-psycopg/typecast_datetime.c
-psycopg/typecast_mxdatetime.c
-scripts/buildtypes.py
-scripts/ext2html.py
-scripts/makedocs.py
-scripts/maketypes.sh
-tests/dbapi20.py
-tests/extras_dictcursor.py
-tests/test_psycopg2_dbapi20.py
-tests/types_basic.py
+++ /dev/null
-recursive-include psycopg *.c *.h
-recursive-include lib *.py
-recursive-include tests *.py
-recursive-include ZPsycopgDA *.py *.gif *.dtml
-recursive-include examples *.py somehackers.jpg whereareyou.jpg
-recursive-include debian *
-recursive-include doc TODO HACKING SUCCESS ChangeLog-1.x async.txt
-recursive-include scripts *.py *.sh
-include scripts/maketypes.sh scripts/buildtypes.py
-include AUTHORS README INSTALL LICENSE ChangeLog
-include PKG-INFO MANIFEST.in MANIFEST setup.py setup.cfg
-recursive-include doc *.rst *.css *.html
+++ /dev/null
-Metadata-Version: 1.0
-Name: psycopg2
-Version: 2.0.5.1
-Summary: Python-PostgreSQL Database Adapter
-Home-page: http://initd.org/tracker/psycopg
-Author: Federico Di Gregorio
-Author-email: fog@initd.org
-License: GPL with exceptions or ZPL
-Download-URL: http://initd.org/pub/software/psycopg2
-Description: psycopg is a PostgreSQL database adapter for the Python programming
- language. This is version 2, a complete rewrite of the original code to
- provide new-style classes for connection and cursor objects and other sweet
- candies. Like the original, psycopg 2 was written with the aim of being
- very small and fast, and stable as a rock.
-
- psycopg is different from the other database adapter because it was
- designed for heavily multi-threaded applications that create and destroy
- lots of cursors and make a conspicuous number of concurrent INSERTs or
- UPDATEs. psycopg 2 also provide full asycronous operations for the really
- brave programmer.
-
-Platform: any
-Classifier: Development Status :: 4 - Beta
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: GNU General Public License (GPL)
-Classifier: License :: OSI Approved :: Zope Public License
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: C
-Classifier: Programming Language :: SQL
-Classifier: Topic :: Database
-Classifier: Topic :: Database :: Front-Ends
-Classifier: Topic :: Software Development
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Classifier: Operating System :: Microsoft :: Windows
-Classifier: Operating System :: Unix
+++ /dev/null
-psycopg - Python-PostgreSQL Database Adapter
-********************************************
-
-psycopg is a PostgreSQL database adapter for the Python programming
-language. This is version 2, a complete rewrite of the original code to
-provide new-style classes for connection and cursor objects and other
-sweet candies. Like the original, psycopg 2 was written with the aim of
-being very small and fast, and stable as a rock.
-
-psycopg is different from the other database adapter because it was
-designed for heavily multi-threaded applications that create and destroy
-lots of cursors and make a conspicuous number of concurrent INSERTs or
-UPDATEs. psycopg 2 also provide full asycronous operations for the really
-brave programmer.
-
-There are confirmed reports of psycopg 1.x compiling and running on Linux
-and FreeBSD on i386, Solaris, MacOS X and win32 architectures. psycopg 2
-does not introduce build-wise incompatible changes so it should be able to
-compile on all architectures just as its predecessor did.
-
-Now go read the INSTALL file. More information about psycopg extensions to
-the DBAPI-2.0 is available in the files located in the doc/ direcory.
-
-psycopg is free software ("free as in freedom" but I like beer too.)
-Licensing information is available in the LICENSE file.
-
-
-Contributors
-------------
-
-A short list of contributors to psycopg2 follows (if you feel you belong
-to this list and you can't find yourself here just drop me a mail):
-
- * Kudos to piro for all the documentation work.
-
- * Peter Fein contributed a logging connection/cursor class that even if it
- was not used directly heavily influenced the implementation currently in
- psycopg2.extras.
-
+++ /dev/null
-# ZPsycopgDA/DA.py - ZPsycopgDA Zope product: Database Connection
-#
-# Copyright (C) 2004 Federico Di Gregorio <fog@initd.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# Or, at your option this program (ZPsycopgDA) can be distributed under the
-# Zope Public License (ZPL) Version 1.0, as published on the Zope web site,
-# http://www.zope.org/Resources/ZPL.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.
-#
-# See the LICENSE file for details.
-
-
-ALLOWED_PSYCOPG_VERSIONS = ('2.0.1', '2.0.2', '2.0.3', '2.0.4', '2.0.5')
-
-import sys
-import time
-import db
-import re
-
-import Acquisition
-import Shared.DC.ZRDB.Connection
-
-from db import DB
-from Globals import HTMLFile
-from ExtensionClass import Base
-from App.Dialogs import MessageDialog
-from DateTime import DateTime
-
-# Build Zope version in a float for later cheks
-import App
-zope_version = App.version_txt.getZopeVersion()
-zope_version = float("%s.%s" %(zope_version[:2]))
-
-# ImageFile is deprecated in Zope >= 2.9
-if zope_version < 2.9:
- from ImageFile import ImageFile
-else:
- from App.ImageFile import ImageFile
-
-# import psycopg and functions/singletons needed for date/time conversions
-
-import psycopg2
-from psycopg2 import NUMBER, STRING, ROWID, DATETIME
-from psycopg2.extensions import INTEGER, LONGINTEGER, FLOAT, BOOLEAN, DATE
-from psycopg2.extensions import TIME, INTERVAL
-from psycopg2.extensions import new_type, register_type
-
-
-# add a new connection to a folder
-
-manage_addZPsycopgConnectionForm = HTMLFile('dtml/add',globals())
-
-def manage_addZPsycopgConnection(self, id, title, connection_string,
- zdatetime=None, tilevel=2,
- check=None, REQUEST=None):
- """Add a DB connection to a folder."""
- self._setObject(id, Connection(id, title, connection_string,
- zdatetime, check, tilevel))
- if REQUEST is not None: return self.manage_main(self, REQUEST)
-
-
-# the connection object
-
-class Connection(Shared.DC.ZRDB.Connection.Connection):
- """ZPsycopg Connection."""
- _isAnSQLConnection = 1
-
- id = 'Psycopg2_database_connection'
- database_type = 'Psycopg2'
- meta_type = title = 'Z Psycopg 2 Database Connection'
- icon = 'misc_/conn'
-
- def __init__(self, id, title, connection_string,
- zdatetime, check=None, tilevel=2, encoding=''):
- self.zdatetime = zdatetime
- self.id = str(id)
- self.edit(title, connection_string, zdatetime,
- check=check, tilevel=tilevel, encoding=encoding)
-
- def factory(self):
- return DB
-
- ## connection parameters editing ##
-
- def edit(self, title, connection_string,
- zdatetime, check=None, tilevel=2, encoding=''):
- self.title = title
- self.connection_string = connection_string
- self.zdatetime = zdatetime
- self.tilevel = tilevel
- self.encoding = encoding
-
- self.set_type_casts()
-
- if check: self.connect(self.connection_string)
-
- manage_properties = HTMLFile('dtml/edit', globals())
-
- def manage_edit(self, title, connection_string,
- zdatetime=None, check=None, tilevel=2, encoding='UTF-8',
- REQUEST=None):
- """Edit the DB connection."""
- self.edit(title, connection_string, zdatetime,
- check=check, tilevel=tilevel, encoding=encoding)
- if REQUEST is not None:
- msg = "Connection edited."
- return self.manage_main(self,REQUEST,manage_tabs_message=msg)
-
- def connect(self, s):
- try:
- self._v_database_connection.close()
- except:
- pass
-
- # check psycopg version and raise exception if does not match
- if psycopg2.__version__[:5] not in ALLOWED_PSYCOPG_VERSIONS:
- raise ImportError("psycopg version mismatch (imported %s)" %
- psycopg2.__version__)
-
- self.set_type_casts()
- self._v_connected = ''
- dbf = self.factory()
-
- # TODO: let the psycopg exception propagate, or not?
- self._v_database_connection = dbf(
- self.connection_string, self.tilevel, self.encoding)
- self._v_database_connection.open()
- self._v_connected = DateTime()
-
- return self
-
- def set_type_casts(self):
- # note that in both cases order *is* important
- if self.zdatetime:
- # use zope internal datetime routines
- register_type(ZDATETIME)
- register_type(ZDATE)
- register_type(ZTIME)
- else:
- # use the standard
- register_type(DATETIME)
- register_type(DATE)
- register_type(TIME)
-
- ## browsing and table/column management ##
-
- manage_options = Shared.DC.ZRDB.Connection.Connection.manage_options
- # + (
- # {'label': 'Browse', 'action':'manage_browse'},)
-
- #manage_tables = HTMLFile('dtml/tables', globals())
- #manage_browse = HTMLFile('dtml/browse', globals())
-
- info = None
-
- def table_info(self):
- return self._v_database_connection.table_info()
-
-
- def __getitem__(self, name):
- if name == 'tableNamed':
- if not hasattr(self, '_v_tables'): self.tpValues()
- return self._v_tables.__of__(self)
- raise KeyError, name
-
- def tpValues(self):
- res = []
- conn = self._v_database_connection
- for d in conn.tables(rdb=0):
- try:
- name = d['TABLE_NAME']
- b = TableBrowser()
- b.__name__ = name
- b._d = d
- b._c = c
- try:
- b.icon = table_icons[d['TABLE_TYPE']]
- except:
- pass
- r.append(b)
- except:
- pass
- return res
-
-
-## database connection registration data ##
-
-classes = (Connection,)
-
-meta_types = ({'name':'Z Psycopg 2 Database Connection',
- 'action':'manage_addZPsycopgConnectionForm'},)
-
-folder_methods = {
- 'manage_addZPsycopgConnection': manage_addZPsycopgConnection,
- 'manage_addZPsycopgConnectionForm': manage_addZPsycopgConnectionForm}
-
-__ac_permissions__ = (
- ('Add Z Psycopg Database Connections',
- ('manage_addZPsycopgConnectionForm', 'manage_addZPsycopgConnection')),)
-
-# add icons
-
-misc_={'conn': ImageFile('Shared/DC/ZRDB/www/DBAdapterFolder_icon.gif')}
-
-for icon in ('table', 'view', 'stable', 'what', 'field', 'text', 'bin',
- 'int', 'float', 'date', 'time', 'datetime'):
- misc_[icon] = ImageFile('icons/%s.gif' % icon, globals())
-
-
-## zope-specific psycopg typecasters ##
-
-# convert an ISO timestamp string from postgres to a Zope DateTime object
-def _cast_DateTime(iso, curs):
- if iso:
- return DateTime(re.split("GMT\+?|GMT-?", iso)[0])
-
- # this will split us into [date, time, GMT/AM/PM(if there)]
- # dt = str.split(' ')
- # if len(dt) > 1:
- # # we now should split out any timezone info
- # dt[1] = dt[1].split('-')[0]
- # dt[1] = dt[1].split('+')[0]
- # return DateTime(' '.join(dt[:2]))
- # else:
- # return DateTime(dt[0])
-
-# convert an ISO date string from postgres to a Zope DateTime object
-def _cast_Date(iso, curs):
- if iso:
- return DateTime(iso)
-
-# Convert a time string from postgres to a Zope DateTime object.
-# NOTE: we set the day as today before feeding to DateTime so
-# that it has the same DST settings.
-def _cast_Time(iso, curs):
- if iso:
- return DateTime(time.strftime('%Y-%m-%d %H:%M:%S',
- time.localtime(time.time())[:3]+
- time.strptime(iso[:8], "%H:%M:%S")[3:]))
-
-# NOTE: we don't cast intervals anymore because they are passed
-# untouched to Zope.
-def _cast_Interval(iso, curs):
- return iso
-
-ZDATETIME = new_type((1184, 1114), "ZDATETIME", _cast_DateTime)
-ZINTERVAL = new_type((1186,), "ZINTERVAL", _cast_Interval)
-ZDATE = new_type((1082,), "ZDATE", _cast_Date)
-ZTIME = new_type((1083,), "ZTIME", _cast_Time)
-
-
-## table browsing helpers ##
-
-class TableBrowserCollection(Acquisition.Implicit):
- pass
-
-class Browser(Base):
- def __getattr__(self, name):
- try:
- return self._d[name]
- except KeyError:
- raise AttributeError, name
-
-class values:
- def len(self):
- return 1
-
- def __getitem__(self, i):
- try:
- return self._d[i]
- except AttributeError:
- pass
- self._d = self._f()
- return self._d[i]
-
-class TableBrowser(Browser, Acquisition.Implicit):
- icon = 'what'
- Description = check = ''
- info = HTMLFile('table_info', globals())
- menu = HTMLFile('table_menu', globals())
-
- def tpValues(self):
- v = values()
- v._f = self.tpValues_
- return v
-
- def tpValues_(self):
- r=[]
- tname=self.__name__
- for d in self._c.columns(tname):
- b=ColumnBrowser()
- b._d=d
- try: b.icon=field_icons[d['Type']]
- except: pass
- b.TABLE_NAME=tname
- r.append(b)
- return r
-
- def tpId(self): return self._d['TABLE_NAME']
- def tpURL(self): return "Table/%s" % self._d['TABLE_NAME']
- def Name(self): return self._d['TABLE_NAME']
- def Type(self): return self._d['TABLE_TYPE']
-
- manage_designInput=HTMLFile('designInput',globals())
- def manage_buildInput(self, id, source, default, REQUEST=None):
- "Create a database method for an input form"
- args=[]
- values=[]
- names=[]
- columns=self._columns
- for i in range(len(source)):
- s=source[i]
- if s=='Null': continue
- c=columns[i]
- d=default[i]
- t=c['Type']
- n=c['Name']
- names.append(n)
- if s=='Argument':
- values.append("<dtml-sqlvar %s type=%s>'" %
- (n, vartype(t)))
- a='%s%s' % (n, boboType(t))
- if d: a="%s=%s" % (a,d)
- args.append(a)
- elif s=='Property':
- values.append("<dtml-sqlvar %s type=%s>'" %
- (n, vartype(t)))
- else:
- if isStringType(t):
- if find(d,"\'") >= 0: d=join(split(d,"\'"),"''")
- values.append("'%s'" % d)
- elif d:
- values.append(str(d))
- else:
- raise ValueError, (
- 'no default was given for <em>%s</em>' % n)
-
-class ColumnBrowser(Browser):
- icon='field'
-
- def check(self):
- return ('\t<input type=checkbox name="%s.%s">' %
- (self.TABLE_NAME, self._d['Name']))
- def tpId(self): return self._d['Name']
- def tpURL(self): return "Column/%s" % self._d['Name']
- def Description(self):
- d=self._d
- if d['Scale']:
- return " %(Type)s(%(Precision)s,%(Scale)s) %(Nullable)s" % d
- else:
- return " %(Type)s(%(Precision)s) %(Nullable)s" % d
-
-table_icons={
- 'TABLE': 'table',
- 'VIEW':'view',
- 'SYSTEM_TABLE': 'stable',
- }
-
-field_icons={
- NUMBER.name: 'i',
- STRING.name: 'text',
- DATETIME.name: 'date',
- INTEGER.name: 'int',
- FLOAT.name: 'float',
- BOOLEAN.name: 'bin',
- ROWID.name: 'int'
- }
+++ /dev/null
-# ZPsycopgDA/__init__.py - ZPsycopgDA Zope product
-#
-# Copyright (C) 2004 Federico Di Gregorio <fog@initd.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# Or, at your option this program (ZPsycopgDA) can be distributed under the
-# Zope Public License (ZPL) Version 1.0, as published on the Zope web site,
-# http://www.zope.org/Resources/ZPL.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.
-#
-# See the LICENSE file for details.
-
-__doc__ = "ZPsycopg Database Adapter Registration."
-__version__ = '2.0'
-
-import DA
-
-def initialize(context):
- context.registerClass(
- DA.Connection,
- permission = 'Add Z Psycopg 2 Database Connections',
- constructors = (DA.manage_addZPsycopgConnectionForm,
- DA.manage_addZPsycopgConnection),
- icon = SOFTWARE_HOME + '/Shared/DC/ZRDB/www/DBAdapterFolder_icon.gif')
+++ /dev/null
-# ZPsycopgDA/db.py - query execution
-#
-# Copyright (C) 2004 Federico Di Gregorio <fog@initd.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# Or, at your option this program (ZPsycopgDA) can be distributed under the
-# Zope Public License (ZPL) Version 1.0, as published on the Zope web site,
-# http://www.zope.org/Resources/ZPL.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.
-#
-# See the LICENSE file for details.
-
-from Shared.DC.ZRDB.TM import TM
-from Shared.DC.ZRDB import dbi_db
-
-from ZODB.POSException import ConflictError
-
-import site
-import pool
-
-import psycopg2
-from psycopg2.extensions import INTEGER, LONGINTEGER, FLOAT, BOOLEAN, DATE, TIME
-from psycopg2 import NUMBER, STRING, ROWID, DATETIME
-
-
-# the DB object, managing all the real query work
-
-class DB(TM, dbi_db.DB):
-
- _p_oid = _p_changed = _registered = None
-
- def __init__(self, dsn, tilevel, enc='utf-8'):
- self.dsn = dsn
- self.tilevel = tilevel
- self.encoding = enc
- self.failures = 0
- self.calls = 0
- self.make_mappings()
-
- def getconn(self, create=True):
- conn = pool.getconn(self.dsn)
- conn.set_isolation_level(int(self.tilevel))
- return conn
-
- def putconn(self, close=False):
- try:
- conn = pool.getconn(self.dsn, False)
- except AttributeError:
- pass
- pool.putconn(self.dsn, conn, close)
-
- def getcursor(self):
- conn = self.getconn()
- return conn.cursor()
-
- def _finish(self, *ignored):
- try:
- conn = self.getconn(False)
- conn.commit()
- self.putconn()
- except AttributeError:
- pass
-
- def _abort(self, *ignored):
- try:
- conn = self.getconn(False)
- conn.rollback()
- self.putconn()
- except AttributeError:
- pass
-
- def open(self):
- # this will create a new pool for our DSN if not already existing,
- # then get and immediately release a connection
- self.getconn()
- self.putconn()
-
- def close(self):
- # FIXME: if this connection is closed we flush all the pool associated
- # with the current DSN; does this makes sense?
- pool.flushpool(self.dsn)
-
- def sortKey(self):
- return 1
-
- def make_mappings(self):
- """Generate the mappings used later by self.convert_description()."""
- self.type_mappings = {}
- for t, s in [(INTEGER,'i'), (LONGINTEGER, 'i'), (NUMBER, 'n'),
- (BOOLEAN,'n'), (ROWID, 'i'),
- (DATETIME, 'd'), (DATE, 'd'), (TIME, 'd')]:
- for v in t.values:
- self.type_mappings[v] = (t, s)
-
- def convert_description(self, desc, use_psycopg_types=False):
- """Convert DBAPI-2.0 description field to Zope format."""
- items = []
- for name, typ, width, ds, p, scale, null_ok in desc:
- m = self.type_mappings.get(typ, (STRING, 's'))
- items.append({
- 'name': name,
- 'type': use_psycopg_types and m[0] or m[1],
- 'width': width,
- 'precision': p,
- 'scale': scale,
- 'null': null_ok,
- })
- return items
-
- ## tables and rows ##
-
- def tables(self, rdb=0, _care=('TABLE', 'VIEW')):
- self._register()
- c = self.getcursor()
- c.execute(
- "SELECT t.tablename AS NAME, 'TABLE' AS TYPE "
- " FROM pg_tables t WHERE tableowner <> 'postgres' "
- "UNION SELECT v.viewname AS NAME, 'VIEW' AS TYPE "
- " FROM pg_views v WHERE viewowner <> 'postgres' "
- "UNION SELECT t.tablename AS NAME, 'SYSTEM_TABLE\' AS TYPE "
- " FROM pg_tables t WHERE tableowner = 'postgres' "
- "UNION SELECT v.viewname AS NAME, 'SYSTEM_TABLE' AS TYPE "
- "FROM pg_views v WHERE viewowner = 'postgres'")
- res = []
- for name, typ in c.fetchall():
- if typ in _care:
- res.append({'TABLE_NAME': name, 'TABLE_TYPE': typ})
- self.putconn()
- return res
-
- def columns(self, table_name):
- self._register()
- c = self.getcursor()
- try:
- r = c.execute('SELECT * FROM "%s" WHERE 1=0' % table_name)
- except:
- return ()
- self.putconn()
- return self.convert_description(c.description, True)
-
- ## query execution ##
-
- def query(self, query_string, max_rows=None, query_data=None):
- self._register()
- self.calls = self.calls+1
-
- desc = ()
- res = []
- nselects = 0
-
- c = self.getcursor()
-
- try:
- for qs in [x for x in query_string.split('\0') if x]:
- if type(qs) == unicode:
- if self.encoding:
- qs = qs.encode(self.encoding)
- try:
- if query_data:
- c.execute(qs, query_data)
- else:
- c.execute(qs)
- except psycopg2.OperationalError, e:
- try:
- self.close()
- except:
- pass
- self.open()
- try:
- if query_data:
- c.execute(qs, query_data)
- else:
- c.execute(qs)
- except (psycopg2.ProgrammingError,
- psycopg2.IntegrityError), e:
- if e.args[0].find("concurrent update") > -1:
- raise ConflictError
- raise e
- except (psycopg2.ProgrammingError, psycopg2.IntegrityError), e:
- if e.args[0].find("concurrent update") > -1:
- raise ConflictError
- raise e
- if c.description is not None:
- nselects += 1
- if c.description != desc and nselects > 1:
- raise psycopg2.ProgrammingError(
- 'multiple selects in single query not allowed')
- if max_rows:
- res = c.fetchmany(max_rows)
- else:
- res = c.fetchall()
- desc = c.description
- self.failures = 0
-
- except StandardError, err:
- self._abort()
- raise err
-
- return self.convert_description(desc), res
+++ /dev/null
-<dtml-var manage_page_header>
-
-<dtml-var "manage_form_title(this(), _,
- form_title='Add Z Psycopg 2 Database Connection',
- help_product='ZPsycopgDA',
- help_topic='ZPsycopgDA-Method-Add.stx'
- )">
-
-<p class="form-help">
-A Zope Psycopg 2 Database Connection is used to connect and execute
-queries on a PostgreSQL database.
-</p>
-
-<p class="form-help">
-In the form below <em>Connection String</em> (also called the Data Source Name
-or DSN for short) is a string... (TODO: finish docs)
-</p>
-
-<form action="manage_addZPsycopgConnection" method="POST">
-<table cellspacing="0" cellpadding="2" border="0">
- <tr>
- <td align="left" valign="top">
- <div class="form-label">
- Id
- </div>
- </td>
- <td align="left" valign="top">
- <input type="text" name="id" size="40"
- value="Psycopg2_database_connection" />
- </td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <div class="form-optional">
- Title
- </div>
- </td>
- <td align="left" valign="top">
- <input type="text" name="title" size="40"
- value="Z Psycopg 2 Database Connection"/>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <div class="form-label">
- Connection string
- </div>
- </td>
- <td align="left" valign="top">
- <input type="text" name="connection_string" size="40" value="" />
- </td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <div class="form-label">
- Connect immediately
- </div>
- </td>
- <td align="left" valign="top">
- <input type="checkbox" name="check" value="YES" checked="YES" />
- </td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <div class="form-label">
- Use Zope's internal DateTime
- </div>
- </td>
- <td align="left" valign="top">
- <input type="checkbox" name="zdatetime" value="YES" checked="YES" />
- </td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <div class="form-label">
- Transaction isolation level
- </div>
- </td>
- <td align="left" valign="top">
- <select name="tilevel:int">
- <option value="1">Read committed</option>
- <option value="2" selected="YES">Serializable</option>
- </select>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="2">
- <div class="form-element">
- <input class="form-element" type="submit" name="submit" value=" Add " />
- </div>
- </td>
- </tr>
-</table>
-</form>
-
-<dtml-var manage_page_footer>
+++ /dev/null
-<html>
- <head><title><dtml-var title_or_id >tables</title></head>
- <body bgcolor="#FFFFFF" link="#000099" vlink="#555555" alink="#77003B">
- <dtml-var manage_tabs>
- <dtml-tree header="info">
- <IMG SRC="<dtml-var SCRIPT_NAME >/misc_/ZPsycopgDA/<dtml-var icon>"
- ALT="<dtml-var Type>" BORDER="0">
- <dtml-var Name><dtml-var Description>
- </dtml-tree>
- </body>
-</html>
+++ /dev/null
-<dtml-var manage_page_header>
-<dtml-var manage_tabs>
-
-<form action="manage_edit" method="POST">
-<table cellspacing="0" cellpadding="2" border="0">
- <tr>
- <td align="left" valign="top">
- <div class="form-optional">
- Title
- </div>
- </td>
- <td align="left" valign="top">
- <input type="text" name="title" size="40"
- value="&dtml-title;"/>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <div class="form-label">
- Connection string
- </div>
- </td>
- <td align="left" valign="top">
- <input type="text" name="connection_string" size="40"
- value="&dtml-connection_string;" />
- </td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <div class="form-label">
- Use Zope's internal DateTime
- </div>
- </td>
- <td align="left" valign="top">
- <input type="checkbox" name="zdatetime" value="YES"
- <dtml-if expr="zdatetime">checked="YES"</dtml-if> />
- </td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <div class="form-label">
- Transaction isolation level
- </div>
- </td>
- <td align="left" valign="top">
- <select name="tilevel:int">
- <option value="1"
- <dtml-if expr="tilevel==1">selected="YES"</dtml-if>>
- Read committed</option>
- <option value="2"
- <dtml-if expr="tilevel==2">selected="YES"</dtml-if>>
- Serializable</option>
- </select>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="2">
- <div class="form-element">
- <input class="form-element" type="submit" name="submit"
- value=" Save Changes " />
- </div>
- </td>
- </tr>
-</table>
-</form>
-
-<dtml-var manage_page_footer>
+++ /dev/null
-<dtml-var standard_html_header>
-
-<dtml-var TABLE_TYPE><dtml-if TABLE_OWNER>
- owned by <dtml-var TABLE_OWNER></dtml-if>
-<dtml-if REMARKS><br><dtml-var REMARKS></dtml-if>
-
-<dtml-var standard_html_footer>
+++ /dev/null
-# ZPsycopgDA/pool.py - ZPsycopgDA Zope product: connection pooling
-#
-# Copyright (C) 2004 Federico Di Gregorio <fog@initd.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# Or, at your option this program (ZPsycopgDA) can be distributed under the
-# Zope Public License (ZPL) Version 1.0, as published on the Zope web site,
-# http://www.zope.org/Resources/ZPL.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.
-#
-# See the LICENSE file for details.
-
-# all the connections are held in a pool of pools, directly accessible by the
-# ZPsycopgDA code in db.py
-
-import threading
-import psycopg2.pool
-
-_connections_pool = {}
-_connections_lock = threading.Lock()
-
-def getpool(dsn, create=True):
- _connections_lock.acquire()
- try:
- if not _connections_pool.has_key(dsn) and create:
- _connections_pool[dsn] = \
- psycopg2.pool.PersistentConnectionPool(4, 200, dsn)
- finally:
- _connections_lock.release()
- return _connections_pool[dsn]
-
-def flushpool(dsn):
- _connections_lock.acquire()
- try:
- _connections_pool[dsn].closeall()
- del _connections_pool[dsn]
- finally:
- _connections_lock.release()
-
-def getconn(dsn, create=True):
- return getpool(dsn, create=create).getconn()
-
-def putconn(dsn, conn, close=False):
- getpool(dsn).putconn(conn, close=close)
+++ /dev/null
-psycopg2 (1.99.12.1-1) experimental; urgency=low
-
- * Adapted from patches sent by W. Borgert.
- * Renamed source package to psycopg2.
-
- -- Federico Di Gregorio <fog@debian.org> Fri, 4 Mar 2005 13:11:43 +0100
-
-psycopg2 (1.99.11-0.1) unstable; urgency=low
-
- * Experimental package.
-
- -- W. Borgert <debacle@debian.org> Sun, 09 Jan 2005 10:14:09 +0000
+++ /dev/null
-Source: psycopg2
-Section: python
-Priority: optional
-Build-depends: postgresql-dev, debhelper (>> 3), python2.3-dev, cdbs
-Maintainer: Federico Di Gregorio <fog@debian.org>
-Standards-Version: 3.6.1.1
-
-Package: python-psycopg2
-Architecture: any
-Section: python
-Depends: python (>= 2.3), python (<< 2.4), python2.3-psycopg2
-Description: Python module for PostgreSQL [dummy package]
- psycopg is a PostgreSQL database adapter for the Python programming
- language. It was written from scratch with the aim of being very small
- and fast, and stable as a rock. The main advantages of psycopg are that
- it supports the full Python DBAPI-2.0 and being thread safe at level 2.
- .
- psycopg 2 is the next generation psycopg, implementing a much better
- type system and even more DBAPI extensions:
- .
- * support for Python datetime and Decimal types;
- * complete implementation of adapt() from PEP 246 to convert Python
- types to PostgreSQL ones;
- * COPY FROM/COPY TO support;
- * inehritable connection and cursor objects and support for connection
- and cursor factories;
- * automatic encoding conversion and support for unicode queries.
- .
- This dummy package just depends on the right, default version of Python
- and psycopg 2.
-
-Package: python2.3-psycopg2
-Architecture: any
-Section: python
-Depends: ${shlibs:Depends}, python2.3
-Description: Python 2.3 module for PostgreSQL
- psycopg is a PostgreSQL database adapter for the Python programming
- language. It was written from scratch with the aim of being very small
- and fast, and stable as a rock. The main advantages of psycopg are that
- it supports the full Python DBAPI-2.0 and being thread safe at level 2.
- .
- psycopg 2 is the next generation psycopg, implementing a much better
- type system and even more DBAPI extensions:
- .
- * support for Python datetime and Decimal types;
- * complete implementation of adapt() from PEP 246 to convert Python
- types to PostgreSQL ones;
- * COPY FROM/COPY TO support;
- * inehritable connection and cursor objects and support for connection
- and cursor factories;
- * automatic encoding conversion and support for unicode queries.
+++ /dev/null
-psycopg 2 can be downloaded from:
-
- http://initd.org/pub/software/psycopg/ALPHA/
-
-Copyright (c) 2001-2005 Federico Di Gregorio <fog@debian.org>
-
-This program is distributed under the GNU GPL.
-
-On Debian GNU/Linux systems, the complete text of the GNU General
-Public License can be found in '/usr/share/common-licenses/GPL'.
+++ /dev/null
-#!/usr/bin/make -f
-
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/python-distutils.mk
+++ /dev/null
-2003-07-26 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.1.7.
-
- * ZPsycopgDA/db.py: added _cursor method that checks for self.db
- before returning a new cursor. Should fix problem reported with
- Zope 2.7.
-
-2003-07-23 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c: applied notify and fileno patch from Vsevolod Lobko.
-
-2003-07-20 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (_mogrify_dict): applied (slightly modofied) patch from
- Tobias Sargeant: now .execute() accept not only dictionaries but
- every type that has a __getitem__ method.
-
-2003-07-13 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.1.6.
-
- * cursor.c (psyco_curs_scroll): added scroll method, patch from
- Jason D.Hildebrand.
-
- * typemod.c (new_psyco_quotedstringobject): discard NUL characters
- (\0) in quoted strings (fix problem reported by Richard Taylor.)
-
-2003-07-10 Federico Di Gregorio <fog@debian.org>
-
- * Added python-taylor.txt in doc directory: very nice introduction
- to DBAPI programming by Richard Taylor.
-
-2003-07-09 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (_psyco_curs_execute): another MT problem exposed and
- fixed by Sebastien Bigaret (self->keeper->status still LOCKED
- after a fatal error during PQexec call.)
-
-2003-06-23 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.1.5.1.
-
- * ZPsycopgDA/db.py (DB.query): stupid error making ZPsycopgDA
- unusable fixed (else->except).
-
-2003-06-22 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.1.5 candidate.
-
- * cursor.c (psyco_curs_copy_to): now any object with the write
- method can be used as a copy_to target.
-
-2003-06-20 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (psyco_curs_copy_from): applied patch to allow copy_to
- from any object having a "readline" attribute (patch from Lex
- Berezhny.) (psyco_curs_copy_from): another patch from Lex to make
- psycopg raise an error on COPY FROM errors.
-
- * ZPsycopgDA/db.py (DB.query): if a query raise an exception,
- first self._abort() is called to rollback current
- "sub-transaction". this is a backward-compatible change for
- people that think continuing to work in the same zope transaction
- after an exception is a Good Thing (TM).
-
- * finally updated check_types.expected. checked by hand the
- conversions work the right way.
-
- * doc/examples/work.py: fixed example. note that it is a long time
- (at least two releases) that psycopg does not END a transaction
- initiated explicitly by the user while in autocommit mode.
-
-2003-06-19 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (_mogrify_dict): fixed dictionary mogrification (patch
- by Vsevolod Lobko.) (_psyco_curs_execute): fixed keeper status
- trashing problem by letting only one thread at time play with
- keeper->status (as suggested by Sebastien Bigaret.)
-
-2003-05-07 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.1.4.
-
- * cursor.c: Added "statusmessage" attribute that holds the backend
- message (modified lots of functions, look for self->status).
-
-2003-05-06 Federico Di Gregorio <fog@debian.org>
-
- * typemod.c (new_psyco_datetimeobject): moved Py_INCREF into
- XXX_FromMx functions, to fix memory leak reported by Jim Crumpler.
-
-2003-04-11 Federico Di Gregorio <fog@debian.org>
-
- * module.h (PyObject_TypeCheck): fixed leak in python 2.1
- (Guido van Rossum).
-
-2003-04-08 Federico Di Gregorio <fog@debian.org>
-
- * buildtypes.py (basic_types): removed LXTEXT (never user, does
- not exists anymore.)
-
-2003-04-07 Federico Di Gregorio <fog@debian.org>
-
- * setup.py: added very lame setup.py script.
-
-2003-04-02 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.3.
-
- * psycopg.spec: Added (but modified) spec file by William
- K. Volkman (again, this change was lost somewhere in time...)
-
-2003-04-01 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (_psyco_curs_execute): psycopg was reporting everything
- as IntegrityError; reported and fix suggested by Amin Abdulghani.
-
-2003-03-21 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (psyco_curs_fetchone): debug statements sometimes made
- psycopg segfault: fixed by a patch by Ken Simpson.
-
-2003-03-18 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (alloc_keeper): patch from Dieter Maurer to unlock GIL
- whaile calling PQconnectdb().
-
-2003-03-05 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.1.2.
-
- * Applied cygwin patch from Hajime Nakagami.
-
-2003-02-25 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.1.2pre1.
-
- * cursor.c: added .lastrowid attribute to cursors (lastoid is
- deprecated and will be removed sometime in the future.)
-
- * cursor.c (begin_pgconn): implemented various isolation levels
- (also, in abort_pgconn, commit_pgconn.)
-
- * Added keyword parameters to psycopg.connect(): all take strings
- (even port): database, host, port, user, password.
-
- * configure.in: fixed test for postgres version > 7.2.
-
- * cursor.c (_psyco_curs_execute): removed if on pgerr in default
- case (if we enter default pgerr can't be one of the cased ones.)
- Also applied slightly modified patch from William K. Volkman.
-
-2003-02-24 Federico Di Gregorio <fog@debian.org>
-
- * Merged in changes from 1.0.15.1 (see below for merged
- ChangeLog.)
-
-2003-02-14 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.15.1.
-
- * cursor.c (_mogrify_fmt): in some cases we where removing one
- character too much from the format string, resulting in BIG BAD
- BUG. <g> Fixed.
-
-2003-02-13 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.15. <g>
-
- * connection.c (_psyco_conn_close): now call dispose_pgconn on all
- cursors, to make sure all phisical connections to the db are
- closed (problem first reported by Amin Abdulghani.)
-
- * DBAPI-2.0 fixed mainly due to Stuart Bishop:
- - cursor.c (psyco_curs_setinputsizes): removed PARSEARGS, as
- this method does nothing.
- - cursor.c (psyco_curs_setoutputsize): .setoutputsize was
- spelled .setoutputsizes! fixed. Also removed PARSEARGS, as this
- method does nothing.
-
-2003-02-12 Federico Di Gregorio <fog@debian.org>
-
- * module.h (Dprintf): check on __APPLE__ to avoid variadic macros
- on macos x (as reported by Stuart Bishop, btw, why gcc seems to
- not support them on macos?)
-
- * cursor.c (_mogrify_fmt): non-alphabetic characters are dropped
- after the closing ")" until a real alphabetic, formatting one is
- found. (Fix bug reported by Randall Randall.)
-
-2003-02-05 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c (psyco_INTERVAL_cast): patched again to take into
- account leading zeroes.
-
-2003-02-02 Federico Di Gregorio <fog@debian.org>
-
- * Makefile.pre.in: applied patch from Albert Chin-A-Young to
- define BLDSHARED.
-
- * README: added explicit permission to link with OpenSSL.
-
-2003-01-30 Federico Di Gregorio <fog@debian.org>
-
- * config.h.in: applied patch from Albert Chin-A-Young to fix
- asprintf prototype.
-
-2003-01-29 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (_mogrify_seq): fixed little refcount leak, as
- suggested by Yves Bastide.
-
-2003-01-24 Federico Di Gregorio <fog@debian.org>
-
- * Merged-in changes from 1.0.14.2 (emacs diff mode is great..)
-
- * Release 1.0.14.2.
-
- * ZPsycopgDA/db.py (DB.query): back to allowing up to 1000 db
- errors before trying to reopen the connection by ourselves.
-
- * ZPsycopgDA/db.py: a false (None preferred, 0 allowed) max_rows
- value now means "fetch all results".
-
-2003-01-22 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (psyco_curs_fetchone): fixed little memory leak
- reported by Dieter Maurer.
-
-2003-01-20 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/db.py (DB.tables/columns): added registration with
- Zope's transaction machinery.
-
- * Release 1.0.14.1.
-
- * ZPsycopgDA/db.py: applied some fixes and cleanups by Dieter
- Maurer (serialization problem were no more correctly detected!)
-
- * Release 1.0.14.
-
- * Merged in 1.0.14.
-
- * Import of 1.1.1 done.
-
- * Moved everything to cvs HEAD.
-
-2003-01-20 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/connectionAdd.dtml: fixed typo (thanks to Andrew
- Veitch.)
-
- * typeobj.c (psyco_INTERVAL_cast): applied patch from Karl Putland
- to fix problems with fractional seconds.
-
-2002-12-03 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.14-pre2.
-
- * module.h: added macro for PyObject_TypeCheck if python version <2.2.
-
- * typeobj.c (psyco_DBAPITypeObject_coerce): added error message to
- coercion errors.
-
-2002-12-02 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.14-pre1.
-
- * ZPsycopgDA/db.py (DB.sortKey): added sortKey().
-
- * ZPsycopgDA/DA.py: applied a patch that was lost on hard disk
- (sic), if you sent me a patch names psycopg-1.0.13.diff modifying
- DA.py imports and want your name here, send me an email. :)
- [btw, the patch fix the ImageFile import, getting it from Globals
- as it is right.]
-
- * typeobj.c (psyco_DBAPITypeObject_coerce): Fixed coerce segfault
- by checking explicitly for all the allowed types.
-
-2002-11-25 Federico Di Gregorio <fog@debian.org>
-
- * doc/examples/*.py: added .rollback() to all exceptions before
- deleteing the old table.
-
- * cursor.c: Apllied patch from John Goerzen (fix memory leak in
- executemany).
-
-2002-10-25 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.13.
-
- * connection.c (_psyco_conn_close): remove cursors from the list
- starting from last and moving backward (as suggested by Jeremy
- Hylton; this is not such a big gain because python lists are
- *linked* lists, but not removing the element 0 makes the code a
- little bit clear.)
-
- * cursor.c (_psyco_curs_execute): now IntegrityError is raised
- instead of ProgrammingError when adding NULL values to a non-NULL
- column (suggested by Edmund Lian) and on referential integrity
- violation (as per debian bug #165791.)
-
- * typeobj.c (psyco_DATE_cast): now we use 999999 instead of
- 5867440 for very large (both signs) dates. This allow to re-insert
- the DateTime object into postgresql (suggested by Zahid Malik.)
-
-2002-09-13 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.12.
-
- * Removed code to support COPY FROM/TO, will be added to new 1.1
- branch to be released next week.
-
- * cursor.c (_mogrify_seq): Fixed memory leak reported by Menno
- Smits (values obtained by calling PySequence_GetItem are *new*
- references!)
-
-2002-09-07 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (_psyco_curs_execute): Added skeleton to support COPY
- FROM/TO.
-
-2002-09-06 Federico Di Gregorio <fog@debian.org>
-
- * configure.in: if libcrypt can't be found we probably are on
- MacOS X: check for libcrypto, as suggested by Aparajita Fishman.
-
-2002-09-03 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/db.py (DB.columns): Applied patch from Dieter Maurer
- to allow the DA-browser to work with mixed case table names.
-
-2002-08-30 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/DA.py (cast_DateTime): Applied patch from Yury to fix
- timestamps (before they were returned with time always set to 0.)
-
-2002-08-26 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.11.1 (to fix a %&£$"! bug in ZPsycopgDA not
- accepting psycopg 1.0.11 as a valid version.
-
- * Release 1.0.11.
-
-2002-08-22 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.11pre2.
-
- * cursor.c (_psyco_curs_execute): fixed IntegrityError as reported
- by Andy Dustman. (psyco_curs_execute): converting TypeError to
- ProgrammingError on wrong number of % and/or aeguments.
-
- * doc/examples/integrity.py: added example and check for
- IntegrityError.
-
-2002-08-08 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.11pre1.
-
-2002-08-06 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/DA.py (cast_DateTime): patched as suggested by Tom
- Jenkins; now it shouldwork with time zones too.
-
-2002-08-01 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/DA.py (cast_DateTime): fixed problem with missing
- AM/PM, as reported by Tom Jenkins.
-
-2002-07-23 Federico Di Gregorio <fog@debian.org>
-
- * Fixed buglets reported by Mike Coleman.
-
-2002-07-22 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.10.
-
-2002-07-14 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.10pre2.
-
- * typeobj.c (psyco_LONGINTEGER_cast): fixed bad segfault by
- INCREFfing Py_None when it is the result of a NULL conversion.
-
-2002-07-04 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.10pre1.
-
- * buildtypes.py (basic_types): added TIMESTAMPTZ to the types
- converted by the DATE builtin.
-
- * ZPsycopgDA/DA.py (Connection.connect): Added version check.
-
-2002-07-03 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c (psyco_XXX_cast): fixed bug reported by multiple users
- by appliying Matt patch.
-
-2002-06-30 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/DA.py (Connection.set_type_casts): applied patch from
- Tom Jenkins to parse dates with TZ.
-
-2002-06-20 Federico Di Gregorio <fog@debian.org>
-
- * Preparing for release 1.0.9.
-
- * Makefile.pre.in (dist): now we really include psycopg.spec.
-
-2002-06-17 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/db.py (_finish, _abort): fixed problem with
- connection left in invalid state by applying Tom Jenkins patch.
-
-2002-06-06 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/db.py (DB._abort): fixed exception raising after an
- error in execute triggerer deletion of self.db.
-
-2002-05-16 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (psyco_curs_fetchone): None values passed to the
- internal typecasters.
-
- * typeobj.c: added management of None to all the builtin
- typecasters.
-
-2002-04-29 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/DA.py (cast_Time): applied 'seconds as a float' patch
- from Jelle.
-
-2002-04-23 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.8.
-
- * Makefile.pre.in: we now include win32 related files in the
- distribution.
-
- * connection.c (psyco_conn_destroy): fixed segfault reported by
- Scott Leerssen (we were double calling _psyco_conn_close().)
-
- * typemod.c (new_psyco_quotedstringobject): fixed memory stomping
- catched by assert(); thanks to Matt Hoskins for reporting this
- one.
-
-2002-04-22 Federico Di Gregorio <fog@debian.org>
-
- * configure.in: grmpf. we need a VERSION file for windows, we'll
- use it for configue and debian/rules too.
-
- * Integrated win32 changes from Jason Erickson. Moved his
- Readme.txt to README.win32, removed VERSION and DATE, patched
- source where required. Renamed HISTORY to ChangeLog.win32, hoping
- Jason will start adding changes to the real ChangeLog file.
-
-2002-04-07 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.7.1.
-
- * configure.in: fixed little bug as reported by ron.
-
-2002-04-05 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.7?
-
- * typemod.c (new_psyco_bufferobject): fixed encoding problem (0xff
- now encoded as \377 and not \777.) Also encoding *all* chars as
- quoted octal values to prevent "Invalid UNICODE character sequence
- found" errors.
-
- * Release 1.0.7. (Real this time.) (Ok, it was a joke....)
-
-2002-04-03 Federico Di Gregorio <fog@debian.org>
-
- * configure.in: fixed problem with postgres versions in the format
- 7.2.x (sic.)
-
- * connection.c (psyco_conn_destroy): moved most of the destroy
- stuff into its own function (_psyco_conn_close) and added a call
- to it from psyco_conn_close. This should fix the "psycopg does not
- release postgres connections on .close()" problem.
-
-2002-03-29 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.7. Delayed.
-
- * buildtypes.py (basic_types): added TIMESTAMPTZ postgres type to
- the list of valid DATETIME types (incredible luck, no changes to
- the parse are needed!)
-
- * typeobj.c (psyco_DATE_cast): fixed wrong managment of sign in
- infinity.
-
-2002-03-27 Federico Di Gregorio <fog@debian.org>
-
- * configure.in (INSTALLOPTS): added AC_PROG_CPP test, now uses
- AC_TRY_CPP to test for _all_ required mx includes.
-
-2002-03-19 Federico Di Gregorio <fog@debian.org>
-
- * configure.in: added check for both pg_config.h and config.h to
- detect postgres version.
-
- * cursor.c: now None values are correctly handled when the format
- string is not %s but %d, etc.
-
-2002-03-08 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/DA.py: added MessageDialog import suggested by
- Guido.
-
-2002-03-07 Federico Di Gregorio <fog@debian.org>
-
- * psycopg.spec: added RPM specs by William K. Volkman.
-
- * Release 1.0.6.
-
- * configure.in: imported changes to allow postgres 7.2 builds from
- unstable branch.
-
-2002-03-04 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.5.
-
- * applied table browser patch from Andy Dustman.
-
-2002-02-26 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c (psyco_DATE_cast): added management of infinity
- values, this can be done in a better way, by accessing the
- MaxDateTime and MinDateTime constants of the mx.DateTime module.
-
-2002-02-20 Federico Di Gregorio <fog@debian.org>
-
- * configure.in: Release 1.0.4.
-
-2002-02-12 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/db.py (DB.columns): fixed select to reenable column
- expansion in table browsing.
-
- * ZPsycopgDA/__init__.py: removed code that made psycopg think
- double.
-
-2002-02-11 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (_mogrify_dict): removed Py_DECREF of Py_None,
- references returned by PyDict_Next() are borrowed (thanks to
- Michael Lausch for this one.)
-
-2002-02-08 Federico Di Gregorio <fog@debian.org>
-
- * A little bug slipped in ZPsycopgDA, releasing 1.0.3 immediately.
-
- * Release 1.0.2.
-
- * tests/check_types.py (TYPES): added check for hundredths of a
- second.
-
-2002-02-07 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c (psyco_INTERVAL_cast): patched to correct wrong
- interpretation of hundredths of a second (patch from
- A. R. Beresford, kudos!)
-
-2002-01-31 Federico Di Gregorio <fog@debian.org>
-
- * FAQ: added.
-
-2002-01-16 Federico Di Gregorio <fog@debian.org>
-
- * Preparing for release 1.0.1.
-
- * cursor.c (alloc_keeper): removed ALLOW_THREADS wrapper around
- PQconnectdb: libpq calls crypt() that is *not* reentrant.
-
-2001-12-19 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c (psyco_DBAPITypeObject_cmp): added check to simply
- return false when two type objects are compared (type objects are
- meaned to be compared to integers!)
-
- * typeobj.c: fixed the memory leak reported by the guys at
- racemi, for real this time. (added about 5 DECREFS and 2 INCREFS,
- ouch!)
-
-2001-12-17 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c (psyco_DBAPITypeObject_cmp): fixed memory leak by
- using PyTuple_GET_ITEM (we are sure the tuple has at least one
- element, we built it, after all...) (many thanks to Scott Leerssen
- for reporting the *exact line* for this one.)
-
-2001-12-13 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c: fixed memory leak due to extra strdup (thanks
- to Leonardo Rochael Almeida.)
-
-2001-11-14 Federico Di Gregorio <fog@debian.org>
-
- * Release 1.0.
-
- * doc/README: added explanation about guide work in progess but
- examples working.
-
- * debian/*: lots of changes to release 1.0 in debian too.
-
-2001-11-12 Federico Di Gregorio <fog@debian.org>
-
- * RELEASE-1.0: added release file, to celebrate 1.0.
-
- * tests/zope/typecheck.zexp: regression test on types for zope.
-
-2001-11-11 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/DA.py (cast_Interval): removed typecast of interval
- into zope DateTime. intervals are reported as strings when using
- zope DateTime and as DateTimeDeltas when using mx.
-
-2001-11-09 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c (psyco_INTERVAL_cast): complete rewrite of the
- interval parsing code. now we don't use sscanf anymore and all is
- done with custom code in a very tight and fast loop.
-
-2001-11-08 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/DA.py (Connection.set_type_casts): added mx INTERVAL
- type restore.
-
- * ZPsycopgDA/db.py (DB.query): now we return column names even if
- there are no rows in the result set. also, cleaned up a little bit
- the code.
-
-2001-11-7 Federico Di Gregorio, <fog@debian.org>
-
- * Makefile.pre.in: fixed small problem with zcat on True64
- (thank you stefan.)
-
-2001-11-06 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/db.py (DB.query): added fix for concurrent update
- from Chris Kratz.
-
-2001-11-05 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c: now we include postgres.h if InvalidOid is still
- undefined after all other #includes.
-
- * README: clarified use of configure args related to python
- versions.
-
- * aclocal.m4: patched to work with symlinks installations (thanks
- to Stuart Bishop.)
-
- * cursor.c (_psyco_curs_execute): now reset the keeper's status to
- the old value and not to BEGIN (solve problem with autocommit not
- switching back.)
-
-2001-11-01 Federico Di Gregorio <fog@debian.org>
-
- * doc/examples/dt.py: added example on how to use the date and
- time constructors.
-
- * Makefile.pre.in (dist-zope): removed dependencies on GNU install
- and tar commands. Also a little general cleanup on various targets.
-
- * ZPsycopgDA/DA.py: fixed mx.DateTime importing.
-
-2001-10-31 Federico Di Gregorio <fog@debian.org>
-
- * typemod.c (psyco_xxxFromMx): fixed bug in argument parsing (we
- weren't usigng the right type object.)
-
- * aclocal.m4: now builds OPT and LDFLAGS on the values of the env
- variables instead of overwriting them.
-
- * Makefile.pre.in (CFLAGS): removed -Wall, you can add it back at
- compile time with OPT="-Wall" ./configure ...
-
- * Setup.in (OPT): removed -Wall.
-
-2001-10-30 Michele Comitini <mcm@initd.net>
-
- * module.h: ANSI C compatibility patch from Daniel Plagge.
-
-2001-10-30 Federico Di Gregorio <fog@debian.org>
-
- * README: added common building problems and solutions.
-
- * configure.in: removed check for install command, already done by
- james's aclocal.m4 for python. removed install-sh. removed -s from
- INSTALLOPTS.
-
-2001-10-29 Federico Di Gregorio <fog@debian.org>
-
- * Makefile.pre.in (dist): removed examples/ directory from
- distribution.
-
- * merge with cvs head. preparing to fork again on PSYCOPG-1-0 (i
- admit BRANCH_1_0 was quite a silly name.)
-
- * doc/examples/usercast.py: now works.
-
- * connection.c (curs_rollbackall): fixed little bug (exposed by
- the deadlock below) by changing KEEPER_READY to KEEPER_READY.
-
- * doc/examples/commit.py: deadlock problem solved, was the
- example script, _not_ psycopg. pew... :)
-
- * examples/*: removed the examples moved to doc/examples/.
-
- * doc/examples/commit.py,dictfetch.py: moved from examples/ and
- changed to work for 1.0. unfortunately commit.py locks psycopg!!!
-
-2001-10-24 Federico Di Gregorio <fog@debian.org>
-
- * modified all files neede for the 1.0 release.
-
- * configure.in (MXFLAGS): removed electric fence support.
-
- * Makefile.pre.in (dist): now we remove CVS working files before
- packing the tarball.
-
- * tests: files in this directory are not coding examples, but
- regression tests. we need a sufficient number of tests to follow
- every single code path in psycopg at least once. first test is
- about datatypes.
-
- * doc/examples: moved new example code to examples directory, old
- tests and code samples will stay in examples/ until the manual will
- be finished.
-
-2001-10-16 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c (psyco_INTERVAL_cast): completely revised interval
- casting code. (psyco_TIME_cast): we use the unix epoch when the
- date is undefined.
-
- * cursor.c (psyco_curs_executemany): modified sanity check to
- accept sequences of tuples too and not just dictionaries.
-
-2001-10-15 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c (psyco_INTERVAL_cast): fixed bug caused by wrong
- parsing on '1 day' (no hours, minutes and seconds.)
-
-2001-10-15 Michele Comitini <mcm@initd.net>
-
- * cursor.c (_execute): use the correct cast functions even on
- retrival of binary cursors.
-
-2001-10-12 Federico Di Gregorio <fog@debian.org>
-
- * typemod.c (new_psyco_bufferobject): space not quoted anymore,
- smarter formula to calculate realloc size.
-
- * cursor.c (psyco_curs_fetchone): removed static tuple (using
- static variable in multithreaded code is *crazy*, why did i do it?
- who knows...)
-
- * typeobj.c (psyco_init_types): exports the binary converter (will
- be used in cursor.c:_execute.)
-
- * typeobj.h: added export of psyco_binary_cast object.
-
-2001-10-05 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (_psyco_curs_execute): added missing Py_XDECREF on
- casts list.
-
- * Makefile.pre.in (dist): added install-sh file to the
- distribution.
-
- * replaced PyMem_DEL with PyObject_Del where necessary.
-
- * connection.c (psyco_conn_destroy): added missing
- pthread_mutex_destroy on keeper lock.
-
-2001-10-01 Michele Comitini <mcm@initd.net>
-
- * typemod.c(new_psyco_bufferobject()): using unsigned char for
- binary objects to avoid too many chars escaped. A quick and
- simple formula to avoid memory wasting and too much reallocating
- for the converted object. Needs _testing_, but it is faster.
-
- * cursor.c: #include <postgres.h>
-
- * module.h: now debugging should be active only when asked by
- ./configure --enable-devel
-
-2001-09-29 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (new_psyco_cursobject): added locking of connection,
- still unsure if necessary.
-
-2001-09-26 Federico Di Gregorio <fog@debian.org>
-
- * configure.in: changed DEBUG into PSYCOTIC_DEBUG, to allow other
- includes (postgres.h) to use the former. better compiler checks:
- inline, ansi, gcc specific extensions. removed MXMODULE: we don't
- need it anymore.
-
- * general #include cleanup, should compile on MacOS X too.
-
- * typeobj.c (psyco_DATE_cast): uses sscanf. should be faster too.
- (psyco_TIME_cast): dixit.
-
- * applied patch from Daniel Plagge (SUN cc changes.)
-
-2001-09-22 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/db.py (DB._finish, DB._begin): fix for the
- self.db == None problem.
-
-2001-09-19 Michele Comitini <mcm@initd.net>
-
- * typemod.c (new_psyco_bufferobject): better memory managment
- (now it allocates only needed space dinamically).
-
- * typeobj.c (psyco_BINARY_cast): ripped a useless check, now
- it assumes that binary streams come out from the db correctly
- escaped. Should be a lot faster.
-
-2001-09-18 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c (psyco_INTERVAL_cast): fixed interval conversion
- (hours were incorrectly converted into seconds.)
-
-2001-09-17 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (_mogrify_seq, _mogrify_dict): added check for None
- value and conversion of None -> NULL (fixes bug reported by Hamish
- Lawson.)
-
-2001-09-12 Federico Di Gregorio <fog@debian.org>
-
- * module.c: added handles to new date and time conversion
- functions (see below.)
-
- * typemod.c (psyco_XXXFromMx): added conversion functions that
- simply wrap the mxDateTime objects instead of creating
- them. DBAPI-2.0 extension, off-curse.
-
-2001-09-10 Federico Di Gregorio <fog@debian.org>
-
- * buildtypes.py: solved hidden bug by changing from dictionary to
- list, to maintain ordering of types. sometimes (and just
- sometimes) the type definitions were printed unsorted, resulting
- is psycopg initializing the type system using the type objects in
- the wrong order. you were getting float values from an int4
- column? be happy, this is now fixed...
-
- * cursor.c (psyco_curs_lastoid): added method to get oid of the
- last inserted row (it was sooo easy, it even works...)
-
-2001-09-08 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c (psyco_INTERVAL_cast): added casting function for the
- postgres INTERVAL and TINTERVAL types (create a DateTimeDelta
- object.)
-
-2001-09-05 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c: moved all calls to begin_pgconn to a single call in
- _psyco_curs_execute, to leave the connection in a not-idle status
- after a commit or a rollback. this should free a lot of resources
- on the backend side. kudos to the webware-discuss mailing list
- members and to Clark C. Evans who suggested a nice solution.
-
- * connection.c (curs_rollbackall, curs_commitall): removed calls
- to begin_pgconn, see above.
-
- * module.c (initpsycopg): cleaned up mxDateTime importing; we now
- use the right function from mxDateTime.h. Is not necessary anymore
- to include our own mx headers. This makes psycopg to depend on
- mxDateTime >= 2.0.0.
-
-2001-09-04 Federico Di Gregorio <fog@debian.org>
-
- * doc/*.tex: added documentation directory and skeleton of the
- psycopg guide.
-
-2001-09-03 Federico Di Gregorio <fog@debian.org>
-
- * merged in changes from HEAD (mostly mcm fixes to binary
- objects.)
-
- * preparing for release 0.99.6.
-
-2001-09-03 Michele Comitini <mcm@initd.net>
-
- * typemod.c: much faster Binary encoding routine.
-
- * typeobj.c: much faster Binary decoding routine.
-
-2001-08-28 Michele Comitini <mcm@initd.net>
-
- * typemod.c: Working binary object to feed data to bytea type
- fields.
-
- * typeobj.c: Added BINARY typecast to extract data from
- bytea type fields.
-
- * cursor.c: Added handling for SQL binary cursors.
-
-2001-08-3 Michele Comitini <mcm@initd.net>
-
- * cursor.c: fixed DATESTYLE problem thanx to Steve Drees.
-
-2001-07-26 Federico Di Gregorio <fog@debian.org>
-
- * Makefile.pre.in: applied change suggested by Stefan H. Holek to
- clobber and distclean targets.
-
-2001-07-23 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/db.py: fixed little bugs exposed by multiple select
- changes, not we correctly import ListType and we don't override
- the type() function with a variable.
-
-2001-07-17 Federico Di Gregorio <fog@debian.org>
-
- * configure.in: Release 0.99.5.
-
-2001-07-12 Federico Di Gregorio <fog@debian.org>
-
- * debian/* fixed some little packaging problems.
-
-2001-07-11 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c, typeobj.c: removed some Py_INCREF on PyDict_SetItem
- keys and values to avoid memory leaks.
-
-2001-07-03 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (_mogrify_dict): added dictionary mogrification: all
- Strings in the dictionary are translated into QuotedStrings. it
- even works... (_mogrify_seq): added sequence mogrification and
- code to automagically mogrify all strings passed to .execute().
-
-2001-07-02 Federico Di Gregorio <fog@debian.org>
-
- * Release 0.99.4.
-
- * typemod.c: added QuotedString class and methods.
-
- * module.c: added QuotedString method to module psycopg.
-
- * typemod.c: changed Binary objects into something usefull. now
- the buffer object quotes the input by translatin every char into
- its octal representation. this consumes 4x memory but guarantees
- that even binary data containing '\0' can go into the Binary
- object.
-
- * typemod.h: added definition of QuotedString object.
-
-2001-06-28 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/db.py, ZPsycopgDA/DABase.py: applied patch sent by
- yury to fix little buglet.
-
-2001-06-22 Federico Di Gregorio <fog@debian.org>
-
- * Release 0.99.3.
-
- * connection.c (new_psyco_connobject): now we strdup dsn, as a fix
- for the problem reported by Jack Moffitt.
-
- * Ok, this will be the stable branch from now on...
-
- * Merged in stuff from 0.99.3. About to re-branch with a better
- name (BRANCH_1_0)
-
-2001-06-20 Federico Di Gregorio <fog@debian.org>
-
- * Release 0.99.3. Showstoppers for 1.0 are:
- - documentation
- - mxDateTime module loading
- - bug reported by Yury.
-
- * Integrated patches from Michele:
- - searching for libcrypt in configure now works
- - removed memory leak in asprintf.c
-
-2001-06-15 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/__init__.py (initialize): applied patch from Jelle to
- resolve problem with Zope 2.4.0a1.
-
-2001-06-14 Federico Di Gregorio <fog@debian.org>
-
- * configure.in: added code to check for missing functions (only
- asprintf at now.)
-
- * asprintf.c: added compatibility code for oses that does not have
- the asprintf() function.
-
-2001-06-10 Federico Di Gregorio <fog@debian.org>
-
- * Branched PSYCOPG_0_99_3. Development will continue on the cvs
- HEAD, final adjustements and bugfixing should go to this newly
- created branch.
-
-2001-06-08 Michele Comitini <mcm@initd.net>
-
- * ZPsycopgDA/DA.py: DateTime casts simplified and corrected
- as suggested by Yury.
-
-2001-06-05 Federico Di Gregorio <fog@debian.org>
-
- * Release 0.99.2.
-
- * Makefile.pre.in (dist): added typemod.h and typemod.c to
- distribution.
-
- * cursor.c (commit_pgconn, abort_pgconn, begin_pgconn): resolved
- segfault reported by Andre by changing PyErr_SetString invokations
- into pgconn_set_critical. the problem was that the python
- interpreter simply segfaults when we touch its internal data (like
- exception message) inside an ALLOW_THREADS wrapper.
-
- * now that we are 100% DBAPI-2.0 compliant is time for the
- one-dot-o release (at last!) Para-pa-pa! This one is tagged
- PSYCOPG_0_99_1 but you can call it 1.0pre1, if you better like.
- (A very long text just to say 'Release 0.99.1')
-
- * typemod.[ch]: to reach complete DBAPI-2.0 compliance we
- introduce some new objects returned by the constructors Date(),
- Time(), Binary(), etc. Those objects are module-to-database only,
- the type system still takes care of the database-to-python
- conversion.
-
-2001-06-01 Federico Di Gregorio <fog@debian.org>
-
- * Release 0.5.5.
-
- * module.h: better error message when trying to commit on a
- cursor derived from serialized connection.
-
- * ZPsycopgDA/db.py (DB.close): now self.cursor is set to None when
- the connection is closed.
-
- * module.c (initpsycopg): added missing (sic) DBAPI module
- parameters (paramstyle, apilevel, threadsafety, etc...)
-
-2001-05-24 Michele Comitini <mcm@initd.net>
-
- * ZPsycopgDA: Support for Zope's internal DateTime, option
- to leave mxDateTime is available on the management interface so
- to switch with little effort :).
-
- * cursor.c: more aggressive cleanup of postgres results
- to avoid the risk of memory leaking.
-
- * typeobj.c, connection.c: deleted some Py_INCREF which
- wasted memory.
-
-2001-05-18 Federico Di Gregorio <fog@debian.org>
-
- * Release 0.5.4.
-
-2001-05-17 Michele Comitini <mcm@initd.net>
-
- * ZPsycopgDA/db.py: The connection closed by the management
- interface of zope now raises error instead of reopening itself.
-
- * cursor.c (psyco_curs_close): does not try to free the cursor
- list, as it caused a segfault on subsequent operations on the same
- cursor.
-
-2001-05-07 Federico Di Gregorio <fog@debian.org>
-
- * Release 0.5.3.
-
- * Merged in changes from me and mcm.
-
-2001-05-06 Michele Comitini <mcm@initd.net>
-
- * ZPsycopgDA/db.py (DB.close): Fixes a bug report by Andre
- Shubert, which was still open since there was a tiny typo in
- method definition.
-
- * ZPsycopgDA/DA.py (Connection.sql_quote__): overriding standard
- sql_quote__ method to provide correct quoting (thank to Philip
- Mayers and Casey Duncan for this bug report).
-
-2001-05-04 Federico Di Gregorio <fog@debian.org>
-
- * ZPsycopgDA/db.py: added .close() method (as suffested by Andre
- Schubert.)
-
-2001-05-04 Michele Comitini <mcm@initd.net>
-
- * module.h: working on a closed object now raises an
- InterfaceError.
-
- * ZPsycopgDA/db.py: fixed problems with dead connections detection.
-
- * ZPsycopgDA/__init__.py: corrected SOFTWARE_HOME bug for zope
- icon.
-
-2001-05-04 Federico Di Gregorio <fog@debian.org>
-
- * examples/thread_test.py: now that the serialization bug is
- fixed, it is clear that thread_test.py is bugged! added a commit()
- after the creation of the first table to avoid loosing it on the
- exception raised by the CREATE of an existing table_b.
-
-2001-05-03 Federico Di Gregorio <fog@debian.org>
-
- * connection.c (psyco_conn_cursor): reverted to old locking
- policy, the new caused a nasty deadlock. apparently the multiple
- connection problem has been solved as a side-effect of the other
- fixes... (?!)
-
- * module.h: removes stdkeeper field from connobject, we don't need
- it anymore.
-
- * cursor.c (dispose_pgconn): now sets self->keeper to NULL to
- avoid decrementing the keeper refcnt two times when the cursor is
- first closed and then destroyed.
-
- * connection.c (psyco_conn_cursor): fixed little bug in cursor
- creation: now the connection is locked for the entire duration of
- the cursor creation, to avoid a new cursor to be created with a
- new keeper due to a delay in assigning the stdmanager cursor.
-
- * cursor.c: added calls to pgconn_set_critical() and to
- EXC_IFCRITICAL() where we expect problems. Still segfaults but at
- least raise an exception...
-
- * cursor.c (psyco_curs_autocommit): added exception if the
- cursor's keeper is shared between more than 1 cursor.
-
- * module.h (EXC_IFCRITICAL): added this macro that call
- pgconn_resolve_critical) on critical errors.
-
- * cursor.c (alloc_keeper): added check for pgres == NULL.
-
- * cursor.c (psyco_curs_destroy): merged psyco_curs_destroy() and
- psyco_curs_close(): now both call _psyco_curs_close() and destroy
- does only some extra cleanup.
-
-2001-05-03 Michele Comitini <mcm@initd.net>
-
- * ZPsycopgDA/db.py: Some cleanup to bring the zope product up to
- date with the python module. Some bugs found thanks to Andre
- Schubert. Now the ZDA should rely on the new serialized version
- of psycopg.
-
- * cursor.c: while looking for problems in the ZDA some come out
- here, with the inability to handle dropping connection correctly.
- This leads to segfaults and is not fixed yet for lack of time.
- Some problems found in cursors not willing to share the same
- connection even if they should. Hopefully it should be fixed
- soon.
-
-2001-04-26 Federico Di Gregorio <fog@debian.org>
-
- * fixed bug reported by Andre Schubert by adding a new cast
- function for long integers (int8 postgresql type.) at now they are
- converted to python LongIntegers: not sure f simply convert to
- floats.
-
- * michele applied patch from Ivo van der Wijk to make zpsycopgda
- behave better when INSTANCE_HOME != SOFTWARE_HOME.
-
- * cursor.c (_psyco_curs_execute): also fill the 'columns' field.
-
- * module.h: added a 'columns' field to cursobject, to better
- support the new dictionary fetch functions (dictfetchone(),
- dictfetchmany(), dictfetchall().)
-
- * cursor.c: added the afore-mentioned functions (function names
- are not definitive, they will follow decisions on the DBAPI SIG.)
-
-2001-04-03 Federico Di Gregorio <fog@debian.org>
-
- * Release 0.5.1.
-
- * mcm fixed a nasty bug by correcting a typo in module.h.
-
-2001-03-30 Federico Di Gregorio <fog@debian.org>
-
- * module.c (psyco_connect): added `serialized' named argument to
- the .connect() method (takes 1 or 0 and initialize the connection
- to the right serialization state.)
-
- * Makefile.pre.in (dist): fixed little bug, a missing -f argument
- to rm.
-
- * examples/thread_test.py: removed all extension cruft.
-
- * examples/thread_test_x.py: this one uses extensions like the
- per-cursor commit, autocommit, etc.
-
- * README (psycopg): added explanation on how .serialize() works.
-
- * connection.c (psyco_conn_serialize): added cursor serialization
- and .serialize() method on the connection object. now we are
- definitely DBAPI-2.0 compliant.
-
-2001-03-20 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (_psyco_curs_execute): replaced some fields in
- description with None, as suggested on the DB-SIG ML.
-
- * something like one hundred of little changes to allow cursors
- share the same postgres connection. added connkeeper object and
- pthread mutexes (both in connobject and connkeeper.) apparently it
- works. this one will be 0.5.0, i think.
-
-2001-03-19 Michele Comitini <mcm@initd.net>
-
- * cursor.c: added mutexes, they do not interact well with python
- threads :(.
-
-2001-03-16 Michele Comitini <mcm@initd.net>
-
- * ZPsycopgDA/db.py (ZDA): some fixes in table browsing.
-
-2001-03-16 Federico Di Gregorio <fog@debian.org>
-
- * suite/tables.postgresql (TABLE_DESCRIPTIONS): fixed some typos
- introduced by copying by hand the type values from pg_type.h.
-
- * suite/*: added some (badly) structured code to test for
- DBAPI-2.0 compliance.
-
- * cursor.c (pgconn_notice_callback): now the NOTICE processor only
- prints NOTICEs when psycopg has been compiled with the
- --enable-devel switch.
-
- * connection.c: removed 'autocommit' attribute, now is a method as
- specified in the DBAPI-2.0 document.
-
-2001-03-15 Federico Di Gregorio <fog@debian.org>
-
- * connection.c (curs_commitall): splitted for cycle in two to
- avoid the "bad snapshot" problem.
-
-2001-03-14 Federico Di Gregorio <fog@debian.org>
-
- * Release 0.4.6.
-
- * cursor.c (_psyco_curs_execute): fixed nasty bug, there was an
- free(query) left from before the execute/callproc split.
-
- * Preparing for 0.4.6.
-
-2001-03-13 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (psyco_curs_execute): fixed some memory leaks in
- argument parsing (the query string was not free()ed.)
- (psyco_curs_callproc): implemented callproc() method on cursors.
- (_psyco_curs_execute): this is the function that does the real
- stuff for callproc() and execute().
- (pgconn_notice_*): added translation of notices into python
- exceptions (do we really want that?)
-
- * configure.in: removed some cruft (old comments and strncasecmp()
- check)
-
-2001-03-12 Federico Di Gregorio <fog@debian.org>
-
- * examples/thread_test.py: added moronic argument parsing: now you
- can give the dsn string on the command line... :(
-
- * Release 0.4.5.
-
-2001-03-10 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (request_pgconn): added code to set datestyle to ISO on
- new connections (many thanks to Yury <yura@vpcit.ru> for the code,
- i changed it just a little bit to raise an exception on error.)
-
-2001-03-09 Federico Di Gregorio <fog@debian.org>
-
- * Release 0.4.4.
-
- * ZPsycopgDA/db.py: michele fixed a nasty bug here.
-
-2001-03-08 Federico Di Gregorio <fog@debian.org>
-
- * Release 0.4.3.
-
-2001-03-07 Federico Di Gregorio <fog@debian.org>
-
- * Makefile.pre.in (dist): typeobj_builtins.c included for people
- without pg_type.h. if you encounter type-casting problems like
- results cast to the wrong type, simply "rm typeobj_builtins.c" and
- rebuild.
-
- * typeobj.c (psyco_*_cast): removed RETURNIFNULL() macro from all
- the builtin casting functions. (psyco_STRING_cast) does not create
- a new string anymore, simply Py_INCREF its argument and return it.
-
- * cursor.c (psyco_curs_fetchone): removed strdup() call. added
- PQgetisnull() test to differentiate between real NULLs and empty
- strings.
-
- * Removed cursor.py (mcm, put tests in examples) and fixed some
- typos in the dtml code.
-
-2001-03-04 Michele Comitini <mcm@initd.net>
-
- * examples/commit_test.py: Modifications to test argument passing
- and string substitution to cursor functions, nothing more.
-
- * ZPsycopgDA/db.py: now it exploits some of the good features of
- the psycopg driver, such as connection reusage and type
- comparison. Code is smaller although it handles (and
- reports) errors much better.
-
- * cursor.c: corrected a bug that left a closed cursor in the
- cursor list of the connection. Now cursors are removed from the
- lists either when they are close or when they are destroyed.
- Better connection (TCP) error reporting and handling.
-
-
-2001-03-02 Federico Di Gregorio <fog@debian.org>
-
- * examples commit_test.py: added code to test autocommit.
-
- * examples/thread_test.py (ab_select): modified select thread to
- test autocommit mode.
-
- * Release 0.4.1.
-
- * module.h, connection.c, cursor.c: added autocommit support.
-
-2001-02-28 Federico Di Gregorio <fog@debian.org>
-
- * Release 0.4.
-
-2001-02-27 Michele Comitini <mcm@initd.net>
-
- * cursor.py: cut some unuseful code in psyco_curs_fetchmany() and
- psyco_curs_fetchall() inserted an assert in case someting goes
- wrong.
-
-2001-02-27 Federico Di Gregorio <fog@debian.org>
-
- * debian/*: various changes to build both the python module and
- the zope db adapter in different packages (respectively
- python-psycopg and zope-psycopgda.)
-
- * examples/type_test.py: better and more modular tests.
-
- * typeobj.c: added DATE, TIME, DATETIME, BOOLEAN, BINARY and ROWID
- types. (RETURNIFNULL) added NULL-test to builtin conversion
- functions (using the RETURNIFNULL macro.)
-
-2001-02-26 Federico Di Gregorio <fog@debian.org>
-
- * releasing 0.3 (added NEWS file.)
-
-2001-02-26 Michele Comitini <mcm@initd.net>
-
- * cursor.c: fetchmany() some cleanup done.
-
- * ZPsycopgDA/db.py, ZPsycopgDA/__init__.py, : fixes to make the
- ZDA work some way. WARNING WARNING WARNING the zda is still
- alpha code, but we need some feed back on it so please give it
- a try.
-
-2001-02-26 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c (psyco_STRING_cast): fixed bad bad bad bug. we
- returned the string without coping it and the type-system was more
- than happy to Py_DECREF() it and trash the whole system. fixed at
- last!
-
- * module.h (Dprintf): added pid to every Dprintf() call, to
- facilitate multi-threaded debug.
-
-2001-02-26 Michele Comitini <mcm@initd.net>
-
- * module.c: added code so that DateTime package need not to be
- loaded to have mxDateTime. This should avoid clashing with
- DateTime from the zope distribution.
-
- * cursor.c: setting error message in fetchmany when no more tuples
- are left. This has to be fixed in fetch and fetchall to.
-
-2001-02-26 Federico Di Gregorio <fog@debian.org>
-
- * configure.in: stepped up version to 0.3, ready to release
- tomorrow morning. added check for path to DateTime module.
-
- * examples/usercast_test.py: generate some random boxes and
- points, select the boxes with at least one point inside and print
- them converting the PostgeSQL output using a user-specified cast
- object. nice.
-
-2001-02-24 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (psyco_curs_fetchone): now an error in the python
- callback when typecasting results raise the correct exception.
-
- * typeobj.c (psyco_DBAPITypeObject_call): removed extra Py_INCREF().
-
-2001-02-23 Federico Di Gregorio <fog@debian.org>
-
- * replaced every single instance of the string 'pgpy' with 'psyco'
- (this was part of the general cleanup.)
-
- * type_test.py: added this little test program to the distribution
- (use the new_type() method to create new instances of the type
- objects.)
-
- * typeobj.c: general cleanup. fixed some bugs related to
- refcounting (again!)
-
- * cursor.c: general cleanup. (request_pgconn) simplified by adding
- a support function (_extract_pgconn.)
-
- * connection.c: general cleanup. replaced some ifs with asserts()
- in utility functions when errors depend on programming errors and
- not on runtime exceptions. (pgpy_conn_destroy) fixed little bug
- when deleting available connections from the list.
-
- * module.h: general cleanup.
-
- * typeobj.h: general cleanup, better comments, made some function
- declarations extern.
-
- * module.c: general cleanup, double-checked every function for
- memory leaks. (pgpy_connect) removed unused variable 'connection'.
-
-2001-02-22 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c: fixed lots of bugs, added NUMBER type object. now the
- basic tests in type_test.py work pretty well.
-
- * cursor.c (pgpy_curs_fetchmany): fixed little bug, fetchmany()
- reported one less row than available.
-
- * fixed lots of bugs in typeobj.c, typeobj.h, cursor.c. apparently
- now the type system works. it is time to clean up things a little
- bit.
-
-2001-02-21 Federico Di Gregorio <fog@debian.org>
-
- * typeobj.c: separated type objects stuff from module.c
-
- * typeobj.h: separated type objects stuff from module.h
-
-2001-02-19 Federico Di Gregorio <fog@debian.org>
-
- * cursor.c (pgpy_curs_fetchmany): now check size and adjust it to
- be lesser or equal than the nuber of available rows.
-
-2001-02-18 Michele Comitini <mcm@initd.net>
-
- * module.c, module.h: added optional args maxconn and minconn to
- connection functions
-
- * cursor.c: better error checking in request_pgconn.
-
- * connection.c: changed new_connect_obj to take as optional args
- maxconn and minconn. Added the corresponding ro attributes to
- connection objects.
-
- * cursor.py: added some code to stress test cursor reusage.
-
- * cursor.c: some fixes on closed cursors.
-
- * connection.c: corrections on some assert calls.
-
-2001-02-16 Federico Di Gregorio <fog@debian.org>
-
- * configure.in: added --enable-priofile sqitch. changed VERSION to
- 0.2: preparing for a new release.
-
- * cursor.c: added a couple of asserts.
-
-2001-02-16 Michele Comitini <mcm@initd.net>
-
- * cursor.c, connection.c: fixed the assert problem: assert must
- take just the value to be tested! no assignemente must be done in
- the argument of assert() otherwise is wiped when NDEBUG is set.
-
- * module.h: some syntax error fixed. Error in allocating a tuple
- corrected in macro DBAPITypeObject_NEW().
-
- * module.c: pgpy_DBAPITypeObject_init() is not declared static anymore.
-
- * cursor.c: executemany() now does not create and destroy tuples
- for each list item, so it is much faster.
-
-2001-02-14 Michele Comitini <mcm@initd.net>
-
- * cursor.c: added again Py_DECREF on the cpcon after disposing
- it. assert() with -DNDEBUG makes the driver segfault while it
- should not.
-
-
-2001-02-13 Federico Di Gregorio <fog@debian.org>
-
- * some of the memory leak were memprof errors, bleah. resumed some
- old code, fixed segfault, fixed other bugs, improved speed. almost
- ready for a new release.
-
- * connection.c (pgpy_conn_destroy): replaced some impossible ifs
- with aseert()s.
-
- * cursor.c (pgpy_curs_close): added Py_DECREF() to
- self->descritpion to prevent a memory leak after an execute().
-
- * connection.c (pgpy_conn_destroy): always access first element of
- lists inside for cycles because removing items from the list makes
- higher indices invalid.
-
- * cursor.c (dispose_pgconn): fixed memory leak, there was a
- missing Py_DECREF() after the addition of the C object wrapping
- the postgresql connection to the list of available connections.
-
- * cursor.c (dispose_pgconn): fixed another memory leak: an
- orphaned cursor should call PQfinish() on its postgresql
- connection because it has no python connection to give the
- postgresql ine back.
-
- * cursor.c (pgpy_curs_execute): added Py_DECREF() of description
- tuple after adding it to self->description. this one fixes the
- execute() memory leak.
-
- * cursor.c (pgpy_curs_fetchall): added missing Py_DECREF() on row
- data (obtained from fetchone().) this fixes the last memory leak.
- (thread_test.py now runs without leaking memory!)
-
-2001-02-12 Federico Di Gregorio <fog@debian.org>
-
- * INSTALL: removed wok cruft from head of this file.
-
- * debian/rules: debianized the sources. python-psycopg is about to
- enter debian. mxDateTime header locally included until the
- maintainer of python-mxdatetime includes them in his package
- (where they do belong.)
-
- * autogen.sh: added option --dont-run-configure.
-
-2001-02-09 Federico Di Gregorio <fog@debian.org>
-
- * module.c (initpsycopg): changed name of init function to match
- new module name (also changed all the exception definitions.)
-
- * README: updated psycopg description (we have a new name!)
-
- * Ready for 0.1 release.
-
-2001-02-07 Michele Comitini <mcm@initd.net>
-
- * cursor.c: now executemany takes sequences and not just
- tuples
-
-2001-02-07 Federico Di Gregorio <fog@debian.org>
-
- * Makefile.pre.in: now dist target includes test programs
- (thread_test.py) and README and INSTALL files.
-
- * configure.in: changed --with-devel to --enable-devel. little
- cosmetical fixes to the option management.
-
- * connection.c, module.c, cursor.c, module.h: removed 'postgres/'
- from #include directive. it is ./configure task to find the right
- directory.
-
- * thread_test.py: added thread testing program.
-
-2001-02-07 Michele Comitini <mcm@initd.net>
-
- * cursor.c: added code to allow threads during PQexec() calls.
-
- * cursor.c: added begin_pgconn to rollback() and commit()
- so that the cursror is not in autocommit mode.
-
- * cursor.c: added rollback() and commit() methods to cursor
- objects.
-
-
-2001-02-07 Federico Di Gregorio <fog@debian.org>
-
- * connection.c (pgpy_conn_destroy): always delete item at index
- 0 and not i (because items shift in the list while deleting and
- accessing items at len(list)/2 segfaults.)
-
-2001-02-07 Michele Comitini <mcm@initd.net>
-
- * connection.c: added some more checking to avoid
- clearing of already cleared pgresults. Calling curs_closall()
- in conn_destroy() since cursors have to live even without
- their parent connection, otherwise explicit deletion of
- object referencing to those cursors can cause arbitrary code
- to be executed.
-
- * cursor.c: some more checking to avoid trying to close
- already close pgconnections.
-
-2001-02-06 Federico Di Gregorio <fog@debian.org>
-
- * Makefile.pre.in (CFLAGS): added -Wall to catch bad programming
- habits.
-
- * cursor.c, connection.c: lots of fixes to the destroy stuff. now
- all the cursor are destroyed *before* the connection goes away.
-
- * cursor.c (request_pgconn): another idiot error done by not
- replacing dsn with owner_conn->dsn. fixed.
- (dispose_pgconn): commented if to guarantee that the connection is
- returned to the pool of available connections.
-
- * merged changes done by mcm.
-
- * cursor.c: general cleanup and better debugging/error
- messages. changed xxx_conn into xxx_pgconn where still
- missing. some pretty big changes to the way pgconn_request()
- allocates new connections.
-
- * connection.c: removed all 'register' integers. obsolete, gcc
- does a much better job optimizing cycles than a programmer
- specifying how to use registers.
-
- * module.h: some general cleanup and better definition of DPrintf
- macro. now the DEBUG variable can be specified at configure time by
- the --with-devel switch to ./configure.
-
-2001-02-02 Michele Comitini <mcm@initd.net>
-
- * cursor.c (Repository): Added functions for managing a connection
- pool. Segfaults.
-
- * configure.in (Repository): removed check for mxdatetime headers.
-
-2001-01-24 Federico Di Gregorio <fog@debian.org>
-
- * first checkout from shinning new init.d cvs.
-
- * autotoolized build system. note that the mx headers are missing
- from the cvs, you should get them someplace else (this is the
- right way to do it, just require the headers in the configure
- script.)
-
-2001-01-21 Michele Comitini <mcm@initd.net>
-
- * cursor.c (Repository): commit, abort, begin functions now check
- the right exit status of the command.
-
- * connection.c (Repository): working commit() and rollback()
- methods.
-
-2001-01-20 Michele Comitini <mcm@initd.net>
-
- * module.h (Repository): added member to cursor struct to handle
- queries without output tuples.
-
- * cursor.c (Repository): new working methods: executemany,
- fetchone, fetchmany, fetchall.
-
-2001-01-18 Michele Comitini <mcm@initd.net>
-
- * cursor.c (Repository): close working. destroy calling close.
- close frees pg structures correctly.
-
- * connection.c (Repository): close method working. destroy seems
- working.
-
-2001-01-17 Michele Comitini <mcm@initd.net>
-
- * cursor.c (Repository): now each python cursor has its own
- connection. Each cursor works in a transaction block.
-
- * connection.c (Repository): added cursor list to connection
- object
-
-2001-01-14 Michele Comitini <mcm@initd.net>
-
- * cursor.c (Repository): Beginning of code to implement cursor
- functionalities as specified in DBA API 2.0, through the use of
- transactions not cursors.
-
- * connection.c (Repository): Added some error checking code for pg
- connection (will be moved to cursor?).
-
-2001-01-13 Michele Comitini <mcm@initd.net>
-
- * connection.c (Repository): Added error checking in connection
- code to fail if connection to the db could not be opened.
-
- * module.h (Repository): New macro to help creating
- DBAPITypeObjects.
-
- * module.c (Repository): DBAPITypeObject __cmp__ function is now
- very simplified using recursion.
-
- * module.h (Repository): "DBAPIObject" changed to
- "DBAPITypeObject".
-
- * module.c (Repository): Fixes for coerce function of DBAPIObjects
- by Federico Di Gregorio <fog@initd.net>.
- (Repository): Clean up and better naming for DBAPITypeObjects.
-
-2001-01-08 Michele Comitini <mcm@initd.net>
-
- * module.c (Repository): Corrected the exception hierarcy
-
- * connection.c (Repository): Begun to use the connection objects
- of libpq
-
-2001-01-07 Michele Comitini <mcm@initd.net>
-
- * module.c (Repository): Added the Date/Time functions.
-
-2001-01-06 Michele Comitini <mcm@initd.net>
-
- * cursor.c (Repository): Skeleton of cursor interface. All
- methods and attributes of cursor objects are now available
- in python. They do nothing now.
-
-2001-01-05 Michele Comitini <mcm@initd.net>
-
- * module.c (Repository): Test version; module loaded with
- exception defined.
-
-2001-01-05 Michele Comitini <mcm@initd.net>
-
- * Setup.in (Repository): Setup file.
-
- * Makefile.pre.in (Repository): from the python source.
-
-2001-01-05 Michele Comitini <mcm@initd.net>
-
- * module.c: Written some code for defining exceptions.
-
- * module.h: Static variable for exceptions.
-
-2001-01-04 Michele Comitini <mcm@initd.net>
-
- * Changelog: pre-release just a few prototypes to get started.
-
-
+++ /dev/null
-General information
-*******************
-
-Some help to people wanting to hack on psycopg. First of all, note that
-*every* function in the psycopg module source code is prefixed by one of the
-following words:
-
- psyco is used for function directly callable from python (i.e., functions
- in the psycopg module itself.) the only notable exception is the
- source code for the module itself, that uses "psyco" even for C-only
- functions.
-
- conn is used for functions related to connection objects.
-
- curs is used for functions related to cursor objects.
-
- typecast is used for typecasters and utility function related to
- typecaster creation and registration.
-
-Pythonic definition of types and functions available from python are defined
-in *_type.c files. Internal functions, callable only from C are located in
-*_int.c files and extensions to the DBAPI can be found in the *_ext.c files.
-
-
-Patches
-*******
-
-If you submit a patch, please send a diff generated with the "-u" switch.
-Also note that I don't like that much cosmetic changes (like renaming
-already existing variables) and I will rewrap the patch to 78 columns
-anyway, so it is much better if you do that beforehand.
-
-
-The type system
-***************
-
-Simple types, like integers and strings, are converted to python base types
-(the conversion functions are in typecast_base.c). Complex types are
-converted to ad-hoc types, defined in the typeobj_*.{c,h} files. The
-conversion function are in the other typecast_*.c files. typecast.c defines
-the basic utility functions (available through the psycopg module) used when
-defining new typecasters from C and python.
-
+++ /dev/null
-From: Jack Moffitt <jack@xiph.org>
-To: Psycopg Mailing List <psycopg@lists.initd.org>
-Subject: Re: [Psycopg] preparing for 1.0
-Date: 22 Oct 2001 11:16:21 -0600
-
-www.vorbis.com is serving from 5-10k pages per day with psycopg serving
-data for most of that.
-
-I plan to use it for several of our other sites, so that number will
-increase.
-
-I've never had a single problem (that wasn't my fault) besides those
-segfaults, and those are now gone as well, and I've been using psycopg
-since June (around 0.99.2?).
-
-jack.
-
-
-From: Yury Don <gercon@vpcit.ru>
-To: Psycopg Mailing List <psycopg@lists.initd.org>
-Subject: Re: [Psycopg] preparing for 1.0
-Date: 23 Oct 2001 09:53:11 +0600
-
-We use psycopg and psycopg zope adapter since fisrt public
-release (it seems version 0.4). Now it works on 3 our sites and in intranet
-applications. We had few problems, but all problems were quckly
-solved. The strong side of psycopg is that it's code is well organized
-and easy to understand. When I found a problem with non-ISO datestyle in first
-version of psycopg, it took for me 15 or 20 minutes to learn code and
-to solve the problem, even thouth my knowledge of c were poor.
-
-BTW, segfault with dictfetchall on particular data set (see [Psycopg]
-dictfetchXXX() problems) disappeared in 0.99.8pre2.
-
---
-Best regards,
-Yury Don
-
-
-From: Tom Jenkins <tjenkins@devis.com>
-To: Federico Di Gregorio <fog@debian.org>
-Cc: Psycopg Mailing List <psycopg@lists.initd.org>
-Subject: Re: [Psycopg] preparing for 1.0
-Date: 23 Oct 2001 08:25:52 -0400
-
-The US Govt Department of Labor's Office of Disability Employment
-Policy's DisabilityDirect website is run on zope and zpsycopg.
-
-
-From: Scott Leerssen <sleerssen@racemi.com>
-To: Federico Di Gregorio <fog@debian.org>
-Subject: Re: [Psycopg] preparing for 1.0
-Date: 23 Oct 2001 09:56:10 -0400
-
-Racemi's load management software infrastructure uses psycopg to handle
-complex server allocation decisions, plus storage and access of
-environmental conditions and accounting records for potentially
-thousands of servers. Psycopg has, to this point, been the only
-Python/PostGreSQL interface that could handle the scaling required for
-our multithreaded applications.
-
-Scott
-
-
-From: Andre Schubert <andre.schubert@geyer.kabeljournal.de>
-To: Federico Di Gregorio <fog@debian.org>
-Cc: Psycopg Mailing List <psycopg@lists.initd.org>
-Subject: Re: [Psycopg] preparing for 1.0
-Date: 23 Oct 2001 11:46:07 +0200
-
-i have changed the psycopg version to 0.99.8pre2 on all devel-machines
-and all segfaults are gone. after my holiday i wil change to 0.99.8pre2
-or 1.0 on our production-server.
-this server contains several web-sites which are all connected to
-postgres over ZPsycopgDA.
-
-thanks as
-
-
-From: Fred Wilson Horch <fhorch@ecoaccess.org>
-To: <psycopg@lists.initd.org>
-Subject: [Psycopg] Success story for psycopg
-Date: 23 Oct 2001 10:59:17 -0400
-
-Due to various quirks of PyGreSQL and PoPy, EcoAccess has been looking for
-a reliable, fast and relatively bug-free Python-PostgreSQL interface for
-our project.
-
-Binary support in psycopg, along with the umlimited tuple size in
-PostgreSQL 7.1, allowed us to quickly prototype a database-backed file
-storage web application, which we're using for file sharing among our
-staff and volunteers. Using a database backend instead of a file system
-allows us to easily enrich the meta-information associated with each file
-and simplifies our data handling routines.
-
-We've been impressed by the responsiveness of the psycopg team to bug
-reports and feature requests, and we're looking forward to using psycopg
-as the Python interface for additional database-backed web applications.
-
-Keep up the good work!
---
-Fred Wilson Horch mailto:fhorch@ecoaccess.org
-Executive Director, EcoAccess http://ecoaccess.org/
-
-
-From: Damon Fasching <fasching@design.lbl.gov>
-To: Michele Comitini <mcm@glisco.it>
-Cc: fog@debian.org
-Subject: Re: How does one create a database within Python using psycopg?
-Date: 25 Feb 2002 17:39:41 -0800
-
-[snip]
-btw I checked out 4 different Python-PostgreSQL packages. psycopg is the
-only one which built and imported w/o any trouble! (At least for me.)
+++ /dev/null
-TODO list for psycopg 2 or later
-********************************
-
-Move items to the DONE section only after writing a test for the
-implementation. Also add a note on how the item was resolved.
-(Obviously I was joking about the test..)
-
-* Find a better way to compile the type-casting code instead of including it
- in typecast.c directy. (Including is not that bad, but the need to touch
- psycopg/typecast.c every time is bad bad bad.)
-
-* executemany() should _not_ take the async flag, remove it and force multiple
- queries to be synchronous.
-
-* Fix all the docstrings.
-
-* Support the protocols API fully.
-
-* Unify the common code in typecast_datetime.c and typecast_mxdatetime.c.
-
-* Port typecasters to new-style classes.
-
-* Write a complete postgresql<->python encodings table.
-
-* Implement binary typecasters (should be easy, but it will take time.)
-
-DONE
-====
-
-* Convert type-casters to new-style types in Python 2.2+.
-
-* callproc() never worked, fix it or remove it and raise right exception.
- [Removed callproc code, now an exception is raised.]
+++ /dev/null
-/* Based on the Epydoc "default.css"\r
-** with some missing reST-related classes\r
-** and Python syntax support (from SilverCity)\r
-*/\r
-\r
-/* Body color */ \r
-body { background: #ffffff; color: #000000; } \r
- \r
-/* Tables */ \r
-table.summary, table.details, table.index\r
- { background: #e8f0f8; color: #000000; } \r
-tr.summary, tr.details, tr.index\r
- { background: #70b0f0; color: #000000; \r
- text-align: left; font-size: 120%; } \r
-tr.group { background: #c0e0f8; color: #000000;\r
- text-align: left; font-size: 120%;\r
- font-style: italic; } \r
-\r
-/* Documentation page titles */\r
-h2.module { margin-top: 0.2em; }\r
-h2.class { margin-top: 0.2em; }\r
- \r
-/* Headings */\r
-h1.heading { font-size: +140%; font-style: italic;\r
- font-weight: bold; }\r
-h2.heading { font-size: +125%; font-style: italic;\r
- font-weight: bold; }\r
-h3.heading { font-size: +110%; font-style: italic;\r
- font-weight: normal; }\r
- \r
-/* Base tree */\r
-pre.base-tree { font-size: 80%; margin: 0; }\r
-\r
-/* TOC */\r
-p.toc { margin: 0; }\r
-\r
-/* Details Sections */\r
-table.func-details { background: #e8f0f8; color: #000000;\r
- border: 2px groove #c0d0d0;\r
- padding: 0 1em 0 1em; margin: 0.4em 0 0 0; }\r
-h3.func-detail { background: transparent; color: #000000;\r
- margin: 0 0 1em 0; }\r
-\r
-table.var-details { background: #e8f0f8; color: #000000;\r
- border: 2px groove #c0d0d0;\r
- padding: 0 1em 0 1em; margin: 0.4em 0 0 0; }\r
-h3.var-details { background: transparent; color: #000000;\r
- margin: 0 0 1em 0; }\r
-\r
-/* Function signatures */\r
-.sig { background: transparent; color: #000000;\r
- font-weight: bold; } \r
-.sig-name { background: transparent; color: #006080; } \r
-.sig-arg, .sig-kwarg, .sig-vararg\r
- { background: transparent; color: #008060; } \r
-.sig-default { background: transparent; color: #602000; } \r
-.summary-sig { background: transparent; color: #000000; } \r
-.summary-sig-name { background: transparent; color: #204080; }\r
-.summary-sig-arg, .summary-sig-kwarg, .summary-sig-vararg\r
- { background: transparent; color: #008060; } \r
-\r
-/* Doctest blocks */\r
-.py-src { background: transparent; color: #000000; }\r
-.py-prompt { background: transparent; color: #005050;\r
- font-weight: bold;}\r
-.py-string { background: transparent; color: #006030; }\r
-.py-comment { background: transparent; color: #003060; }\r
-.py-keyword { background: transparent; color: #600000; }\r
-.py-output { background: transparent; color: #404040; }\r
-div.code-block,\r
-pre.literal-block,\r
-pre.doctestblock { background: #f4faff; color: #000000; \r
- padding: .5em; margin: 1em;\r
- border: 1px solid #708890; }\r
-table pre.doctestblock\r
- { background: #dce4ec; color: #000000; \r
- padding: .5em; margin: 1em;\r
- border: 1px solid #708890; }\r
-div.code-block { font-family: monospace; }\r
-\r
-/* Variable values */\r
-pre.variable { background: #dce4ec; color: #000000;\r
- padding: .5em; margin: 0;\r
- border: 1px solid #708890; }\r
-.variable-linewrap { background: transparent; color: #604000; }\r
-.variable-ellipsis { background: transparent; color: #604000; }\r
-.variable-quote { background: transparent; color: #604000; }\r
-.re { background: transparent; color: #000000; }\r
-.re-char { background: transparent; color: #006030; }\r
-.re-op { background: transparent; color: #600000; }\r
-.re-group { background: transparent; color: #003060; }\r
-.re-ref { background: transparent; color: #404040; }\r
-\r
-/* Navigation bar */ \r
-table.navbar { background: #a0c0ff; color: #0000ff;\r
- border: 2px groove #c0d0d0; }\r
-th.navbar { background: #a0c0ff; color: #0000ff; } \r
-th.navselect { background: #70b0ff; color: #000000; } \r
-.nomargin { margin: 0; }\r
-\r
-/* Links */ \r
-a:link { background: transparent; color: #0000ff; } \r
-a:visited { background: transparent; color: #204080; } \r
-a.navbar:link { background: transparent; color: #0000ff; \r
- text-decoration: none; } \r
-a.navbar:visited { background: transparent; color: #204080; \r
- text-decoration: none; } \r
-\r
-/* Admonitions */\r
-div.warning,\r
-div.note { background-color: #c0e0f8;\r
- border: thin solid black;\r
- padding: 1em;\r
- margin-left: 1em;\r
- margin-right: 1em; }\r
-div.warning .first,\r
-div.note .first { font-family: sans-serif;\r
- font-size: 110%;\r
- margin-right: 0.5em; }\r
-\r
-/* Lists */\r
-ul { margin-top: 0; }\r
-\r
-/* Python syntax */\r
-.p_character { color: olive; }\r
-.p_classname { color: blue; font-weight: bold; }\r
-.p_commentblock {color: gray; font-style: italic; }\r
-.p_commentline { color: green; font-style: italic; }\r
-.p_default {}\r
-.p_defname { color: #009999; font-weight: bold; }\r
-.p_identifier { color: black; }\r
-.p_number { color: #009999; }\r
-.p_operator { color: black; }\r
-.p_string { color: #7F007F; }\r
-.p_stringeol { color: #7F007F; }\r
-.p_triple { color: #7F0000; }\r
-.p_tripledouble { color: #7F0000; }\r
-.p_word { color: navy; font-weight: bold; }\r
+++ /dev/null
-/* Based on the Epydoc "default.css"\r
-** with some missing reST-related classes\r
-** and Python syntax support (from SilverCity)\r
-*/\r
-\r
-/* Body color */ \r
-body { background: #ffffff; color: #000000; } \r
- \r
-/* Tables */ \r
-table.summary, table.details, table.index\r
- { background: #e8f0f8; color: #000000; } \r
-tr.summary, tr.details, tr.index\r
- { background: #70b0f0; color: #000000; \r
- text-align: left; font-size: 120%; } \r
-tr.group { background: #c0e0f8; color: #000000;\r
- text-align: left; font-size: 120%;\r
- font-style: italic; } \r
-\r
-/* Documentation page titles */\r
-h2.module { margin-top: 0.2em; }\r
-h2.class { margin-top: 0.2em; }\r
- \r
-/* Headings */\r
-h1.heading { font-size: +140%; font-style: italic;\r
- font-weight: bold; }\r
-h2.heading { font-size: +125%; font-style: italic;\r
- font-weight: bold; }\r
-h3.heading { font-size: +110%; font-style: italic;\r
- font-weight: normal; }\r
- \r
-/* Base tree */\r
-pre.base-tree { font-size: 80%; margin: 0; }\r
-\r
-/* TOC */\r
-p.toc { margin: 0; }\r
-\r
-/* Details Sections */\r
-table.func-details { background: #e8f0f8; color: #000000;\r
- border: 2px groove #c0d0d0;\r
- padding: 0 1em 0 1em; margin: 0.4em 0 0 0; }\r
-h3.func-detail { background: transparent; color: #000000;\r
- margin: 0 0 1em 0; }\r
-\r
-table.var-details { background: #e8f0f8; color: #000000;\r
- border: 2px groove #c0d0d0;\r
- padding: 0 1em 0 1em; margin: 0.4em 0 0 0; }\r
-h3.var-details { background: transparent; color: #000000;\r
- margin: 0 0 1em 0; }\r
-\r
-/* Function signatures */\r
-.sig { background: transparent; color: #000000;\r
- font-weight: bold; } \r
-.sig-name { background: transparent; color: #006080; } \r
-.sig-arg, .sig-kwarg, .sig-vararg\r
- { background: transparent; color: #008060; } \r
-.sig-default { background: transparent; color: #602000; } \r
-.summary-sig { background: transparent; color: #000000; } \r
-.summary-sig-name { background: transparent; color: #204080; }\r
-.summary-sig-arg, .summary-sig-kwarg, .summary-sig-vararg\r
- { background: transparent; color: #008060; } \r
-\r
-/* Doctest blocks */\r
-.py-src { background: transparent; color: #000000; }\r
-.py-prompt { background: transparent; color: #005050;\r
- font-weight: bold;}\r
-.py-string { background: transparent; color: #006030; }\r
-.py-comment { background: transparent; color: #003060; }\r
-.py-keyword { background: transparent; color: #600000; }\r
-.py-output { background: transparent; color: #404040; }\r
-div.code-block,\r
-pre.literal-block,\r
-pre.doctestblock { background: #f4faff; color: #000000; \r
- padding: .5em; margin: 1em;\r
- border: 1px solid #708890; }\r
-table pre.doctestblock\r
- { background: #dce4ec; color: #000000; \r
- padding: .5em; margin: 1em;\r
- border: 1px solid #708890; }\r
-div.code-block { font-family: monospace; }\r
-\r
-/* Variable values */\r
-pre.variable { background: #dce4ec; color: #000000;\r
- padding: .5em; margin: 0;\r
- border: 1px solid #708890; }\r
-.variable-linewrap { background: transparent; color: #604000; }\r
-.variable-ellipsis { background: transparent; color: #604000; }\r
-.variable-quote { background: transparent; color: #604000; }\r
-.re { background: transparent; color: #000000; }\r
-.re-char { background: transparent; color: #006030; }\r
-.re-op { background: transparent; color: #600000; }\r
-.re-group { background: transparent; color: #003060; }\r
-.re-ref { background: transparent; color: #404040; }\r
-\r
-/* Navigation bar */ \r
-table.navbar { background: #a0c0ff; color: #0000ff;\r
- border: 2px groove #c0d0d0; }\r
-th.navbar { background: #a0c0ff; color: #0000ff; } \r
-th.navselect { background: #70b0ff; color: #000000; } \r
-.nomargin { margin: 0; }\r
-\r
-/* Links */ \r
-a:link { background: transparent; color: #0000ff; } \r
-a:visited { background: transparent; color: #204080; } \r
-a.navbar:link { background: transparent; color: #0000ff; \r
- text-decoration: none; } \r
-a.navbar:visited { background: transparent; color: #204080; \r
- text-decoration: none; } \r
-\r
-/* Admonitions */\r
-div.warning,\r
-div.note { background-color: #c0e0f8;\r
- border: thin solid black;\r
- padding: 1em;\r
- margin-left: 1em;\r
- margin-right: 1em; }\r
-div.warning .first,\r
-div.note .first { font-family: sans-serif;\r
- font-size: 110%;\r
- margin-right: 0.5em; }\r
-\r
-/* Lists */\r
-ul { margin-top: 0; }\r
-\r
-/* Python syntax */\r
-.p_character { color: olive; }\r
-.p_classname { color: blue; font-weight: bold; }\r
-.p_commentblock {color: gray; font-style: italic; }\r
-.p_commentline { color: green; font-style: italic; }\r
-.p_default {}\r
-.p_defname { color: #009999; font-weight: bold; }\r
-.p_identifier { color: black; }\r
-.p_number { color: #009999; }\r
-.p_operator { color: black; }\r
-.p_string { color: #7F007F; }\r
-.p_stringeol { color: #7F007F; }\r
-.p_triple { color: #7F0000; }\r
-.p_tripledouble { color: #7F0000; }\r
-.p_word { color: navy; font-weight: bold; }\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"\r
- "DTD/xhtml1-frameset.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title> API Documentation </title>\r
-</head>\r
-<frameset cols="20%,80%">\r
- <frameset rows="30%,70%">\r
- <frame src="public/toc.html" name="moduleListFrame" id="moduleListFrame" />\r
- <frame src="public/toc-everything.html" name="moduleFrame" id="moduleFrame" />\r
- </frameset>\r
- <frame src="public/psycopg2-module.html" name="mainFrame" id="mainFrame" />\r
-</frameset>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>__builtin__.list</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Module __builtin__ ::\r
- Class list\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/__builtin__.list-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="__builtin__.list-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type list</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">list</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.extras.DictRow-class.html"><code>DictRow</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>list() -> new list\r
-list(sequence) -> new list initialized from sequence's items</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__add__"></a><span class="summary-sig"><span class="summary-sig-name">__add__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x+y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__contains__"></a><span class="summary-sig"><span class="summary-sig-name">__contains__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return y in x...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__delitem__"></a><span class="summary-sig"><span class="summary-sig-name">__delitem__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return del x[y]...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__delslice__" class="summary-sig-name"><code>__delslice__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">j</span>)</span></code>\r
-<br />\r
-Use of negative indices is not supported.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__eq__"></a><span class="summary-sig"><span class="summary-sig-name">__eq__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x==y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__ge__"></a><span class="summary-sig"><span class="summary-sig-name">__ge__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x>=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__getitem__"></a><span class="summary-sig"><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x[y]...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getslice__" class="summary-sig-name"><code>__getslice__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">j</span>)</span></code>\r
-<br />\r
-Use of negative indices is not supported.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__gt__"></a><span class="summary-sig"><span class="summary-sig-name">__gt__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x>y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__hash__"></a><span class="summary-sig"><span class="summary-sig-name">__hash__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__iadd__"></a><span class="summary-sig"><span class="summary-sig-name">__iadd__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x+=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__imul__"></a><span class="summary-sig"><span class="summary-sig-name">__imul__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x*=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__iter__"></a><span class="summary-sig"><span class="summary-sig-name">__iter__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return iter(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__le__"></a><span class="summary-sig"><span class="summary-sig-name">__le__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x<=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__len__"></a><span class="summary-sig"><span class="summary-sig-name">__len__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return len(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__lt__"></a><span class="summary-sig"><span class="summary-sig-name">__lt__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x<y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__mul__"></a><span class="summary-sig"><span class="summary-sig-name">__mul__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">n</span>)</span></code>\r
-<br />\r
-Return x*n...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__ne__"></a><span class="summary-sig"><span class="summary-sig-name">__ne__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x!=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__rmul__"></a><span class="summary-sig"><span class="summary-sig-name">__rmul__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">n</span>)</span></code>\r
-<br />\r
-Return n*x...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__setitem__"></a><span class="summary-sig"><span class="summary-sig-name">__setitem__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x[i]=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__setslice__" class="summary-sig-name"><code>__setslice__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">j</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Use of negative indices is not supported.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#append" class="summary-sig-name"><code>append</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">object</span>)</span></code>\r
-<br />\r
-append object to end</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#count" class="summary-sig-name"><code>count</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">value</span>)</span></code>\r
-<br />\r
-return number of occurrences of value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#extend" class="summary-sig-name"><code>extend</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">iterable</span>)</span></code>\r
-<br />\r
-extend list by appending elements from the iterable</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#index" class="summary-sig-name"><code>index</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-L.index(value, [start, [stop]]) -> integer -- return first index of value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#insert" class="summary-sig-name"><code>insert</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">index</span>,\r
- <span class="summary-sig-arg">object</span>)</span></code>\r
-<br />\r
-insert object before index</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#pop" class="summary-sig-name"><code>pop</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">index</span>)</span></code>\r
-<br />\r
-remove and return item at index (default last)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#remove" class="summary-sig-name"><code>remove</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">value</span>)</span></code>\r
-<br />\r
-remove first occurrence of value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#reverse" class="summary-sig-name"><code>reverse</code></a>(<span class="summary-sig-arg">L</span>)</span></code>\r
-<br />\r
-reverse <em>IN PLACE</em></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#sort" class="summary-sig-name"><code>sort</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">cmpfunc</span>)</span></code>\r
-<br />\r
-stable sort <em>IN PLACE</em>; cmpfunc(x, y) -> -1, 0, 1</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__add__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__add__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Addition operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x+y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__contains__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__contains__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(In operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-y in x\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__delitem__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__delitem__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Index deletion operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-del x[y]\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__delslice__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__delslice__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">i</span>,\r
- <span class="sig-arg">j</span>)</span>\r
- <br /><em class="fname">(Slice deletion operator)</em>\r
- </h3>\r
-<p>Use of negative indices is not supported.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-del x[i:j]\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__eq__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__eq__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Equality operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x==y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__ge__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__ge__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Greater-than-or-equals operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x>=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getattribute__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__getattribute__('name') <==> x.name</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__getattribute__"><code>__builtin__.object.__getattribute__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getitem__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Indexing operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x[y]\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getslice__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getslice__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">i</span>,\r
- <span class="sig-arg">j</span>)</span>\r
- <br /><em class="fname">(Slicling operator)</em>\r
- </h3>\r
-<p>Use of negative indices is not supported.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x[i:j]\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__gt__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__gt__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Greater-than operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x>y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__hash__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__hash__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Hashing function)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-hash(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__hash__"><code>__builtin__.object.__hash__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__iadd__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__iadd__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x+=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__imul__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__imul__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x*=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__iter__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__iter__</span>(<span class="sig-arg">x</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-iter(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__le__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__le__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Less-than-or-equals operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x<=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__len__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__len__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Length operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-len(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__lt__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__lt__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Less-than operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x<y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__mul__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__mul__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">n</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x*n\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__ne__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__ne__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Inequality operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x!=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__new__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,\r
- <span class="sig-arg">S</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-a new object with type S, a subtype of T\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__repr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-repr(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__repr__"><code>__builtin__.object.__repr__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__rmul__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__rmul__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">n</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-n*x\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__setitem__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__setitem__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">i</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Index assignment operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x[i]=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__setslice__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__setslice__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">i</span>,\r
- <span class="sig-arg">j</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Slice assignment operator)</em>\r
- </h3>\r
-<p>Use of negative indices is not supported.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x[i:j]=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="append"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">append</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">object</span>)</span>\r
- </h3>\r
-<p>append object to end</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="count"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">count</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">value</span>)</span>\r
- </h3>\r
-<p>return number of occurrences of value</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-integer\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="extend"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">extend</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">iterable</span>)</span>\r
- </h3>\r
-<p>extend list by appending elements from the iterable</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="index"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">index</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>L.index(value, [start, [stop]]) -> integer -- return first index of value</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="insert"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">insert</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">index</span>,\r
- <span class="sig-arg">object</span>)</span>\r
- </h3>\r
-<p>insert object before index</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="pop"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">pop</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">index</span>=<span class="sig-default">...</span>)</span>\r
- </h3>\r
-<p>remove and return item at index (default last)</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-item\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="remove"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">remove</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">value</span>)</span>\r
- </h3>\r
-<p>remove first occurrence of value</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="reverse"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">reverse</span>(<span class="sig-arg">L</span>)</span>\r
- </h3>\r
-<p>reverse <em>IN PLACE</em></p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="sort"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">sort</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">cmpfunc</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>stable sort <em>IN PLACE</em>; cmpfunc(x, y) -> -1, 0, 1</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>__builtin__.object</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Module __builtin__ ::\r
- Class object\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/__builtin__.object-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="__builtin__.object-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type object</h2>\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a>,\r
- <a href="__builtin__.list-class.html"><code>list</code></a>,\r
- <a href="psycopg2.extras.SQL_IN-class.html"><code>SQL_IN</code></a>,\r
- <a href="__builtin__.type-class.html"><code>type</code></a>,\r
- <a href="datetime.tzinfo-class.html"><code>tzinfo</code></a>,\r
- <a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a>,\r
- <a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a>,\r
- <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>ISQLQuote</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>The most base type</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__hash__"></a><span class="summary-sig"><span class="summary-sig-name">__hash__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF CLASS VARIABLE SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Class Variable Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
- <td><a name="__class__"></a><strong><code class="vname">__class__</code></strong> = <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__delattr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__delattr__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__delattr__('name') <==> del x.name</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getattribute__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__getattribute__('name') <==> x.name</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__hash__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__hash__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Hashing function)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-hash(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__new__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,\r
- <span class="sig-arg">S</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-a new object with type S, a subtype of T\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__reduce__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__reduce__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>helper for pickle</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__reduce_ex__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__reduce_ex__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>helper for pickle</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__repr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-repr(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__setattr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__setattr__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__setattr__('name', value) <==> x.name = value</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__str__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Informal representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-str(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>__builtin__.type</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Module __builtin__ ::\r
- Class type\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/__builtin__.type-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="__builtin__.type-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type type</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">type</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>type(object) -> the object's type\r
-type(name, bases, dict) -> a new type</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__call__"></a><span class="summary-sig"><span class="summary-sig-name">__call__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return x(...)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__cmp__"></a><span class="summary-sig"><span class="summary-sig-name">__cmp__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return cmp(x,y)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__hash__"></a><span class="summary-sig"><span class="summary-sig-name">__hash__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">list of immediate subclasses</td>\r
- <td><code><a name="__subclasses__"></a><span class="summary-sig"><span class="summary-sig-name">__subclasses__</span>()</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">list</td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#mro" class="summary-sig-name"><code>mro</code></a>()</span></code>\r
-<br />\r
-return a type's method resolution order</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF PROPERTY SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Property Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__base__"></a><strong><code>__base__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__basicsize__"></a><strong><code>__basicsize__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__dictoffset__"></a><strong><code>__dictoffset__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__flags__"></a><strong><code>__flags__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__itemsize__"></a><strong><code>__itemsize__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__mro__"></a><strong><code>__mro__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__weakrefoffset__"></a><strong><code>__weakrefoffset__</code></strong></td></tr></table><br />\r
-\r
-\r
-<!-- =========== START OF CLASS VARIABLE SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Class Variable Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>tuple</code></td>\r
-<td><strong><a href="__builtin__.type-class.html#__bases__"><code>__bases__</code></a></strong> = <span title="(<type 'object'>,)"><code>(<type 'object'>,) </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td>\r
-<td><strong><a href="__builtin__.type-class.html#__name__"><code>__name__</code></a></strong> = <span title="'type'"><code><span class="variable-quote">'</span>type<span class="variable-quote">'</span> </code>\r
-</span></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__call__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__call__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Call operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x(...)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__cmp__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__cmp__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Comparison operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-cmp(x,y)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__delattr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__delattr__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__delattr__('name') <==> del x.name</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__delattr__"><code>__builtin__.object.__delattr__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getattribute__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__getattribute__('name') <==> x.name</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__getattribute__"><code>__builtin__.object.__getattribute__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__hash__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__hash__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Hashing function)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-hash(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__hash__"><code>__builtin__.object.__hash__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__new__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,\r
- <span class="sig-arg">S</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-a new object with type S, a subtype of T\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__repr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-repr(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__repr__"><code>__builtin__.object.__repr__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__setattr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__setattr__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__setattr__('name', value) <==> x.name = value</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__setattr__"><code>__builtin__.object.__setattr__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__subclasses__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__subclasses__</span>()</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-list of immediate subclasses </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="mro"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">mro</span>()</span>\r
- </h3>\r
-<p>return a type's method resolution order</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-list </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF CLASS VARIABLE DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Class Variable Details</th></tr>\r
-</table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="__bases__"></a>\r
-<h3>__bases__</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>tuple</code>\r
-\r
- </dd>\r
- <dt title="(<type 'object'>,)">Value:</dt>\r
- <dd title="(<type 'object'>,)"><table><tr><td>\r
-<pre class="variable">\r
-(<type 'object'>,) </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="__name__"></a>\r
-<h3>__name__</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>str</code>\r
-\r
- </dd>\r
- <dt title="'type'">Value:</dt>\r
- <dd title="'type'"><table><tr><td>\r
-<pre class="variable">\r
-<span class="variable-quote">'</span>type<span class="variable-quote">'</span> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>datetime.tzinfo</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Module datetime ::\r
- Class tzinfo\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/datetime.tzinfo-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="datetime.tzinfo-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type tzinfo</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">tzinfo</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>FixedOffsetTimezone</code></a>,\r
- <a href="psycopg2.tz.LocalTimezone-class.html"><code>LocalTimezone</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>Abstract base class for time zone info objects.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
--> (cls, state)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#dst" class="summary-sig-name"><code>dst</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-datetime -> DST offset in minutes east of UTC.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#fromutc" class="summary-sig-name"><code>fromutc</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-datetime in UTC -> datetime in local time.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#tzname" class="summary-sig-name"><code>tzname</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-datetime -> string name of time zone.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#utcoffset" class="summary-sig-name"><code>utcoffset</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-datetime -> minutes east of UTC (negative for west of UTC).</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__getattribute__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__getattribute__('name') <==> x.name</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__getattribute__"><code>__builtin__.object.__getattribute__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__new__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,\r
- <span class="sig-arg">S</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-a new object with type S, a subtype of T\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__reduce__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__reduce__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>-> (cls, state)</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__reduce__"><code>__builtin__.object.__reduce__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="dst"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dst</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>datetime -> DST offset in minutes east of UTC.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="fromutc"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">fromutc</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>datetime in UTC -> datetime in local time.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="tzname"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">tzname</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>datetime -> string name of time zone.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="utcoffset"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">utcoffset</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>datetime -> minutes east of UTC (negative for west of UTC).</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-/* Based on the Epydoc "default.css"\r
-** with some missing reST-related classes\r
-** and Python syntax support (from SilverCity)\r
-*/\r
-\r
-/* Body color */ \r
-body { background: #ffffff; color: #000000; } \r
- \r
-/* Tables */ \r
-table.summary, table.details, table.index\r
- { background: #e8f0f8; color: #000000; } \r
-tr.summary, tr.details, tr.index\r
- { background: #70b0f0; color: #000000; \r
- text-align: left; font-size: 120%; } \r
-tr.group { background: #c0e0f8; color: #000000;\r
- text-align: left; font-size: 120%;\r
- font-style: italic; } \r
-\r
-/* Documentation page titles */\r
-h2.module { margin-top: 0.2em; }\r
-h2.class { margin-top: 0.2em; }\r
- \r
-/* Headings */\r
-h1.heading { font-size: +140%; font-style: italic;\r
- font-weight: bold; }\r
-h2.heading { font-size: +125%; font-style: italic;\r
- font-weight: bold; }\r
-h3.heading { font-size: +110%; font-style: italic;\r
- font-weight: normal; }\r
- \r
-/* Base tree */\r
-pre.base-tree { font-size: 80%; margin: 0; }\r
-\r
-/* TOC */\r
-p.toc { margin: 0; }\r
-\r
-/* Details Sections */\r
-table.func-details { background: #e8f0f8; color: #000000;\r
- border: 2px groove #c0d0d0;\r
- padding: 0 1em 0 1em; margin: 0.4em 0 0 0; }\r
-h3.func-detail { background: transparent; color: #000000;\r
- margin: 0 0 1em 0; }\r
-\r
-table.var-details { background: #e8f0f8; color: #000000;\r
- border: 2px groove #c0d0d0;\r
- padding: 0 1em 0 1em; margin: 0.4em 0 0 0; }\r
-h3.var-details { background: transparent; color: #000000;\r
- margin: 0 0 1em 0; }\r
-\r
-/* Function signatures */\r
-.sig { background: transparent; color: #000000;\r
- font-weight: bold; } \r
-.sig-name { background: transparent; color: #006080; } \r
-.sig-arg, .sig-kwarg, .sig-vararg\r
- { background: transparent; color: #008060; } \r
-.sig-default { background: transparent; color: #602000; } \r
-.summary-sig { background: transparent; color: #000000; } \r
-.summary-sig-name { background: transparent; color: #204080; }\r
-.summary-sig-arg, .summary-sig-kwarg, .summary-sig-vararg\r
- { background: transparent; color: #008060; } \r
-\r
-/* Doctest blocks */\r
-.py-src { background: transparent; color: #000000; }\r
-.py-prompt { background: transparent; color: #005050;\r
- font-weight: bold;}\r
-.py-string { background: transparent; color: #006030; }\r
-.py-comment { background: transparent; color: #003060; }\r
-.py-keyword { background: transparent; color: #600000; }\r
-.py-output { background: transparent; color: #404040; }\r
-div.code-block,\r
-pre.literal-block,\r
-pre.doctestblock { background: #f4faff; color: #000000; \r
- padding: .5em; margin: 1em;\r
- border: 1px solid #708890; }\r
-table pre.doctestblock\r
- { background: #dce4ec; color: #000000; \r
- padding: .5em; margin: 1em;\r
- border: 1px solid #708890; }\r
-div.code-block { font-family: monospace; }\r
-\r
-/* Variable values */\r
-pre.variable { background: #dce4ec; color: #000000;\r
- padding: .5em; margin: 0;\r
- border: 1px solid #708890; }\r
-.variable-linewrap { background: transparent; color: #604000; }\r
-.variable-ellipsis { background: transparent; color: #604000; }\r
-.variable-quote { background: transparent; color: #604000; }\r
-.re { background: transparent; color: #000000; }\r
-.re-char { background: transparent; color: #006030; }\r
-.re-op { background: transparent; color: #600000; }\r
-.re-group { background: transparent; color: #003060; }\r
-.re-ref { background: transparent; color: #404040; }\r
-\r
-/* Navigation bar */ \r
-table.navbar { background: #a0c0ff; color: #0000ff;\r
- border: 2px groove #c0d0d0; }\r
-th.navbar { background: #a0c0ff; color: #0000ff; } \r
-th.navselect { background: #70b0ff; color: #000000; } \r
-.nomargin { margin: 0; }\r
-\r
-/* Links */ \r
-a:link { background: transparent; color: #0000ff; } \r
-a:visited { background: transparent; color: #204080; } \r
-a.navbar:link { background: transparent; color: #0000ff; \r
- text-decoration: none; } \r
-a.navbar:visited { background: transparent; color: #204080; \r
- text-decoration: none; } \r
-\r
-/* Admonitions */\r
-div.warning,\r
-div.note { background-color: #c0e0f8;\r
- border: thin solid black;\r
- padding: 1em;\r
- margin-left: 1em;\r
- margin-right: 1em; }\r
-div.warning .first,\r
-div.note .first { font-family: sans-serif;\r
- font-size: 110%;\r
- margin-right: 0.5em; }\r
-\r
-/* Lists */\r
-ul { margin-top: 0; }\r
-\r
-/* Python syntax */\r
-.p_character { color: olive; }\r
-.p_classname { color: blue; font-weight: bold; }\r
-.p_commentblock {color: gray; font-style: italic; }\r
-.p_commentline { color: green; font-style: italic; }\r
-.p_default {}\r
-.p_defname { color: #009999; font-weight: bold; }\r
-.p_identifier { color: black; }\r
-.p_number { color: #009999; }\r
-.p_operator { color: black; }\r
-.p_string { color: #7F007F; }\r
-.p_stringeol { color: #7F007F; }\r
-.p_triple { color: #7F0000; }\r
-.p_tripledouble { color: #7F0000; }\r
-.p_word { color: navy; font-weight: bold; }\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>exceptions.Exception</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Module exceptions ::\r
- Class Exception\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/exceptions.Exception-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="exceptions.Exception-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class Exception</h2>\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="exceptions.StandardError-class.html"><code>StandardError</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>Common base class for all exceptions.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__getitem__"></a><span class="summary-sig"><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getitem__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Indexing operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__str__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Informal representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>exceptions.StandardError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Module exceptions ::\r
- Class StandardError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/exceptions.StandardError-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="exceptions.StandardError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class StandardError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+\r
- |\r
- <strong class="uidshort">StandardError</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.Error-class.html"><code>Error</code></a>,\r
- <a href="psycopg2.Warning-class.html"><code>Warning</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>Base class for all standard Python exceptions.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"\r
- "DTD/xhtml1-frameset.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title> API Documentation </title>\r
-</head>\r
-<frameset cols="20%,80%">\r
- <frameset rows="30%,70%">\r
- <frame src="toc.html" name="moduleListFrame" id="moduleListFrame" />\r
- <frame src="toc-everything.html" name="moduleFrame" id="moduleFrame" />\r
- </frameset>\r
- <frame src="psycopg2-module.html" name="mainFrame" id="mainFrame" />\r
-</frameset>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>Help</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th bgcolor="#70b0f0" class="navselect"> Help </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/help.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="help.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<h1 class="help"> API Documentation </h1>\r
-\r
-<p> This document contains the API (Application Programming Interface)\r
-documentation for this project. Documentation for the Python\r
-objects defined by the project is divided into separate pages for each\r
-package, module, and class. The API documentation also includes two\r
-pages containing information about the project as a whole: a trees\r
-page, and an index page. </p>\r
-\r
-<h2> Object Documentation </h2>\r
-\r
- <p>Each <strong>Package Documentation</strong> page contains: </p>\r
- <ul>\r
- <li> A description of the package. </li>\r
- <li> A list of the modules and sub-packages contained by the\r
- package. </li>\r
- <li> A summary of the classes defined by the package. </li>\r
- <li> A summary of the functions defined by the package. </li>\r
- <li> A summary of the variables defined by the package. </li>\r
- <li> A detailed description of each function defined by the\r
- package. </li>\r
- <li> A detailed description of each variable defined by the\r
- package. </li>\r
- </ul>\r
- \r
- <p>Each <strong>Module Documentation</strong> page contains:</p>\r
- <ul>\r
- <li> A description of the module. </li>\r
- <li> A summary of the classes defined by the module. </li>\r
- <li> A summary of the functions defined by the module. </li>\r
- <li> A summary of the variables defined by the module. </li>\r
- <li> A detailed description of each function defined by the\r
- module. </li>\r
- <li> A detailed description of each variable defined by the\r
- module. </li>\r
- </ul>\r
- \r
- <p>Each <strong>Class Documentation</strong> page contains: </p>\r
- <ul>\r
- <li> A class inheritance diagram. </li>\r
- <li> A list of known subclasses. </li>\r
- <li> A description of the class. </li>\r
- <li> A summary of the methods defined by the class. </li>\r
- <li> A summary of the instance variables defined by the class. </li>\r
- <li> A summary of the class (static) variables defined by the\r
- class. </li> \r
- <li> A detailed description of each method defined by the\r
- class. </li>\r
- <li> A detailed description of each instance variable defined by the\r
- class. </li> \r
- <li> A detailed description of each class (static) variable defined\r
- by the class. </li> \r
- </ul>\r
-\r
-<h2> Project Documentation </h2>\r
-\r
- <p> The <strong>Trees</strong> page contains the module and class hierarchies: </p>\r
- <ul>\r
- <li> The <em>module hierarchy</em> lists every package and module, with\r
- modules grouped into packages. At the top level, and within each\r
- package, modules and sub-packages are listed alphabetically. </li>\r
- <li> The <em>class hierarchy</em> lists every class, grouped by base\r
- class. If a class has more than one base class, then it will be\r
- listed under each base class. At the top level, and under each base\r
- class, classes are listed alphabetically. </li>\r
- </ul>\r
- \r
- <p> The <strong>Index</strong> page contains indices of terms and\r
- identifiers: </p>\r
- <ul>\r
- <li> The <em>term index</em> lists every term indexed by any object's\r
- documentation. For each term, the index provides links to each\r
- place where the term is indexed. </li>\r
- <li> The <em>identifier index</em> lists the (short) name of every package,\r
- module, class, method, function, variable, and parameter. For each\r
- identifier, the index provides a short description, and a link to\r
- its documentation. </li>\r
- </ul>\r
-\r
-<h2> The Table of Contents </h2>\r
-\r
-<p> The table of contents occupies the two frames on the left side of\r
-the window. The upper-left frame displays the <em>project\r
-contents</em>, and the lower-left frame displays the <em>module\r
-contents</em>: </p>\r
-\r
-<table class="help summary" border="1" cellspacing="0" cellpadding="3">\r
- <tr style="height: 30%">\r
- <td align="center" style="font-size: small">\r
- Project<br />Contents<hr />...</td>\r
- <td align="center" style="font-size: small" rowspan="2" width="70%">\r
- API<br />Documentation<br />Frame<br /><br /><br />\r
- </td>\r
- </tr>\r
- <tr>\r
- <td align="center" style="font-size: small">\r
- Module<br />Contents<hr /> <br />...<br /> \r
- </td>\r
- </tr>\r
-</table><br />\r
-\r
-<p> The <strong>project contents frame</strong> contains a list of all packages\r
-and modules that are defined by the project. Clicking on an entry\r
-will display its contents in the module contents frame. Clicking on a\r
-special entry, labeled "Everything," will display the contents of\r
-the entire project. </p>\r
-\r
-<p> The <strong>module contents frame</strong> contains a list of every\r
-submodule, class, type, exception, function, and variable defined by a\r
-module or package. Clicking on an entry will display its\r
-documentation in the API documentation frame. Clicking on the name of\r
-the module, at the top of the frame, will display the documentation\r
-for the module itself. </p>\r
-\r
-<p> The "<strong>frames</strong>" and "<strong>no frames</strong>" buttons below the top\r
-navigation bar can be used to control whether the table of contents is\r
-displayed or not. </p>\r
-\r
-<h2> The Navigation Bar </h2>\r
-\r
-<p> A navigation bar is located at the top and bottom of every page.\r
-It indicates what type of page you are currently viewing, and allows\r
-you to go to related pages. The following table describes the labels\r
-on the navigation bar. Note that not some labels (such as\r
-[Parent]) are not displayed on all pages. </p>\r
-\r
-<table class="summary" border="1" cellspacing="0" cellpadding="3" width="100%">\r
-<tr class="summary">\r
- <th>Label</th>\r
- <th>Highlighted when...</th>\r
- <th>Links to...</th>\r
-</tr>\r
- <tr><td valign="top"><strong>[Parent]</strong></td>\r
- <td valign="top"><em>(never highlighted)</em></td>\r
- <td valign="top"> the parent of the current package </td></tr>\r
- <tr><td valign="top"><strong>[Package]</strong></td>\r
- <td valign="top">viewing a package</td>\r
- <td valign="top">the package containing the current object\r
- </td></tr>\r
- <tr><td valign="top"><strong>[Module]</strong></td>\r
- <td valign="top">viewing a module</td>\r
- <td valign="top">the module containing the current object\r
- </td></tr> \r
- <tr><td valign="top"><strong>[Class]</strong></td>\r
- <td valign="top">viewing a class </td>\r
- <td valign="top">the class containing the current object</td></tr>\r
- <tr><td valign="top"><strong>[Trees]</strong></td>\r
- <td valign="top">viewing the trees page</td>\r
- <td valign="top"> the trees page </td></tr>\r
- <tr><td valign="top"><strong>[Index]</strong></td>\r
- <td valign="top">viewing the index page</td>\r
- <td valign="top"> the index page </td></tr>\r
- <tr><td valign="top"><strong>[Help]</strong></td>\r
- <td valign="top">viewing the help page</td>\r
- <td valign="top"> the help page </td></tr>\r
-</table>\r
-\r
-<p> The "<strong>show private</strong>" and "<strong>hide private</strong>" buttons below\r
-the top navigation bar can be used to control whether documentation\r
-for private objects is displayed. Private objects are usually defined\r
-as objects whose (short) names begin with a single underscore, but do\r
-not end with an underscore. For example, "<code>_x</code>",\r
-"<code>__pprint</code>", and "<code>epydoc.epytext._tokenize</code>"\r
-are private objects; but "<code>re.sub</code>",\r
-"<code>__init__</code>", and "<code>type_</code>" are not. However,\r
-if a module defines the "<code>__all__</code>" variable, then its\r
-contents are used to decide which objects are private. </p>\r
-\r
-<p> A timestamp below the bottom navigation bar indicates when each\r
-page was last updated. </p>\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th bgcolor="#70b0f0" class="navselect"> Help </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"\r
- "DTD/xhtml1-frameset.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title> API Documentation </title>\r
-</head>\r
-<frameset cols="20%,80%">\r
- <frameset rows="30%,70%">\r
- <frame src="toc.html" name="moduleListFrame" id="moduleListFrame" />\r
- <frame src="toc-everything.html" name="moduleFrame" id="moduleFrame" />\r
- </frameset>\r
- <frame src="psycopg2-module.html" name="mainFrame" id="mainFrame" />\r
-</frameset>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>Index</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th bgcolor="#70b0f0" class="navselect"> Index </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/indices.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="indices.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-<br />\r
-\r
-<!-- =========== START OF IDENTIFIER INDEX =========== -->\r
-<table class="index" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="index">\r
- <th colspan="2">Identifier Index</th></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__add__"><code>__add__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__base__"><code>__base__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__bases__"><code>__bases__</code></a></td>\r
- <td>Variable in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__basicsize__"><code>__basicsize__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2.psycopg1.cursor-class.html#__build_dict"><code>__build_dict</code></a></td>\r
- <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__call__"><code>__call__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html"><code>type</code></a></td>\r
- <td>Class in module <code>__builtin__</code></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__cmp__"><code>__cmp__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__contains__"><code>__contains__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__delattr__"><code>__delattr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__delattr__"><code>__delattr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__delitem__"><code>__delitem__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__delslice__"><code>__delslice__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__dictoffset__"><code>__dictoffset__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__eq__"><code>__eq__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__flags__"><code>__flags__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__ge__"><code>__ge__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__getattribute__"><code>__getattribute__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__getattribute__"><code>__getattribute__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__getattribute__"><code>__getattribute__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#__getattribute__"><code>__getattribute__</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__getitem__"><code>__getitem__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="exceptions.Exception-class.html#__getitem__"><code>__getitem__</code></a></td>\r
- <td>Method in class <a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#__getitem__"><code>__getitem__</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__getslice__"><code>__getslice__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__gt__"><code>__gt__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__hash__"><code>__hash__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__hash__"><code>__hash__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__hash__"><code>__hash__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__iadd__"><code>__iadd__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__imul__"><code>__imul__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="exceptions.Exception-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.SQL_IN-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.SQL_IN-class.html"><code>psycopg2.extras.SQL_IN</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__itemsize__"><code>__itemsize__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__iter__"><code>__iter__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#__iter__"><code>__iter__</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__le__"><code>__le__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__len__"><code>__len__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__lt__"><code>__lt__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__mro__"><code>__mro__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__mul__"><code>__mul__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__name__"><code>__name__</code></a></td>\r
- <td>Variable in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__ne__"><code>__ne__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__new__"><code>__new__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__new__"><code>__new__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__new__"><code>__new__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#__new__"><code>__new__</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#__new__"><code>__new__</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#__new__"><code>__new__</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#__new__"><code>__new__</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__reduce__"><code>__reduce__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#__reduce__"><code>__reduce__</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__reduce_ex__"><code>__reduce_ex__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__repr__"><code>__repr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__repr__"><code>__repr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__repr__"><code>__repr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#__repr__"><code>__repr__</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#__repr__"><code>__repr__</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__rmul__"><code>__rmul__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__setattr__"><code>__setattr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__setattr__"><code>__setattr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__setitem__"><code>__setitem__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__setslice__"><code>__setslice__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__str__"><code>__str__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="exceptions.Exception-class.html#__str__"><code>__str__</code></a></td>\r
- <td>Method in class <a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#__str__"><code>__str__</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#__str__"><code>__str__</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__subclasses__"><code>__subclasses__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#__version__"><code>__version__</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__weakrefoffset__"><code>__weakrefoffset__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2.extras.DictCursor-class.html#_build_index"><code>_build_index</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#_C_API"><code>_C_API</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_closeall"><code>_closeall</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_connect"><code>_connect</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2.extras.DictCursor-class.html#__query_executed"><code>__query_executed</code></a></td>\r
- <td>Variable in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getconn"><code>_getconn</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getkey"><code>_getkey</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2.tz.LocalTimezone-class.html#_isdst"><code>_isdst</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2.tz.FixedOffsetTimezone-class.html#_name"><code>_name</code></a></td>\r
- <td>Variable in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2.tz.FixedOffsetTimezone-class.html#_offset"><code>_offset</code></a></td>\r
- <td>Variable in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html"><code>_psycopg</code></a></td>\r
- <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_putconn"><code>_putconn</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#_wrapped"><code>_wrapped</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a></td>\r
- <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#adapt"><code>adapt</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#adapters"><code>adapters</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#apilevel"><code>apilevel</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#append"><code>append</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#arraysize"><code>arraysize</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#AsIs"><code>AsIs</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.connection-class.html#autocommit"><code>autocommit</code></a></td>\r
- <td>Method in class <a href="psycopg2.psycopg1.connection-class.html"><code>psycopg2.psycopg1.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#Binary"><code>Binary</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#BINARY"><code>BINARY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#binary_types"><code>binary_types</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#binary_types"><code>binary_types</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#BINARYARRAY"><code>BINARYARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#BOOLEAN"><code>BOOLEAN</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#Boolean"><code>Boolean</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#BOOLEANARRAY"><code>BOOLEANARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#callproc"><code>callproc</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#callproc"><code>callproc</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#close"><code>close</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#close"><code>close</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#closeall"><code>closeall</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#closeall"><code>closeall</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#closed"><code>closed</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#commit"><code>commit</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#connect"><code>connect</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1-module.html#connect"><code>connect</code></a></td>\r
- <td>Function in module <a href="psycopg2.psycopg1-module.html"><code>psycopg2.psycopg1</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a></td>\r
- <td>Class in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#connection"><code>connection</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.connection-class.html"><code>connection</code></a></td>\r
- <td>Class in module <a href="psycopg2.psycopg1-module.html"><code>psycopg2.psycopg1</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_from"><code>copy_from</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_to"><code>copy_to</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#count"><code>count</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#cursor"><code>cursor</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a></td>\r
- <td>Class in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictConnection-class.html#cursor"><code>cursor</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictConnection-class.html"><code>psycopg2.extras.DictConnection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.connection-class.html#cursor"><code>cursor</code></a></td>\r
- <td>Method in class <a href="psycopg2.psycopg1.connection-class.html"><code>psycopg2.psycopg1.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html"><code>cursor</code></a></td>\r
- <td>Class in module <a href="psycopg2.psycopg1-module.html"><code>psycopg2.psycopg1</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#DatabaseError"><code>DatabaseError</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.DataError-class.html"><code>DataError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#DataError"><code>DataError</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#Date"><code>Date</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#DATE"><code>DATE</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#DATEARRAY"><code>DATEARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#DateFromPy"><code>DateFromPy</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#DateFromTicks"><code>DateFromTicks</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#DATETIME"><code>DATETIME</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#DATETIMEARRAY"><code>DATETIMEARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool-module.html#dbg"><code>dbg</code></a></td>\r
- <td>Function in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#DECIMAL"><code>DECIMAL</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#DECIMALARRAY"><code>DECIMALARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#description"><code>description</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictConnection-class.html"><code>DictConnection</code></a></td>\r
- <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html"><code>DictCursor</code></a></td>\r
- <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html#dictfetchall"><code>dictfetchall</code></a></td>\r
- <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html#dictfetchmany"><code>dictfetchmany</code></a></td>\r
- <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html#dictfetchone"><code>dictfetchone</code></a></td>\r
- <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html"><code>DictRow</code></a></td>\r
- <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#dsn"><code>dsn</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#dst"><code>dst</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#dst"><code>dst</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html#dst"><code>dst</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz-module.html#DSTDIFF"><code>DSTDIFF</code></a></td>\r
- <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#encoding"><code>encoding</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#encodings"><code>encodings</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.Error-class.html"><code>Error</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#Error"><code>Error</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="exceptions.Exception-class.html"><code>Exception</code></a></td>\r
- <td>Class in module <code>exceptions</code></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#execute"><code>execute</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#execute"><code>execute</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#executemany"><code>executemany</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#extend"><code>extend</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html"><code>extensions</code></a></td>\r
- <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras-module.html"><code>extras</code></a></td>\r
- <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchall"><code>fetchall</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#fetchall"><code>fetchall</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany"><code>fetchmany</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#fetchmany"><code>fetchmany</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchone"><code>fetchone</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#fetchone"><code>fetchone</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#fileno"><code>fileno</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>FixedOffsetTimezone</code></a></td>\r
- <td>Class in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#FLOAT"><code>FLOAT</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#FLOATARRAY"><code>FLOATARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#fromutc"><code>fromutc</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#get"><code>get</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#getbinary"><code>getbinary</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#getbuffer"><code>getbuffer</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#getconn"><code>getconn</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#getconn"><code>getconn</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#getquoted"><code>getquoted</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.SQL_IN-class.html#getquoted"><code>getquoted</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.SQL_IN-class.html"><code>psycopg2.extras.SQL_IN</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#has_key"><code>has_key</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#index"><code>index</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#insert"><code>insert</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#INTEGER"><code>INTEGER</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#INTEGERARRAY"><code>INTEGERARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.IntegrityError-class.html"><code>IntegrityError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#IntegrityError"><code>IntegrityError</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.InterfaceError-class.html"><code>InterfaceError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#InterfaceError"><code>InterfaceError</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.InternalError-class.html"><code>InternalError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#InternalError"><code>InternalError</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#INTERVAL"><code>INTERVAL</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#INTERVALARRAY"><code>INTERVALARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#IntervalFromPy"><code>IntervalFromPy</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#isolation_level"><code>isolation_level</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT"><code>ISOLATION_LEVEL_AUTOCOMMIT</code></a></td>\r
- <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED"><code>ISOLATION_LEVEL_READ_COMMITTED</code></a></td>\r
- <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED"><code>ISOLATION_LEVEL_READ_UNCOMMITTED</code></a></td>\r
- <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ"><code>ISOLATION_LEVEL_REPEATABLE_READ</code></a></td>\r
- <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE"><code>ISOLATION_LEVEL_SERIALIZABLE</code></a></td>\r
- <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>ISQLQuote</code></a></td>\r
- <td>Class in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#isready"><code>isready</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#items"><code>items</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#keys"><code>keys</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#lastrowid"><code>lastrowid</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html"><code>list</code></a></td>\r
- <td>Class in module <code>__builtin__</code></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#List"><code>List</code></a></td>\r
- <td>Function in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz-module.html#LOCAL"><code>LOCAL</code></a></td>\r
- <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html"><code>LocalTimezone</code></a></td>\r
- <td>Class in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#LONGINTEGER"><code>LONGINTEGER</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#LONGINTEGERARRAY"><code>LONGINTEGERARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#mogrify"><code>mogrify</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#mro"><code>mro</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#name"><code>name</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#new_type"><code>new_type</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#next"><code>next</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#nextset"><code>nextset</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#notices"><code>notices</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#notifies"><code>notifies</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.NotSupportedError-class.html"><code>NotSupportedError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#NotSupportedError"><code>NotSupportedError</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#NUMBER"><code>NUMBER</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html"><code>object</code></a></td>\r
- <td>Class in module <code>__builtin__</code></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.OperationalError-class.html"><code>OperationalError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#OperationalError"><code>OperationalError</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#paramstyle"><code>paramstyle</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>PersistentConnectionPool</code></a></td>\r
- <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool-module.html"><code>pool</code></a></td>\r
- <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.PoolError-class.html"><code>PoolError</code></a></td>\r
- <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#pop"><code>pop</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.ProgrammingError-class.html"><code>ProgrammingError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#ProgrammingError"><code>ProgrammingError</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1-module.html"><code>psycopg1</code></a></td>\r
- <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html"><code>psycopg2</code></a></td>\r
- <td>Package</td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#putconn"><code>putconn</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#putconn"><code>putconn</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#PYDATE"><code>PYDATE</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#PYDATETIME"><code>PYDATETIME</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#PYINTERVAL"><code>PYINTERVAL</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#PYTIME"><code>PYTIME</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#query"><code>query</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#QuotedString"><code>QuotedString</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#register_adapter"><code>register_adapter</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#register_type"><code>register_type</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#remove"><code>remove</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#reverse"><code>reverse</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#rollback"><code>rollback</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#row_factory"><code>row_factory</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#rowcount"><code>rowcount</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#ROWID"><code>ROWID</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#ROWIDARRAY"><code>ROWIDARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#rownumber"><code>rownumber</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#scroll"><code>scroll</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#set_client_encoding"><code>set_client_encoding</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#set_isolation_level"><code>set_isolation_level</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#setinputsizes"><code>setinputsizes</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#setoutputsize"><code>setoutputsize</code></a></td>\r
- <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>SimpleConnectionPool</code></a></td>\r
- <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#sort"><code>sort</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.SQL_IN-class.html"><code>SQL_IN</code></a></td>\r
- <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr>\r
- <tr><td width="15%"><a href="exceptions.StandardError-class.html"><code>StandardError</code></a></td>\r
- <td>Class in module <code>exceptions</code></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#statusmessage"><code>statusmessage</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz-module.html#STDOFFSET"><code>STDOFFSET</code></a></td>\r
- <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#STRING"><code>STRING</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#string_types"><code>string_types</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#string_types"><code>string_types</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#STRINGARRAY"><code>STRINGARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>ThreadedConnectionPool</code></a></td>\r
- <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#threadsafety"><code>threadsafety</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#Time"><code>Time</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#TIME"><code>TIME</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#TIMEARRAY"><code>TIMEARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#TimeFromPy"><code>TimeFromPy</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#TimeFromTicks"><code>TimeFromTicks</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#Timestamp"><code>Timestamp</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#TimestampFromPy"><code>TimestampFromPy</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#TimestampFromTicks"><code>TimestampFromTicks</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html"><code>type</code></a></td>\r
- <td>Class in module <code>__builtin__</code></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#typecaster"><code>typecaster</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz-module.html"><code>tz</code></a></td>\r
- <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html"><code>tzinfo</code></a></td>\r
- <td>Class in module <code>datetime</code></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#tzinfo_factory"><code>tzinfo_factory</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#tzname"><code>tzname</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#tzname"><code>tzname</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html#tzname"><code>tzname</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#UNICODE"><code>UNICODE</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#UNICODEARRAY"><code>UNICODEARRAY</code></a></td>\r
- <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#utcoffset"><code>utcoffset</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#utcoffset"><code>utcoffset</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html#utcoffset"><code>utcoffset</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#values"><code>values</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.Warning-class.html"><code>Warning</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#Warning"><code>Warning</code></a></td>\r
- <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz-module.html#ZERO"><code>ZERO</code></a></td>\r
- <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr>\r
-</table>\r
-<br />\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th bgcolor="#70b0f0" class="navselect"> Index </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th bgcolor="#70b0f0" class="navselect"> Home </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Package psycopg2\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2-module.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF PACKAGE DESCRIPTION =========== -->\r
-<h2 class="package">Package psycopg2</h2>\r
-\r
-<p>A Python driver for PostgreSQL</p>\r
-<p>psycopg is a <a class="reference" href="http://www.postgresql.org/">PostgreSQL</a> database adapter for the <a class="reference" href="http://www.python.org/">Python</a> programming\r
-language. This is version 2, a complete rewrite of the original code to\r
-provide new-style classes for connection and cursor objects and other sweet\r
-candies. Like the original, psycopg 2 was written with the aim of being very\r
-small and fast, and stable as a rock.</p>\r
-<p>Homepage: <a class="reference" href="http://initd.org/projects/psycopg2">http://initd.org/projects/psycopg2</a></p>\r
-<hr/>\r
-\r
-<!-- =========== START OF SUBMODULES =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Submodules</th></tr>\r
- <tr><td><ul>\r
-<li> <strong class="uidlink"><a href="psycopg2.extensions-module.html"><code>extensions</code></a></strong>: <em class="summary">psycopg extensions to the DBAPI-2.0</em></li>\r
-<li> <strong class="uidlink"><a href="psycopg2.extras-module.html"><code>extras</code></a></strong>: <em class="summary">Miscellaneous goodies for psycopg2</em></li>\r
-<li> <strong class="uidlink"><a href="psycopg2.pool-module.html"><code>pool</code></a></strong>: <em class="summary">Connection pooling for psycopg2</em></li>\r
-<li> <strong class="uidlink"><a href="psycopg2.psycopg1-module.html"><code>psycopg1</code></a></strong>: <em class="summary">psycopg 1.1.x compatibility module</em></li>\r
-<li> <strong class="uidlink"><a href="psycopg2.tz-module.html"><code>tz</code></a></strong>: <em class="summary">tzinfo implementations for psycopg2</em></li>\r
-<li> <strong class="uidlink"><a href="../private/psycopg2._psycopg-module.html"><code>_psycopg</code></a></strong>: <em class="summary">psycopg PostgreSQL driver</em></li>\r
- </ul></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF EXCEPTIONS =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Exceptions</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a></strong></td>\r
- <td>Error related to the database engine.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.DataError-class.html"><code>DataError</code></a></strong></td>\r
- <td>Error related to problems with the processed data.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.Error-class.html"><code>Error</code></a></strong></td>\r
- <td>Base class for error exceptions.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.IntegrityError-class.html"><code>IntegrityError</code></a></strong></td>\r
- <td>Error related to database integrity.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.InterfaceError-class.html"><code>InterfaceError</code></a></strong></td>\r
- <td>Error related to the database interface.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.InternalError-class.html"><code>InternalError</code></a></strong></td>\r
- <td>The database encountered an internal error.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.NotSupportedError-class.html"><code>NotSupportedError</code></a></strong></td>\r
- <td>A not supported datbase API was called.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.OperationalError-class.html"><code>OperationalError</code></a></strong></td>\r
- <td>Error related to database operation (disconnect, memory allocation etc).</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.ProgrammingError-class.html"><code>ProgrammingError</code></a></strong></td>\r
- <td>Error related to database programming (SQL error, table not found etc).</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.Warning-class.html"><code>Warning</code></a></strong></td>\r
- <td>A database warning.</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Function Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Connections creation</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"><a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>extensions.connection</code></a></td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#connect" class="summary-sig-name"><code>connect</code></a>(<span class="summary-sig-arg">dsn</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Create a new database connection.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Value objects constructors</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new binary object</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#Binary" class="summary-sig-name"><code>Binary</code></a>(<span class="summary-sig-arg">buffer</span>)</span></code>\r
-<br />\r
-Build an object capable to hold a bynary string value.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new date</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#Date" class="summary-sig-name"><code>Date</code></a>(<span class="summary-sig-arg">year</span>,\r
- <span class="summary-sig-arg">month</span>,\r
- <span class="summary-sig-arg">day</span>)</span></code>\r
-<br />\r
-Build an object holding a date value.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new date</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#DateFromTicks" class="summary-sig-name"><code>DateFromTicks</code></a>(<span class="summary-sig-arg">ticks</span>)</span></code>\r
-<br />\r
-Build an object holding a date value from the given ticks value.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new time</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#Time" class="summary-sig-name"><code>Time</code></a>(<span class="summary-sig-arg">hour</span>,\r
- <span class="summary-sig-arg">minutes</span>,\r
- <span class="summary-sig-arg">seconds</span>,\r
- <span class="summary-sig-arg">tzinfo</span>)</span></code>\r
-<br />\r
-Build an object holding a time value.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new time</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#TimeFromTicks" class="summary-sig-name"><code>TimeFromTicks</code></a>(<span class="summary-sig-arg">ticks</span>)</span></code>\r
-<br />\r
-Build an object holding a time value from the given ticks value.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new timestamp</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#Timestamp" class="summary-sig-name"><code>Timestamp</code></a>(<span class="summary-sig-arg">year</span>,\r
- <span class="summary-sig-arg">month</span>,\r
- <span class="summary-sig-arg">day</span>,\r
- <span class="summary-sig-arg">hour</span>,\r
- <span class="summary-sig-arg">minutes</span>,\r
- <span class="summary-sig-arg">seconds</span>,\r
- <span class="summary-sig-arg">tzinfo</span>)</span></code>\r
-<br />\r
-Build an object holding a timestamp value.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new timestamp</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#TimestampFromTicks" class="summary-sig-name"><code>TimestampFromTicks</code></a>(<span class="summary-sig-arg">ticks</span>)</span></code>\r
-<br />\r
-Build an object holding a timestamp value from the given ticks value.</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Function Details</th></tr>\r
-</table>\r
-\r
-<a name="connect"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">connect</span>(<span class="sig-arg">dsn</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>Create a new database connection.</p>\r
-<p>This function supports two different but equivalent sets of arguments.\r
-A single data source name or <tt class="docutils literal"><span class="pre">dsn</span></tt> string can be used to specify the\r
-connection parameters, as follows:</p>\r
-<pre class="literal-block">\r
-psycopg2.connect("dbname=xxx user=xxx ...")\r
-</pre>\r
-<p>If <tt class="docutils literal"><span class="pre">dsn</span></tt> is not provided it is possible to pass the parameters as\r
-keyword arguments; e.g.:</p>\r
-<pre class="literal-block">\r
-psycopg2.connect(database='xxx', user='xxx', ...)\r
-</pre>\r
-<p>The full list of available parameters is:</p>\r
-<ul class="rst-simple">\r
-<li><tt class="docutils literal"><span class="pre">dbname</span></tt> -- database name (only in 'dsn')</li>\r
-<li><tt class="docutils literal"><span class="pre">database</span></tt> -- database name (only as keyword argument)</li>\r
-<li><tt class="docutils literal"><span class="pre">host</span></tt> -- host address (defaults to UNIX socket if not provided)</li>\r
-<li><tt class="docutils literal"><span class="pre">port</span></tt> -- port number (defaults to 5432 if not provided)</li>\r
-<li><tt class="docutils literal"><span class="pre">user</span></tt> -- user name used to authenticate</li>\r
-<li><tt class="docutils literal"><span class="pre">password</span></tt> -- password used to authenticate</li>\r
-<li><tt class="docutils literal"><span class="pre">sslmode</span></tt> -- SSL mode (see PostgreSQL documentation)</li>\r
-</ul>\r
-<p>If the <tt class="docutils literal"><span class="pre">connection_factory</span></tt> keyword argument is not provided this\r
-function always return an instance of the <code>connection</code> class.\r
-Else the given sub-class of <a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>extensions.connection</code></a> will be used to\r
-instantiate the connection object.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-New database connection <br /><em> \r
- (type=<a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>extensions.connection</code></a>)</em>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="Binary"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">Binary</span>(<span class="sig-arg">buffer</span>)</span>\r
- </h3>\r
-<p>Build an object capable to hold a bynary string value.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new binary object </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="Date"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">Date</span>(<span class="sig-arg">year</span>,\r
- <span class="sig-arg">month</span>,\r
- <span class="sig-arg">day</span>)</span>\r
- </h3>\r
-<p>Build an object holding a date value.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new date </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="DateFromTicks"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">DateFromTicks</span>(<span class="sig-arg">ticks</span>)</span>\r
- </h3>\r
-<p>Build an object holding a date value from the given ticks value.</p>\r
-<p>Ticks are the number of seconds since the epoch; see the documentation of the standard Python time module for details).</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new date </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="Time"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">Time</span>(<span class="sig-arg">hour</span>,\r
- <span class="sig-arg">minutes</span>,\r
- <span class="sig-arg">seconds</span>,\r
- <span class="sig-arg">tzinfo</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>Build an object holding a time value.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new time </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="TimeFromTicks"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">TimeFromTicks</span>(<span class="sig-arg">ticks</span>)</span>\r
- </h3>\r
-<p>Build an object holding a time value from the given ticks value.</p>\r
-<p>Ticks are the number of seconds since the epoch; see the documentation of the standard Python time module for details).</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new time </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="Timestamp"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">Timestamp</span>(<span class="sig-arg">year</span>,\r
- <span class="sig-arg">month</span>,\r
- <span class="sig-arg">day</span>,\r
- <span class="sig-arg">hour</span>,\r
- <span class="sig-arg">minutes</span>,\r
- <span class="sig-arg">seconds</span>,\r
- <span class="sig-arg">tzinfo</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>Build an object holding a timestamp value.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new timestamp </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="TimestampFromTicks"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">TimestampFromTicks</span>(<span class="sig-arg">ticks</span>)</span>\r
- </h3>\r
-<p>Build an object holding a timestamp value from the given ticks value.</p>\r
-<p>Ticks are the number of seconds since the epoch; see the documentation of the standard Python time module for details).</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new timestamp </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th bgcolor="#70b0f0" class="navselect"> Home </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.DataError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class DataError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.DataError-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.DataError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class DataError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ \r
- | \r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+\r
- |\r
- <strong class="uidshort">DataError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Error related to problems with the processed data.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.DatabaseError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class DatabaseError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.DatabaseError-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.DatabaseError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class DatabaseError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+\r
- |\r
- <strong class="uidshort">DatabaseError</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.DataError-class.html"><code>DataError</code></a>,\r
- <a href="psycopg2.IntegrityError-class.html"><code>IntegrityError</code></a>,\r
- <a href="psycopg2.InternalError-class.html"><code>InternalError</code></a>,\r
- <a href="psycopg2.NotSupportedError-class.html"><code>NotSupportedError</code></a>,\r
- <a href="psycopg2.OperationalError-class.html"><code>OperationalError</code></a>,\r
- <a href="psycopg2.ProgrammingError-class.html"><code>ProgrammingError</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>Error related to the database engine.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.Error</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class Error\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.Error-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.Error-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class Error</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+\r
- |\r
- <strong class="uidshort">Error</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a>,\r
- <a href="psycopg2.InterfaceError-class.html"><code>InterfaceError</code></a>,\r
- <a href="psycopg2.pool.PoolError-class.html"><code>PoolError</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>Base class for error exceptions.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.IntegrityError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class IntegrityError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.IntegrityError-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.IntegrityError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class IntegrityError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ \r
- | \r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+\r
- |\r
- <strong class="uidshort">IntegrityError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Error related to database integrity.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.InterfaceError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class InterfaceError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.InterfaceError-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.InterfaceError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class InterfaceError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+\r
- |\r
- <strong class="uidshort">InterfaceError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Error related to the database interface.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.InternalError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class InternalError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.InternalError-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.InternalError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class InternalError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ \r
- | \r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+\r
- |\r
- <strong class="uidshort">InternalError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>The database encountered an internal error.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.NotSupportedError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class NotSupportedError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.NotSupportedError-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.NotSupportedError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class NotSupportedError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ \r
- | \r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+\r
- |\r
- <strong class="uidshort">NotSupportedError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A not supported datbase API was called.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.OperationalError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class OperationalError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.OperationalError-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.OperationalError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class OperationalError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ \r
- | \r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+\r
- |\r
- <strong class="uidshort">OperationalError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Error related to database operation (disconnect, memory allocation etc).</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.ProgrammingError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class ProgrammingError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.ProgrammingError-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.ProgrammingError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class ProgrammingError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ \r
- | \r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+\r
- |\r
- <strong class="uidshort">ProgrammingError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Error related to database programming (SQL error, table not found etc).</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.Warning</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class Warning\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.Warning-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.Warning-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class Warning</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+\r
- |\r
- <strong class="uidshort">Warning</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A database warning.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2._psycopg</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Module _psycopg\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<strong>show private</strong> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="../private/psycopg2._psycopg-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE DESCRIPTION =========== -->\r
-<h2 class="module">Module psycopg2._psycopg</h2>\r
-\r
-<p>psycopg PostgreSQL driver</p>\r
-<hr/>\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Classes</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a></strong></td>\r
- <td>connection(dsn, ...) -> new connection object</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a></strong></td>\r
- <td>A database cursor.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>ISQLQuote</code></a></strong></td>\r
- <td>Abstract ISQLQuote protocol</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Function Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new quoted list</td>\r
- <td><code><a name="List"></a><span class="summary-sig"><span class="summary-sig-name">List</span>(<span class="summary-sig-arg">list</span>,\r
- <span class="summary-sig-arg">enc</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF VARIABLE SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Variable Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#__version__"><code>__version__</code></a></strong> = <span title="'2.0b7 (dt ext pq3)'"><code><span class="variable-quote">'</span>2.0b7 (dt ext pq3)<span class="variable-quote">'</span> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>PyCObject</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#_C_API"><code>_C_API</code></a></strong> = <span title="<PyCObject object at 0x0076A320>"><code><PyCObject object at 0x0076A320> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#adapters"><code>adapters</code></a></strong> = <span title="{(<type 'bool'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Boolean'>, (<type 'list'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.List'>, (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function TimestampFromPy>, (<type 'buffer'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Binary'>, (<type 'unicode'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.QuotedString'>, (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function DateFromPy>, (<type 'datetime.time'>, ..."><code>{(<type 'bool'>, <type 'psycopg2._psycopg.ISQ<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#apilevel"><code>apilevel</code></a></strong> = <span title="'2.0'"><code><span class="variable-quote">'</span>2.0<span class="variable-quote">'</span> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#BINARY"><code>BINARY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847A00>"><code><psycopg2._psycopg.type object at 0x00847A00> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#binary_types"><code>binary_types</code></a></strong> = <span title="{}"><code>{} </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#BINARYARRAY"><code>BINARYARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847CA0>"><code><psycopg2._psycopg.type object at 0x00847C<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#BOOLEAN"><code>BOOLEAN</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847880>"><code><psycopg2._psycopg.type object at 0x00847880> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#BOOLEANARRAY"><code>BOOLEANARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847BA0>"><code><psycopg2._psycopg.type object at 0x00847<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#DATE"><code>DATE</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847960>"><code><psycopg2._psycopg.type object at 0x00847960> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#DATEARRAY"><code>DATEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847C20>"><code><psycopg2._psycopg.type object at 0x00847C20<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#DATETIME"><code>DATETIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x008478C0>"><code><psycopg2._psycopg.type object at 0x008478C0> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#DATETIMEARRAY"><code>DATETIMEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847BC0>"><code><psycopg2._psycopg.type object at 0x0084<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#DECIMAL"><code>DECIMAL</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x008477A0>"><code><psycopg2._psycopg.type object at 0x008477A0> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#DECIMALARRAY"><code>DECIMALARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847B20>"><code><psycopg2._psycopg.type object at 0x00847<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#encodings"><code>encodings</code></a></strong> = <span title="{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL_ASCII': 'ascii', 'UNICODE': 'utf_8', 'LATIN1': 'latin_1'}"><code>{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#FLOAT"><code>FLOAT</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847740>"><code><psycopg2._psycopg.type object at 0x00847740> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#FLOATARRAY"><code>FLOATARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847AE0>"><code><psycopg2._psycopg.type object at 0x00847AE<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#INTEGER"><code>INTEGER</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847700>"><code><psycopg2._psycopg.type object at 0x00847700> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#INTEGERARRAY"><code>INTEGERARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847AC0>"><code><psycopg2._psycopg.type object at 0x00847<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#INTERVAL"><code>INTERVAL</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x008479A0>"><code><psycopg2._psycopg.type object at 0x008479A0> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#INTERVALARRAY"><code>INTERVALARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847C60>"><code><psycopg2._psycopg.type object at 0x0084<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#LONGINTEGER"><code>LONGINTEGER</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x008476C0>"><code><psycopg2._psycopg.type object at 0x008476<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#LONGINTEGERARRAY"><code>LONGINTEGERARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847AA0>"><code><psycopg2._psycopg.type object at 0x0<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#NUMBER"><code>NUMBER</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847680>"><code><psycopg2._psycopg.type object at 0x00847680> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#paramstyle"><code>paramstyle</code></a></strong> = <span title="'pyformat'"><code><span class="variable-quote">'</span>pyformat<span class="variable-quote">'</span> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#PYDATE"><code>PYDATE</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847DC0>"><code><psycopg2._psycopg.type object at 0x00847DC0> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#PYDATETIME"><code>PYDATETIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847D20>"><code><psycopg2._psycopg.type object at 0x00847D2<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#PYINTERVAL"><code>PYINTERVAL</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847DE0>"><code><psycopg2._psycopg.type object at 0x00847DE<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#PYTIME"><code>PYTIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847D60>"><code><psycopg2._psycopg.type object at 0x00847D60> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#ROWID"><code>ROWID</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847A60>"><code><psycopg2._psycopg.type object at 0x00847A60> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#ROWIDARRAY"><code>ROWIDARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847CC0>"><code><psycopg2._psycopg.type object at 0x00847CC<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#STRING"><code>STRING</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847820>"><code><psycopg2._psycopg.type object at 0x00847820> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#string_types"><code>string_types</code></a></strong> = <span title="{1028: <psycopg2._psycopg.type object at 0x00847CC0>, 1005: <psycopg2._psycopg.type object at 0x00847AC0>, 16: <psycopg2._psycopg.type object at 0x00847880>, 17: <psycopg2._psycopg.type object at 0x00847A00>, 1042: <psycopg2._psycopg.type object at 0x00847820>, 1043: <psycopg2._psycopg.type object at 0x00847820>, 20: <psycopg2._psycopg.type object at 0x008476C0>, 21: <psycopg2._psycopg.type object at 0x00847700>, 23: <psycopg2._psycopg.type object at 0x00847700>, 25: <psycopg2._psycopg.type object at 0x00847820>, 26: <psycopg2._psycopg.type object at 0x00847A60>, 1182: <psycopg2._psycopg.ty..."><code>{1028: <psycopg2._psycopg.type object at <span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#STRINGARRAY"><code>STRINGARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847B60>"><code><psycopg2._psycopg.type object at 0x00847B<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#threadsafety"><code>threadsafety</code></a></strong> = <span title="2">2 </span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#TIME"><code>TIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847900>"><code><psycopg2._psycopg.type object at 0x00847900> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#TIMEARRAY"><code>TIMEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847BE0>"><code><psycopg2._psycopg.type object at 0x00847BE0<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#UNICODE"><code>UNICODE</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x008477E0>"><code><psycopg2._psycopg.type object at 0x008477E0> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="../private/psycopg2._psycopg-module.html#UNICODEARRAY"><code>UNICODEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847B40>"><code><psycopg2._psycopg.type object at 0x00847<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Function Details</th></tr>\r
-</table>\r
-\r
-<a name="List"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">List</span>(<span class="sig-arg">list</span>,\r
- <span class="sig-arg">enc</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new quoted list </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF VARIABLE DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Variable Details</th></tr>\r
-</table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="__version__"></a>\r
-<h3>__version__</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>str</code>\r
-\r
- </dd>\r
- <dt title="'2.0b7 (dt ext pq3)'">Value:</dt>\r
- <dd title="'2.0b7 (dt ext pq3)'"><table><tr><td>\r
-<pre class="variable">\r
-<span class="variable-quote">'</span>2.0b7 (dt ext pq3)<span class="variable-quote">'</span> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="_C_API"></a>\r
-<h3>_C_API</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>PyCObject</code>\r
-\r
- </dd>\r
- <dt title="<PyCObject object at 0x0076A320>">Value:</dt>\r
- <dd title="<PyCObject object at 0x0076A320>"><table><tr><td>\r
-<pre class="variable">\r
-<PyCObject object at 0x0076A320> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="adapters"></a>\r
-<h3>adapters</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>dict</code>\r
-\r
- </dd>\r
- <dt title="{(<type 'bool'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Boolean'>, (<type 'list'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.List'>, (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function TimestampFromPy>, (<type 'buffer'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Binary'>, (<type 'unicode'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.QuotedString'>, (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function DateFromPy>, (<type 'datetime.time'>, ...">Value:</dt>\r
- <dd title="{(<type 'bool'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Boolean'>, (<type 'list'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.List'>, (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function TimestampFromPy>, (<type 'buffer'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Binary'>, (<type 'unicode'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.QuotedString'>, (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function DateFromPy>, (<type 'datetime.time'>, ..."><table><tr><td>\r
-<pre class="variable">\r
-{(<type 'datetime.timedelta'>, <type 'psycopg2._psycopg.ISQLQuote'>): <span class="variable-linewrap">\</span>\r
-<built-in function IntervalFromPy>,\r
- (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <buil<span class="variable-linewrap">\</span>\r
-t-in function DateFromPy>,\r
- (<type 'datetime.time'>, <type 'psycopg2._psycopg.ISQLQuote'>): <buil<span class="variable-linewrap">\</span>\r
-t-in function TimeFromPy>,\r
- (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <<span class="variable-linewrap">\</span>\r
-built-in function TimestampFromPy>,\r
-<span class="variable-ellipsis">...</span> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="apilevel"></a>\r
-<h3>apilevel</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>str</code>\r
-\r
- </dd>\r
- <dt title="'2.0'">Value:</dt>\r
- <dd title="'2.0'"><table><tr><td>\r
-<pre class="variable">\r
-<span class="variable-quote">'</span>2.0<span class="variable-quote">'</span> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="BINARY"></a>\r
-<h3>BINARY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847A00>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847A00>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847A00> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="binary_types"></a>\r
-<h3>binary_types</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>dict</code>\r
-\r
- </dd>\r
- <dt title="{}">Value:</dt>\r
- <dd title="{}"><table><tr><td>\r
-<pre class="variable">\r
-{} </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="BINARYARRAY"></a>\r
-<h3>BINARYARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847CA0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847CA0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847CA0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="BOOLEAN"></a>\r
-<h3>BOOLEAN</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847880>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847880>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847880> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="BOOLEANARRAY"></a>\r
-<h3>BOOLEANARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847BA0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847BA0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847BA0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DATE"></a>\r
-<h3>DATE</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847960>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847960>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847960> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DATEARRAY"></a>\r
-<h3>DATEARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847C20>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847C20>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847C20> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DATETIME"></a>\r
-<h3>DATETIME</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x008478C0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x008478C0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x008478C0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DATETIMEARRAY"></a>\r
-<h3>DATETIMEARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847BC0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847BC0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847BC0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DECIMAL"></a>\r
-<h3>DECIMAL</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x008477A0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x008477A0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x008477A0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DECIMALARRAY"></a>\r
-<h3>DECIMALARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847B20>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847B20>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847B20> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="encodings"></a>\r
-<h3>encodings</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>dict</code>\r
-\r
- </dd>\r
- <dt title="{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL_ASCII': 'ascii', 'UNICODE': 'utf_8', 'LATIN1': 'latin_1'}">Value:</dt>\r
- <dd title="{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL_ASCII': 'ascii', 'UNICODE': 'utf_8', 'LATIN1': 'latin_1'}"><table><tr><td>\r
-<pre class="variable">\r
-{'LATIN-1': 'latin_1',\r
- 'LATIN1': 'latin_1',\r
- 'SQL_ASCII': 'ascii',\r
- 'UNICODE': 'utf_8',\r
- 'UTF8': 'utf_8'} </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="FLOAT"></a>\r
-<h3>FLOAT</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847740>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847740>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847740> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="FLOATARRAY"></a>\r
-<h3>FLOATARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847AE0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847AE0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847AE0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="INTEGER"></a>\r
-<h3>INTEGER</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847700>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847700>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847700> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="INTEGERARRAY"></a>\r
-<h3>INTEGERARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847AC0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847AC0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847AC0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="INTERVAL"></a>\r
-<h3>INTERVAL</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x008479A0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x008479A0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x008479A0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="INTERVALARRAY"></a>\r
-<h3>INTERVALARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847C60>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847C60>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847C60> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="LONGINTEGER"></a>\r
-<h3>LONGINTEGER</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x008476C0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x008476C0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x008476C0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="LONGINTEGERARRAY"></a>\r
-<h3>LONGINTEGERARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847AA0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847AA0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847AA0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="NUMBER"></a>\r
-<h3>NUMBER</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847680>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847680>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847680> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="paramstyle"></a>\r
-<h3>paramstyle</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>str</code>\r
-\r
- </dd>\r
- <dt title="'pyformat'">Value:</dt>\r
- <dd title="'pyformat'"><table><tr><td>\r
-<pre class="variable">\r
-<span class="variable-quote">'</span>pyformat<span class="variable-quote">'</span> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="PYDATE"></a>\r
-<h3>PYDATE</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847DC0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847DC0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847DC0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="PYDATETIME"></a>\r
-<h3>PYDATETIME</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847D20>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847D20>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847D20> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="PYINTERVAL"></a>\r
-<h3>PYINTERVAL</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847DE0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847DE0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847DE0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="PYTIME"></a>\r
-<h3>PYTIME</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847D60>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847D60>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847D60> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ROWID"></a>\r
-<h3>ROWID</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847A60>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847A60>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847A60> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ROWIDARRAY"></a>\r
-<h3>ROWIDARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847CC0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847CC0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847CC0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="STRING"></a>\r
-<h3>STRING</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847820>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847820>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847820> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="string_types"></a>\r
-<h3>string_types</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>dict</code>\r
-\r
- </dd>\r
- <dt title="{1028: <psycopg2._psycopg.type object at 0x00847CC0>, 1005: <psycopg2._psycopg.type object at 0x00847AC0>, 16: <psycopg2._psycopg.type object at 0x00847880>, 17: <psycopg2._psycopg.type object at 0x00847A00>, 1042: <psycopg2._psycopg.type object at 0x00847820>, 1043: <psycopg2._psycopg.type object at 0x00847820>, 20: <psycopg2._psycopg.type object at 0x008476C0>, 21: <psycopg2._psycopg.type object at 0x00847700>, 23: <psycopg2._psycopg.type object at 0x00847700>, 25: <psycopg2._psycopg.type object at 0x00847820>, 26: <psycopg2._psycopg.type object at 0x00847A60>, 1182: <psycopg2._psycopg.ty...">Value:</dt>\r
- <dd title="{1028: <psycopg2._psycopg.type object at 0x00847CC0>, 1005: <psycopg2._psycopg.type object at 0x00847AC0>, 16: <psycopg2._psycopg.type object at 0x00847880>, 17: <psycopg2._psycopg.type object at 0x00847A00>, 1042: <psycopg2._psycopg.type object at 0x00847820>, 1043: <psycopg2._psycopg.type object at 0x00847820>, 20: <psycopg2._psycopg.type object at 0x008476C0>, 21: <psycopg2._psycopg.type object at 0x00847700>, 23: <psycopg2._psycopg.type object at 0x00847700>, 25: <psycopg2._psycopg.type object at 0x00847820>, 26: <psycopg2._psycopg.type object at 0x00847A60>, 1182: <psycopg2._psycopg.ty..."><table><tr><td>\r
-<pre class="variable">\r
-{16: <psycopg2._psycopg.type object at 0x00847880>,\r
- 17: <psycopg2._psycopg.type object at 0x00847A00>,\r
- 18: <psycopg2._psycopg.type object at 0x00847820>,\r
- 19: <psycopg2._psycopg.type object at 0x00847820>,\r
- 20: <psycopg2._psycopg.type object at 0x008476C0>,\r
- 21: <psycopg2._psycopg.type object at 0x00847700>,\r
- 23: <psycopg2._psycopg.type object at 0x00847700>,\r
- 25: <psycopg2._psycopg.type object at 0x00847820>,\r
-<span class="variable-ellipsis">...</span> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="STRINGARRAY"></a>\r
-<h3>STRINGARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847B60>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847B60>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847B60> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="threadsafety"></a>\r
-<h3>threadsafety</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="2">Value:</dt>\r
- <dd title="2"><table><tr><td>\r
-<pre class="variable">\r
-2 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="TIME"></a>\r
-<h3>TIME</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847900>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847900>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847900> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="TIMEARRAY"></a>\r
-<h3>TIMEARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847BE0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847BE0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847BE0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="UNICODE"></a>\r
-<h3>UNICODE</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x008477E0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x008477E0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x008477E0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="UNICODEARRAY"></a>\r
-<h3>UNICODEARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00847B40>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00847B40>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00847B40> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:33 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2._psycopg.ISQLQuote</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="../private/psycopg2._psycopg-module.html">Module _psycopg</a> ::\r
- Class ISQLQuote\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<strong>show private</strong> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="../private/psycopg2._psycopg.ISQLQuote-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type ISQLQuote</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">ISQLQuote</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Abstract ISQLQuote protocol</p>\r
-<p>An object conform to this protocol should expose a <tt class="docutils literal"><span class="pre">getquoted()</span></tt> method\r
-returning the SQL representation of the object.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#getbinary" class="summary-sig-name"><code>getbinary</code></a>()</span></code>\r
-<br />\r
-return SQL-quoted binary representation of this object</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#getbuffer" class="summary-sig-name"><code>getbuffer</code></a>()</span></code>\r
-<br />\r
-return this object</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#getquoted" class="summary-sig-name"><code>getquoted</code></a>()</span></code>\r
-<br />\r
-return SQL-quoted representation of this object</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF PROPERTY SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Property Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="_wrapped"></a><strong><code>_wrapped</code></strong></td></tr></table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__new__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,\r
- <span class="sig-arg">S</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-a new object with type S, a subtype of T\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="getbinary"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">getbinary</span>()</span>\r
- </h3>\r
-<p>return SQL-quoted binary representation of this object</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="getbuffer"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">getbuffer</span>()</span>\r
- </h3>\r
-<p>return this object</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="getquoted"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">getquoted</span>()</span>\r
- </h3>\r
-<p>return SQL-quoted representation of this object</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2._psycopg.connection</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="../private/psycopg2._psycopg-module.html">Module _psycopg</a> ::\r
- Class connection\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<strong>show private</strong> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="../private/psycopg2._psycopg.connection-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type connection</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">connection</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.psycopg1.connection-class.html"><code>connection</code></a>,\r
- <a href="psycopg2.extras.DictConnection-class.html"><code>DictConnection</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>connection(dsn, ...) -> new connection object</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#close" class="summary-sig-name"><code>close</code></a>()</span></code>\r
-<br />\r
-Close the connection.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#commit" class="summary-sig-name"><code>commit</code></a>()</span></code>\r
-<br />\r
-Commit all changes to database.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"><a href="../private/psycopg2._psycopg.cursor-class.html" class="link"><code>extensions.cursor</code></a></td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#cursor" class="summary-sig-name"><code>cursor</code></a>(<span class="summary-sig-arg">cursor_factory</span>)</span></code>\r
-<br />\r
-new cursor</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#rollback" class="summary-sig-name"><code>rollback</code></a>()</span></code>\r
-<br />\r
-Roll back all changes done to database.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#set_client_encoding" class="summary-sig-name"><code>set_client_encoding</code></a>(<span class="summary-sig-arg">encoding</span>)</span></code>\r
-<br />\r
-Set client encoding to <tt class="docutils literal docutils literal"><span class="pre">encoding</span></tt>.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#set_isolation_level" class="summary-sig-name"><code>set_isolation_level</code></a>(<span class="summary-sig-arg">level</span>)</span></code>\r
-<br />\r
-Switch isolation level to <tt class="docutils literal docutils literal"><span class="pre">level</span></tt>.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF PROPERTY SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Property Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#closed"><code>closed</code></a></strong>: True if the connection is closed.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#dsn"><code>dsn</code></a></strong>: The current connection string.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#encoding"><code>encoding</code></a></strong>: The current client encoding.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#isolation_level"><code>isolation_level</code></a></strong>: The current isolation level.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="notices"></a><strong><code>notices</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="notifies"></a><strong><code>notifies</code></strong></td></tr><tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> DBAPI-2.0 errors</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#Error"><code>Error</code></a></strong>: Base class for error exceptions.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#Warning"><code>Warning</code></a></strong>: A database warning.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#InterfaceError"><code>InterfaceError</code></a></strong>: Error related to the database interface.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#DatabaseError"><code>DatabaseError</code></a></strong>: Error related to the database engine.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#InternalError"><code>InternalError</code></a></strong>: The database encountered an internal error.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#OperationalError"><code>OperationalError</code></a></strong>: Error related to database operation (disconnect, memory allocation etc).</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#ProgrammingError"><code>ProgrammingError</code></a></strong>: Error related to database programming (SQL error, table not found etc).</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#IntegrityError"><code>IntegrityError</code></a></strong>: Error related to database integrity.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#DataError"><code>DataError</code></a></strong>: Error related to problems with the processed data.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#NotSupportedError"><code>NotSupportedError</code></a></strong>: A not supported datbase API was called.</td></tr></table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__new__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,\r
- <span class="sig-arg">S</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-a new object with type S, a subtype of T\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__repr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-repr(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__repr__"><code>__builtin__.object.__repr__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__str__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Informal representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-str(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__str__"><code>__builtin__.object.__str__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="close"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">close</span>()</span>\r
- </h3>\r
-<p>Close the connection.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="commit"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">commit</span>()</span>\r
- </h3>\r
-<p>Commit all changes to database.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="cursor"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">cursor</span>(<span class="sig-arg">cursor_factory</span>=<span class="sig-default">extensions.cursor</span>)</span>\r
- </h3>\r
-<p>new cursor</p>\r
-<p>Return a new cursor.</p>\r
-<p>The <tt class="docutils literal"><span class="pre">cursor_factory</span></tt> argument can be used to\r
-create non-standard cursors by passing a class different from the\r
-default. Note that the new class <em>should</em> be a sub-class of\r
-<a href="../private/psycopg2._psycopg.cursor-class.html" class="link"><code>extensions.cursor</code></a>.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<a href="../private/psycopg2._psycopg.cursor-class.html" class="link"><code>extensions.cursor</code></a> </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="rollback"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">rollback</span>()</span>\r
- </h3>\r
-<p>Roll back all changes done to database.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="set_client_encoding"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">set_client_encoding</span>(<span class="sig-arg">encoding</span>)</span>\r
- </h3>\r
-<p>Set client encoding to <tt class="docutils literal docutils literal docutils literal"><span class="pre">encoding</span></tt>.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="set_isolation_level"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">set_isolation_level</span>(<span class="sig-arg">level</span>)</span>\r
- </h3>\r
-<p>Switch isolation level to <tt class="docutils literal docutils literal docutils literal"><span class="pre">level</span></tt>.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF PROPERTY DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Property Details</th></tr>\r
-</table>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="Error"></a>\r
-<h3>Error</h3>\r
-<p>Base class for error exceptions.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="Warning"></a>\r
-<h3>Warning</h3>\r
-<p>A database warning.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="InterfaceError"></a>\r
-<h3>InterfaceError</h3>\r
-<p>Error related to the database interface.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="DatabaseError"></a>\r
-<h3>DatabaseError</h3>\r
-<p>Error related to the database engine.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="InternalError"></a>\r
-<h3>InternalError</h3>\r
-<p>The database encountered an internal error.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="OperationalError"></a>\r
-<h3>OperationalError</h3>\r
-<p>Error related to database operation (disconnect, memory allocation etc).</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="ProgrammingError"></a>\r
-<h3>ProgrammingError</h3>\r
-<p>Error related to database programming (SQL error, table not found etc).</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="IntegrityError"></a>\r
-<h3>IntegrityError</h3>\r
-<p>Error related to database integrity.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="DataError"></a>\r
-<h3>DataError</h3>\r
-<p>Error related to problems with the processed data.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="NotSupportedError"></a>\r
-<h3>NotSupportedError</h3>\r
-<p>A not supported datbase API was called.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="closed"></a>\r
-<h3>closed</h3>\r
-<p>True if the connection is closed.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="dsn"></a>\r
-<h3>dsn</h3>\r
-<p>The current connection string.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="encoding"></a>\r
-<h3>encoding</h3>\r
-<p>The current client encoding.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="isolation_level"></a>\r
-<h3>isolation_level</h3>\r
-<p>The current isolation level.</p>\r
-</td></tr></table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:31 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2._psycopg.cursor</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="../private/psycopg2._psycopg-module.html">Module _psycopg</a> ::\r
- Class cursor\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<strong>show private</strong> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="../private/psycopg2._psycopg.cursor-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type cursor</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">cursor</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.psycopg1.cursor-class.html"><code>cursor</code></a>,\r
- <a href="psycopg2.extras.DictCursor-class.html"><code>DictCursor</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>A database cursor.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__iter__"></a><span class="summary-sig"><span class="summary-sig-name">__iter__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return iter(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#callproc" class="summary-sig-name"><code>callproc</code></a>(<span class="summary-sig-arg">procname</span>,\r
- <span class="summary-sig-arg">parameters</span>,\r
- <span class="summary-sig-arg">async</span>)</span></code>\r
-<br />\r
-Execute stored procedure.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#close" class="summary-sig-name"><code>close</code></a>()</span></code>\r
-<br />\r
-Close the cursor.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_from" class="summary-sig-name"><code>copy_from</code></a>(<span class="summary-sig-arg">file</span>,\r
- <span class="summary-sig-arg">table</span>,\r
- <span class="summary-sig-arg">sep</span>,\r
- <span class="summary-sig-arg">null</span>)</span></code>\r
-<br />\r
-Copy table from file.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_to" class="summary-sig-name"><code>copy_to</code></a>(<span class="summary-sig-arg">file</span>,\r
- <span class="summary-sig-arg">table</span>,\r
- <span class="summary-sig-arg">sep</span>,\r
- <span class="summary-sig-arg">null</span>)</span></code>\r
-<br />\r
-Copy table to file.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#execute" class="summary-sig-name"><code>execute</code></a>(<span class="summary-sig-arg">query</span>,\r
- <span class="summary-sig-arg">vars</span>,\r
- <span class="summary-sig-arg">async</span>)</span></code>\r
-<br />\r
-Execute query with bound vars.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#executemany" class="summary-sig-name"><code>executemany</code></a>(<span class="summary-sig-arg">query</span>,\r
- <span class="summary-sig-arg">vars_list</span>,\r
- <span class="summary-sig-arg">async</span>)</span></code>\r
-<br />\r
-Execute many queries with bound vars.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">list of tuple</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchall" class="summary-sig-name"><code>fetchall</code></a>()</span></code>\r
-<br />\r
-Return all the remaining rows of a query result set.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">list of tuple</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="summary-sig-name"><code>fetchmany</code></a>(<span class="summary-sig-arg">size</span>)</span></code>\r
-<br />\r
-Return the next <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>size</code></a> rows of a query result set in the form of a list\r
-of tuples (by default) or using the sequence factory previously set in\r
-the <a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">tuple or None</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchone" class="summary-sig-name"><code>fetchone</code></a>()</span></code>\r
-<br />\r
-Return the next row of a query result set in the form of a tuple (by\r
-default) or using the sequence factory previously set in the\r
-<a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">int</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fileno" class="summary-sig-name"><code>fileno</code></a>()</span></code>\r
-<br />\r
-Return file descriptor associated to database connection.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">bool</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#isready" class="summary-sig-name"><code>isready</code></a>()</span></code>\r
-<br />\r
-Return True if data is ready after an async query.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">str</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#mogrify" class="summary-sig-name"><code>mogrify</code></a>(<span class="summary-sig-arg">query</span>,\r
- <span class="summary-sig-arg">vars</span>)</span></code>\r
-<br />\r
-Return query after vars binding.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="next"></a><span class="summary-sig"><span class="summary-sig-name">next</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return the next value, or raise StopIteration...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#nextset" class="summary-sig-name"><code>nextset</code></a>()</span></code>\r
-<br />\r
-Skip to next set of data.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#scroll" class="summary-sig-name"><code>scroll</code></a>(<span class="summary-sig-arg">value</span>,\r
- <span class="summary-sig-arg">mode</span>)</span></code>\r
-<br />\r
-Scroll to new position according to mode.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#setinputsizes" class="summary-sig-name"><code>setinputsizes</code></a>(<span class="summary-sig-arg">sizes</span>)</span></code>\r
-<br />\r
-Set memory areas before execute.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#setoutputsize" class="summary-sig-name"><code>setoutputsize</code></a>(<span class="summary-sig-arg">size</span>,\r
- <span class="summary-sig-arg">column</span>)</span></code>\r
-<br />\r
-Set column buffer size.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF PROPERTY SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Property Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#arraysize"><code>arraysize</code></a></strong>: Number of records <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>fetchmany()</code></a> must fetch if not explicitely specified.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="binary_types"></a><strong><code>binary_types</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#connection"><code>connection</code></a></strong>: The connection where the cursor comes from.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#description"><code>description</code></a></strong>: Cursor description as defined in DBAPI-2.0.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#lastrowid"><code>lastrowid</code></a></strong>: The <tt class="docutils literal docutils literal docutils literal"><span class="pre">oid</span></tt> of the last row inserted by the cursor.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="name"></a><strong><code>name</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#query"><code>query</code></a></strong>: The last query text sent to the backend.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="row_factory"></a><strong><code>row_factory</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#rowcount"><code>rowcount</code></a></strong>: Number of rows read from the backend in the last command.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#rownumber"><code>rownumber</code></a></strong>: The current row position.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#statusmessage"><code>statusmessage</code></a></strong>: The return message of the last command.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="string_types"></a><strong><code>string_types</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="typecaster"></a><strong><code>typecaster</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="tzinfo_factory"></a><strong><code>tzinfo_factory</code></strong></td></tr></table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__iter__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__iter__</span>(<span class="sig-arg">x</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-iter(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__new__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,\r
- <span class="sig-arg">S</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-a new object with type S, a subtype of T\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__repr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-repr(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__repr__"><code>__builtin__.object.__repr__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__str__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Informal representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-str(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__str__"><code>__builtin__.object.__str__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="callproc"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">callproc</span>(<span class="sig-arg">procname</span>,\r
- <span class="sig-arg">parameters</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">async</span>=<span class="sig-default">0</span>)</span>\r
- </h3>\r
-<p>Execute stored procedure.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="close"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">close</span>()</span>\r
- </h3>\r
-<p>Close the cursor.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="copy_from"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">copy_from</span>(<span class="sig-arg">file</span>,\r
- <span class="sig-arg">table</span>,\r
- <span class="sig-arg">sep</span>=<span class="sig-default">'\t'</span>,\r
- <span class="sig-arg">null</span>=<span class="sig-default">'\N'</span>)</span>\r
- </h3>\r
-<p>Copy table from file.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="copy_to"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">copy_to</span>(<span class="sig-arg">file</span>,\r
- <span class="sig-arg">table</span>,\r
- <span class="sig-arg">sep</span>=<span class="sig-default">'\t'</span>,\r
- <span class="sig-arg">null</span>=<span class="sig-default">'\N'</span>)</span>\r
- </h3>\r
-<p>Copy table to file.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="execute"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">execute</span>(<span class="sig-arg">query</span>,\r
- <span class="sig-arg">vars</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">async</span>=<span class="sig-default">0</span>)</span>\r
- </h3>\r
-<p>Execute query with bound vars.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="executemany"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">executemany</span>(<span class="sig-arg">query</span>,\r
- <span class="sig-arg">vars_list</span>=<span class="sig-default">()</span>,\r
- <span class="sig-arg">async</span>=<span class="sig-default">0</span>)</span>\r
- </h3>\r
-<p>Execute many queries with bound vars.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="fetchall"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">fetchall</span>()</span>\r
- </h3>\r
-<p>Return all the remaining rows of a query result set.</p>\r
-<p>Rows are returned in the form of a list of tuples (by default) or using\r
-the sequence factory previously set in the <a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute.\r
-Return <code>None</code> when no more data is available.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-list of tuple </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="fetchmany"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">fetchmany</span>(<span class="sig-arg">size</span>=<span class="sig-default">self.arraysize</span>)</span>\r
- </h3>\r
-<p>Return the next <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>size</code></a> rows of a query result set in the form of a list\r
-of tuples (by default) or using the sequence factory previously set in\r
-the <a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute. Return <code>None</code> when no more data is available.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-list of tuple </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="fetchone"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">fetchone</span>()</span>\r
- </h3>\r
-<p>Return the next row of a query result set in the form of a tuple (by\r
-default) or using the sequence factory previously set in the\r
-<a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute. Return <code>None</code> when no more data is available.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-tuple or None </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="fileno"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">fileno</span>()</span>\r
- </h3>\r
-<p>Return file descriptor associated to database connection.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-int </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="isready"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">isready</span>()</span>\r
- </h3>\r
-<p>Return True if data is ready after an async query.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-bool </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="mogrify"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">mogrify</span>(<span class="sig-arg">query</span>,\r
- <span class="sig-arg">vars</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>Return query after vars binding.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-str </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="next"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">next</span>(<span class="sig-arg">x</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-the next value, or raise StopIteration\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="nextset"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">nextset</span>()</span>\r
- </h3>\r
-<p>Skip to next set of data.</p>\r
-<p>This method is not supported (PostgreSQL does not have multiple data \r
-sets) and will raise a NotSupportedError exception.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="scroll"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">scroll</span>(<span class="sig-arg">value</span>,\r
- <span class="sig-arg">mode</span>=<span class="sig-default">'relative'</span>)</span>\r
- </h3>\r
-<p>Scroll to new position according to mode.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="setinputsizes"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">setinputsizes</span>(<span class="sig-arg">sizes</span>)</span>\r
- </h3>\r
-<p>Set memory areas before execute.</p>\r
-<p>This method currently does nothing but it is safe to call it.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="setoutputsize"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">setoutputsize</span>(<span class="sig-arg">size</span>,\r
- <span class="sig-arg">column</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>Set column buffer size.</p>\r
-<p>This method currently does nothing but it is safe to call it.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF PROPERTY DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Property Details</th></tr>\r
-</table>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="arraysize"></a>\r
-<h3>arraysize</h3>\r
-<p>Number of records <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>fetchmany()</code></a> must fetch if not explicitely specified.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="connection"></a>\r
-<h3>connection</h3>\r
-<p>The connection where the cursor comes from.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="description"></a>\r
-<h3>description</h3>\r
-<p>Cursor description as defined in DBAPI-2.0.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="lastrowid"></a>\r
-<h3>lastrowid</h3>\r
-<p>The <tt class="docutils literal docutils literal docutils literal docutils literal"><span class="pre">oid</span></tt> of the last row inserted by the cursor.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="query"></a>\r
-<h3>query</h3>\r
-<p>The last query text sent to the backend.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="rowcount"></a>\r
-<h3>rowcount</h3>\r
-<p>Number of rows read from the backend in the last command.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="rownumber"></a>\r
-<h3>rownumber</h3>\r
-<p>The current row position.</p>\r
-</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
-\r
-<a name="statusmessage"></a>\r
-<h3>statusmessage</h3>\r
-<p>The return message of the last command.</p>\r
-</td></tr></table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extensions</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Module extensions\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.extensions-module.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extensions-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE DESCRIPTION =========== -->\r
-<h2 class="module">Module psycopg2.extensions</h2>\r
-\r
-<p>psycopg extensions to the DBAPI-2.0</p>\r
-<p>This module holds all the extensions to the DBAPI-2.0 provided by psycopg.</p>\r
-<ul class="rst-simple">\r
-<li><a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>connection</code></a> -- the new-type inheritable connection class</li>\r
-<li><a href="../private/psycopg2._psycopg.cursor-class.html" class="link"><code>cursor</code></a> -- the new-type inheritable cursor class</li>\r
-<li><a href="psycopg2.extensions-module.html#adapt" class="link"><code>adapt()</code></a> -- exposes the <a class="reference" href="http://www.python.org/peps/pep-0246.html">PEP-246</a> compatible adapting mechanism used\r
-by psycopg to adapt Python types to PostgreSQL ones</li>\r
-</ul>\r
-<hr/>\r
-\r
-<!-- =========== START OF FUNCTION SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Function Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">object</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#adapt" class="summary-sig-name"><code>adapt</code></a>(<span class="summary-sig-arg">obj</span>,\r
- <span class="summary-sig-arg">protocol</span>,\r
- <span class="summary-sig-arg">alternate</span>)</span></code>\r
-<br />\r
-adapt obj to given protocol</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new AsIs wrapper object</td>\r
- <td><code><a name="AsIs"></a><span class="summary-sig"><span class="summary-sig-name">AsIs</span>(<span class="summary-sig-arg">obj</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new boolean value</td>\r
- <td><code><a name="Boolean"></a><span class="summary-sig"><span class="summary-sig-name">Boolean</span>(<span class="summary-sig-arg">obj</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td>\r
- <td><code><a name="DateFromPy"></a><span class="summary-sig"><span class="summary-sig-name">DateFromPy</span>(<span class="summary-sig-arg">datetime.date</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td>\r
- <td><code><a name="IntervalFromPy"></a><span class="summary-sig"><span class="summary-sig-name">IntervalFromPy</span>(<span class="summary-sig-arg">datetime.timedelta</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new type object</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#new_type" class="summary-sig-name"><code>new_type</code></a>(<span class="summary-sig-arg">oids</span>,\r
- <span class="summary-sig-arg">name</span>,\r
- <span class="summary-sig-arg">adapter</span>)</span></code>\r
-<br />\r
-Create a new binding object.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new quoted string</td>\r
- <td><code><a name="QuotedString"></a><span class="summary-sig"><span class="summary-sig-name">QuotedString</span>(<span class="summary-sig-arg">str</span>,\r
- <span class="summary-sig-arg">enc</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#register_adapter" class="summary-sig-name"><code>register_adapter</code></a>(<span class="summary-sig-arg">typ</span>,\r
- <span class="summary-sig-arg">callable</span>)</span></code>\r
-<br />\r
-Register 'callable' as an ISQLQuote adapter for type 'typ'.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">None</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#register_type" class="summary-sig-name"><code>register_type</code></a>(<span class="summary-sig-arg">obj</span>)</span></code>\r
-<br />\r
-register obj with psycopg type system</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td>\r
- <td><code><a name="TimeFromPy"></a><span class="summary-sig"><span class="summary-sig-name">TimeFromPy</span>(<span class="summary-sig-arg">datetime.time</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td>\r
- <td><code><a name="TimestampFromPy"></a><span class="summary-sig"><span class="summary-sig-name">TimestampFromPy</span>(<span class="summary-sig-arg">datetime.datetime</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF VARIABLE SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Variable Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT"><code>ISOLATION_LEVEL_AUTOCOMMIT</code></a></strong> = <span title="0">0 </span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED"><code>ISOLATION_LEVEL_READ_COMMITTED</code></a></strong> = <span title="1">1 </span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED"><code>ISOLATION_LEVEL_READ_UNCOMMITTED</code></a></strong> = <span title="1">1 </span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ"><code>ISOLATION_LEVEL_REPEATABLE_READ</code></a></strong> = <span title="2">2 </span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE"><code>ISOLATION_LEVEL_SERIALIZABLE</code></a></strong> = <span title="2">2 </span></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Function Details</th></tr>\r
-</table>\r
-\r
-<a name="adapt"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">adapt</span>(<span class="sig-arg">obj</span>,\r
- <span class="sig-arg">protocol</span>,\r
- <span class="sig-arg">alternate</span>)</span>\r
- </h3>\r
-<p>adapt obj to given protocol</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-object </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="AsIs"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">AsIs</span>(<span class="sig-arg">obj</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new AsIs wrapper object </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="Boolean"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">Boolean</span>(<span class="sig-arg">obj</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new boolean value </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="DateFromPy"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">DateFromPy</span>(<span class="sig-arg">datetime.date</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new wrapper </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="IntervalFromPy"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">IntervalFromPy</span>(<span class="sig-arg">datetime.timedelta</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new wrapper </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="new_type"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">new_type</span>(<span class="sig-arg">oids</span>,\r
- <span class="sig-arg">name</span>,\r
- <span class="sig-arg">adapter</span>)</span>\r
- </h3>\r
-<p>Create a new binding object. The object can be used with the\r
-<a href="psycopg2.extensions-module.html#register_type" class="link"><code>register_type()</code></a> function to bind PostgreSQL objects to python objects.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Parameters:</dt>\r
- <dd><code><strong class="pname">oids</strong></code> -\r
- Tuple of <tt class="docutils literal"><span class="pre">oid</span></tt> of the PostgreSQL types to convert.\r
- </dd>\r
- <dd><code><strong class="pname">name</strong></code> -\r
- Name for the new type\r
- </dd>\r
- <dd><code><strong class="pname">adapter</strong></code> -\r
- Callable to perform type conversion.\r
-It must have the signature <tt class="docutils literal"><span class="pre">fun(value,</span> <span class="pre">cur)</span></tt> where <tt class="docutils literal"><span class="pre">value</span></tt> is\r
-the string representation returned by PostgreSQL (<code>None</code> if <tt class="docutils literal"><span class="pre">NULL</span></tt>)\r
-and <tt class="docutils literal"><span class="pre">cur</span></tt> is the cursor from which data are read.\r
- </dd>\r
- </dl>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new type object </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="QuotedString"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">QuotedString</span>(<span class="sig-arg">str</span>,\r
- <span class="sig-arg">enc</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new quoted string </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="register_adapter"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">register_adapter</span>(<span class="sig-arg">typ</span>,\r
- <span class="sig-arg">callable</span>)</span>\r
- </h3>\r
-<p>Register 'callable' as an ISQLQuote adapter for type 'typ'.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="register_type"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">register_type</span>(<span class="sig-arg">obj</span>)</span>\r
- </h3>\r
-<p>register obj with psycopg type system</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Parameters:</dt>\r
- <dd><code><strong class="pname">obj</strong></code> -\r
- A type adapter created by <a href="psycopg2.extensions-module.html#new_type" class="link"><code>new_type()</code></a>\r
- </dd>\r
- </dl>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-None </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="TimeFromPy"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">TimeFromPy</span>(<span class="sig-arg">datetime.time</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new wrapper </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="TimestampFromPy"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">TimestampFromPy</span>(<span class="sig-arg">datetime.datetime</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new wrapper </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF VARIABLE DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Variable Details</th></tr>\r
-</table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ISOLATION_LEVEL_AUTOCOMMIT"></a>\r
-<h3>ISOLATION_LEVEL_AUTOCOMMIT</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="0">Value:</dt>\r
- <dd title="0"><table><tr><td>\r
-<pre class="variable">\r
-0 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ISOLATION_LEVEL_READ_COMMITTED"></a>\r
-<h3>ISOLATION_LEVEL_READ_COMMITTED</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="1">Value:</dt>\r
- <dd title="1"><table><tr><td>\r
-<pre class="variable">\r
-1 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ISOLATION_LEVEL_READ_UNCOMMITTED"></a>\r
-<h3>ISOLATION_LEVEL_READ_UNCOMMITTED</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="1">Value:</dt>\r
- <dd title="1"><table><tr><td>\r
-<pre class="variable">\r
-1 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ISOLATION_LEVEL_REPEATABLE_READ"></a>\r
-<h3>ISOLATION_LEVEL_REPEATABLE_READ</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="2">Value:</dt>\r
- <dd title="2"><table><tr><td>\r
-<pre class="variable">\r
-2 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ISOLATION_LEVEL_SERIALIZABLE"></a>\r
-<h3>ISOLATION_LEVEL_SERIALIZABLE</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="2">Value:</dt>\r
- <dd title="2"><table><tr><td>\r
-<pre class="variable">\r
-2 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extras</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Module extras\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.extras-module.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE DESCRIPTION =========== -->\r
-<h2 class="module">Module psycopg2.extras</h2>\r
-\r
-<p>Miscellaneous goodies for psycopg2</p>\r
-<p>This module is a generic place used to hold little helper functions\r
-and classes untill a better place in the distribution is found.</p>\r
-<hr/>\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Classes</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.extras.DictConnection-class.html"><code>DictConnection</code></a></strong></td>\r
- <td>A connection that uses DictCursor automatically.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.extras.DictCursor-class.html"><code>DictCursor</code></a></strong></td>\r
- <td>A cursor that keeps a list of column name -> index mappings.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.extras.DictRow-class.html"><code>DictRow</code></a></strong></td>\r
- <td>A row object that allow by-colun-name access to data.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.extras.SQL_IN-class.html"><code>SQL_IN</code></a></strong></td>\r
- <td>Adapt any iterable to an SQL quotable object.</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extras.DictConnection</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.extras-module.html">Module extras</a> ::\r
- Class DictConnection\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.extras.DictConnection-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.DictConnection-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type DictConnection</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
-<a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a> --+\r
- |\r
- <strong class="uidshort">DictConnection</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A connection that uses DictCursor automatically.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="cursor"></a><span class="summary-sig"><span class="summary-sig-name">cursor</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from connection</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#close" class="summary-sig-name"><code>close</code></a>()</span></code>\r
-<br />\r
-Close the connection.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#commit" class="summary-sig-name"><code>commit</code></a>()</span></code>\r
-<br />\r
-Commit all changes to database.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#rollback" class="summary-sig-name"><code>rollback</code></a>()</span></code>\r
-<br />\r
-Roll back all changes done to database.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#set_client_encoding" class="summary-sig-name"><code>set_client_encoding</code></a>(<span class="summary-sig-arg">encoding</span>)</span></code>\r
-<br />\r
-Set client encoding to <tt class="docutils literal"><span class="pre">encoding</span></tt>.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#set_isolation_level" class="summary-sig-name"><code>set_isolation_level</code></a>(<span class="summary-sig-arg">level</span>)</span></code>\r
-<br />\r
-Switch isolation level to <tt class="docutils literal"><span class="pre">level</span></tt>.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF PROPERTY SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Property Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from connection</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#closed"><code>closed</code></a></strong>: True if the connection is closed.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#DatabaseError"><code>DatabaseError</code></a></strong>: Error related to the database engine.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#DataError"><code>DataError</code></a></strong>: Error related to problems with the processed data.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#dsn"><code>dsn</code></a></strong>: The current connection string.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#encoding"><code>encoding</code></a></strong>: The current client encoding.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#Error"><code>Error</code></a></strong>: Base class for error exceptions.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#IntegrityError"><code>IntegrityError</code></a></strong>: Error related to database integrity.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#InterfaceError"><code>InterfaceError</code></a></strong>: Error related to the database interface.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#InternalError"><code>InternalError</code></a></strong>: The database encountered an internal error.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#isolation_level"><code>isolation_level</code></a></strong>: The current isolation level.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#notices"><code>notices</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#notifies"><code>notifies</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#NotSupportedError"><code>NotSupportedError</code></a></strong>: A not supported datbase API was called.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#OperationalError"><code>OperationalError</code></a></strong>: Error related to database operation (disconnect, memory allocation etc).</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#ProgrammingError"><code>ProgrammingError</code></a></strong>: Error related to database programming (SQL error, table not found etc).</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#Warning"><code>Warning</code></a></strong>: A database warning.</td></tr></table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="cursor"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">cursor</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.connection-class.html#cursor"><code>psycopg2._psycopg.connection.cursor</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:31 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extras.DictCursor</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.extras-module.html">Module extras</a> ::\r
- Class DictCursor\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.extras.DictCursor-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.DictCursor-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type DictCursor</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
- <a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a> --+\r
- |\r
- <strong class="uidshort">DictCursor</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A cursor that keeps a list of column name -> index mappings.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="callproc"></a><span class="summary-sig"><span class="summary-sig-name">callproc</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">procname</span>,\r
- <span class="summary-sig-arg">vars</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="execute"></a><span class="summary-sig"><span class="summary-sig-name">execute</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">query</span>,\r
- <span class="summary-sig-arg">vars</span>,\r
- <span class="summary-sig-arg">async</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="fetchall"></a><span class="summary-sig"><span class="summary-sig-name">fetchall</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="fetchmany"></a><span class="summary-sig"><span class="summary-sig-name">fetchmany</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">size</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="fetchone"></a><span class="summary-sig"><span class="summary-sig-name">fetchone</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="_build_index"></a><span class="summary-sig"><span class="summary-sig-name">_build_index</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from cursor</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__iter__" class="summary-sig-name"><code>__iter__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return iter(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#close" class="summary-sig-name"><code>close</code></a>()</span></code>\r
-<br />\r
-Close the cursor.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_from" class="summary-sig-name"><code>copy_from</code></a>(<span class="summary-sig-arg">file</span>,\r
- <span class="summary-sig-arg">table</span>,\r
- <span class="summary-sig-arg">sep</span>,\r
- <span class="summary-sig-arg">null</span>)</span></code>\r
-<br />\r
-Copy table from file.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_to" class="summary-sig-name"><code>copy_to</code></a>(<span class="summary-sig-arg">file</span>,\r
- <span class="summary-sig-arg">table</span>,\r
- <span class="summary-sig-arg">sep</span>,\r
- <span class="summary-sig-arg">null</span>)</span></code>\r
-<br />\r
-Copy table to file.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#executemany" class="summary-sig-name"><code>executemany</code></a>(<span class="summary-sig-arg">query</span>,\r
- <span class="summary-sig-arg">vars_list</span>,\r
- <span class="summary-sig-arg">async</span>)</span></code>\r
-<br />\r
-Execute many queries with bound vars.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">int</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fileno" class="summary-sig-name"><code>fileno</code></a>()</span></code>\r
-<br />\r
-Return file descriptor associated to database connection.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">bool</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#isready" class="summary-sig-name"><code>isready</code></a>()</span></code>\r
-<br />\r
-Return True if data is ready after an async query.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">str</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#mogrify" class="summary-sig-name"><code>mogrify</code></a>(<span class="summary-sig-arg">query</span>,\r
- <span class="summary-sig-arg">vars</span>)</span></code>\r
-<br />\r
-Return query after vars binding.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#next" class="summary-sig-name"><code>next</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return the next value, or raise StopIteration...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#nextset" class="summary-sig-name"><code>nextset</code></a>()</span></code>\r
-<br />\r
-Skip to next set of data.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#scroll" class="summary-sig-name"><code>scroll</code></a>(<span class="summary-sig-arg">value</span>,\r
- <span class="summary-sig-arg">mode</span>)</span></code>\r
-<br />\r
-Scroll to new position according to mode.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#setinputsizes" class="summary-sig-name"><code>setinputsizes</code></a>(<span class="summary-sig-arg">sizes</span>)</span></code>\r
-<br />\r
-Set memory areas before execute.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#setoutputsize" class="summary-sig-name"><code>setoutputsize</code></a>(<span class="summary-sig-arg">size</span>,\r
- <span class="summary-sig-arg">column</span>)</span></code>\r
-<br />\r
-Set column buffer size.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF PROPERTY SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Property Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from cursor</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#arraysize"><code>arraysize</code></a></strong>: Number of records <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>fetchmany()</code></a> must fetch if not explicitely specified.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#binary_types"><code>binary_types</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#connection"><code>connection</code></a></strong>: The connection where the cursor comes from.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#description"><code>description</code></a></strong>: Cursor description as defined in DBAPI-2.0.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#lastrowid"><code>lastrowid</code></a></strong>: The <tt class="docutils literal"><span class="pre">oid</span></tt> of the last row inserted by the cursor.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#name"><code>name</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#query"><code>query</code></a></strong>: The last query text sent to the backend.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#row_factory"><code>row_factory</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#rowcount"><code>rowcount</code></a></strong>: Number of rows read from the backend in the last command.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#rownumber"><code>rownumber</code></a></strong>: The current row position.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#statusmessage"><code>statusmessage</code></a></strong>: The return message of the last command.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#string_types"><code>string_types</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#typecaster"><code>typecaster</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#tzinfo_factory"><code>tzinfo_factory</code></a></strong></td></tr></table><br />\r
-\r
-\r
-<!-- =========== START OF CLASS VARIABLE SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Class Variable Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="../private/psycopg2.extras.DictCursor-class.html#__query_executed"><code>_DictCursor__query_executed</code></a></strong> = <span title="0">0 </span></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="callproc"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">callproc</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">procname</span>,\r
- <span class="sig-arg">vars</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.cursor-class.html#callproc"><code>psycopg2._psycopg.cursor.callproc</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="execute"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">execute</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">query</span>,\r
- <span class="sig-arg">vars</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">async</span>=<span class="sig-default">0</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.cursor-class.html#execute"><code>psycopg2._psycopg.cursor.execute</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="fetchall"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">fetchall</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.cursor-class.html#fetchall"><code>psycopg2._psycopg.cursor.fetchall</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="fetchmany"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">fetchmany</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">size</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany"><code>psycopg2._psycopg.cursor.fetchmany</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="fetchone"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">fetchone</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.cursor-class.html#fetchone"><code>psycopg2._psycopg.cursor.fetchone</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="_build_index"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">_build_index</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF CLASS VARIABLE DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Class Variable Details</th></tr>\r
-</table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="_DictCursor__query_executed"></a>\r
-<h3>_DictCursor__query_executed</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="0">Value:</dt>\r
- <dd title="0"><table><tr><td>\r
-<pre class="variable">\r
-0 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extras.DictRow</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.extras-module.html">Module extras</a> ::\r
- Class DictRow\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.extras.DictRow-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.DictRow-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type DictRow</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
- <a href="__builtin__.list-class.html"><code>list</code></a> --+\r
- |\r
- <strong class="uidshort">DictRow</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A row object that allow by-colun-name access to data.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">cursor</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__getitem__"></a><span class="summary-sig"><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">x</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="get"></a><span class="summary-sig"><span class="summary-sig-name">get</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">default</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="has_key"></a><span class="summary-sig"><span class="summary-sig-name">has_key</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">x</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="items"></a><span class="summary-sig"><span class="summary-sig-name">items</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="keys"></a><span class="summary-sig"><span class="summary-sig-name">keys</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="values"></a><span class="summary-sig"><span class="summary-sig-name">values</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from list</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__add__" class="summary-sig-name"><code>__add__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x+y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__contains__" class="summary-sig-name"><code>__contains__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return y in x...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__delitem__" class="summary-sig-name"><code>__delitem__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return del x[y]...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__delslice__" class="summary-sig-name"><code>__delslice__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">j</span>)</span></code>\r
-<br />\r
-Use of negative indices is not supported.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__eq__" class="summary-sig-name"><code>__eq__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x==y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__ge__" class="summary-sig-name"><code>__ge__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x>=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getslice__" class="summary-sig-name"><code>__getslice__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">j</span>)</span></code>\r
-<br />\r
-Use of negative indices is not supported.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__gt__" class="summary-sig-name"><code>__gt__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x>y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__iadd__" class="summary-sig-name"><code>__iadd__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x+=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__imul__" class="summary-sig-name"><code>__imul__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x*=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__iter__" class="summary-sig-name"><code>__iter__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return iter(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__le__" class="summary-sig-name"><code>__le__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x<=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__len__" class="summary-sig-name"><code>__len__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return len(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__lt__" class="summary-sig-name"><code>__lt__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x<y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__mul__" class="summary-sig-name"><code>__mul__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">n</span>)</span></code>\r
-<br />\r
-Return x*n...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__ne__" class="summary-sig-name"><code>__ne__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x!=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__rmul__" class="summary-sig-name"><code>__rmul__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">n</span>)</span></code>\r
-<br />\r
-Return n*x...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__setitem__" class="summary-sig-name"><code>__setitem__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x[i]=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__setslice__" class="summary-sig-name"><code>__setslice__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">j</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Use of negative indices is not supported.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#append" class="summary-sig-name"><code>append</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">object</span>)</span></code>\r
-<br />\r
-append object to end</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#count" class="summary-sig-name"><code>count</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">value</span>)</span></code>\r
-<br />\r
-return number of occurrences of value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#extend" class="summary-sig-name"><code>extend</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">iterable</span>)</span></code>\r
-<br />\r
-extend list by appending elements from the iterable</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#index" class="summary-sig-name"><code>index</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-L.index(value, [start, [stop]]) -> integer -- return first index of value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#insert" class="summary-sig-name"><code>insert</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">index</span>,\r
- <span class="summary-sig-arg">object</span>)</span></code>\r
-<br />\r
-insert object before index</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#pop" class="summary-sig-name"><code>pop</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">index</span>)</span></code>\r
-<br />\r
-remove and return item at index (default last)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#remove" class="summary-sig-name"><code>remove</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">value</span>)</span></code>\r
-<br />\r
-remove first occurrence of value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#reverse" class="summary-sig-name"><code>reverse</code></a>(<span class="summary-sig-arg">L</span>)</span></code>\r
-<br />\r
-reverse <em>IN PLACE</em></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#sort" class="summary-sig-name"><code>sort</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">cmpfunc</span>)</span></code>\r
-<br />\r
-stable sort <em>IN PLACE</em>; cmpfunc(x, y) -> -1, 0, 1</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">cursor</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.list-class.html#__init__"><code>__builtin__.list.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getitem__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Indexing operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.list-class.html#__getitem__"><code>__builtin__.list.__getitem__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="get"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">get</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">x</span>,\r
- <span class="sig-arg">default</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="has_key"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">has_key</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">x</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="items"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">items</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="keys"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">keys</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="values"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">values</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extras.SQL_IN</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.extras-module.html">Module extras</a> ::\r
- Class SQL_IN\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.extras.SQL_IN-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.SQL_IN-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type SQL_IN</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">SQL_IN</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Adapt any iterable to an SQL quotable object.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">seq</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="getquoted"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="getquoted"></a><span class="summary-sig"><span class="summary-sig-name">getquoted</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">seq</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="getquoted"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">self</span>)</span>\r
- <br /><em class="fname">(Informal representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="getquoted"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">getquoted</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Module pool\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.pool-module.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE DESCRIPTION =========== -->\r
-<h2 class="module">Module psycopg2.pool</h2>\r
-\r
-<p>Connection pooling for psycopg2</p>\r
-<p>This module implements thread-safe (and not) connection pools.</p>\r
-<hr/>\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Classes</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a></strong></td>\r
- <td>Generic key-based pooling code.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>PersistentConnectionPool</code></a></strong></td>\r
- <td>A pool that assigns persistent connections to different threads.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>SimpleConnectionPool</code></a></strong></td>\r
- <td>A connection pool that can't be shared across different threads.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>ThreadedConnectionPool</code></a></strong></td>\r
- <td>A connection pool that works with the threading module.</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF EXCEPTIONS =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Exceptions</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.pool.PoolError-class.html"><code>PoolError</code></a></strong></td>\r
- <td> </td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Function Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="dbg"></a><span class="summary-sig"><span class="summary-sig-name">dbg</span>(<span class="summary-sig-vararg">*args</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Function Details</th></tr>\r
-</table>\r
-\r
-<a name="dbg"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dbg</span>(<span class="sig-vararg">*args</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool.AbstractConnectionPool</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.pool-module.html">Module pool</a> ::\r
- Class AbstractConnectionPool\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.pool.AbstractConnectionPool-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.AbstractConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type AbstractConnectionPool</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">AbstractConnectionPool</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>PersistentConnectionPool</code></a>,\r
- <a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>SimpleConnectionPool</code></a>,\r
- <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>ThreadedConnectionPool</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>Generic key-based pooling code.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">minconn</span>,\r
- <span class="summary-sig-arg">maxconn</span>,\r
- <span class="summary-sig-vararg">*args</span>,\r
- <span class="summary-sig-kwarg">**kwargs</span>)</span></code>\r
-<br />\r
-Initialize the connection pool.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_closeall" class="summary-sig-name"><code>_closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Close all connections.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_connect" class="summary-sig-name"><code>_connect</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">key</span>)</span></code>\r
-<br />\r
-Create a new connection and assign it to 'key' if not None.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getconn" class="summary-sig-name"><code>_getconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">key</span>)</span></code>\r
-<br />\r
-Get a free connection and assign it to 'key' if not None.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getkey" class="summary-sig-name"><code>_getkey</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Return a new unique key.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_putconn" class="summary-sig-name"><code>_putconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">conn</span>,\r
- <span class="summary-sig-arg">key</span>,\r
- <span class="summary-sig-arg">close</span>)</span></code>\r
-<br />\r
-Put away a connection.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">minconn</span>,\r
- <span class="sig-arg">maxconn</span>,\r
- <span class="sig-vararg">*args</span>,\r
- <span class="sig-kwarg">**kwargs</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>Initialize the connection pool.</p>\r
-<p>New 'minconn' connections are created immediately calling 'connfunc'\r
-with given parameters. The connection pool will support a maximum of\r
-about 'maxconn' connections.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="_closeall"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">_closeall</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
-<p>Close all connections.</p>\r
-<p>Note that this can lead to some code fail badly when trying to use\r
-an already closed connection. If you call .closeall() make sure\r
-your code can deal with it.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="_connect"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">_connect</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">key</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>Create a new connection and assign it to 'key' if not None.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="_getconn"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">_getconn</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">key</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>Get a free connection and assign it to 'key' if not None.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="_getkey"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">_getkey</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
-<p>Return a new unique key.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="_putconn"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">_putconn</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">conn</span>,\r
- <span class="sig-arg">key</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">close</span>=<span class="sig-default">False</span>)</span>\r
- </h3>\r
-<p>Put away a connection.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool.PersistentConnectionPool</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.pool-module.html">Module pool</a> ::\r
- Class PersistentConnectionPool\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.pool.PersistentConnectionPool-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.PersistentConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type PersistentConnectionPool</h2>\r
-\r
-<pre class="base-tree">\r
- <a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
-<a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a> --+\r
- |\r
- <strong class="uidshort">PersistentConnectionPool</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A pool that assigns persistent connections to different threads.</p>\r
-<p>Note that this connection pool generates by itself the required keys\r
-using the current thread id. This means that untill a thread put away\r
-a connection it will always get the same connection object by successive\r
-.getconn() calls. This also means that a thread can't use more than one\r
-single connection from the pool.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">minconn</span>,\r
- <span class="summary-sig-arg">maxconn</span>,\r
- <span class="summary-sig-vararg">*args</span>,\r
- <span class="summary-sig-kwarg">**kwargs</span>)</span></code>\r
-<br />\r
-Initialize the threading lock.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#closeall" class="summary-sig-name"><code>closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Close all connections (even the one currently in use.)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#getconn" class="summary-sig-name"><code>getconn</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Generate thread id and return a connection.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#putconn" class="summary-sig-name"><code>putconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">conn</span>,\r
- <span class="summary-sig-arg">close</span>)</span></code>\r
-<br />\r
-Put away an unused connection.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from AbstractConnectionPool</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_closeall" class="summary-sig-name"><code>_closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Close all connections.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_connect" class="summary-sig-name"><code>_connect</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">key</span>)</span></code>\r
-<br />\r
-Create a new connection and assign it to 'key' if not None.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getconn" class="summary-sig-name"><code>_getconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">key</span>)</span></code>\r
-<br />\r
-Get a free connection and assign it to 'key' if not None.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getkey" class="summary-sig-name"><code>_getkey</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Return a new unique key.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_putconn" class="summary-sig-name"><code>_putconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">conn</span>,\r
- <span class="summary-sig-arg">key</span>,\r
- <span class="summary-sig-arg">close</span>)</span></code>\r
-<br />\r
-Put away a connection.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">minconn</span>,\r
- <span class="sig-arg">maxconn</span>,\r
- <span class="sig-vararg">*args</span>,\r
- <span class="sig-kwarg">**kwargs</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>Initialize the threading lock.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__"><code>psycopg2.pool.AbstractConnectionPool.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="closeall"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">closeall</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
-<p>Close all connections (even the one currently in use.)</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="getconn"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">getconn</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
-<p>Generate thread id and return a connection.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="putconn"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">putconn</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">conn</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">close</span>=<span class="sig-default">False</span>)</span>\r
- </h3>\r
-<p>Put away an unused connection.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool.PoolError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.pool-module.html">Module pool</a> ::\r
- Class PoolError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.pool.PoolError-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.PoolError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class PoolError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+\r
- |\r
- <strong class="uidshort">PoolError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool.SimpleConnectionPool</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.pool-module.html">Module pool</a> ::\r
- Class SimpleConnectionPool\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.pool.SimpleConnectionPool-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.SimpleConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type SimpleConnectionPool</h2>\r
-\r
-<pre class="base-tree">\r
- <a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
-<a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a> --+\r
- |\r
- <strong class="uidshort">SimpleConnectionPool</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A connection pool that can't be shared across different threads.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.SimpleConnectionPool-class.html#_closeall" class="summary-sig-name"><code>closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Close all connections.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.SimpleConnectionPool-class.html#_getconn" class="summary-sig-name"><code>getconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">key</span>)</span></code>\r
-<br />\r
-Get a free connection and assign it to 'key' if not None.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.SimpleConnectionPool-class.html#_putconn" class="summary-sig-name"><code>putconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">conn</span>,\r
- <span class="summary-sig-arg">key</span>,\r
- <span class="summary-sig-arg">close</span>)</span></code>\r
-<br />\r
-Put away a connection.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from AbstractConnectionPool</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">minconn</span>,\r
- <span class="summary-sig-arg">maxconn</span>,\r
- <span class="summary-sig-vararg">*args</span>,\r
- <span class="summary-sig-kwarg">**kwargs</span>)</span></code>\r
-<br />\r
-Initialize the connection pool.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_closeall" class="summary-sig-name"><code>_closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Close all connections.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_connect" class="summary-sig-name"><code>_connect</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">key</span>)</span></code>\r
-<br />\r
-Create a new connection and assign it to 'key' if not None.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getconn" class="summary-sig-name"><code>_getconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">key</span>)</span></code>\r
-<br />\r
-Get a free connection and assign it to 'key' if not None.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getkey" class="summary-sig-name"><code>_getkey</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Return a new unique key.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_putconn" class="summary-sig-name"><code>_putconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">conn</span>,\r
- <span class="summary-sig-arg">key</span>,\r
- <span class="summary-sig-arg">close</span>)</span></code>\r
-<br />\r
-Put away a connection.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="_closeall"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">closeall</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
-<p>Close all connections.</p>\r
-<p>Note that this can lead to some code fail badly when trying to use\r
-an already closed connection. If you call .closeall() make sure\r
-your code can deal with it.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="_getconn"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">getconn</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">key</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>Get a free connection and assign it to 'key' if not None.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="_putconn"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">putconn</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">conn</span>,\r
- <span class="sig-arg">key</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">close</span>=<span class="sig-default">False</span>)</span>\r
- </h3>\r
-<p>Put away a connection.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool.ThreadedConnectionPool</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.pool-module.html">Module pool</a> ::\r
- Class ThreadedConnectionPool\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.pool.ThreadedConnectionPool-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.ThreadedConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type ThreadedConnectionPool</h2>\r
-\r
-<pre class="base-tree">\r
- <a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
-<a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a> --+\r
- |\r
- <strong class="uidshort">ThreadedConnectionPool</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A connection pool that works with the threading module.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">minconn</span>,\r
- <span class="summary-sig-arg">maxconn</span>,\r
- <span class="summary-sig-vararg">*args</span>,\r
- <span class="summary-sig-kwarg">**kwargs</span>)</span></code>\r
-<br />\r
-Initialize the threading lock.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#closeall" class="summary-sig-name"><code>closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Close all connections (even the one currently in use.)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#getconn" class="summary-sig-name"><code>getconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">key</span>)</span></code>\r
-<br />\r
-Get a free connection and assign it to 'key' if not None.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#putconn" class="summary-sig-name"><code>putconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">conn</span>,\r
- <span class="summary-sig-arg">key</span>,\r
- <span class="summary-sig-arg">close</span>)</span></code>\r
-<br />\r
-Put away an unused connection.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from AbstractConnectionPool</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_closeall" class="summary-sig-name"><code>_closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Close all connections.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_connect" class="summary-sig-name"><code>_connect</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">key</span>)</span></code>\r
-<br />\r
-Create a new connection and assign it to 'key' if not None.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getconn" class="summary-sig-name"><code>_getconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">key</span>)</span></code>\r
-<br />\r
-Get a free connection and assign it to 'key' if not None.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getkey" class="summary-sig-name"><code>_getkey</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Return a new unique key.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_putconn" class="summary-sig-name"><code>_putconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">conn</span>,\r
- <span class="summary-sig-arg">key</span>,\r
- <span class="summary-sig-arg">close</span>)</span></code>\r
-<br />\r
-Put away a connection.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">minconn</span>,\r
- <span class="sig-arg">maxconn</span>,\r
- <span class="sig-vararg">*args</span>,\r
- <span class="sig-kwarg">**kwargs</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>Initialize the threading lock.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__"><code>psycopg2.pool.AbstractConnectionPool.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="closeall"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">closeall</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
-<p>Close all connections (even the one currently in use.)</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="getconn"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">getconn</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">key</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>Get a free connection and assign it to 'key' if not None.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="putconn"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">putconn</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">conn</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">key</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">close</span>=<span class="sig-default">False</span>)</span>\r
- </h3>\r
-<p>Put away an unused connection.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.psycopg1</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Module psycopg1\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.psycopg1-module.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.psycopg1-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE DESCRIPTION =========== -->\r
-<h2 class="module">Module psycopg2.psycopg1</h2>\r
-\r
-<p>psycopg 1.1.x compatibility module</p>\r
-<p>This module uses the new style connection and cursor types to build a psycopg\r
-1.1.1.x compatibility layer. It should be considered a temporary hack to run\r
-old code while porting to psycopg 2. Import it as follows:</p>\r
-<pre class="literal-block">\r
-from psycopg2 import psycopg1 as psycopg\r
-</pre>\r
-<hr/>\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Classes</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.psycopg1.connection-class.html"><code>connection</code></a></strong></td>\r
- <td>psycopg 1.1.x connection.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.psycopg1.cursor-class.html"><code>cursor</code></a></strong></td>\r
- <td>psycopg 1.1.x cursor.</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Function Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new psycopg 1.1.x compatible connection object</td>\r
- <td><code><a name="connect"></a><span class="summary-sig"><span class="summary-sig-name">connect</span>(<span class="summary-sig-arg">dsn</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Function Details</th></tr>\r
-</table>\r
-\r
-<a name="connect"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">connect</span>(<span class="sig-arg">dsn</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new psycopg 1.1.x compatible connection object </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.psycopg1.connection</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.psycopg1-module.html">Module psycopg1</a> ::\r
- Class connection\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.psycopg1.connection-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.psycopg1.connection-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type connection</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
-<a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a> --+\r
- |\r
- <strong class="uidshort">connection</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>psycopg 1.1.x connection.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">switch autocommit on (1) or off (0)</td>\r
- <td><code><a name="autocommit"></a><span class="summary-sig"><span class="summary-sig-name">autocommit</span>(<span class="summary-sig-arg">on_off</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new psycopg 1.1.x compatible cursor object</td>\r
- <td><code><a name="cursor"></a><span class="summary-sig"><span class="summary-sig-name">cursor</span>()</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from connection</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#close" class="summary-sig-name"><code>close</code></a>()</span></code>\r
-<br />\r
-Close the connection.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#commit" class="summary-sig-name"><code>commit</code></a>()</span></code>\r
-<br />\r
-Commit all changes to database.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#rollback" class="summary-sig-name"><code>rollback</code></a>()</span></code>\r
-<br />\r
-Roll back all changes done to database.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#set_client_encoding" class="summary-sig-name"><code>set_client_encoding</code></a>(<span class="summary-sig-arg">encoding</span>)</span></code>\r
-<br />\r
-Set client encoding to <tt class="docutils literal docutils literal docutils literal docutils literal"><span class="pre">encoding</span></tt>.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#set_isolation_level" class="summary-sig-name"><code>set_isolation_level</code></a>(<span class="summary-sig-arg">level</span>)</span></code>\r
-<br />\r
-Switch isolation level to <tt class="docutils literal docutils literal docutils literal docutils literal"><span class="pre">level</span></tt>.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF PROPERTY SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Property Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from connection</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#closed"><code>closed</code></a></strong>: True if the connection is closed.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#DatabaseError"><code>DatabaseError</code></a></strong>: Error related to the database engine.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#DataError"><code>DataError</code></a></strong>: Error related to problems with the processed data.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#dsn"><code>dsn</code></a></strong>: The current connection string.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#encoding"><code>encoding</code></a></strong>: The current client encoding.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#Error"><code>Error</code></a></strong>: Base class for error exceptions.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#IntegrityError"><code>IntegrityError</code></a></strong>: Error related to database integrity.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#InterfaceError"><code>InterfaceError</code></a></strong>: Error related to the database interface.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#InternalError"><code>InternalError</code></a></strong>: The database encountered an internal error.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#isolation_level"><code>isolation_level</code></a></strong>: The current isolation level.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#notices"><code>notices</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#notifies"><code>notifies</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#NotSupportedError"><code>NotSupportedError</code></a></strong>: A not supported datbase API was called.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#OperationalError"><code>OperationalError</code></a></strong>: Error related to database operation (disconnect, memory allocation etc).</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#ProgrammingError"><code>ProgrammingError</code></a></strong>: Error related to database programming (SQL error, table not found etc).</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#Warning"><code>Warning</code></a></strong>: A database warning.</td></tr></table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="autocommit"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">autocommit</span>(<span class="sig-arg">on_off</span>=<span class="sig-default">1</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-switch autocommit on (1) or off (0) </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="cursor"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">cursor</span>()</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new psycopg 1.1.x compatible cursor object </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.connection-class.html#cursor"><code>psycopg2._psycopg.connection.cursor</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.psycopg1.cursor</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.psycopg1-module.html">Module psycopg1</a> ::\r
- Class cursor\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.psycopg1.cursor-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.psycopg1.cursor-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type cursor</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
- <a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a> --+\r
- |\r
- <strong class="uidshort">cursor</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>psycopg 1.1.x cursor.</p>\r
-<p>Note that this cursor implements the exact procedure used by psycopg 1 to\r
-build dictionaries out of result rows. The DictCursor in the\r
-psycopg.extras modules implements a much better and faster algorithm.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="dictfetchall"></a><span class="summary-sig"><span class="summary-sig-name">dictfetchall</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="dictfetchmany"></a><span class="summary-sig"><span class="summary-sig-name">dictfetchmany</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">size</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="dictfetchone"></a><span class="summary-sig"><span class="summary-sig-name">dictfetchone</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__build_dict"></a><span class="summary-sig"><span class="summary-sig-name">__build_dict</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">row</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from cursor</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__iter__" class="summary-sig-name"><code>__iter__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return iter(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#callproc" class="summary-sig-name"><code>callproc</code></a>(<span class="summary-sig-arg">procname</span>,\r
- <span class="summary-sig-arg">parameters</span>,\r
- <span class="summary-sig-arg">async</span>)</span></code>\r
-<br />\r
-Execute stored procedure.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#close" class="summary-sig-name"><code>close</code></a>()</span></code>\r
-<br />\r
-Close the cursor.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_from" class="summary-sig-name"><code>copy_from</code></a>(<span class="summary-sig-arg">file</span>,\r
- <span class="summary-sig-arg">table</span>,\r
- <span class="summary-sig-arg">sep</span>,\r
- <span class="summary-sig-arg">null</span>)</span></code>\r
-<br />\r
-Copy table from file.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_to" class="summary-sig-name"><code>copy_to</code></a>(<span class="summary-sig-arg">file</span>,\r
- <span class="summary-sig-arg">table</span>,\r
- <span class="summary-sig-arg">sep</span>,\r
- <span class="summary-sig-arg">null</span>)</span></code>\r
-<br />\r
-Copy table to file.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#execute" class="summary-sig-name"><code>execute</code></a>(<span class="summary-sig-arg">query</span>,\r
- <span class="summary-sig-arg">vars</span>,\r
- <span class="summary-sig-arg">async</span>)</span></code>\r
-<br />\r
-Execute query with bound vars.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#executemany" class="summary-sig-name"><code>executemany</code></a>(<span class="summary-sig-arg">query</span>,\r
- <span class="summary-sig-arg">vars_list</span>,\r
- <span class="summary-sig-arg">async</span>)</span></code>\r
-<br />\r
-Execute many queries with bound vars.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">list of tuple</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchall" class="summary-sig-name"><code>fetchall</code></a>()</span></code>\r
-<br />\r
-Return all the remaining rows of a query result set.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">list of tuple</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="summary-sig-name"><code>fetchmany</code></a>(<span class="summary-sig-arg">size</span>)</span></code>\r
-<br />\r
-Return the next <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>size</code></a> rows of a query result set in the form of a list\r
-of tuples (by default) or using the sequence factory previously set in\r
-the <a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">tuple or None</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchone" class="summary-sig-name"><code>fetchone</code></a>()</span></code>\r
-<br />\r
-Return the next row of a query result set in the form of a tuple (by\r
-default) or using the sequence factory previously set in the\r
-<a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">int</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fileno" class="summary-sig-name"><code>fileno</code></a>()</span></code>\r
-<br />\r
-Return file descriptor associated to database connection.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">bool</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#isready" class="summary-sig-name"><code>isready</code></a>()</span></code>\r
-<br />\r
-Return True if data is ready after an async query.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">str</td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#mogrify" class="summary-sig-name"><code>mogrify</code></a>(<span class="summary-sig-arg">query</span>,\r
- <span class="summary-sig-arg">vars</span>)</span></code>\r
-<br />\r
-Return query after vars binding.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#next" class="summary-sig-name"><code>next</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return the next value, or raise StopIteration...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#nextset" class="summary-sig-name"><code>nextset</code></a>()</span></code>\r
-<br />\r
-Skip to next set of data.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#scroll" class="summary-sig-name"><code>scroll</code></a>(<span class="summary-sig-arg">value</span>,\r
- <span class="summary-sig-arg">mode</span>)</span></code>\r
-<br />\r
-Scroll to new position according to mode.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#setinputsizes" class="summary-sig-name"><code>setinputsizes</code></a>(<span class="summary-sig-arg">sizes</span>)</span></code>\r
-<br />\r
-Set memory areas before execute.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#setoutputsize" class="summary-sig-name"><code>setoutputsize</code></a>(<span class="summary-sig-arg">size</span>,\r
- <span class="summary-sig-arg">column</span>)</span></code>\r
-<br />\r
-Set column buffer size.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF PROPERTY SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Property Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from cursor</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#arraysize"><code>arraysize</code></a></strong>: Number of records <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>fetchmany()</code></a> must fetch if not explicitely specified.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#binary_types"><code>binary_types</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#connection"><code>connection</code></a></strong>: The connection where the cursor comes from.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#description"><code>description</code></a></strong>: Cursor description as defined in DBAPI-2.0.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#lastrowid"><code>lastrowid</code></a></strong>: The <tt class="docutils literal docutils literal"><span class="pre">oid</span></tt> of the last row inserted by the cursor.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#name"><code>name</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#query"><code>query</code></a></strong>: The last query text sent to the backend.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#row_factory"><code>row_factory</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#rowcount"><code>rowcount</code></a></strong>: Number of rows read from the backend in the last command.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#rownumber"><code>rownumber</code></a></strong>: The current row position.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#statusmessage"><code>statusmessage</code></a></strong>: The return message of the last command.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#string_types"><code>string_types</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#typecaster"><code>typecaster</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#tzinfo_factory"><code>tzinfo_factory</code></a></strong></td></tr></table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="dictfetchall"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dictfetchall</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="dictfetchmany"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dictfetchmany</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">size</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="dictfetchone"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dictfetchone</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__build_dict"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__build_dict</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">row</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:33 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.tz</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Module tz\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.tz-module.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.tz-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE DESCRIPTION =========== -->\r
-<h2 class="module">Module psycopg2.tz</h2>\r
-\r
-<p>tzinfo implementations for psycopg2</p>\r
-<p>This module holds two different tzinfo implementations that can be used as\r
-the 'tzinfo' argument to datetime constructors, directly passed to psycopg\r
-functions or used to set the .tzinfo_factory attribute in cursors.</p>\r
-<hr/>\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Classes</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>FixedOffsetTimezone</code></a></strong></td>\r
- <td>Fixed offset in minutes east from UTC.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.tz.LocalTimezone-class.html"><code>LocalTimezone</code></a></strong></td>\r
- <td>Platform idea of local timezone.</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF VARIABLE SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Variable Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td>\r
-<td><strong><a href="psycopg2.tz-module.html#DSTDIFF"><code>DSTDIFF</code></a></strong> = <span title="datetime.timedelta(0, 3600)"><code>datetime.timedelta(0, 3600) </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>LocalTimezone</code></td>\r
-<td><strong><a href="psycopg2.tz-module.html#LOCAL"><code>LOCAL</code></a></strong> = <span title="<psycopg2.tz.LocalTimezone object at 0x00847090>"><code><psycopg2.tz.LocalTimezone object at 0x00847090> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td>\r
-<td><strong><a href="psycopg2.tz-module.html#STDOFFSET"><code>STDOFFSET</code></a></strong> = <span title="datetime.timedelta(0, 3600)"><code>datetime.timedelta(0, 3600) </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td>\r
-<td><strong><a href="psycopg2.tz-module.html#ZERO"><code>ZERO</code></a></strong> = <span title="datetime.timedelta(0)"><code>datetime.timedelta(0) </code>\r
-</span></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF VARIABLE DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Variable Details</th></tr>\r
-</table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DSTDIFF"></a>\r
-<h3>DSTDIFF</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>timedelta</code>\r
-\r
- </dd>\r
- <dt title="datetime.timedelta(0, 3600)">Value:</dt>\r
- <dd title="datetime.timedelta(0, 3600)"><table><tr><td>\r
-<pre class="variable">\r
-datetime.timedelta(0, 3600) </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="LOCAL"></a>\r
-<h3>LOCAL</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>LocalTimezone</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2.tz.LocalTimezone object at 0x00847090>">Value:</dt>\r
- <dd title="<psycopg2.tz.LocalTimezone object at 0x00847090>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2.tz.LocalTimezone object at 0x00847090> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="STDOFFSET"></a>\r
-<h3>STDOFFSET</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>timedelta</code>\r
-\r
- </dd>\r
- <dt title="datetime.timedelta(0, 3600)">Value:</dt>\r
- <dd title="datetime.timedelta(0, 3600)"><table><tr><td>\r
-<pre class="variable">\r
-datetime.timedelta(0, 3600) </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ZERO"></a>\r
-<h3>ZERO</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>timedelta</code>\r
-\r
- </dd>\r
- <dt title="datetime.timedelta(0)">Value:</dt>\r
- <dd title="datetime.timedelta(0)"><table><tr><td>\r
-<pre class="variable">\r
-datetime.timedelta(0) </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.tz.FixedOffsetTimezone</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.tz-module.html">Module tz</a> ::\r
- Class FixedOffsetTimezone\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.tz.FixedOffsetTimezone-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.tz.FixedOffsetTimezone-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type FixedOffsetTimezone</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
- <a href="datetime.tzinfo-class.html"><code>tzinfo</code></a> --+\r
- |\r
- <strong class="uidshort">FixedOffsetTimezone</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Fixed offset in minutes east from UTC.</p>\r
-<p>This is exactly the implementation found in Python 2.3.x documentation,\r
-with a small change to the __init__ method to allow for pickling and a\r
-default name in the form 'sHH:MM' ('s' is the sign.)</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">offset</span>,\r
- <span class="summary-sig-arg">name</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="dst"></a><span class="summary-sig"><span class="summary-sig-name">dst</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="tzname"></a><span class="summary-sig"><span class="summary-sig-name">tzname</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="utcoffset"></a><span class="summary-sig"><span class="summary-sig-name">utcoffset</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from tzinfo</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
--> (cls, state)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#fromutc" class="summary-sig-name"><code>fromutc</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-datetime in UTC -> datetime in local time.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF CLASS VARIABLE SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Class Variable Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>NoneType</code></td>\r
-<td><strong><a href="../private/psycopg2.tz.FixedOffsetTimezone-class.html#_name"><code>_name</code></a></strong> = <span title="None">None </span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td>\r
-<td><strong><a href="../private/psycopg2.tz.FixedOffsetTimezone-class.html#_offset"><code>_offset</code></a></strong> = <span title="datetime.timedelta(0)"><code>datetime.timedelta(0) </code>\r
-</span></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">offset</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">name</span>=<span class="sig-default">None</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="dst"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dst</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="datetime.tzinfo-class.html#dst"><code>datetime.tzinfo.dst</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="tzname"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">tzname</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="datetime.tzinfo-class.html#tzname"><code>datetime.tzinfo.tzname</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="utcoffset"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">utcoffset</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="datetime.tzinfo-class.html#utcoffset"><code>datetime.tzinfo.utcoffset</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF CLASS VARIABLE DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Class Variable Details</th></tr>\r
-</table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="_name"></a>\r
-<h3>_name</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>NoneType</code>\r
-\r
- </dd>\r
- <dt title="None">Value:</dt>\r
- <dd title="None"><table><tr><td>\r
-<pre class="variable">\r
-None </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="_offset"></a>\r
-<h3>_offset</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>timedelta</code>\r
-\r
- </dd>\r
- <dt title="datetime.timedelta(0)">Value:</dt>\r
- <dd title="datetime.timedelta(0)"><table><tr><td>\r
-<pre class="variable">\r
-datetime.timedelta(0) </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.tz.LocalTimezone</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.tz-module.html">Module tz</a> ::\r
- Class LocalTimezone\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.tz.LocalTimezone-class.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.tz.LocalTimezone-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type LocalTimezone</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
- <a href="datetime.tzinfo-class.html"><code>tzinfo</code></a> --+\r
- |\r
- <strong class="uidshort">LocalTimezone</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Platform idea of local timezone.</p>\r
-<p>This is the exact implementation from the Pyhton 2.3 documentation.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="dst"></a><span class="summary-sig"><span class="summary-sig-name">dst</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="tzname"></a><span class="summary-sig"><span class="summary-sig-name">tzname</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="utcoffset"></a><span class="summary-sig"><span class="summary-sig-name">utcoffset</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="_isdst"></a><span class="summary-sig"><span class="summary-sig-name">_isdst</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from tzinfo</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
--> (cls, state)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#fromutc" class="summary-sig-name"><code>fromutc</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-datetime in UTC -> datetime in local time.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="dst"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dst</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="datetime.tzinfo-class.html#dst"><code>datetime.tzinfo.dst</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="tzname"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">tzname</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="datetime.tzinfo-class.html#tzname"><code>datetime.tzinfo.tzname</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="utcoffset"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">utcoffset</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="datetime.tzinfo-class.html#utcoffset"><code>datetime.tzinfo.utcoffset</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="_isdst"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">_isdst</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>Everything</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading">Everything</h1>\r
-<hr />\r
-\r
-<!-- =========== START OF ALL CLASSES =========== -->\r
-<h2 class="tocheading">All Classes</h2>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg.connection-class.html">psycopg2._psycopg.connection</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg.cursor-class.html">psycopg2._psycopg.cursor</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg.ISQLQuote-class.html">psycopg2._psycopg.ISQLQuote</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictConnection-class.html">psycopg2.extras.DictConnection</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictCursor-class.html">psycopg2.extras.DictCursor</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictRow-class.html">psycopg2.extras.DictRow</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.SQL_IN-class.html">psycopg2.extras.SQL_IN</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.AbstractConnectionPool-class.html">psycopg2.pool.AbstractConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.PersistentConnectionPool-class.html">psycopg2.pool.PersistentConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.SimpleConnectionPool-class.html">psycopg2.pool.SimpleConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.ThreadedConnectionPool-class.html">psycopg2.pool.ThreadedConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.connection-class.html">psycopg2.psycopg1.connection</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.cursor-class.html">psycopg2.psycopg1.cursor</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz.FixedOffsetTimezone-class.html">psycopg2.tz.FixedOffsetTimezone</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz.LocalTimezone-class.html">psycopg2.tz.LocalTimezone</a></p>\r
-\r
-<!-- =========== START OF ALL EXCEPTIONS =========== -->\r
-<h2 class="tocheading">All Exceptions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.DatabaseError-class.html">psycopg2.DatabaseError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.DataError-class.html">psycopg2.DataError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.Error-class.html">psycopg2.Error</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.IntegrityError-class.html">psycopg2.IntegrityError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.InterfaceError-class.html">psycopg2.InterfaceError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.InternalError-class.html">psycopg2.InternalError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.NotSupportedError-class.html">psycopg2.NotSupportedError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.OperationalError-class.html">psycopg2.OperationalError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.PoolError-class.html">psycopg2.pool.PoolError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.ProgrammingError-class.html">psycopg2.ProgrammingError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.Warning-class.html">psycopg2.Warning</a></p>\r
-\r
-<!-- =========== START OF ALL FUNCTIONS =========== -->\r
-<h2 class="tocheading">All Functions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#adapt">adapt</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#AsIs">AsIs</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Binary">Binary</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#Boolean">Boolean</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#connect">connect</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1-module.html#connect">connect</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Date">Date</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#DateFromPy">DateFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#DateFromTicks">DateFromTicks</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool-module.html#dbg">dbg</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#IntervalFromPy">IntervalFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#List">List</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#new_type">new_type</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#QuotedString">QuotedString</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_adapter">register_adapter</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_type">register_type</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Time">Time</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimeFromPy">TimeFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimeFromTicks">TimeFromTicks</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Timestamp">Timestamp</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimestampFromPy">TimestampFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimestampFromTicks">TimestampFromTicks</a></p>\r
-\r
-<!-- =========== START OF ALL VARIABLES =========== -->\r
-<h2 class="tocheading">All Variables</h2>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#__version__">__version__</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#_C_API">_C_API</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#adapters">adapters</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#apilevel">apilevel</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BINARY">BINARY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#binary_types">binary_types</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BINARYARRAY">BINARYARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BOOLEAN">BOOLEAN</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BOOLEANARRAY">BOOLEANARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATE">DATE</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATEARRAY">DATEARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATETIME">DATETIME</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATETIMEARRAY">DATETIMEARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DECIMAL">DECIMAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DECIMALARRAY">DECIMALARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#DSTDIFF">DSTDIFF</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#encodings">encodings</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#FLOAT">FLOAT</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#FLOATARRAY">FLOATARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTEGER">INTEGER</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTEGERARRAY">INTEGERARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTERVAL">INTERVAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTERVALARRAY">INTERVALARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT">ISOLATION_LEVEL_AUTOCOMMIT</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED">ISOLATION_LEVEL_READ_COMMITTED</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED">ISOLATION_LEVEL_READ_UNCOMMITTED</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ">ISOLATION_LEVEL_REPEATABLE_READ</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE">ISOLATION_LEVEL_SERIALIZABLE</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#LOCAL">LOCAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#LONGINTEGER">LONGINTEGER</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#LONGINTEGERARRAY">LONGINTEGERARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#NUMBER">NUMBER</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#paramstyle">paramstyle</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYDATE">PYDATE</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYDATETIME">PYDATETIME</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYINTERVAL">PYINTERVAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYTIME">PYTIME</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#ROWID">ROWID</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#ROWIDARRAY">ROWIDARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#STDOFFSET">STDOFFSET</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#STRING">STRING</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#string_types">string_types</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#STRINGARRAY">STRINGARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#threadsafety">threadsafety</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#TIME">TIME</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#TIMEARRAY">TIMEARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#UNICODE">UNICODE</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#UNICODEARRAY">UNICODEARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#ZERO">ZERO</a></p>\r
-\r
-<hr />\r
-<span class="options">[show private | <a href="../public/toc-everything.html">hide private</a>]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2-module.html">psycopg2</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF MODULES =========== -->\r
-<h2 class="tocheading">Modules</h2>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html">_psycopg</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html">extensions</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras-module.html">extras</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool-module.html">pool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1-module.html">psycopg1</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html">tz</a></p>\r
-\r
-<!-- =========== START OF EXCEPTIONS =========== -->\r
-<h2 class="tocheading">Exceptions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.DatabaseError-class.html">DatabaseError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.DataError-class.html">DataError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.Error-class.html">Error</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.IntegrityError-class.html">IntegrityError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.InterfaceError-class.html">InterfaceError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.InternalError-class.html">InternalError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.NotSupportedError-class.html">NotSupportedError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.OperationalError-class.html">OperationalError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.ProgrammingError-class.html">ProgrammingError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.Warning-class.html">Warning</a></p>\r
-\r
-<!-- =========== START OF FUNCTIONS =========== -->\r
-<h2 class="tocheading">Functions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Binary">Binary</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#connect">connect</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Date">Date</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#DateFromTicks">DateFromTicks</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Time">Time</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimeFromTicks">TimeFromTicks</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Timestamp">Timestamp</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimestampFromTicks">TimestampFromTicks</a></p>\r
-\r
-<hr />\r
-<span class="options">[show private | <a href="../public/toc-psycopg2-module.html">hide private</a>]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2._psycopg</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html">_psycopg</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<h2 class="tocheading">Classes</h2>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg.connection-class.html">connection</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg.cursor-class.html">cursor</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg.ISQLQuote-class.html">ISQLQuote</a></p>\r
-\r
-<!-- =========== START OF FUNCTIONS =========== -->\r
-<h2 class="tocheading">Functions</h2>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#List">List</a></p>\r
-\r
-<!-- =========== START OF VARIABLES =========== -->\r
-<h2 class="tocheading">Variables</h2>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#__version__">__version__</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#_C_API">_C_API</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#adapters">adapters</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#apilevel">apilevel</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BINARY">BINARY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#binary_types">binary_types</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BINARYARRAY">BINARYARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BOOLEAN">BOOLEAN</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BOOLEANARRAY">BOOLEANARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATE">DATE</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATEARRAY">DATEARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATETIME">DATETIME</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATETIMEARRAY">DATETIMEARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DECIMAL">DECIMAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DECIMALARRAY">DECIMALARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#encodings">encodings</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#FLOAT">FLOAT</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#FLOATARRAY">FLOATARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTEGER">INTEGER</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTEGERARRAY">INTEGERARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTERVAL">INTERVAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTERVALARRAY">INTERVALARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#LONGINTEGER">LONGINTEGER</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#LONGINTEGERARRAY">LONGINTEGERARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#NUMBER">NUMBER</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#paramstyle">paramstyle</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYDATE">PYDATE</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYDATETIME">PYDATETIME</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYINTERVAL">PYINTERVAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYTIME">PYTIME</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#ROWID">ROWID</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#ROWIDARRAY">ROWIDARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#STRING">STRING</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#string_types">string_types</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#STRINGARRAY">STRINGARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#threadsafety">threadsafety</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#TIME">TIME</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#TIMEARRAY">TIMEARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#UNICODE">UNICODE</a></p>\r
-<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#UNICODEARRAY">UNICODEARRAY</a></p>\r
-\r
-<hr />\r
-<span class="options">[<strong>show private</strong> | hide private]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extensions</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2.extensions-module.html">extensions</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF FUNCTIONS =========== -->\r
-<h2 class="tocheading">Functions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#adapt">adapt</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#AsIs">AsIs</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#Boolean">Boolean</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#DateFromPy">DateFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#IntervalFromPy">IntervalFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#new_type">new_type</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#QuotedString">QuotedString</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_adapter">register_adapter</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_type">register_type</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimeFromPy">TimeFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimestampFromPy">TimestampFromPy</a></p>\r
-\r
-<!-- =========== START OF VARIABLES =========== -->\r
-<h2 class="tocheading">Variables</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT">ISOLATION_LEVEL_AUTOCOMMIT</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED">ISOLATION_LEVEL_READ_COMMITTED</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED">ISOLATION_LEVEL_READ_UNCOMMITTED</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ">ISOLATION_LEVEL_REPEATABLE_READ</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE">ISOLATION_LEVEL_SERIALIZABLE</a></p>\r
-\r
-<hr />\r
-<span class="options">[show private | <a href="../public/toc-psycopg2.extensions-module.html">hide private</a>]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extras</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2.extras-module.html">extras</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<h2 class="tocheading">Classes</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictConnection-class.html">DictConnection</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictCursor-class.html">DictCursor</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictRow-class.html">DictRow</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.SQL_IN-class.html">SQL_IN</a></p>\r
-\r
-<hr />\r
-<span class="options">[show private | <a href="../public/toc-psycopg2.extras-module.html">hide private</a>]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2.pool-module.html">pool</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<h2 class="tocheading">Classes</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.AbstractConnectionPool-class.html">AbstractConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.PersistentConnectionPool-class.html">PersistentConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.SimpleConnectionPool-class.html">SimpleConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.ThreadedConnectionPool-class.html">ThreadedConnectionPool</a></p>\r
-\r
-<!-- =========== START OF EXCEPTIONS =========== -->\r
-<h2 class="tocheading">Exceptions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.PoolError-class.html">PoolError</a></p>\r
-\r
-<!-- =========== START OF FUNCTIONS =========== -->\r
-<h2 class="tocheading">Functions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool-module.html#dbg">dbg</a></p>\r
-\r
-<hr />\r
-<span class="options">[show private | <a href="../public/toc-psycopg2.pool-module.html">hide private</a>]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.psycopg1</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2.psycopg1-module.html">psycopg1</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<h2 class="tocheading">Classes</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.connection-class.html">connection</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.cursor-class.html">cursor</a></p>\r
-\r
-<!-- =========== START OF FUNCTIONS =========== -->\r
-<h2 class="tocheading">Functions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1-module.html#connect">connect</a></p>\r
-\r
-<hr />\r
-<span class="options">[show private | <a href="../public/toc-psycopg2.psycopg1-module.html">hide private</a>]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.tz</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2.tz-module.html">tz</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<h2 class="tocheading">Classes</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz.FixedOffsetTimezone-class.html">FixedOffsetTimezone</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz.LocalTimezone-class.html">LocalTimezone</a></p>\r
-\r
-<!-- =========== START OF VARIABLES =========== -->\r
-<h2 class="tocheading">Variables</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#DSTDIFF">DSTDIFF</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#LOCAL">LOCAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#STDOFFSET">STDOFFSET</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#ZERO">ZERO</a></p>\r
-\r
-<hr />\r
-<span class="options">[show private | <a href="../public/toc-psycopg2.tz-module.html">hide private</a>]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>Table of Contents</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading">Table of Contents</h1>\r
-<hr />\r
-<p class="toc"><a target="moduleFrame" href="toc-everything.html">Everything</a></p>\r
-\r
-<!-- =========== START OF PACKAGES =========== -->\r
-<h2 class="tocheading">Packages</h2>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2-module.html" onclick="setFrame('toc-psycopg2-module.html', 'psycopg2-module.html');">psycopg2</a></p>\r
-\r
-<!-- =========== START OF MODULES =========== -->\r
-<h2 class="tocheading">Modules</h2>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2._psycopg-module.html" onclick="setFrame('toc-psycopg2._psycopg-module.html', 'psycopg2._psycopg-module.html');">psycopg2._psycopg</a></p>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2.extensions-module.html" onclick="setFrame('toc-psycopg2.extensions-module.html', 'psycopg2.extensions-module.html');">psycopg2.extensions</a></p>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2.extras-module.html" onclick="setFrame('toc-psycopg2.extras-module.html', 'psycopg2.extras-module.html');">psycopg2.extras</a></p>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2.pool-module.html" onclick="setFrame('toc-psycopg2.pool-module.html', 'psycopg2.pool-module.html');">psycopg2.pool</a></p>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2.psycopg1-module.html" onclick="setFrame('toc-psycopg2.psycopg1-module.html', 'psycopg2.psycopg1-module.html');">psycopg2.psycopg1</a></p>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2.tz-module.html" onclick="setFrame('toc-psycopg2.tz-module.html', 'psycopg2.tz-module.html');">psycopg2.tz</a></p>\r
-\r
-<hr />\r
-<span class="options">[show private | <a href="../public/toc.html">hide private</a>]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>Module and Class Hierarchies</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th bgcolor="#70b0f0" class="navselect"> Trees </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[show private | <a href="../public/trees.html">hide private</a>]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="trees.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE HIERARCHY =========== -->\r
-<h2>Module Hierarchy</h2>\r
-<ul>\r
-<li> <strong class="uidlink"><a href="psycopg2-module.html"><code>psycopg2</code></a></strong>: <em class="summary">A Python driver for PostgreSQL</em> <ul>\r
- <li> <strong class="uidlink"><a href="../private/psycopg2._psycopg-module.html"><code>_psycopg</code></a></strong>: <em class="summary">psycopg PostgreSQL driver</em></li>\r
- <li> <strong class="uidlink"><a href="psycopg2.extensions-module.html"><code>extensions</code></a></strong>: <em class="summary">psycopg extensions to the DBAPI-2.0</em></li>\r
- <li> <strong class="uidlink"><a href="psycopg2.extras-module.html"><code>extras</code></a></strong>: <em class="summary">Miscellaneous goodies for psycopg2</em></li>\r
- <li> <strong class="uidlink"><a href="psycopg2.pool-module.html"><code>pool</code></a></strong>: <em class="summary">Connection pooling for psycopg2</em></li>\r
- <li> <strong class="uidlink"><a href="psycopg2.psycopg1-module.html"><code>psycopg1</code></a></strong>: <em class="summary">psycopg 1.1.x compatibility module</em></li>\r
- <li> <strong class="uidlink"><a href="psycopg2.tz-module.html"><code>tz</code></a></strong>: <em class="summary">tzinfo implementations for psycopg2</em></li>\r
- </ul>\r
-</li>\r
-</ul>\r
-\r
-<!-- =========== START OF CLASS HIERARCHY =========== -->\r
-<h2>Class Hierarchy</h2>\r
-<ul>\r
- <li> <strong class="uidlink"><a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></strong>: <em class="summary">\r
-The most base type</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></strong>: <em class="summary">\r
-Generic key-based pooling code.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></strong>: <em class="summary">\r
-A pool that assigns persistent connections to different threads.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>psycopg2.pool.SimpleConnectionPool</code></a></strong>: <em class="summary">\r
-A connection pool that can't be shared across different threads.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></strong>: <em class="summary">\r
-A connection pool that works with the threading module.</em>\r
- </li>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></strong>: <em class="summary">\r
-list() -> new list\r
-list(sequence) -> new list initialized from sequence's items</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></strong>: <em class="summary">\r
-A row object that allow by-colun-name access to data.</em>\r
- </li>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.extras.SQL_IN-class.html"><code>psycopg2.extras.SQL_IN</code></a></strong>: <em class="summary">\r
-Adapt any iterable to an SQL quotable object.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></strong>: <em class="summary">\r
-type(object) -> the object's type\r
-type(name, bases, dict) -> a new type</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></strong>: <em class="summary">\r
-Abstract base class for time zone info objects.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></strong>: <em class="summary">\r
-Fixed offset in minutes east from UTC.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></strong>: <em class="summary">\r
-Platform idea of local timezone.</em>\r
- </li>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></strong>: <em class="summary">\r
-connection(dsn, ...) -> new connection object</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.psycopg1.connection-class.html"><code>psycopg2.psycopg1.connection</code></a></strong>: <em class="summary">\r
-psycopg 1.1.x connection.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.extras.DictConnection-class.html"><code>psycopg2.extras.DictConnection</code></a></strong>: <em class="summary">\r
-A connection that uses DictCursor automatically.</em>\r
- </li>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></strong>: <em class="summary">\r
-A database cursor.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></strong>: <em class="summary">\r
-psycopg 1.1.x cursor.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></strong>: <em class="summary">\r
-A cursor that keeps a list of column name -> index mappings.</em>\r
- </li>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></strong>: <em class="summary">\r
-Abstract ISQLQuote protocol</em>\r
- </li>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></strong>: <em class="summary">\r
-Common base class for all exceptions.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="exceptions.StandardError-class.html"><code>exceptions.StandardError</code></a></strong>: <em class="summary">\r
-Base class for all standard Python exceptions.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.Error-class.html"><code>psycopg2.Error</code></a></strong>: <em class="summary">\r
-Base class for error exceptions.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.DatabaseError-class.html"><code>psycopg2.DatabaseError</code></a></strong>: <em class="summary">\r
-Error related to the database engine.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.DataError-class.html"><code>psycopg2.DataError</code></a></strong>: <em class="summary">\r
-Error related to problems with the processed data.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.IntegrityError-class.html"><code>psycopg2.IntegrityError</code></a></strong>: <em class="summary">\r
-Error related to database integrity.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.InternalError-class.html"><code>psycopg2.InternalError</code></a></strong>: <em class="summary">\r
-The database encountered an internal error.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.NotSupportedError-class.html"><code>psycopg2.NotSupportedError</code></a></strong>: <em class="summary">\r
-A not supported datbase API was called.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.OperationalError-class.html"><code>psycopg2.OperationalError</code></a></strong>: <em class="summary">\r
-Error related to database operation (disconnect, memory allocation etc).</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.ProgrammingError-class.html"><code>psycopg2.ProgrammingError</code></a></strong>: <em class="summary">\r
-Error related to database programming (SQL error, table not found etc).</em>\r
- </li>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.InterfaceError-class.html"><code>psycopg2.InterfaceError</code></a></strong>: <em class="summary">\r
-Error related to the database interface.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.pool.PoolError-class.html"><code>psycopg2.pool.PoolError</code></a></strong>\r
- </li>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.Warning-class.html"><code>psycopg2.Warning</code></a></strong>: <em class="summary">\r
-A database warning.</em>\r
- </li>\r
- </ul>\r
- </li>\r
- </ul>\r
- </li>\r
-</ul>\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>__builtin__.list</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Module __builtin__ ::\r
- Class list\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/__builtin__.list-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="__builtin__.list-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type list</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">list</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.extras.DictRow-class.html"><code>DictRow</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>list() -> new list\r
-list(sequence) -> new list initialized from sequence's items</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__add__"></a><span class="summary-sig"><span class="summary-sig-name">__add__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x+y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__contains__"></a><span class="summary-sig"><span class="summary-sig-name">__contains__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return y in x...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__delitem__"></a><span class="summary-sig"><span class="summary-sig-name">__delitem__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return del x[y]...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__delslice__" class="summary-sig-name"><code>__delslice__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">j</span>)</span></code>\r
-<br />\r
-Use of negative indices is not supported.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__eq__"></a><span class="summary-sig"><span class="summary-sig-name">__eq__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x==y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__ge__"></a><span class="summary-sig"><span class="summary-sig-name">__ge__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x>=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__getitem__"></a><span class="summary-sig"><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x[y]...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getslice__" class="summary-sig-name"><code>__getslice__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">j</span>)</span></code>\r
-<br />\r
-Use of negative indices is not supported.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__gt__"></a><span class="summary-sig"><span class="summary-sig-name">__gt__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x>y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__hash__"></a><span class="summary-sig"><span class="summary-sig-name">__hash__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__iadd__"></a><span class="summary-sig"><span class="summary-sig-name">__iadd__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x+=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__imul__"></a><span class="summary-sig"><span class="summary-sig-name">__imul__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x*=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__iter__"></a><span class="summary-sig"><span class="summary-sig-name">__iter__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return iter(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__le__"></a><span class="summary-sig"><span class="summary-sig-name">__le__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x<=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__len__"></a><span class="summary-sig"><span class="summary-sig-name">__len__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return len(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__lt__"></a><span class="summary-sig"><span class="summary-sig-name">__lt__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x<y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__mul__"></a><span class="summary-sig"><span class="summary-sig-name">__mul__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">n</span>)</span></code>\r
-<br />\r
-Return x*n...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__ne__"></a><span class="summary-sig"><span class="summary-sig-name">__ne__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x!=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__rmul__"></a><span class="summary-sig"><span class="summary-sig-name">__rmul__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">n</span>)</span></code>\r
-<br />\r
-Return n*x...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__setitem__"></a><span class="summary-sig"><span class="summary-sig-name">__setitem__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x[i]=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__setslice__" class="summary-sig-name"><code>__setslice__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">j</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Use of negative indices is not supported.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#append" class="summary-sig-name"><code>append</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">object</span>)</span></code>\r
-<br />\r
-append object to end</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#count" class="summary-sig-name"><code>count</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">value</span>)</span></code>\r
-<br />\r
-return number of occurrences of value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#extend" class="summary-sig-name"><code>extend</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">iterable</span>)</span></code>\r
-<br />\r
-extend list by appending elements from the iterable</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#index" class="summary-sig-name"><code>index</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-L.index(value, [start, [stop]]) -> integer -- return first index of value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#insert" class="summary-sig-name"><code>insert</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">index</span>,\r
- <span class="summary-sig-arg">object</span>)</span></code>\r
-<br />\r
-insert object before index</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#pop" class="summary-sig-name"><code>pop</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">index</span>)</span></code>\r
-<br />\r
-remove and return item at index (default last)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#remove" class="summary-sig-name"><code>remove</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">value</span>)</span></code>\r
-<br />\r
-remove first occurrence of value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#reverse" class="summary-sig-name"><code>reverse</code></a>(<span class="summary-sig-arg">L</span>)</span></code>\r
-<br />\r
-reverse <em>IN PLACE</em></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#sort" class="summary-sig-name"><code>sort</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">cmpfunc</span>)</span></code>\r
-<br />\r
-stable sort <em>IN PLACE</em>; cmpfunc(x, y) -> -1, 0, 1</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__add__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__add__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Addition operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x+y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__contains__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__contains__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(In operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-y in x\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__delitem__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__delitem__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Index deletion operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-del x[y]\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__delslice__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__delslice__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">i</span>,\r
- <span class="sig-arg">j</span>)</span>\r
- <br /><em class="fname">(Slice deletion operator)</em>\r
- </h3>\r
-<p>Use of negative indices is not supported.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-del x[i:j]\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__eq__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__eq__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Equality operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x==y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__ge__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__ge__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Greater-than-or-equals operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x>=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getattribute__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__getattribute__('name') <==> x.name</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__getattribute__"><code>__builtin__.object.__getattribute__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getitem__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Indexing operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x[y]\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getslice__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getslice__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">i</span>,\r
- <span class="sig-arg">j</span>)</span>\r
- <br /><em class="fname">(Slicling operator)</em>\r
- </h3>\r
-<p>Use of negative indices is not supported.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x[i:j]\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__gt__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__gt__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Greater-than operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x>y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__hash__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__hash__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Hashing function)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-hash(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__hash__"><code>__builtin__.object.__hash__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__iadd__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__iadd__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x+=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__imul__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__imul__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x*=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__iter__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__iter__</span>(<span class="sig-arg">x</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-iter(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__le__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__le__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Less-than-or-equals operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x<=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__len__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__len__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Length operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-len(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__lt__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__lt__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Less-than operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x<y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__mul__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__mul__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">n</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x*n\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__ne__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__ne__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Inequality operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x!=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__new__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,\r
- <span class="sig-arg">S</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-a new object with type S, a subtype of T\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__repr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-repr(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__repr__"><code>__builtin__.object.__repr__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__rmul__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__rmul__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">n</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-n*x\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__setitem__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__setitem__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">i</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Index assignment operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x[i]=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__setslice__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__setslice__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">i</span>,\r
- <span class="sig-arg">j</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Slice assignment operator)</em>\r
- </h3>\r
-<p>Use of negative indices is not supported.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x[i:j]=y\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="append"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">append</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">object</span>)</span>\r
- </h3>\r
-<p>append object to end</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="count"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">count</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">value</span>)</span>\r
- </h3>\r
-<p>return number of occurrences of value</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-integer\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="extend"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">extend</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">iterable</span>)</span>\r
- </h3>\r
-<p>extend list by appending elements from the iterable</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="index"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">index</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>L.index(value, [start, [stop]]) -> integer -- return first index of value</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="insert"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">insert</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">index</span>,\r
- <span class="sig-arg">object</span>)</span>\r
- </h3>\r
-<p>insert object before index</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="pop"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">pop</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">index</span>=<span class="sig-default">...</span>)</span>\r
- </h3>\r
-<p>remove and return item at index (default last)</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-item\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="remove"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">remove</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">value</span>)</span>\r
- </h3>\r
-<p>remove first occurrence of value</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="reverse"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">reverse</span>(<span class="sig-arg">L</span>)</span>\r
- </h3>\r
-<p>reverse <em>IN PLACE</em></p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="sort"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">sort</span>(<span class="sig-arg">L</span>,\r
- <span class="sig-arg">cmpfunc</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>stable sort <em>IN PLACE</em>; cmpfunc(x, y) -> -1, 0, 1</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>__builtin__.object</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Module __builtin__ ::\r
- Class object\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/__builtin__.object-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="__builtin__.object-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type object</h2>\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a>,\r
- <a href="__builtin__.list-class.html"><code>list</code></a>,\r
- <a href="psycopg2.extras.SQL_IN-class.html"><code>SQL_IN</code></a>,\r
- <a href="__builtin__.type-class.html"><code>type</code></a>,\r
- <a href="datetime.tzinfo-class.html"><code>tzinfo</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>The most base type</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__hash__"></a><span class="summary-sig"><span class="summary-sig-name">__hash__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF CLASS VARIABLE SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Class Variable Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
- <td><a name="__class__"></a><strong><code class="vname">__class__</code></strong> = <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__delattr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__delattr__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__delattr__('name') <==> del x.name</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getattribute__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__getattribute__('name') <==> x.name</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__hash__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__hash__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Hashing function)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-hash(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__new__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,\r
- <span class="sig-arg">S</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-a new object with type S, a subtype of T\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__reduce__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__reduce__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>helper for pickle</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__reduce_ex__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__reduce_ex__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>helper for pickle</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__repr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-repr(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__setattr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__setattr__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__setattr__('name', value) <==> x.name = value</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__str__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Informal representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-str(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>__builtin__.type</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Module __builtin__ ::\r
- Class type\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/__builtin__.type-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="__builtin__.type-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type type</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">type</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>type(object) -> the object's type\r
-type(name, bases, dict) -> a new type</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__call__"></a><span class="summary-sig"><span class="summary-sig-name">__call__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return x(...)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__cmp__"></a><span class="summary-sig"><span class="summary-sig-name">__cmp__</span>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return cmp(x,y)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__hash__"></a><span class="summary-sig"><span class="summary-sig-name">__hash__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">list of immediate subclasses</td>\r
- <td><code><a name="__subclasses__"></a><span class="summary-sig"><span class="summary-sig-name">__subclasses__</span>()</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">list</td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#mro" class="summary-sig-name"><code>mro</code></a>()</span></code>\r
-<br />\r
-return a type's method resolution order</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF PROPERTY SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Property Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__base__"></a><strong><code>__base__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__basicsize__"></a><strong><code>__basicsize__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__dictoffset__"></a><strong><code>__dictoffset__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__flags__"></a><strong><code>__flags__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__itemsize__"></a><strong><code>__itemsize__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__mro__"></a><strong><code>__mro__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td>\r
- <td><a name="__weakrefoffset__"></a><strong><code>__weakrefoffset__</code></strong></td></tr></table><br />\r
-\r
-\r
-<!-- =========== START OF CLASS VARIABLE SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Class Variable Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>tuple</code></td>\r
-<td><strong><a href="__builtin__.type-class.html#__bases__"><code>__bases__</code></a></strong> = <span title="(<type 'object'>,)"><code>(<type 'object'>,) </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td>\r
-<td><strong><a href="__builtin__.type-class.html#__name__"><code>__name__</code></a></strong> = <span title="'type'"><code><span class="variable-quote">'</span>type<span class="variable-quote">'</span> </code>\r
-</span></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__call__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__call__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Call operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-x(...)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__cmp__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__cmp__</span>(<span class="sig-arg">x</span>,\r
- <span class="sig-arg">y</span>)</span>\r
- <br /><em class="fname">(Comparison operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-cmp(x,y)\r
-</pre>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__delattr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__delattr__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__delattr__('name') <==> del x.name</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__delattr__"><code>__builtin__.object.__delattr__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getattribute__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__getattribute__('name') <==> x.name</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__getattribute__"><code>__builtin__.object.__getattribute__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__hash__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__hash__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Hashing function)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-hash(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__hash__"><code>__builtin__.object.__hash__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__new__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,\r
- <span class="sig-arg">S</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-a new object with type S, a subtype of T\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__repr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-repr(x)\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__repr__"><code>__builtin__.object.__repr__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__setattr__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__setattr__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__setattr__('name', value) <==> x.name = value</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__setattr__"><code>__builtin__.object.__setattr__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__subclasses__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__subclasses__</span>()</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-list of immediate subclasses </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="mro"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">mro</span>()</span>\r
- </h3>\r
-<p>return a type's method resolution order</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-list </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF CLASS VARIABLE DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Class Variable Details</th></tr>\r
-</table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="__bases__"></a>\r
-<h3>__bases__</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>tuple</code>\r
-\r
- </dd>\r
- <dt title="(<type 'object'>,)">Value:</dt>\r
- <dd title="(<type 'object'>,)"><table><tr><td>\r
-<pre class="variable">\r
-(<type 'object'>,) </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="__name__"></a>\r
-<h3>__name__</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>str</code>\r
-\r
- </dd>\r
- <dt title="'type'">Value:</dt>\r
- <dd title="'type'"><table><tr><td>\r
-<pre class="variable">\r
-<span class="variable-quote">'</span>type<span class="variable-quote">'</span> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>datetime.tzinfo</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Module datetime ::\r
- Class tzinfo\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/datetime.tzinfo-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="datetime.tzinfo-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type tzinfo</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">tzinfo</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>FixedOffsetTimezone</code></a>,\r
- <a href="psycopg2.tz.LocalTimezone-class.html"><code>LocalTimezone</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>Abstract base class for time zone info objects.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
--> (cls, state)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#dst" class="summary-sig-name"><code>dst</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-datetime -> DST offset in minutes east of UTC.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#fromutc" class="summary-sig-name"><code>fromutc</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-datetime in UTC -> datetime in local time.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#tzname" class="summary-sig-name"><code>tzname</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-datetime -> string name of time zone.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#utcoffset" class="summary-sig-name"><code>utcoffset</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-datetime -> minutes east of UTC (negative for west of UTC).</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__getattribute__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>x.__getattribute__('name') <==> x.name</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__getattribute__"><code>__builtin__.object.__getattribute__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__new__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,\r
- <span class="sig-arg">S</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-<pre class="literalblock">\r
-a new object with type S, a subtype of T\r
-</pre>\r
- </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__reduce__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__reduce__</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>-> (cls, state)</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__reduce__"><code>__builtin__.object.__reduce__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="dst"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dst</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>datetime -> DST offset in minutes east of UTC.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="fromutc"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">fromutc</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>datetime in UTC -> datetime in local time.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="tzname"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">tzname</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>datetime -> string name of time zone.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="utcoffset"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">utcoffset</span>(<span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>datetime -> minutes east of UTC (negative for west of UTC).</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-/* Based on the Epydoc "default.css"\r
-** with some missing reST-related classes\r
-** and Python syntax support (from SilverCity)\r
-*/\r
-\r
-/* Body color */ \r
-body { background: #ffffff; color: #000000; } \r
- \r
-/* Tables */ \r
-table.summary, table.details, table.index\r
- { background: #e8f0f8; color: #000000; } \r
-tr.summary, tr.details, tr.index\r
- { background: #70b0f0; color: #000000; \r
- text-align: left; font-size: 120%; } \r
-tr.group { background: #c0e0f8; color: #000000;\r
- text-align: left; font-size: 120%;\r
- font-style: italic; } \r
-\r
-/* Documentation page titles */\r
-h2.module { margin-top: 0.2em; }\r
-h2.class { margin-top: 0.2em; }\r
- \r
-/* Headings */\r
-h1.heading { font-size: +140%; font-style: italic;\r
- font-weight: bold; }\r
-h2.heading { font-size: +125%; font-style: italic;\r
- font-weight: bold; }\r
-h3.heading { font-size: +110%; font-style: italic;\r
- font-weight: normal; }\r
- \r
-/* Base tree */\r
-pre.base-tree { font-size: 80%; margin: 0; }\r
-\r
-/* TOC */\r
-p.toc { margin: 0; }\r
-\r
-/* Details Sections */\r
-table.func-details { background: #e8f0f8; color: #000000;\r
- border: 2px groove #c0d0d0;\r
- padding: 0 1em 0 1em; margin: 0.4em 0 0 0; }\r
-h3.func-detail { background: transparent; color: #000000;\r
- margin: 0 0 1em 0; }\r
-\r
-table.var-details { background: #e8f0f8; color: #000000;\r
- border: 2px groove #c0d0d0;\r
- padding: 0 1em 0 1em; margin: 0.4em 0 0 0; }\r
-h3.var-details { background: transparent; color: #000000;\r
- margin: 0 0 1em 0; }\r
-\r
-/* Function signatures */\r
-.sig { background: transparent; color: #000000;\r
- font-weight: bold; } \r
-.sig-name { background: transparent; color: #006080; } \r
-.sig-arg, .sig-kwarg, .sig-vararg\r
- { background: transparent; color: #008060; } \r
-.sig-default { background: transparent; color: #602000; } \r
-.summary-sig { background: transparent; color: #000000; } \r
-.summary-sig-name { background: transparent; color: #204080; }\r
-.summary-sig-arg, .summary-sig-kwarg, .summary-sig-vararg\r
- { background: transparent; color: #008060; } \r
-\r
-/* Doctest blocks */\r
-.py-src { background: transparent; color: #000000; }\r
-.py-prompt { background: transparent; color: #005050;\r
- font-weight: bold;}\r
-.py-string { background: transparent; color: #006030; }\r
-.py-comment { background: transparent; color: #003060; }\r
-.py-keyword { background: transparent; color: #600000; }\r
-.py-output { background: transparent; color: #404040; }\r
-div.code-block,\r
-pre.literal-block,\r
-pre.doctestblock { background: #f4faff; color: #000000; \r
- padding: .5em; margin: 1em;\r
- border: 1px solid #708890; }\r
-table pre.doctestblock\r
- { background: #dce4ec; color: #000000; \r
- padding: .5em; margin: 1em;\r
- border: 1px solid #708890; }\r
-div.code-block { font-family: monospace; }\r
-\r
-/* Variable values */\r
-pre.variable { background: #dce4ec; color: #000000;\r
- padding: .5em; margin: 0;\r
- border: 1px solid #708890; }\r
-.variable-linewrap { background: transparent; color: #604000; }\r
-.variable-ellipsis { background: transparent; color: #604000; }\r
-.variable-quote { background: transparent; color: #604000; }\r
-.re { background: transparent; color: #000000; }\r
-.re-char { background: transparent; color: #006030; }\r
-.re-op { background: transparent; color: #600000; }\r
-.re-group { background: transparent; color: #003060; }\r
-.re-ref { background: transparent; color: #404040; }\r
-\r
-/* Navigation bar */ \r
-table.navbar { background: #a0c0ff; color: #0000ff;\r
- border: 2px groove #c0d0d0; }\r
-th.navbar { background: #a0c0ff; color: #0000ff; } \r
-th.navselect { background: #70b0ff; color: #000000; } \r
-.nomargin { margin: 0; }\r
-\r
-/* Links */ \r
-a:link { background: transparent; color: #0000ff; } \r
-a:visited { background: transparent; color: #204080; } \r
-a.navbar:link { background: transparent; color: #0000ff; \r
- text-decoration: none; } \r
-a.navbar:visited { background: transparent; color: #204080; \r
- text-decoration: none; } \r
-\r
-/* Admonitions */\r
-div.warning,\r
-div.note { background-color: #c0e0f8;\r
- border: thin solid black;\r
- padding: 1em;\r
- margin-left: 1em;\r
- margin-right: 1em; }\r
-div.warning .first,\r
-div.note .first { font-family: sans-serif;\r
- font-size: 110%;\r
- margin-right: 0.5em; }\r
-\r
-/* Lists */\r
-ul { margin-top: 0; }\r
-\r
-/* Python syntax */\r
-.p_character { color: olive; }\r
-.p_classname { color: blue; font-weight: bold; }\r
-.p_commentblock {color: gray; font-style: italic; }\r
-.p_commentline { color: green; font-style: italic; }\r
-.p_default {}\r
-.p_defname { color: #009999; font-weight: bold; }\r
-.p_identifier { color: black; }\r
-.p_number { color: #009999; }\r
-.p_operator { color: black; }\r
-.p_string { color: #7F007F; }\r
-.p_stringeol { color: #7F007F; }\r
-.p_triple { color: #7F0000; }\r
-.p_tripledouble { color: #7F0000; }\r
-.p_word { color: navy; font-weight: bold; }\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>exceptions.Exception</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Module exceptions ::\r
- Class Exception\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/exceptions.Exception-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="exceptions.Exception-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class Exception</h2>\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="exceptions.StandardError-class.html"><code>StandardError</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>Common base class for all exceptions.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__getitem__"></a><span class="summary-sig"><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getitem__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Indexing operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__str__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-vararg">...</span>)</span>\r
- <br /><em class="fname">(Informal representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>exceptions.StandardError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Module exceptions ::\r
- Class StandardError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/exceptions.StandardError-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="exceptions.StandardError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class StandardError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+\r
- |\r
- <strong class="uidshort">StandardError</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.Error-class.html"><code>Error</code></a>,\r
- <a href="psycopg2.Warning-class.html"><code>Warning</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>Base class for all standard Python exceptions.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"\r
- "DTD/xhtml1-frameset.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title> API Documentation </title>\r
-</head>\r
-<frameset cols="20%,80%">\r
- <frameset rows="30%,70%">\r
- <frame src="toc.html" name="moduleListFrame" id="moduleListFrame" />\r
- <frame src="toc-everything.html" name="moduleFrame" id="moduleFrame" />\r
- </frameset>\r
- <frame src="psycopg2-module.html" name="mainFrame" id="mainFrame" />\r
-</frameset>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>Help</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th bgcolor="#70b0f0" class="navselect"> Help </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/help.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="help.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<h1 class="help"> API Documentation </h1>\r
-\r
-<p> This document contains the API (Application Programming Interface)\r
-documentation for this project. Documentation for the Python\r
-objects defined by the project is divided into separate pages for each\r
-package, module, and class. The API documentation also includes two\r
-pages containing information about the project as a whole: a trees\r
-page, and an index page. </p>\r
-\r
-<h2> Object Documentation </h2>\r
-\r
- <p>Each <strong>Package Documentation</strong> page contains: </p>\r
- <ul>\r
- <li> A description of the package. </li>\r
- <li> A list of the modules and sub-packages contained by the\r
- package. </li>\r
- <li> A summary of the classes defined by the package. </li>\r
- <li> A summary of the functions defined by the package. </li>\r
- <li> A summary of the variables defined by the package. </li>\r
- <li> A detailed description of each function defined by the\r
- package. </li>\r
- <li> A detailed description of each variable defined by the\r
- package. </li>\r
- </ul>\r
- \r
- <p>Each <strong>Module Documentation</strong> page contains:</p>\r
- <ul>\r
- <li> A description of the module. </li>\r
- <li> A summary of the classes defined by the module. </li>\r
- <li> A summary of the functions defined by the module. </li>\r
- <li> A summary of the variables defined by the module. </li>\r
- <li> A detailed description of each function defined by the\r
- module. </li>\r
- <li> A detailed description of each variable defined by the\r
- module. </li>\r
- </ul>\r
- \r
- <p>Each <strong>Class Documentation</strong> page contains: </p>\r
- <ul>\r
- <li> A class inheritance diagram. </li>\r
- <li> A list of known subclasses. </li>\r
- <li> A description of the class. </li>\r
- <li> A summary of the methods defined by the class. </li>\r
- <li> A summary of the instance variables defined by the class. </li>\r
- <li> A summary of the class (static) variables defined by the\r
- class. </li> \r
- <li> A detailed description of each method defined by the\r
- class. </li>\r
- <li> A detailed description of each instance variable defined by the\r
- class. </li> \r
- <li> A detailed description of each class (static) variable defined\r
- by the class. </li> \r
- </ul>\r
-\r
-<h2> Project Documentation </h2>\r
-\r
- <p> The <strong>Trees</strong> page contains the module and class hierarchies: </p>\r
- <ul>\r
- <li> The <em>module hierarchy</em> lists every package and module, with\r
- modules grouped into packages. At the top level, and within each\r
- package, modules and sub-packages are listed alphabetically. </li>\r
- <li> The <em>class hierarchy</em> lists every class, grouped by base\r
- class. If a class has more than one base class, then it will be\r
- listed under each base class. At the top level, and under each base\r
- class, classes are listed alphabetically. </li>\r
- </ul>\r
- \r
- <p> The <strong>Index</strong> page contains indices of terms and\r
- identifiers: </p>\r
- <ul>\r
- <li> The <em>term index</em> lists every term indexed by any object's\r
- documentation. For each term, the index provides links to each\r
- place where the term is indexed. </li>\r
- <li> The <em>identifier index</em> lists the (short) name of every package,\r
- module, class, method, function, variable, and parameter. For each\r
- identifier, the index provides a short description, and a link to\r
- its documentation. </li>\r
- </ul>\r
-\r
-<h2> The Table of Contents </h2>\r
-\r
-<p> The table of contents occupies the two frames on the left side of\r
-the window. The upper-left frame displays the <em>project\r
-contents</em>, and the lower-left frame displays the <em>module\r
-contents</em>: </p>\r
-\r
-<table class="help summary" border="1" cellspacing="0" cellpadding="3">\r
- <tr style="height: 30%">\r
- <td align="center" style="font-size: small">\r
- Project<br />Contents<hr />...</td>\r
- <td align="center" style="font-size: small" rowspan="2" width="70%">\r
- API<br />Documentation<br />Frame<br /><br /><br />\r
- </td>\r
- </tr>\r
- <tr>\r
- <td align="center" style="font-size: small">\r
- Module<br />Contents<hr /> <br />...<br /> \r
- </td>\r
- </tr>\r
-</table><br />\r
-\r
-<p> The <strong>project contents frame</strong> contains a list of all packages\r
-and modules that are defined by the project. Clicking on an entry\r
-will display its contents in the module contents frame. Clicking on a\r
-special entry, labeled "Everything," will display the contents of\r
-the entire project. </p>\r
-\r
-<p> The <strong>module contents frame</strong> contains a list of every\r
-submodule, class, type, exception, function, and variable defined by a\r
-module or package. Clicking on an entry will display its\r
-documentation in the API documentation frame. Clicking on the name of\r
-the module, at the top of the frame, will display the documentation\r
-for the module itself. </p>\r
-\r
-<p> The "<strong>frames</strong>" and "<strong>no frames</strong>" buttons below the top\r
-navigation bar can be used to control whether the table of contents is\r
-displayed or not. </p>\r
-\r
-<h2> The Navigation Bar </h2>\r
-\r
-<p> A navigation bar is located at the top and bottom of every page.\r
-It indicates what type of page you are currently viewing, and allows\r
-you to go to related pages. The following table describes the labels\r
-on the navigation bar. Note that not some labels (such as\r
-[Parent]) are not displayed on all pages. </p>\r
-\r
-<table class="summary" border="1" cellspacing="0" cellpadding="3" width="100%">\r
-<tr class="summary">\r
- <th>Label</th>\r
- <th>Highlighted when...</th>\r
- <th>Links to...</th>\r
-</tr>\r
- <tr><td valign="top"><strong>[Parent]</strong></td>\r
- <td valign="top"><em>(never highlighted)</em></td>\r
- <td valign="top"> the parent of the current package </td></tr>\r
- <tr><td valign="top"><strong>[Package]</strong></td>\r
- <td valign="top">viewing a package</td>\r
- <td valign="top">the package containing the current object\r
- </td></tr>\r
- <tr><td valign="top"><strong>[Module]</strong></td>\r
- <td valign="top">viewing a module</td>\r
- <td valign="top">the module containing the current object\r
- </td></tr> \r
- <tr><td valign="top"><strong>[Class]</strong></td>\r
- <td valign="top">viewing a class </td>\r
- <td valign="top">the class containing the current object</td></tr>\r
- <tr><td valign="top"><strong>[Trees]</strong></td>\r
- <td valign="top">viewing the trees page</td>\r
- <td valign="top"> the trees page </td></tr>\r
- <tr><td valign="top"><strong>[Index]</strong></td>\r
- <td valign="top">viewing the index page</td>\r
- <td valign="top"> the index page </td></tr>\r
- <tr><td valign="top"><strong>[Help]</strong></td>\r
- <td valign="top">viewing the help page</td>\r
- <td valign="top"> the help page </td></tr>\r
-</table>\r
-\r
-<p> The "<strong>show private</strong>" and "<strong>hide private</strong>" buttons below\r
-the top navigation bar can be used to control whether documentation\r
-for private objects is displayed. Private objects are usually defined\r
-as objects whose (short) names begin with a single underscore, but do\r
-not end with an underscore. For example, "<code>_x</code>",\r
-"<code>__pprint</code>", and "<code>epydoc.epytext._tokenize</code>"\r
-are private objects; but "<code>re.sub</code>",\r
-"<code>__init__</code>", and "<code>type_</code>" are not. However,\r
-if a module defines the "<code>__all__</code>" variable, then its\r
-contents are used to decide which objects are private. </p>\r
-\r
-<p> A timestamp below the bottom navigation bar indicates when each\r
-page was last updated. </p>\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th bgcolor="#70b0f0" class="navselect"> Help </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"\r
- "DTD/xhtml1-frameset.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title> API Documentation </title>\r
-</head>\r
-<frameset cols="20%,80%">\r
- <frameset rows="30%,70%">\r
- <frame src="toc.html" name="moduleListFrame" id="moduleListFrame" />\r
- <frame src="toc-everything.html" name="moduleFrame" id="moduleFrame" />\r
- </frameset>\r
- <frame src="psycopg2-module.html" name="mainFrame" id="mainFrame" />\r
-</frameset>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>Index</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th bgcolor="#70b0f0" class="navselect"> Index </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/indices.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="indices.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-<br />\r
-\r
-<!-- =========== START OF IDENTIFIER INDEX =========== -->\r
-<table class="index" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="index">\r
- <th colspan="2">Identifier Index</th></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__add__"><code>__add__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__base__"><code>__base__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__bases__"><code>__bases__</code></a></td>\r
- <td>Variable in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__basicsize__"><code>__basicsize__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__call__"><code>__call__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html"><code>type</code></a></td>\r
- <td>Class in module <code>__builtin__</code></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__cmp__"><code>__cmp__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__contains__"><code>__contains__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__delattr__"><code>__delattr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__delattr__"><code>__delattr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__delitem__"><code>__delitem__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__delslice__"><code>__delslice__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__dictoffset__"><code>__dictoffset__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__eq__"><code>__eq__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__flags__"><code>__flags__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__ge__"><code>__ge__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__getattribute__"><code>__getattribute__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__getattribute__"><code>__getattribute__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__getattribute__"><code>__getattribute__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#__getattribute__"><code>__getattribute__</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__getitem__"><code>__getitem__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="exceptions.Exception-class.html#__getitem__"><code>__getitem__</code></a></td>\r
- <td>Method in class <a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#__getitem__"><code>__getitem__</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__getslice__"><code>__getslice__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__gt__"><code>__gt__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__hash__"><code>__hash__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__hash__"><code>__hash__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__hash__"><code>__hash__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__iadd__"><code>__iadd__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__imul__"><code>__imul__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="exceptions.Exception-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.SQL_IN-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.SQL_IN-class.html"><code>psycopg2.extras.SQL_IN</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#__init__"><code>__init__</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__itemsize__"><code>__itemsize__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__iter__"><code>__iter__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__le__"><code>__le__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__len__"><code>__len__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__lt__"><code>__lt__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__mro__"><code>__mro__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__mul__"><code>__mul__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__name__"><code>__name__</code></a></td>\r
- <td>Variable in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__ne__"><code>__ne__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__new__"><code>__new__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__new__"><code>__new__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__new__"><code>__new__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#__new__"><code>__new__</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__reduce__"><code>__reduce__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#__reduce__"><code>__reduce__</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__reduce_ex__"><code>__reduce_ex__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__repr__"><code>__repr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__repr__"><code>__repr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__repr__"><code>__repr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__rmul__"><code>__rmul__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__setattr__"><code>__setattr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__setattr__"><code>__setattr__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__setitem__"><code>__setitem__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#__setslice__"><code>__setslice__</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html#__str__"><code>__str__</code></a></td>\r
- <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr>\r
- <tr><td width="15%"><a href="exceptions.Exception-class.html#__str__"><code>__str__</code></a></td>\r
- <td>Method in class <a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__subclasses__"><code>__subclasses__</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#__weakrefoffset__"><code>__weakrefoffset__</code></a></td>\r
- <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a></td>\r
- <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#adapt"><code>adapt</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#append"><code>append</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#AsIs"><code>AsIs</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.connection-class.html#autocommit"><code>autocommit</code></a></td>\r
- <td>Method in class <a href="psycopg2.psycopg1.connection-class.html"><code>psycopg2.psycopg1.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#Binary"><code>Binary</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#Boolean"><code>Boolean</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#callproc"><code>callproc</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#closeall"><code>closeall</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#closeall"><code>closeall</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#connect"><code>connect</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1-module.html#connect"><code>connect</code></a></td>\r
- <td>Function in module <a href="psycopg2.psycopg1-module.html"><code>psycopg2.psycopg1</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.connection-class.html"><code>connection</code></a></td>\r
- <td>Class in module <a href="psycopg2.psycopg1-module.html"><code>psycopg2.psycopg1</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#count"><code>count</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictConnection-class.html#cursor"><code>cursor</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictConnection-class.html"><code>psycopg2.extras.DictConnection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.connection-class.html#cursor"><code>cursor</code></a></td>\r
- <td>Method in class <a href="psycopg2.psycopg1.connection-class.html"><code>psycopg2.psycopg1.connection</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html"><code>cursor</code></a></td>\r
- <td>Class in module <a href="psycopg2.psycopg1-module.html"><code>psycopg2.psycopg1</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.DataError-class.html"><code>DataError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#Date"><code>Date</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#DateFromPy"><code>DateFromPy</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#DateFromTicks"><code>DateFromTicks</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool-module.html#dbg"><code>dbg</code></a></td>\r
- <td>Function in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictConnection-class.html"><code>DictConnection</code></a></td>\r
- <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html"><code>DictCursor</code></a></td>\r
- <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html#dictfetchall"><code>dictfetchall</code></a></td>\r
- <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html#dictfetchmany"><code>dictfetchmany</code></a></td>\r
- <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html#dictfetchone"><code>dictfetchone</code></a></td>\r
- <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html"><code>DictRow</code></a></td>\r
- <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#dst"><code>dst</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#dst"><code>dst</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html#dst"><code>dst</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz-module.html#DSTDIFF"><code>DSTDIFF</code></a></td>\r
- <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.Error-class.html"><code>Error</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="exceptions.Exception-class.html"><code>Exception</code></a></td>\r
- <td>Class in module <code>exceptions</code></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#execute"><code>execute</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#extend"><code>extend</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html"><code>extensions</code></a></td>\r
- <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras-module.html"><code>extras</code></a></td>\r
- <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#fetchall"><code>fetchall</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#fetchmany"><code>fetchmany</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#fetchone"><code>fetchone</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>FixedOffsetTimezone</code></a></td>\r
- <td>Class in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#fromutc"><code>fromutc</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#get"><code>get</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#getconn"><code>getconn</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#getconn"><code>getconn</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.SQL_IN-class.html#getquoted"><code>getquoted</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.SQL_IN-class.html"><code>psycopg2.extras.SQL_IN</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#has_key"><code>has_key</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#index"><code>index</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#insert"><code>insert</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.IntegrityError-class.html"><code>IntegrityError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.InterfaceError-class.html"><code>InterfaceError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.InternalError-class.html"><code>InternalError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#IntervalFromPy"><code>IntervalFromPy</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT"><code>ISOLATION_LEVEL_AUTOCOMMIT</code></a></td>\r
- <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED"><code>ISOLATION_LEVEL_READ_COMMITTED</code></a></td>\r
- <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED"><code>ISOLATION_LEVEL_READ_UNCOMMITTED</code></a></td>\r
- <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ"><code>ISOLATION_LEVEL_REPEATABLE_READ</code></a></td>\r
- <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE"><code>ISOLATION_LEVEL_SERIALIZABLE</code></a></td>\r
- <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#items"><code>items</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#keys"><code>keys</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html"><code>list</code></a></td>\r
- <td>Class in module <code>__builtin__</code></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz-module.html#LOCAL"><code>LOCAL</code></a></td>\r
- <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html"><code>LocalTimezone</code></a></td>\r
- <td>Class in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html#mro"><code>mro</code></a></td>\r
- <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#new_type"><code>new_type</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.NotSupportedError-class.html"><code>NotSupportedError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.object-class.html"><code>object</code></a></td>\r
- <td>Class in module <code>__builtin__</code></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.OperationalError-class.html"><code>OperationalError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>PersistentConnectionPool</code></a></td>\r
- <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool-module.html"><code>pool</code></a></td>\r
- <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.PoolError-class.html"><code>PoolError</code></a></td>\r
- <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#pop"><code>pop</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.ProgrammingError-class.html"><code>ProgrammingError</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.psycopg1-module.html"><code>psycopg1</code></a></td>\r
- <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html"><code>psycopg2</code></a></td>\r
- <td>Package</td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#putconn"><code>putconn</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#putconn"><code>putconn</code></a></td>\r
- <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#QuotedString"><code>QuotedString</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#register_adapter"><code>register_adapter</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#register_type"><code>register_type</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#remove"><code>remove</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#reverse"><code>reverse</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>SimpleConnectionPool</code></a></td>\r
- <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.list-class.html#sort"><code>sort</code></a></td>\r
- <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.SQL_IN-class.html"><code>SQL_IN</code></a></td>\r
- <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr>\r
- <tr><td width="15%"><a href="exceptions.StandardError-class.html"><code>StandardError</code></a></td>\r
- <td>Class in module <code>exceptions</code></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz-module.html#STDOFFSET"><code>STDOFFSET</code></a></td>\r
- <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>ThreadedConnectionPool</code></a></td>\r
- <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#Time"><code>Time</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#TimeFromPy"><code>TimeFromPy</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#TimeFromTicks"><code>TimeFromTicks</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#Timestamp"><code>Timestamp</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extensions-module.html#TimestampFromPy"><code>TimestampFromPy</code></a></td>\r
- <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2-module.html#TimestampFromTicks"><code>TimestampFromTicks</code></a></td>\r
- <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="__builtin__.type-class.html"><code>type</code></a></td>\r
- <td>Class in module <code>__builtin__</code></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz-module.html"><code>tz</code></a></td>\r
- <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html"><code>tzinfo</code></a></td>\r
- <td>Class in module <code>datetime</code></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#tzname"><code>tzname</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#tzname"><code>tzname</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html#tzname"><code>tzname</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="datetime.tzinfo-class.html#utcoffset"><code>utcoffset</code></a></td>\r
- <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#utcoffset"><code>utcoffset</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html#utcoffset"><code>utcoffset</code></a></td>\r
- <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#values"><code>values</code></a></td>\r
- <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.Warning-class.html"><code>Warning</code></a></td>\r
- <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr>\r
- <tr><td width="15%"><a href="psycopg2.tz-module.html#ZERO"><code>ZERO</code></a></td>\r
- <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr>\r
-</table>\r
-<br />\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th bgcolor="#70b0f0" class="navselect"> Index </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th bgcolor="#70b0f0" class="navselect"> Home </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- Package psycopg2\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2-module.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF PACKAGE DESCRIPTION =========== -->\r
-<h2 class="package">Package psycopg2</h2>\r
-\r
-<p>A Python driver for PostgreSQL</p>\r
-<p>psycopg is a <a class="reference" href="http://www.postgresql.org/">PostgreSQL</a> database adapter for the <a class="reference" href="http://www.python.org/">Python</a> programming\r
-language. This is version 2, a complete rewrite of the original code to\r
-provide new-style classes for connection and cursor objects and other sweet\r
-candies. Like the original, psycopg 2 was written with the aim of being very\r
-small and fast, and stable as a rock.</p>\r
-<p>Homepage: <a class="reference" href="http://initd.org/projects/psycopg2">http://initd.org/projects/psycopg2</a></p>\r
-<hr/>\r
-\r
-<!-- =========== START OF SUBMODULES =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Submodules</th></tr>\r
- <tr><td><ul>\r
-<li> <strong class="uidlink"><a href="psycopg2.extensions-module.html"><code>extensions</code></a></strong>: <em class="summary">psycopg extensions to the DBAPI-2.0</em></li>\r
-<li> <strong class="uidlink"><a href="psycopg2.extras-module.html"><code>extras</code></a></strong>: <em class="summary">Miscellaneous goodies for psycopg2</em></li>\r
-<li> <strong class="uidlink"><a href="psycopg2.pool-module.html"><code>pool</code></a></strong>: <em class="summary">Connection pooling for psycopg2</em></li>\r
-<li> <strong class="uidlink"><a href="psycopg2.psycopg1-module.html"><code>psycopg1</code></a></strong>: <em class="summary">psycopg 1.1.x compatibility module</em></li>\r
-<li> <strong class="uidlink"><a href="psycopg2.tz-module.html"><code>tz</code></a></strong>: <em class="summary">tzinfo implementations for psycopg2</em></li>\r
- </ul></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF EXCEPTIONS =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Exceptions</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a></strong></td>\r
- <td>Error related to the database engine.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.DataError-class.html"><code>DataError</code></a></strong></td>\r
- <td>Error related to problems with the processed data.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.Error-class.html"><code>Error</code></a></strong></td>\r
- <td>Base class for error exceptions.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.IntegrityError-class.html"><code>IntegrityError</code></a></strong></td>\r
- <td>Error related to database integrity.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.InterfaceError-class.html"><code>InterfaceError</code></a></strong></td>\r
- <td>Error related to the database interface.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.InternalError-class.html"><code>InternalError</code></a></strong></td>\r
- <td>The database encountered an internal error.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.NotSupportedError-class.html"><code>NotSupportedError</code></a></strong></td>\r
- <td>A not supported datbase API was called.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.OperationalError-class.html"><code>OperationalError</code></a></strong></td>\r
- <td>Error related to database operation (disconnect, memory allocation etc).</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.ProgrammingError-class.html"><code>ProgrammingError</code></a></strong></td>\r
- <td>Error related to database programming (SQL error, table not found etc).</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.Warning-class.html"><code>Warning</code></a></strong></td>\r
- <td>A database warning.</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Function Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Connections creation</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"><a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>extensions.connection</code></a></td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#connect" class="summary-sig-name"><code>connect</code></a>(<span class="summary-sig-arg">dsn</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Create a new database connection.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Value objects constructors</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new binary object</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#Binary" class="summary-sig-name"><code>Binary</code></a>(<span class="summary-sig-arg">buffer</span>)</span></code>\r
-<br />\r
-Build an object capable to hold a bynary string value.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new date</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#Date" class="summary-sig-name"><code>Date</code></a>(<span class="summary-sig-arg">year</span>,\r
- <span class="summary-sig-arg">month</span>,\r
- <span class="summary-sig-arg">day</span>)</span></code>\r
-<br />\r
-Build an object holding a date value.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new date</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#DateFromTicks" class="summary-sig-name"><code>DateFromTicks</code></a>(<span class="summary-sig-arg">ticks</span>)</span></code>\r
-<br />\r
-Build an object holding a date value from the given ticks value.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new time</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#Time" class="summary-sig-name"><code>Time</code></a>(<span class="summary-sig-arg">hour</span>,\r
- <span class="summary-sig-arg">minutes</span>,\r
- <span class="summary-sig-arg">seconds</span>,\r
- <span class="summary-sig-arg">tzinfo</span>)</span></code>\r
-<br />\r
-Build an object holding a time value.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new time</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#TimeFromTicks" class="summary-sig-name"><code>TimeFromTicks</code></a>(<span class="summary-sig-arg">ticks</span>)</span></code>\r
-<br />\r
-Build an object holding a time value from the given ticks value.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new timestamp</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#Timestamp" class="summary-sig-name"><code>Timestamp</code></a>(<span class="summary-sig-arg">year</span>,\r
- <span class="summary-sig-arg">month</span>,\r
- <span class="summary-sig-arg">day</span>,\r
- <span class="summary-sig-arg">hour</span>,\r
- <span class="summary-sig-arg">minutes</span>,\r
- <span class="summary-sig-arg">seconds</span>,\r
- <span class="summary-sig-arg">tzinfo</span>)</span></code>\r
-<br />\r
-Build an object holding a timestamp value.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new timestamp</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2-module.html#TimestampFromTicks" class="summary-sig-name"><code>TimestampFromTicks</code></a>(<span class="summary-sig-arg">ticks</span>)</span></code>\r
-<br />\r
-Build an object holding a timestamp value from the given ticks value.</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Function Details</th></tr>\r
-</table>\r
-\r
-<a name="connect"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">connect</span>(<span class="sig-arg">dsn</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
-<p>Create a new database connection.</p>\r
-<p>This function supports two different but equivalent sets of arguments.\r
-A single data source name or <tt class="docutils literal"><span class="pre">dsn</span></tt> string can be used to specify the\r
-connection parameters, as follows:</p>\r
-<pre class="literal-block">\r
-psycopg2.connect("dbname=xxx user=xxx ...")\r
-</pre>\r
-<p>If <tt class="docutils literal"><span class="pre">dsn</span></tt> is not provided it is possible to pass the parameters as\r
-keyword arguments; e.g.:</p>\r
-<pre class="literal-block">\r
-psycopg2.connect(database='xxx', user='xxx', ...)\r
-</pre>\r
-<p>The full list of available parameters is:</p>\r
-<ul class="rst-simple">\r
-<li><tt class="docutils literal"><span class="pre">dbname</span></tt> -- database name (only in 'dsn')</li>\r
-<li><tt class="docutils literal"><span class="pre">database</span></tt> -- database name (only as keyword argument)</li>\r
-<li><tt class="docutils literal"><span class="pre">host</span></tt> -- host address (defaults to UNIX socket if not provided)</li>\r
-<li><tt class="docutils literal"><span class="pre">port</span></tt> -- port number (defaults to 5432 if not provided)</li>\r
-<li><tt class="docutils literal"><span class="pre">user</span></tt> -- user name used to authenticate</li>\r
-<li><tt class="docutils literal"><span class="pre">password</span></tt> -- password used to authenticate</li>\r
-<li><tt class="docutils literal"><span class="pre">sslmode</span></tt> -- SSL mode (see PostgreSQL documentation)</li>\r
-</ul>\r
-<p>If the <tt class="docutils literal"><span class="pre">connection_factory</span></tt> keyword argument is not provided this\r
-function always return an instance of the <code>connection</code> class.\r
-Else the given sub-class of <a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>extensions.connection</code></a> will be used to\r
-instantiate the connection object.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-New database connection <br /><em> \r
- (type=<a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>extensions.connection</code></a>)</em>\r
- </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="Binary"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">Binary</span>(<span class="sig-arg">buffer</span>)</span>\r
- </h3>\r
-<p>Build an object capable to hold a bynary string value.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new binary object </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="Date"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">Date</span>(<span class="sig-arg">year</span>,\r
- <span class="sig-arg">month</span>,\r
- <span class="sig-arg">day</span>)</span>\r
- </h3>\r
-<p>Build an object holding a date value.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new date </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="DateFromTicks"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">DateFromTicks</span>(<span class="sig-arg">ticks</span>)</span>\r
- </h3>\r
-<p>Build an object holding a date value from the given ticks value.</p>\r
-<p>Ticks are the number of seconds since the epoch; see the documentation of the standard Python time module for details).</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new date </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="Time"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">Time</span>(<span class="sig-arg">hour</span>,\r
- <span class="sig-arg">minutes</span>,\r
- <span class="sig-arg">seconds</span>,\r
- <span class="sig-arg">tzinfo</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>Build an object holding a time value.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new time </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="TimeFromTicks"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">TimeFromTicks</span>(<span class="sig-arg">ticks</span>)</span>\r
- </h3>\r
-<p>Build an object holding a time value from the given ticks value.</p>\r
-<p>Ticks are the number of seconds since the epoch; see the documentation of the standard Python time module for details).</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new time </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="Timestamp"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">Timestamp</span>(<span class="sig-arg">year</span>,\r
- <span class="sig-arg">month</span>,\r
- <span class="sig-arg">day</span>,\r
- <span class="sig-arg">hour</span>,\r
- <span class="sig-arg">minutes</span>,\r
- <span class="sig-arg">seconds</span>,\r
- <span class="sig-arg">tzinfo</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>Build an object holding a timestamp value.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new timestamp </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="TimestampFromTicks"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">TimestampFromTicks</span>(<span class="sig-arg">ticks</span>)</span>\r
- </h3>\r
-<p>Build an object holding a timestamp value from the given ticks value.</p>\r
-<p>Ticks are the number of seconds since the epoch; see the documentation of the standard Python time module for details).</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new timestamp </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th bgcolor="#70b0f0" class="navselect"> Home </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.DataError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class DataError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.DataError-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.DataError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class DataError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ \r
- | \r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+\r
- |\r
- <strong class="uidshort">DataError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Error related to problems with the processed data.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.DatabaseError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class DatabaseError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.DatabaseError-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.DatabaseError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class DatabaseError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+\r
- |\r
- <strong class="uidshort">DatabaseError</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.DataError-class.html"><code>DataError</code></a>,\r
- <a href="psycopg2.IntegrityError-class.html"><code>IntegrityError</code></a>,\r
- <a href="psycopg2.InternalError-class.html"><code>InternalError</code></a>,\r
- <a href="psycopg2.NotSupportedError-class.html"><code>NotSupportedError</code></a>,\r
- <a href="psycopg2.OperationalError-class.html"><code>OperationalError</code></a>,\r
- <a href="psycopg2.ProgrammingError-class.html"><code>ProgrammingError</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>Error related to the database engine.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.Error</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class Error\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.Error-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.Error-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class Error</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+\r
- |\r
- <strong class="uidshort">Error</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a>,\r
- <a href="psycopg2.InterfaceError-class.html"><code>InterfaceError</code></a>,\r
- <a href="psycopg2.pool.PoolError-class.html"><code>PoolError</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>Base class for error exceptions.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.IntegrityError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class IntegrityError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.IntegrityError-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.IntegrityError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class IntegrityError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ \r
- | \r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+\r
- |\r
- <strong class="uidshort">IntegrityError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Error related to database integrity.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.InterfaceError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class InterfaceError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.InterfaceError-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.InterfaceError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class InterfaceError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+\r
- |\r
- <strong class="uidshort">InterfaceError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Error related to the database interface.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.InternalError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class InternalError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.InternalError-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.InternalError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class InternalError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ \r
- | \r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+\r
- |\r
- <strong class="uidshort">InternalError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>The database encountered an internal error.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.NotSupportedError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class NotSupportedError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.NotSupportedError-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.NotSupportedError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class NotSupportedError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ \r
- | \r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+\r
- |\r
- <strong class="uidshort">NotSupportedError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A not supported datbase API was called.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.OperationalError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class OperationalError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.OperationalError-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.OperationalError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class OperationalError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ \r
- | \r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+\r
- |\r
- <strong class="uidshort">OperationalError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Error related to database operation (disconnect, memory allocation etc).</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.ProgrammingError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class ProgrammingError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.ProgrammingError-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.ProgrammingError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class ProgrammingError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ \r
- | \r
- <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+\r
- |\r
- <strong class="uidshort">ProgrammingError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Error related to database programming (SQL error, table not found etc).</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.Warning</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Class Warning\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.Warning-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.Warning-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class Warning</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+\r
- |\r
- <strong class="uidshort">Warning</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A database warning.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2._psycopg</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Module _psycopg\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2._psycopg-module.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2._psycopg-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE DESCRIPTION =========== -->\r
-<h2 class="module">Module psycopg2._psycopg</h2>\r
-\r
-<p>psycopg PostgreSQL driver</p>\r
-<hr/>\r
-\r
-<!-- =========== START OF VARIABLE SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Variable Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#__version__"><code>__version__</code></a></strong> = <span title="'2.0b7 (dt ext pq3)'"><code><span class="variable-quote">'</span>2.0b7 (dt ext pq3)<span class="variable-quote">'</span> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#adapters"><code>adapters</code></a></strong> = <span title="{(<type 'bool'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Boolean'>, (<type 'list'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.List'>, (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function TimestampFromPy>, (<type 'buffer'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Binary'>, (<type 'unicode'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.QuotedString'>, (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function DateFromPy>, (<type 'datetime.time'>, ..."><code>{(<type 'bool'>, <type 'psycopg2._psycopg.ISQ<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#apilevel"><code>apilevel</code></a></strong> = <span title="'2.0'"><code><span class="variable-quote">'</span>2.0<span class="variable-quote">'</span> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#BINARY"><code>BINARY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009558C0>"><code><psycopg2._psycopg.type object at 0x009558C0> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#binary_types"><code>binary_types</code></a></strong> = <span title="{}"><code>{} </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#BINARYARRAY"><code>BINARYARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955B60>"><code><psycopg2._psycopg.type object at 0x00955B<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#BOOLEAN"><code>BOOLEAN</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955760>"><code><psycopg2._psycopg.type object at 0x00955760> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#BOOLEANARRAY"><code>BOOLEANARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955A20>"><code><psycopg2._psycopg.type object at 0x00955<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#DATE"><code>DATE</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009558A0>"><code><psycopg2._psycopg.type object at 0x009558A0> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#DATEARRAY"><code>DATEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955AA0>"><code><psycopg2._psycopg.type object at 0x00955AA0<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#DATETIME"><code>DATETIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009557C0>"><code><psycopg2._psycopg.type object at 0x009557C0> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#DATETIMEARRAY"><code>DATETIMEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955AC0>"><code><psycopg2._psycopg.type object at 0x0095<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#DECIMAL"><code>DECIMAL</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955680>"><code><psycopg2._psycopg.type object at 0x00955680> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#DECIMALARRAY"><code>DECIMALARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955260>"><code><psycopg2._psycopg.type object at 0x00955<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#encodings"><code>encodings</code></a></strong> = <span title="{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL_ASCII': 'ascii', 'UNICODE': 'utf_8', 'LATIN1': 'latin_1'}"><code>{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#FLOAT"><code>FLOAT</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955660>"><code><psycopg2._psycopg.type object at 0x00955660> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#FLOATARRAY"><code>FLOATARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009559E0>"><code><psycopg2._psycopg.type object at 0x009559E<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#INTEGER"><code>INTEGER</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955620>"><code><psycopg2._psycopg.type object at 0x00955620> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#INTEGERARRAY"><code>INTEGERARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955A00>"><code><psycopg2._psycopg.type object at 0x00955<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#INTERVAL"><code>INTERVAL</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955860>"><code><psycopg2._psycopg.type object at 0x00955860> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#INTERVALARRAY"><code>INTERVALARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955BA0>"><code><psycopg2._psycopg.type object at 0x0095<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#LONGINTEGER"><code>LONGINTEGER</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009555C0>"><code><psycopg2._psycopg.type object at 0x009555<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#LONGINTEGERARRAY"><code>LONGINTEGERARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955960>"><code><psycopg2._psycopg.type object at 0x0<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#NUMBER"><code>NUMBER</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955540>"><code><psycopg2._psycopg.type object at 0x00955540> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#paramstyle"><code>paramstyle</code></a></strong> = <span title="'pyformat'"><code><span class="variable-quote">'</span>pyformat<span class="variable-quote">'</span> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#PYDATE"><code>PYDATE</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955D00>"><code><psycopg2._psycopg.type object at 0x00955D00> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#PYDATETIME"><code>PYDATETIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955C00>"><code><psycopg2._psycopg.type object at 0x00955C0<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#PYINTERVAL"><code>PYINTERVAL</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955CE0>"><code><psycopg2._psycopg.type object at 0x00955CE<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#PYTIME"><code>PYTIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955C40>"><code><psycopg2._psycopg.type object at 0x00955C40> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#ROWID"><code>ROWID</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009559A0>"><code><psycopg2._psycopg.type object at 0x009559A0> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#ROWIDARRAY"><code>ROWIDARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955BE0>"><code><psycopg2._psycopg.type object at 0x00955BE<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#STRING"><code>STRING</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955720>"><code><psycopg2._psycopg.type object at 0x00955720> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#string_types"><code>string_types</code></a></strong> = <span title="{1028: <psycopg2._psycopg.type object at 0x00955BE0>, 1005: <psycopg2._psycopg.type object at 0x00955A00>, 16: <psycopg2._psycopg.type object at 0x00955760>, 17: <psycopg2._psycopg.type object at 0x009558C0>, 1042: <psycopg2._psycopg.type object at 0x00955720>, 1043: <psycopg2._psycopg.type object at 0x00955720>, 20: <psycopg2._psycopg.type object at 0x009555C0>, 21: <psycopg2._psycopg.type object at 0x00955620>, 23: <psycopg2._psycopg.type object at 0x00955620>, 25: <psycopg2._psycopg.type object at 0x00955720>, 26: <psycopg2._psycopg.type object at 0x009559A0>, 1182: <psycopg2._psycopg.ty..."><code>{1028: <psycopg2._psycopg.type object at <span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#STRINGARRAY"><code>STRINGARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955A80>"><code><psycopg2._psycopg.type object at 0x00955A<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#threadsafety"><code>threadsafety</code></a></strong> = <span title="2">2 </span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#TIME"><code>TIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955840>"><code><psycopg2._psycopg.type object at 0x00955840> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#TIMEARRAY"><code>TIMEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955B00>"><code><psycopg2._psycopg.type object at 0x00955B00<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#UNICODE"><code>UNICODE</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009556C0>"><code><psycopg2._psycopg.type object at 0x009556C0> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td>\r
-<td><strong><a href="psycopg2._psycopg-module.html#UNICODEARRAY"><code>UNICODEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955A40>"><code><psycopg2._psycopg.type object at 0x00955<span class="variable-ellipsis">...</span></code>\r
-</span></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF VARIABLE DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Variable Details</th></tr>\r
-</table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="__version__"></a>\r
-<h3>__version__</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>str</code>\r
-\r
- </dd>\r
- <dt title="'2.0b7 (dt ext pq3)'">Value:</dt>\r
- <dd title="'2.0b7 (dt ext pq3)'"><table><tr><td>\r
-<pre class="variable">\r
-<span class="variable-quote">'</span>2.0b7 (dt ext pq3)<span class="variable-quote">'</span> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="adapters"></a>\r
-<h3>adapters</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>dict</code>\r
-\r
- </dd>\r
- <dt title="{(<type 'bool'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Boolean'>, (<type 'list'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.List'>, (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function TimestampFromPy>, (<type 'buffer'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Binary'>, (<type 'unicode'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.QuotedString'>, (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function DateFromPy>, (<type 'datetime.time'>, ...">Value:</dt>\r
- <dd title="{(<type 'bool'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Boolean'>, (<type 'list'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.List'>, (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function TimestampFromPy>, (<type 'buffer'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Binary'>, (<type 'unicode'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.QuotedString'>, (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function DateFromPy>, (<type 'datetime.time'>, ..."><table><tr><td>\r
-<pre class="variable">\r
-{(<type 'datetime.timedelta'>, <type 'psycopg2._psycopg.ISQLQuote'>): <span class="variable-linewrap">\</span>\r
-<built-in function IntervalFromPy>,\r
- (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <buil<span class="variable-linewrap">\</span>\r
-t-in function DateFromPy>,\r
- (<type 'datetime.time'>, <type 'psycopg2._psycopg.ISQLQuote'>): <buil<span class="variable-linewrap">\</span>\r
-t-in function TimeFromPy>,\r
- (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <<span class="variable-linewrap">\</span>\r
-built-in function TimestampFromPy>,\r
-<span class="variable-ellipsis">...</span> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="apilevel"></a>\r
-<h3>apilevel</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>str</code>\r
-\r
- </dd>\r
- <dt title="'2.0'">Value:</dt>\r
- <dd title="'2.0'"><table><tr><td>\r
-<pre class="variable">\r
-<span class="variable-quote">'</span>2.0<span class="variable-quote">'</span> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="BINARY"></a>\r
-<h3>BINARY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x009558C0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x009558C0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x009558C0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="binary_types"></a>\r
-<h3>binary_types</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>dict</code>\r
-\r
- </dd>\r
- <dt title="{}">Value:</dt>\r
- <dd title="{}"><table><tr><td>\r
-<pre class="variable">\r
-{} </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="BINARYARRAY"></a>\r
-<h3>BINARYARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955B60>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955B60>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955B60> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="BOOLEAN"></a>\r
-<h3>BOOLEAN</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955760>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955760>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955760> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="BOOLEANARRAY"></a>\r
-<h3>BOOLEANARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955A20>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955A20>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955A20> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DATE"></a>\r
-<h3>DATE</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x009558A0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x009558A0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x009558A0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DATEARRAY"></a>\r
-<h3>DATEARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955AA0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955AA0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955AA0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DATETIME"></a>\r
-<h3>DATETIME</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x009557C0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x009557C0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x009557C0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DATETIMEARRAY"></a>\r
-<h3>DATETIMEARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955AC0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955AC0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955AC0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DECIMAL"></a>\r
-<h3>DECIMAL</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955680>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955680>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955680> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DECIMALARRAY"></a>\r
-<h3>DECIMALARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955260>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955260>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955260> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="encodings"></a>\r
-<h3>encodings</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>dict</code>\r
-\r
- </dd>\r
- <dt title="{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL_ASCII': 'ascii', 'UNICODE': 'utf_8', 'LATIN1': 'latin_1'}">Value:</dt>\r
- <dd title="{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL_ASCII': 'ascii', 'UNICODE': 'utf_8', 'LATIN1': 'latin_1'}"><table><tr><td>\r
-<pre class="variable">\r
-{'LATIN-1': 'latin_1',\r
- 'LATIN1': 'latin_1',\r
- 'SQL_ASCII': 'ascii',\r
- 'UNICODE': 'utf_8',\r
- 'UTF8': 'utf_8'} </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="FLOAT"></a>\r
-<h3>FLOAT</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955660>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955660>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955660> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="FLOATARRAY"></a>\r
-<h3>FLOATARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x009559E0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x009559E0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x009559E0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="INTEGER"></a>\r
-<h3>INTEGER</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955620>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955620>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955620> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="INTEGERARRAY"></a>\r
-<h3>INTEGERARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955A00>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955A00>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955A00> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="INTERVAL"></a>\r
-<h3>INTERVAL</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955860>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955860>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955860> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="INTERVALARRAY"></a>\r
-<h3>INTERVALARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955BA0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955BA0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955BA0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="LONGINTEGER"></a>\r
-<h3>LONGINTEGER</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x009555C0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x009555C0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x009555C0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="LONGINTEGERARRAY"></a>\r
-<h3>LONGINTEGERARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955960>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955960>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955960> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="NUMBER"></a>\r
-<h3>NUMBER</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955540>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955540>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955540> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="paramstyle"></a>\r
-<h3>paramstyle</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>str</code>\r
-\r
- </dd>\r
- <dt title="'pyformat'">Value:</dt>\r
- <dd title="'pyformat'"><table><tr><td>\r
-<pre class="variable">\r
-<span class="variable-quote">'</span>pyformat<span class="variable-quote">'</span> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="PYDATE"></a>\r
-<h3>PYDATE</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955D00>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955D00>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955D00> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="PYDATETIME"></a>\r
-<h3>PYDATETIME</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955C00>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955C00>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955C00> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="PYINTERVAL"></a>\r
-<h3>PYINTERVAL</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955CE0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955CE0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955CE0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="PYTIME"></a>\r
-<h3>PYTIME</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955C40>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955C40>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955C40> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ROWID"></a>\r
-<h3>ROWID</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x009559A0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x009559A0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x009559A0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ROWIDARRAY"></a>\r
-<h3>ROWIDARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955BE0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955BE0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955BE0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="STRING"></a>\r
-<h3>STRING</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955720>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955720>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955720> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="string_types"></a>\r
-<h3>string_types</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>dict</code>\r
-\r
- </dd>\r
- <dt title="{1028: <psycopg2._psycopg.type object at 0x00955BE0>, 1005: <psycopg2._psycopg.type object at 0x00955A00>, 16: <psycopg2._psycopg.type object at 0x00955760>, 17: <psycopg2._psycopg.type object at 0x009558C0>, 1042: <psycopg2._psycopg.type object at 0x00955720>, 1043: <psycopg2._psycopg.type object at 0x00955720>, 20: <psycopg2._psycopg.type object at 0x009555C0>, 21: <psycopg2._psycopg.type object at 0x00955620>, 23: <psycopg2._psycopg.type object at 0x00955620>, 25: <psycopg2._psycopg.type object at 0x00955720>, 26: <psycopg2._psycopg.type object at 0x009559A0>, 1182: <psycopg2._psycopg.ty...">Value:</dt>\r
- <dd title="{1028: <psycopg2._psycopg.type object at 0x00955BE0>, 1005: <psycopg2._psycopg.type object at 0x00955A00>, 16: <psycopg2._psycopg.type object at 0x00955760>, 17: <psycopg2._psycopg.type object at 0x009558C0>, 1042: <psycopg2._psycopg.type object at 0x00955720>, 1043: <psycopg2._psycopg.type object at 0x00955720>, 20: <psycopg2._psycopg.type object at 0x009555C0>, 21: <psycopg2._psycopg.type object at 0x00955620>, 23: <psycopg2._psycopg.type object at 0x00955620>, 25: <psycopg2._psycopg.type object at 0x00955720>, 26: <psycopg2._psycopg.type object at 0x009559A0>, 1182: <psycopg2._psycopg.ty..."><table><tr><td>\r
-<pre class="variable">\r
-{16: <psycopg2._psycopg.type object at 0x00955760>,\r
- 17: <psycopg2._psycopg.type object at 0x009558C0>,\r
- 18: <psycopg2._psycopg.type object at 0x00955720>,\r
- 19: <psycopg2._psycopg.type object at 0x00955720>,\r
- 20: <psycopg2._psycopg.type object at 0x009555C0>,\r
- 21: <psycopg2._psycopg.type object at 0x00955620>,\r
- 23: <psycopg2._psycopg.type object at 0x00955620>,\r
- 25: <psycopg2._psycopg.type object at 0x00955720>,\r
-<span class="variable-ellipsis">...</span> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="STRINGARRAY"></a>\r
-<h3>STRINGARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955A80>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955A80>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955A80> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="threadsafety"></a>\r
-<h3>threadsafety</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="2">Value:</dt>\r
- <dd title="2"><table><tr><td>\r
-<pre class="variable">\r
-2 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="TIME"></a>\r
-<h3>TIME</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955840>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955840>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955840> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="TIMEARRAY"></a>\r
-<h3>TIMEARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955B00>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955B00>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955B00> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="UNICODE"></a>\r
-<h3>UNICODE</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x009556C0>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x009556C0>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x009556C0> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="UNICODEARRAY"></a>\r
-<h3>UNICODEARRAY</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>type</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2._psycopg.type object at 0x00955A40>">Value:</dt>\r
- <dd title="<psycopg2._psycopg.type object at 0x00955A40>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2._psycopg.type object at 0x00955A40> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Fri Jan 13 10:57:06 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extensions</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Module extensions\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.extensions-module.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extensions-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE DESCRIPTION =========== -->\r
-<h2 class="module">Module psycopg2.extensions</h2>\r
-\r
-<p>psycopg extensions to the DBAPI-2.0</p>\r
-<p>This module holds all the extensions to the DBAPI-2.0 provided by psycopg.</p>\r
-<ul class="rst-simple">\r
-<li><a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>connection</code></a> -- the new-type inheritable connection class</li>\r
-<li><a href="../private/psycopg2._psycopg.cursor-class.html" class="link"><code>cursor</code></a> -- the new-type inheritable cursor class</li>\r
-<li><a href="psycopg2.extensions-module.html#adapt" class="link"><code>adapt()</code></a> -- exposes the <a class="reference" href="http://www.python.org/peps/pep-0246.html">PEP-246</a> compatible adapting mechanism used\r
-by psycopg to adapt Python types to PostgreSQL ones</li>\r
-</ul>\r
-<hr/>\r
-\r
-<!-- =========== START OF FUNCTION SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Function Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">object</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#adapt" class="summary-sig-name"><code>adapt</code></a>(<span class="summary-sig-arg">obj</span>,\r
- <span class="summary-sig-arg">protocol</span>,\r
- <span class="summary-sig-arg">alternate</span>)</span></code>\r
-<br />\r
-adapt obj to given protocol</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new AsIs wrapper object</td>\r
- <td><code><a name="AsIs"></a><span class="summary-sig"><span class="summary-sig-name">AsIs</span>(<span class="summary-sig-arg">obj</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new boolean value</td>\r
- <td><code><a name="Boolean"></a><span class="summary-sig"><span class="summary-sig-name">Boolean</span>(<span class="summary-sig-arg">obj</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td>\r
- <td><code><a name="DateFromPy"></a><span class="summary-sig"><span class="summary-sig-name">DateFromPy</span>(<span class="summary-sig-arg">datetime.date</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td>\r
- <td><code><a name="IntervalFromPy"></a><span class="summary-sig"><span class="summary-sig-name">IntervalFromPy</span>(<span class="summary-sig-arg">datetime.timedelta</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new type object</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#new_type" class="summary-sig-name"><code>new_type</code></a>(<span class="summary-sig-arg">oids</span>,\r
- <span class="summary-sig-arg">name</span>,\r
- <span class="summary-sig-arg">adapter</span>)</span></code>\r
-<br />\r
-Create a new binding object.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new quoted string</td>\r
- <td><code><a name="QuotedString"></a><span class="summary-sig"><span class="summary-sig-name">QuotedString</span>(<span class="summary-sig-arg">str</span>,\r
- <span class="summary-sig-arg">enc</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#register_adapter" class="summary-sig-name"><code>register_adapter</code></a>(<span class="summary-sig-arg">typ</span>,\r
- <span class="summary-sig-arg">callable</span>)</span></code>\r
-<br />\r
-Register 'callable' as an ISQLQuote adapter for type 'typ'.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">None</td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#register_type" class="summary-sig-name"><code>register_type</code></a>(<span class="summary-sig-arg">obj</span>)</span></code>\r
-<br />\r
-register obj with psycopg type system</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td>\r
- <td><code><a name="TimeFromPy"></a><span class="summary-sig"><span class="summary-sig-name">TimeFromPy</span>(<span class="summary-sig-arg">datetime.time</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td>\r
- <td><code><a name="TimestampFromPy"></a><span class="summary-sig"><span class="summary-sig-name">TimestampFromPy</span>(<span class="summary-sig-arg">datetime.datetime</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF VARIABLE SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Variable Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT"><code>ISOLATION_LEVEL_AUTOCOMMIT</code></a></strong> = <span title="0">0 </span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED"><code>ISOLATION_LEVEL_READ_COMMITTED</code></a></strong> = <span title="1">1 </span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED"><code>ISOLATION_LEVEL_READ_UNCOMMITTED</code></a></strong> = <span title="1">1 </span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ"><code>ISOLATION_LEVEL_REPEATABLE_READ</code></a></strong> = <span title="2">2 </span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td>\r
-<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE"><code>ISOLATION_LEVEL_SERIALIZABLE</code></a></strong> = <span title="2">2 </span></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Function Details</th></tr>\r
-</table>\r
-\r
-<a name="adapt"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">adapt</span>(<span class="sig-arg">obj</span>,\r
- <span class="sig-arg">protocol</span>,\r
- <span class="sig-arg">alternate</span>)</span>\r
- </h3>\r
-<p>adapt obj to given protocol</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-object </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="AsIs"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">AsIs</span>(<span class="sig-arg">obj</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new AsIs wrapper object </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="Boolean"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">Boolean</span>(<span class="sig-arg">obj</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new boolean value </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="DateFromPy"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">DateFromPy</span>(<span class="sig-arg">datetime.date</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new wrapper </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="IntervalFromPy"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">IntervalFromPy</span>(<span class="sig-arg">datetime.timedelta</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new wrapper </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="new_type"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">new_type</span>(<span class="sig-arg">oids</span>,\r
- <span class="sig-arg">name</span>,\r
- <span class="sig-arg">adapter</span>)</span>\r
- </h3>\r
-<p>Create a new binding object. The object can be used with the\r
-<a href="psycopg2.extensions-module.html#register_type" class="link"><code>register_type()</code></a> function to bind PostgreSQL objects to python objects.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Parameters:</dt>\r
- <dd><code><strong class="pname">oids</strong></code> -\r
- Tuple of <tt class="docutils literal"><span class="pre">oid</span></tt> of the PostgreSQL types to convert.\r
- </dd>\r
- <dd><code><strong class="pname">name</strong></code> -\r
- Name for the new type\r
- </dd>\r
- <dd><code><strong class="pname">adapter</strong></code> -\r
- Callable to perform type conversion.\r
-It must have the signature <tt class="docutils literal"><span class="pre">fun(value,</span> <span class="pre">cur)</span></tt> where <tt class="docutils literal"><span class="pre">value</span></tt> is\r
-the string representation returned by PostgreSQL (<code>None</code> if <tt class="docutils literal"><span class="pre">NULL</span></tt>)\r
-and <tt class="docutils literal"><span class="pre">cur</span></tt> is the cursor from which data are read.\r
- </dd>\r
- </dl>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new type object </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="QuotedString"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">QuotedString</span>(<span class="sig-arg">str</span>,\r
- <span class="sig-arg">enc</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new quoted string </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="register_adapter"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">register_adapter</span>(<span class="sig-arg">typ</span>,\r
- <span class="sig-arg">callable</span>)</span>\r
- </h3>\r
-<p>Register 'callable' as an ISQLQuote adapter for type 'typ'.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="register_type"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">register_type</span>(<span class="sig-arg">obj</span>)</span>\r
- </h3>\r
-<p>register obj with psycopg type system</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Parameters:</dt>\r
- <dd><code><strong class="pname">obj</strong></code> -\r
- A type adapter created by <a href="psycopg2.extensions-module.html#new_type" class="link"><code>new_type()</code></a>\r
- </dd>\r
- </dl>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-None </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="TimeFromPy"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">TimeFromPy</span>(<span class="sig-arg">datetime.time</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new wrapper </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="TimestampFromPy"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">TimestampFromPy</span>(<span class="sig-arg">datetime.datetime</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new wrapper </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF VARIABLE DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Variable Details</th></tr>\r
-</table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ISOLATION_LEVEL_AUTOCOMMIT"></a>\r
-<h3>ISOLATION_LEVEL_AUTOCOMMIT</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="0">Value:</dt>\r
- <dd title="0"><table><tr><td>\r
-<pre class="variable">\r
-0 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ISOLATION_LEVEL_READ_COMMITTED"></a>\r
-<h3>ISOLATION_LEVEL_READ_COMMITTED</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="1">Value:</dt>\r
- <dd title="1"><table><tr><td>\r
-<pre class="variable">\r
-1 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ISOLATION_LEVEL_READ_UNCOMMITTED"></a>\r
-<h3>ISOLATION_LEVEL_READ_UNCOMMITTED</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="1">Value:</dt>\r
- <dd title="1"><table><tr><td>\r
-<pre class="variable">\r
-1 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ISOLATION_LEVEL_REPEATABLE_READ"></a>\r
-<h3>ISOLATION_LEVEL_REPEATABLE_READ</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="2">Value:</dt>\r
- <dd title="2"><table><tr><td>\r
-<pre class="variable">\r
-2 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ISOLATION_LEVEL_SERIALIZABLE"></a>\r
-<h3>ISOLATION_LEVEL_SERIALIZABLE</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>int</code>\r
-\r
- </dd>\r
- <dt title="2">Value:</dt>\r
- <dd title="2"><table><tr><td>\r
-<pre class="variable">\r
-2 </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extras</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Module extras\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.extras-module.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE DESCRIPTION =========== -->\r
-<h2 class="module">Module psycopg2.extras</h2>\r
-\r
-<p>Miscellaneous goodies for psycopg2</p>\r
-<p>This module is a generic place used to hold little helper functions\r
-and classes untill a better place in the distribution is found.</p>\r
-<hr/>\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Classes</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.extras.DictConnection-class.html"><code>DictConnection</code></a></strong></td>\r
- <td>A connection that uses DictCursor automatically.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.extras.DictCursor-class.html"><code>DictCursor</code></a></strong></td>\r
- <td>A cursor that keeps a list of column name -> index mappings.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.extras.DictRow-class.html"><code>DictRow</code></a></strong></td>\r
- <td>A row object that allow by-colun-name access to data.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.extras.SQL_IN-class.html"><code>SQL_IN</code></a></strong></td>\r
- <td>Adapt any iterable to an SQL quotable object.</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extras.DictConnection</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.extras-module.html">Module extras</a> ::\r
- Class DictConnection\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.extras.DictConnection-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.DictConnection-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type DictConnection</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
-<a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a> --+\r
- |\r
- <strong class="uidshort">DictConnection</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A connection that uses DictCursor automatically.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="cursor"></a><span class="summary-sig"><span class="summary-sig-name">cursor</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="cursor"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">cursor</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.connection-class.html#cursor"><code>psycopg2._psycopg.connection.cursor</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:31 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extras.DictCursor</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.extras-module.html">Module extras</a> ::\r
- Class DictCursor\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.extras.DictCursor-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.DictCursor-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type DictCursor</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
- <a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a> --+\r
- |\r
- <strong class="uidshort">DictCursor</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A cursor that keeps a list of column name -> index mappings.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="callproc"></a><span class="summary-sig"><span class="summary-sig-name">callproc</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">procname</span>,\r
- <span class="summary-sig-arg">vars</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="execute"></a><span class="summary-sig"><span class="summary-sig-name">execute</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">query</span>,\r
- <span class="summary-sig-arg">vars</span>,\r
- <span class="summary-sig-arg">async</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="fetchall"></a><span class="summary-sig"><span class="summary-sig-name">fetchall</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="fetchmany"></a><span class="summary-sig"><span class="summary-sig-name">fetchmany</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">size</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="fetchone"></a><span class="summary-sig"><span class="summary-sig-name">fetchone</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="callproc"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">callproc</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">procname</span>,\r
- <span class="sig-arg">vars</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.cursor-class.html#callproc"><code>psycopg2._psycopg.cursor.callproc</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="execute"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">execute</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">query</span>,\r
- <span class="sig-arg">vars</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">async</span>=<span class="sig-default">0</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.cursor-class.html#execute"><code>psycopg2._psycopg.cursor.execute</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="fetchall"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">fetchall</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.cursor-class.html#fetchall"><code>psycopg2._psycopg.cursor.fetchall</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="fetchmany"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">fetchmany</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">size</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany"><code>psycopg2._psycopg.cursor.fetchmany</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="fetchone"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">fetchone</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.cursor-class.html#fetchone"><code>psycopg2._psycopg.cursor.fetchone</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extras.DictRow</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.extras-module.html">Module extras</a> ::\r
- Class DictRow\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.extras.DictRow-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.DictRow-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type DictRow</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
- <a href="__builtin__.list-class.html"><code>list</code></a> --+\r
- |\r
- <strong class="uidshort">DictRow</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A row object that allow by-colun-name access to data.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">cursor</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__getitem__"></a><span class="summary-sig"><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">x</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="get"></a><span class="summary-sig"><span class="summary-sig-name">get</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">default</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="has_key"></a><span class="summary-sig"><span class="summary-sig-name">has_key</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">x</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="items"></a><span class="summary-sig"><span class="summary-sig-name">items</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="keys"></a><span class="summary-sig"><span class="summary-sig-name">keys</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="values"></a><span class="summary-sig"><span class="summary-sig-name">values</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from list</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__add__" class="summary-sig-name"><code>__add__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x+y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__contains__" class="summary-sig-name"><code>__contains__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return y in x...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__delitem__" class="summary-sig-name"><code>__delitem__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return del x[y]...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__delslice__" class="summary-sig-name"><code>__delslice__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">j</span>)</span></code>\r
-<br />\r
-Use of negative indices is not supported.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__eq__" class="summary-sig-name"><code>__eq__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x==y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__ge__" class="summary-sig-name"><code>__ge__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x>=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getslice__" class="summary-sig-name"><code>__getslice__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">j</span>)</span></code>\r
-<br />\r
-Use of negative indices is not supported.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__gt__" class="summary-sig-name"><code>__gt__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x>y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__iadd__" class="summary-sig-name"><code>__iadd__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x+=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__imul__" class="summary-sig-name"><code>__imul__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x*=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__iter__" class="summary-sig-name"><code>__iter__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return iter(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__le__" class="summary-sig-name"><code>__le__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x<=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__len__" class="summary-sig-name"><code>__len__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return len(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__lt__" class="summary-sig-name"><code>__lt__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x<y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__mul__" class="summary-sig-name"><code>__mul__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">n</span>)</span></code>\r
-<br />\r
-Return x*n...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__ne__" class="summary-sig-name"><code>__ne__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x!=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__rmul__" class="summary-sig-name"><code>__rmul__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">n</span>)</span></code>\r
-<br />\r
-Return n*x...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__setitem__" class="summary-sig-name"><code>__setitem__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Return x[i]=y...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__setslice__" class="summary-sig-name"><code>__setslice__</code></a>(<span class="summary-sig-arg">x</span>,\r
- <span class="summary-sig-arg">i</span>,\r
- <span class="summary-sig-arg">j</span>,\r
- <span class="summary-sig-arg">y</span>)</span></code>\r
-<br />\r
-Use of negative indices is not supported.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#append" class="summary-sig-name"><code>append</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">object</span>)</span></code>\r
-<br />\r
-append object to end</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#count" class="summary-sig-name"><code>count</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">value</span>)</span></code>\r
-<br />\r
-return number of occurrences of value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#extend" class="summary-sig-name"><code>extend</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">iterable</span>)</span></code>\r
-<br />\r
-extend list by appending elements from the iterable</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#index" class="summary-sig-name"><code>index</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-L.index(value, [start, [stop]]) -> integer -- return first index of value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#insert" class="summary-sig-name"><code>insert</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">index</span>,\r
- <span class="summary-sig-arg">object</span>)</span></code>\r
-<br />\r
-insert object before index</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#pop" class="summary-sig-name"><code>pop</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">index</span>)</span></code>\r
-<br />\r
-remove and return item at index (default last)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#remove" class="summary-sig-name"><code>remove</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">value</span>)</span></code>\r
-<br />\r
-remove first occurrence of value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#reverse" class="summary-sig-name"><code>reverse</code></a>(<span class="summary-sig-arg">L</span>)</span></code>\r
-<br />\r
-reverse <em>IN PLACE</em></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#sort" class="summary-sig-name"><code>sort</code></a>(<span class="summary-sig-arg">L</span>,\r
- <span class="summary-sig-arg">cmpfunc</span>)</span></code>\r
-<br />\r
-stable sort <em>IN PLACE</em>; cmpfunc(x, y) -> -1, 0, 1</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">cursor</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.list-class.html#__init__"><code>__builtin__.list.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="__getitem__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">x</span>)</span>\r
- <br /><em class="fname">(Indexing operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.list-class.html#__getitem__"><code>__builtin__.list.__getitem__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="get"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">get</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">x</span>,\r
- <span class="sig-arg">default</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="has_key"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">has_key</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">x</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="items"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">items</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="keys"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">keys</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="values"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">values</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extras.SQL_IN</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.extras-module.html">Module extras</a> ::\r
- Class SQL_IN\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.extras.SQL_IN-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.SQL_IN-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type SQL_IN</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">SQL_IN</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Adapt any iterable to an SQL quotable object.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">seq</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="getquoted"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="getquoted"></a><span class="summary-sig"><span class="summary-sig-name">getquoted</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">seq</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="getquoted"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">self</span>)</span>\r
- <br /><em class="fname">(Informal representation operator)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="getquoted"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">getquoted</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Module pool\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.pool-module.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE DESCRIPTION =========== -->\r
-<h2 class="module">Module psycopg2.pool</h2>\r
-\r
-<p>Connection pooling for psycopg2</p>\r
-<p>This module implements thread-safe (and not) connection pools.</p>\r
-<hr/>\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Classes</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a></strong></td>\r
- <td>Generic key-based pooling code.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>PersistentConnectionPool</code></a></strong></td>\r
- <td>A pool that assigns persistent connections to different threads.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>SimpleConnectionPool</code></a></strong></td>\r
- <td>A connection pool that can't be shared across different threads.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>ThreadedConnectionPool</code></a></strong></td>\r
- <td>A connection pool that works with the threading module.</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF EXCEPTIONS =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Exceptions</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.pool.PoolError-class.html"><code>PoolError</code></a></strong></td>\r
- <td> </td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Function Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="dbg"></a><span class="summary-sig"><span class="summary-sig-name">dbg</span>(<span class="summary-sig-vararg">*args</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Function Details</th></tr>\r
-</table>\r
-\r
-<a name="dbg"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dbg</span>(<span class="sig-vararg">*args</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool.AbstractConnectionPool</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.pool-module.html">Module pool</a> ::\r
- Class AbstractConnectionPool\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.pool.AbstractConnectionPool-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.AbstractConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type AbstractConnectionPool</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+\r
- |\r
- <strong class="uidshort">AbstractConnectionPool</strong>\r
-</pre><br />\r
-\r
-<dl><dt>Known Subclasses:</dt>\r
-<dd>\r
- <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>PersistentConnectionPool</code></a>,\r
- <a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>SimpleConnectionPool</code></a>,\r
- <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>ThreadedConnectionPool</code></a></dd></dl>\r
-\r
-<hr/>\r
-\r
-<p>Generic key-based pooling code.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">minconn</span>,\r
- <span class="summary-sig-arg">maxconn</span>,\r
- <span class="summary-sig-vararg">*args</span>,\r
- <span class="summary-sig-kwarg">**kwargs</span>)</span></code>\r
-<br />\r
-Initialize the connection pool.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">minconn</span>,\r
- <span class="sig-arg">maxconn</span>,\r
- <span class="sig-vararg">*args</span>,\r
- <span class="sig-kwarg">**kwargs</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>Initialize the connection pool.</p>\r
-<p>New 'minconn' connections are created immediately calling 'connfunc'\r
-with given parameters. The connection pool will support a maximum of\r
-about 'maxconn' connections.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool.PersistentConnectionPool</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.pool-module.html">Module pool</a> ::\r
- Class PersistentConnectionPool\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.pool.PersistentConnectionPool-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.PersistentConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type PersistentConnectionPool</h2>\r
-\r
-<pre class="base-tree">\r
- <a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
-<a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a> --+\r
- |\r
- <strong class="uidshort">PersistentConnectionPool</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A pool that assigns persistent connections to different threads.</p>\r
-<p>Note that this connection pool generates by itself the required keys\r
-using the current thread id. This means that untill a thread put away\r
-a connection it will always get the same connection object by successive\r
-.getconn() calls. This also means that a thread can't use more than one\r
-single connection from the pool.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">minconn</span>,\r
- <span class="summary-sig-arg">maxconn</span>,\r
- <span class="summary-sig-vararg">*args</span>,\r
- <span class="summary-sig-kwarg">**kwargs</span>)</span></code>\r
-<br />\r
-Initialize the threading lock.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#closeall" class="summary-sig-name"><code>closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Close all connections (even the one currently in use.)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#getconn" class="summary-sig-name"><code>getconn</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Generate thread id and return a connection.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#putconn" class="summary-sig-name"><code>putconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">conn</span>,\r
- <span class="summary-sig-arg">close</span>)</span></code>\r
-<br />\r
-Put away an unused connection.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">minconn</span>,\r
- <span class="sig-arg">maxconn</span>,\r
- <span class="sig-vararg">*args</span>,\r
- <span class="sig-kwarg">**kwargs</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>Initialize the threading lock.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__"><code>psycopg2.pool.AbstractConnectionPool.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="closeall"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">closeall</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
-<p>Close all connections (even the one currently in use.)</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="getconn"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">getconn</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
-<p>Generate thread id and return a connection.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="putconn"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">putconn</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">conn</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">close</span>=<span class="sig-default">False</span>)</span>\r
- </h3>\r
-<p>Put away an unused connection.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool.PoolError</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.pool-module.html">Module pool</a> ::\r
- Class PoolError\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.pool.PoolError-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.PoolError-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Class PoolError</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ \r
- | \r
-<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ \r
- | \r
- <a href="psycopg2.Error-class.html"><code>Error</code></a> --+\r
- |\r
- <strong class="uidshort">PoolError</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from Exception</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool.SimpleConnectionPool</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.pool-module.html">Module pool</a> ::\r
- Class SimpleConnectionPool\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.pool.SimpleConnectionPool-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.SimpleConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type SimpleConnectionPool</h2>\r
-\r
-<pre class="base-tree">\r
- <a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
-<a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a> --+\r
- |\r
- <strong class="uidshort">SimpleConnectionPool</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A connection pool that can't be shared across different threads.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from AbstractConnectionPool</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">minconn</span>,\r
- <span class="summary-sig-arg">maxconn</span>,\r
- <span class="summary-sig-vararg">*args</span>,\r
- <span class="summary-sig-kwarg">**kwargs</span>)</span></code>\r
-<br />\r
-Initialize the connection pool.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool.ThreadedConnectionPool</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.pool-module.html">Module pool</a> ::\r
- Class ThreadedConnectionPool\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.pool.ThreadedConnectionPool-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.ThreadedConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type ThreadedConnectionPool</h2>\r
-\r
-<pre class="base-tree">\r
- <a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
-<a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a> --+\r
- |\r
- <strong class="uidshort">ThreadedConnectionPool</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>A connection pool that works with the threading module.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">minconn</span>,\r
- <span class="summary-sig-arg">maxconn</span>,\r
- <span class="summary-sig-vararg">*args</span>,\r
- <span class="summary-sig-kwarg">**kwargs</span>)</span></code>\r
-<br />\r
-Initialize the threading lock.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#closeall" class="summary-sig-name"><code>closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code>\r
-<br />\r
-Close all connections (even the one currently in use.)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#getconn" class="summary-sig-name"><code>getconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">key</span>)</span></code>\r
-<br />\r
-Get a free connection and assign it to 'key' if not None.</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#putconn" class="summary-sig-name"><code>putconn</code></a>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">conn</span>,\r
- <span class="summary-sig-arg">key</span>,\r
- <span class="summary-sig-arg">close</span>)</span></code>\r
-<br />\r
-Put away an unused connection.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">minconn</span>,\r
- <span class="sig-arg">maxconn</span>,\r
- <span class="sig-vararg">*args</span>,\r
- <span class="sig-kwarg">**kwargs</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
-<p>Initialize the threading lock.</p>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__"><code>psycopg2.pool.AbstractConnectionPool.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="closeall"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">closeall</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
-<p>Close all connections (even the one currently in use.)</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="getconn"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">getconn</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">key</span>=<span class="sig-default">None</span>)</span>\r
- </h3>\r
-<p>Get a free connection and assign it to 'key' if not None.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="putconn"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">putconn</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">conn</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">key</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">close</span>=<span class="sig-default">False</span>)</span>\r
- </h3>\r
-<p>Put away an unused connection.</p>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.psycopg1</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Module psycopg1\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.psycopg1-module.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.psycopg1-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE DESCRIPTION =========== -->\r
-<h2 class="module">Module psycopg2.psycopg1</h2>\r
-\r
-<p>psycopg 1.1.x compatibility module</p>\r
-<p>This module uses the new style connection and cursor types to build a psycopg\r
-1.1.1.x compatibility layer. It should be considered a temporary hack to run\r
-old code while porting to psycopg 2. Import it as follows:</p>\r
-<pre class="literal-block">\r
-from psycopg2 import psycopg1 as psycopg\r
-</pre>\r
-<hr/>\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Classes</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.psycopg1.connection-class.html"><code>connection</code></a></strong></td>\r
- <td>psycopg 1.1.x connection.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.psycopg1.cursor-class.html"><code>cursor</code></a></strong></td>\r
- <td>psycopg 1.1.x cursor.</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Function Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new psycopg 1.1.x compatible connection object</td>\r
- <td><code><a name="connect"></a><span class="summary-sig"><span class="summary-sig-name">connect</span>(<span class="summary-sig-arg">dsn</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF FUNCTION DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Function Details</th></tr>\r
-</table>\r
-\r
-<a name="connect"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">connect</span>(<span class="sig-arg">dsn</span>,\r
- <span class="sig-vararg">...</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new psycopg 1.1.x compatible connection object </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.psycopg1.connection</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.psycopg1-module.html">Module psycopg1</a> ::\r
- Class connection\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.psycopg1.connection-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.psycopg1.connection-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type connection</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
-<a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a> --+\r
- |\r
- <strong class="uidshort">connection</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>psycopg 1.1.x connection.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">switch autocommit on (1) or off (0)</td>\r
- <td><code><a name="autocommit"></a><span class="summary-sig"><span class="summary-sig-name">autocommit</span>(<span class="summary-sig-arg">on_off</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype">new psycopg 1.1.x compatible cursor object</td>\r
- <td><code><a name="cursor"></a><span class="summary-sig"><span class="summary-sig-name">cursor</span>()</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="autocommit"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">autocommit</span>(<span class="sig-arg">on_off</span>=<span class="sig-default">1</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-switch autocommit on (1) or off (0) </dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="cursor"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">cursor</span>()</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Returns:</dt>\r
- <dd>\r
-new psycopg 1.1.x compatible cursor object </dd>\r
- </dl>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="../private/psycopg2._psycopg.connection-class.html#cursor"><code>psycopg2._psycopg.connection.cursor</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.psycopg1.cursor</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.psycopg1-module.html">Module psycopg1</a> ::\r
- Class cursor\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.psycopg1.cursor-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.psycopg1.cursor-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type cursor</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
- <a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a> --+\r
- |\r
- <strong class="uidshort">cursor</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>psycopg 1.1.x cursor.</p>\r
-<p>Note that this cursor implements the exact procedure used by psycopg 1 to\r
-build dictionaries out of result rows. The DictCursor in the\r
-psycopg.extras modules implements a much better and faster algorithm.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="dictfetchall"></a><span class="summary-sig"><span class="summary-sig-name">dictfetchall</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="dictfetchmany"></a><span class="summary-sig"><span class="summary-sig-name">dictfetchmany</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">size</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="dictfetchone"></a><span class="summary-sig"><span class="summary-sig-name">dictfetchone</span>(<span class="summary-sig-arg">self</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="dictfetchall"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dictfetchall</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="dictfetchmany"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dictfetchmany</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">size</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="dictfetchone"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dictfetchone</span>(<span class="sig-arg">self</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:33 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.tz</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- Module tz\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.tz-module.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.tz-module.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE DESCRIPTION =========== -->\r
-<h2 class="module">Module psycopg2.tz</h2>\r
-\r
-<p>tzinfo implementations for psycopg2</p>\r
-<p>This module holds two different tzinfo implementations that can be used as\r
-the 'tzinfo' argument to datetime constructors, directly passed to psycopg\r
-functions or used to set the .tzinfo_factory attribute in cursors.</p>\r
-<hr/>\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Classes</th></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>FixedOffsetTimezone</code></a></strong></td>\r
- <td>Fixed offset in minutes east from UTC.</td></tr>\r
-<tr><td width="15%">\r
- <strong><a href="psycopg2.tz.LocalTimezone-class.html"><code>LocalTimezone</code></a></strong></td>\r
- <td>Platform idea of local timezone.</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF VARIABLE SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Variable Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td>\r
-<td><strong><a href="psycopg2.tz-module.html#DSTDIFF"><code>DSTDIFF</code></a></strong> = <span title="datetime.timedelta(0, 3600)"><code>datetime.timedelta(0, 3600) </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>LocalTimezone</code></td>\r
-<td><strong><a href="psycopg2.tz-module.html#LOCAL"><code>LOCAL</code></a></strong> = <span title="<psycopg2.tz.LocalTimezone object at 0x00847090>"><code><psycopg2.tz.LocalTimezone object at 0x00847090> </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td>\r
-<td><strong><a href="psycopg2.tz-module.html#STDOFFSET"><code>STDOFFSET</code></a></strong> = <span title="datetime.timedelta(0, 3600)"><code>datetime.timedelta(0, 3600) </code>\r
-</span></td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td>\r
-<td><strong><a href="psycopg2.tz-module.html#ZERO"><code>ZERO</code></a></strong> = <span title="datetime.timedelta(0)"><code>datetime.timedelta(0) </code>\r
-</span></td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF VARIABLE DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Variable Details</th></tr>\r
-</table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="DSTDIFF"></a>\r
-<h3>DSTDIFF</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>timedelta</code>\r
-\r
- </dd>\r
- <dt title="datetime.timedelta(0, 3600)">Value:</dt>\r
- <dd title="datetime.timedelta(0, 3600)"><table><tr><td>\r
-<pre class="variable">\r
-datetime.timedelta(0, 3600) </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="LOCAL"></a>\r
-<h3>LOCAL</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>LocalTimezone</code>\r
-\r
- </dd>\r
- <dt title="<psycopg2.tz.LocalTimezone object at 0x00847090>">Value:</dt>\r
- <dd title="<psycopg2.tz.LocalTimezone object at 0x00847090>"><table><tr><td>\r
-<pre class="variable">\r
-<psycopg2.tz.LocalTimezone object at 0x00847090> </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="STDOFFSET"></a>\r
-<h3>STDOFFSET</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>timedelta</code>\r
-\r
- </dd>\r
- <dt title="datetime.timedelta(0, 3600)">Value:</dt>\r
- <dd title="datetime.timedelta(0, 3600)"><table><tr><td>\r
-<pre class="variable">\r
-datetime.timedelta(0, 3600) </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>\r
-<a name="ZERO"></a>\r
-<h3>ZERO</h3>\r
-<dl>\r
- <dt></dt>\r
- <dd>\r
- <dl>\r
- <dt>Type:</dt>\r
- <dd>\r
- <code>timedelta</code>\r
-\r
- </dd>\r
- <dt title="datetime.timedelta(0)">Value:</dt>\r
- <dd title="datetime.timedelta(0)"><table><tr><td>\r
-<pre class="variable">\r
-datetime.timedelta(0) </pre>\r
- </td></tr></table></dd>\r
- </dl>\r
- </dd>\r
-</dl></td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.tz.FixedOffsetTimezone</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.tz-module.html">Module tz</a> ::\r
- Class FixedOffsetTimezone\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.tz.FixedOffsetTimezone-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.tz.FixedOffsetTimezone-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type FixedOffsetTimezone</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
- <a href="datetime.tzinfo-class.html"><code>tzinfo</code></a> --+\r
- |\r
- <strong class="uidshort">FixedOffsetTimezone</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Fixed offset in minutes east from UTC.</p>\r
-<p>This is exactly the implementation found in Python 2.3.x documentation,\r
-with a small change to the __init__ method to allow for pickling and a\r
-default name in the form 'sHH:MM' ('s' is the sign.)</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">offset</span>,\r
- <span class="summary-sig-arg">name</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="dst"></a><span class="summary-sig"><span class="summary-sig-name">dst</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="tzname"></a><span class="summary-sig"><span class="summary-sig-name">tzname</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="utcoffset"></a><span class="summary-sig"><span class="summary-sig-name">utcoffset</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from tzinfo</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
--> (cls, state)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#fromutc" class="summary-sig-name"><code>fromutc</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-datetime in UTC -> datetime in local time.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="__init__"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">offset</span>=<span class="sig-default">None</span>,\r
- <span class="sig-arg">name</span>=<span class="sig-default">None</span>)</span>\r
- <br /><em class="fname">(Constructor)</em>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="dst"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dst</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="datetime.tzinfo-class.html#dst"><code>datetime.tzinfo.dst</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="tzname"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">tzname</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="datetime.tzinfo-class.html#tzname"><code>datetime.tzinfo.tzname</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="utcoffset"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">utcoffset</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="datetime.tzinfo-class.html#utcoffset"><code>datetime.tzinfo.utcoffset</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.tz.LocalTimezone</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- <span class="breadcrumbs">\r
- <a href="psycopg2-module.html">Package psycopg2</a> ::\r
- <a href="psycopg2.tz-module.html">Module tz</a> ::\r
- Class LocalTimezone\r
- </span><br />\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/psycopg2.tz.LocalTimezone-class.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.tz.LocalTimezone-class.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF CLASS DESCRIPTION =========== -->\r
-<h2 class="class">Type LocalTimezone</h2>\r
-\r
-<pre class="base-tree">\r
-<a href="__builtin__.object-class.html"><code>object</code></a> --+ \r
- | \r
- <a href="datetime.tzinfo-class.html"><code>tzinfo</code></a> --+\r
- |\r
- <strong class="uidshort">LocalTimezone</strong>\r
-</pre><br />\r
-\r
-<hr/>\r
-\r
-<p>Platform idea of local timezone.</p>\r
-<p>This is the exact implementation from the Pyhton 2.3 documentation.</p>\r
-<hr/>\r
-\r
-\r
-<!-- =========== START OF METHOD SUMMARY =========== -->\r
-<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="summary">\r
- <th colspan="2">Method Summary</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="dst"></a><span class="summary-sig"><span class="summary-sig-name">dst</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="tzname"></a><span class="summary-sig"><span class="summary-sig-name">tzname</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><a name="utcoffset"></a><span class="summary-sig"><span class="summary-sig-name">utcoffset</span>(<span class="summary-sig-arg">self</span>,\r
- <span class="summary-sig-arg">dt</span>)</span></code>\r
-</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from tzinfo</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__getattribute__('name') <==> x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>,\r
- <span class="summary-sig-arg">S</span>,\r
- <span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-Return a new object with type S, a subtype of T...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
--> (cls, state)</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#fromutc" class="summary-sig-name"><code>fromutc</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-datetime in UTC -> datetime in local time.</td></tr>\r
-<tr bgcolor="#e8f0f8" class="group">\r
- <th colspan="2"> Inherited from object</th></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__delattr__('name') <==> del x.name</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return hash(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-helper for pickle</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return repr(x)...</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>\r
-<br />\r
-x.__setattr__('name', value) <==> x.name = value</td></tr>\r
-<tr><td align="right" valign="top" width="15%" class="rtype"> </td>\r
- <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code>\r
-<br />\r
-Return str(x)...</td></tr>\r
-</table><br />\r
-\r
-\r
-<!-- =========== START OF METHOD DETAILS =========== -->\r
-<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">\r
-<tr bgcolor="#70b0f0" class="details">\r
- <th colspan="2">Method Details</th></tr>\r
-</table>\r
-\r
-<a name="dst"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">dst</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="datetime.tzinfo-class.html#dst"><code>datetime.tzinfo.dst</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="tzname"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">tzname</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="datetime.tzinfo-class.html#tzname"><code>datetime.tzinfo.tzname</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-\r
-<a name="utcoffset"></a>\r
-<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>\r
- <h3><span class="sig"><span class="sig-name">utcoffset</span>(<span class="sig-arg">self</span>,\r
- <span class="sig-arg">dt</span>)</span>\r
- </h3>\r
- <dl><dt></dt><dd>\r
- <dl><dt>Overrides:</dt>\r
- <dd><a href="datetime.tzinfo-class.html#utcoffset"><code>datetime.tzinfo.utcoffset</code></a></dd>\r
- </dl>\r
- </dd></dl>\r
-</td></tr></table>\r
-<br />\r
-\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>Everything</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading">Everything</h1>\r
-<hr />\r
-\r
-<!-- =========== START OF ALL CLASSES =========== -->\r
-<h2 class="tocheading">All Classes</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictConnection-class.html">psycopg2.extras.DictConnection</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictCursor-class.html">psycopg2.extras.DictCursor</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictRow-class.html">psycopg2.extras.DictRow</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.SQL_IN-class.html">psycopg2.extras.SQL_IN</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.AbstractConnectionPool-class.html">psycopg2.pool.AbstractConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.PersistentConnectionPool-class.html">psycopg2.pool.PersistentConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.SimpleConnectionPool-class.html">psycopg2.pool.SimpleConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.ThreadedConnectionPool-class.html">psycopg2.pool.ThreadedConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.connection-class.html">psycopg2.psycopg1.connection</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.cursor-class.html">psycopg2.psycopg1.cursor</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz.FixedOffsetTimezone-class.html">psycopg2.tz.FixedOffsetTimezone</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz.LocalTimezone-class.html">psycopg2.tz.LocalTimezone</a></p>\r
-\r
-<!-- =========== START OF ALL EXCEPTIONS =========== -->\r
-<h2 class="tocheading">All Exceptions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.DatabaseError-class.html">psycopg2.DatabaseError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.DataError-class.html">psycopg2.DataError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.Error-class.html">psycopg2.Error</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.IntegrityError-class.html">psycopg2.IntegrityError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.InterfaceError-class.html">psycopg2.InterfaceError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.InternalError-class.html">psycopg2.InternalError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.NotSupportedError-class.html">psycopg2.NotSupportedError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.OperationalError-class.html">psycopg2.OperationalError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.PoolError-class.html">psycopg2.pool.PoolError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.ProgrammingError-class.html">psycopg2.ProgrammingError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.Warning-class.html">psycopg2.Warning</a></p>\r
-\r
-<!-- =========== START OF ALL FUNCTIONS =========== -->\r
-<h2 class="tocheading">All Functions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#adapt">adapt</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#AsIs">AsIs</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Binary">Binary</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#Boolean">Boolean</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#connect">connect</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1-module.html#connect">connect</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Date">Date</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#DateFromPy">DateFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#DateFromTicks">DateFromTicks</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool-module.html#dbg">dbg</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#IntervalFromPy">IntervalFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#new_type">new_type</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#QuotedString">QuotedString</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_adapter">register_adapter</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_type">register_type</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Time">Time</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimeFromPy">TimeFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimeFromTicks">TimeFromTicks</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Timestamp">Timestamp</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimestampFromPy">TimestampFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimestampFromTicks">TimestampFromTicks</a></p>\r
-\r
-<!-- =========== START OF ALL VARIABLES =========== -->\r
-<h2 class="tocheading">All Variables</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#DSTDIFF">DSTDIFF</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT">ISOLATION_LEVEL_AUTOCOMMIT</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED">ISOLATION_LEVEL_READ_COMMITTED</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED">ISOLATION_LEVEL_READ_UNCOMMITTED</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ">ISOLATION_LEVEL_REPEATABLE_READ</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE">ISOLATION_LEVEL_SERIALIZABLE</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#LOCAL">LOCAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#STDOFFSET">STDOFFSET</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#ZERO">ZERO</a></p>\r
-\r
-<hr />\r
-<span class="options">[<a href="../private/toc-everything.html">show private</a> | hide private]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2-module.html">psycopg2</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF MODULES =========== -->\r
-<h2 class="tocheading">Modules</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html">extensions</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras-module.html">extras</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool-module.html">pool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1-module.html">psycopg1</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html">tz</a></p>\r
-\r
-<!-- =========== START OF EXCEPTIONS =========== -->\r
-<h2 class="tocheading">Exceptions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.DatabaseError-class.html">DatabaseError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.DataError-class.html">DataError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.Error-class.html">Error</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.IntegrityError-class.html">IntegrityError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.InterfaceError-class.html">InterfaceError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.InternalError-class.html">InternalError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.NotSupportedError-class.html">NotSupportedError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.OperationalError-class.html">OperationalError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.ProgrammingError-class.html">ProgrammingError</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.Warning-class.html">Warning</a></p>\r
-\r
-<!-- =========== START OF FUNCTIONS =========== -->\r
-<h2 class="tocheading">Functions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Binary">Binary</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#connect">connect</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Date">Date</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#DateFromTicks">DateFromTicks</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Time">Time</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimeFromTicks">TimeFromTicks</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Timestamp">Timestamp</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimestampFromTicks">TimestampFromTicks</a></p>\r
-\r
-<hr />\r
-<span class="options">[<a href="../private/toc-psycopg2-module.html">show private</a> | hide private]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2._psycopg</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2._psycopg-module.html">_psycopg</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<h2 class="tocheading">Classes</h2>\r
-\r
-<!-- =========== START OF FUNCTIONS =========== -->\r
-<h2 class="tocheading">Functions</h2>\r
-\r
-<!-- =========== START OF VARIABLES =========== -->\r
-<h2 class="tocheading">Variables</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#__version__">__version__</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#adapters">adapters</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#apilevel">apilevel</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#BINARY">BINARY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#binary_types">binary_types</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#BINARYARRAY">BINARYARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#BOOLEAN">BOOLEAN</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#BOOLEANARRAY">BOOLEANARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#DATE">DATE</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#DATEARRAY">DATEARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#DATETIME">DATETIME</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#DATETIMEARRAY">DATETIMEARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#DECIMAL">DECIMAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#DECIMALARRAY">DECIMALARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#encodings">encodings</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#FLOAT">FLOAT</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#FLOATARRAY">FLOATARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#INTEGER">INTEGER</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#INTEGERARRAY">INTEGERARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#INTERVAL">INTERVAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#INTERVALARRAY">INTERVALARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#LONGINTEGER">LONGINTEGER</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#LONGINTEGERARRAY">LONGINTEGERARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#NUMBER">NUMBER</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#paramstyle">paramstyle</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#PYDATE">PYDATE</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#PYDATETIME">PYDATETIME</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#PYINTERVAL">PYINTERVAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#PYTIME">PYTIME</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#ROWID">ROWID</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#ROWIDARRAY">ROWIDARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#STRING">STRING</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#string_types">string_types</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#STRINGARRAY">STRINGARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#threadsafety">threadsafety</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#TIME">TIME</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#TIMEARRAY">TIMEARRAY</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#UNICODE">UNICODE</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#UNICODEARRAY">UNICODEARRAY</a></p>\r
-\r
-<hr />\r
-<span class="options">[<a href="../private/toc-psycopg2._psycopg-module.html">show private</a> | hide private]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extensions</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2.extensions-module.html">extensions</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF FUNCTIONS =========== -->\r
-<h2 class="tocheading">Functions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#adapt">adapt</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#AsIs">AsIs</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#Boolean">Boolean</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#DateFromPy">DateFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#IntervalFromPy">IntervalFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#new_type">new_type</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#QuotedString">QuotedString</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_adapter">register_adapter</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_type">register_type</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimeFromPy">TimeFromPy</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimestampFromPy">TimestampFromPy</a></p>\r
-\r
-<!-- =========== START OF VARIABLES =========== -->\r
-<h2 class="tocheading">Variables</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT">ISOLATION_LEVEL_AUTOCOMMIT</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED">ISOLATION_LEVEL_READ_COMMITTED</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED">ISOLATION_LEVEL_READ_UNCOMMITTED</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ">ISOLATION_LEVEL_REPEATABLE_READ</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE">ISOLATION_LEVEL_SERIALIZABLE</a></p>\r
-\r
-<hr />\r
-<span class="options">[<a href="../private/toc-psycopg2.extensions-module.html">show private</a> | hide private]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.extras</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2.extras-module.html">extras</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<h2 class="tocheading">Classes</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictConnection-class.html">DictConnection</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictCursor-class.html">DictCursor</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictRow-class.html">DictRow</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.extras.SQL_IN-class.html">SQL_IN</a></p>\r
-\r
-<hr />\r
-<span class="options">[<a href="../private/toc-psycopg2.extras-module.html">show private</a> | hide private]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.pool</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2.pool-module.html">pool</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<h2 class="tocheading">Classes</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.AbstractConnectionPool-class.html">AbstractConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.PersistentConnectionPool-class.html">PersistentConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.SimpleConnectionPool-class.html">SimpleConnectionPool</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.ThreadedConnectionPool-class.html">ThreadedConnectionPool</a></p>\r
-\r
-<!-- =========== START OF EXCEPTIONS =========== -->\r
-<h2 class="tocheading">Exceptions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool.PoolError-class.html">PoolError</a></p>\r
-\r
-<!-- =========== START OF FUNCTIONS =========== -->\r
-<h2 class="tocheading">Functions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.pool-module.html#dbg">dbg</a></p>\r
-\r
-<hr />\r
-<span class="options">[<a href="../private/toc-psycopg2.pool-module.html">show private</a> | hide private]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.psycopg1</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2.psycopg1-module.html">psycopg1</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<h2 class="tocheading">Classes</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.connection-class.html">connection</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.cursor-class.html">cursor</a></p>\r
-\r
-<!-- =========== START OF FUNCTIONS =========== -->\r
-<h2 class="tocheading">Functions</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1-module.html#connect">connect</a></p>\r
-\r
-<hr />\r
-<span class="options">[<a href="../private/toc-psycopg2.psycopg1-module.html">show private</a> | hide private]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>psycopg2.tz</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading"><a target="mainFrame" href="psycopg2.tz-module.html">tz</a></h1>\r
-<hr />\r
-\r
-<!-- =========== START OF CLASSES =========== -->\r
-<h2 class="tocheading">Classes</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz.FixedOffsetTimezone-class.html">FixedOffsetTimezone</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz.LocalTimezone-class.html">LocalTimezone</a></p>\r
-\r
-<!-- =========== START OF VARIABLES =========== -->\r
-<h2 class="tocheading">Variables</h2>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#DSTDIFF">DSTDIFF</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#LOCAL">LOCAL</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#STDOFFSET">STDOFFSET</a></p>\r
-<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#ZERO">ZERO</a></p>\r
-\r
-<hr />\r
-<span class="options">[<a href="../private/toc-psycopg2.tz-module.html">show private</a> | hide private]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>Table of Contents</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-<h1 class="tocheading">Table of Contents</h1>\r
-<hr />\r
-<p class="toc"><a target="moduleFrame" href="toc-everything.html">Everything</a></p>\r
-\r
-<!-- =========== START OF PACKAGES =========== -->\r
-<h2 class="tocheading">Packages</h2>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2-module.html" onclick="setFrame('toc-psycopg2-module.html', 'psycopg2-module.html');">psycopg2</a></p>\r
-\r
-<!-- =========== START OF MODULES =========== -->\r
-<h2 class="tocheading">Modules</h2>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2.extensions-module.html" onclick="setFrame('toc-psycopg2.extensions-module.html', 'psycopg2.extensions-module.html');">psycopg2.extensions</a></p>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2.extras-module.html" onclick="setFrame('toc-psycopg2.extras-module.html', 'psycopg2.extras-module.html');">psycopg2.extras</a></p>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2.pool-module.html" onclick="setFrame('toc-psycopg2.pool-module.html', 'psycopg2.pool-module.html');">psycopg2.pool</a></p>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2.psycopg1-module.html" onclick="setFrame('toc-psycopg2.psycopg1-module.html', 'psycopg2.psycopg1-module.html');">psycopg2.psycopg1</a></p>\r
-<p class="toc"><a target="moduleFrame" href="toc-psycopg2.tz-module.html" onclick="setFrame('toc-psycopg2.tz-module.html', 'psycopg2.tz-module.html');">psycopg2.tz</a></p>\r
-\r
-<hr />\r
-<span class="options">[<a href="../private/toc.html">show private</a> | hide private]</span>\r
-</body>\r
-</html>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
- "DTD/xhtml1-transitional.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
-<head>\r
- <title>Module and Class Hierarchies</title>\r
- <link rel="stylesheet" href="epydoc.css" type="text/css" />\r
-<script type="text/javascript">\r
-<!--\r
-function setFrame(url1, url2){\r
- parent.frames[1].location.href = url1;\r
- parent.frames[2].location.href = url2;\r
-}\r
--->\r
-</script>\r
-</head>\r
-<body bgcolor="white" text="black" link="blue" vlink="#204080"\r
- alink="#204080">\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th bgcolor="#70b0f0" class="navselect"> Trees </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
- <tr valign="top">\r
- <td width="100%">\r
- </td>\r
- <td><table cellpadding="0" cellspacing="0">\r
- <tr><td align="right"><span class="options">[<a href="../private/trees.html">show private</a> | hide private]</span></td></tr>\r
- <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="trees.html" target="_top">no frames</a>]</span></td></tr>\r
- </table></td>\r
-</tr></table>\r
-\r
-<!-- =========== START OF MODULE HIERARCHY =========== -->\r
-<h2>Module Hierarchy</h2>\r
-<ul>\r
-<li> <strong class="uidlink"><a href="psycopg2-module.html"><code>psycopg2</code></a></strong>: <em class="summary">A Python driver for PostgreSQL</em> <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.extensions-module.html"><code>extensions</code></a></strong>: <em class="summary">psycopg extensions to the DBAPI-2.0</em></li>\r
- <li> <strong class="uidlink"><a href="psycopg2.extras-module.html"><code>extras</code></a></strong>: <em class="summary">Miscellaneous goodies for psycopg2</em></li>\r
- <li> <strong class="uidlink"><a href="psycopg2.pool-module.html"><code>pool</code></a></strong>: <em class="summary">Connection pooling for psycopg2</em></li>\r
- <li> <strong class="uidlink"><a href="psycopg2.psycopg1-module.html"><code>psycopg1</code></a></strong>: <em class="summary">psycopg 1.1.x compatibility module</em></li>\r
- <li> <strong class="uidlink"><a href="psycopg2.tz-module.html"><code>tz</code></a></strong>: <em class="summary">tzinfo implementations for psycopg2</em></li>\r
- </ul>\r
-</li>\r
-</ul>\r
-\r
-<!-- =========== START OF CLASS HIERARCHY =========== -->\r
-<h2>Class Hierarchy</h2>\r
-<ul>\r
- <li> <strong class="uidlink"><a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></strong>: <em class="summary">\r
-The most base type</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></strong>: <em class="summary">\r
-Generic key-based pooling code.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></strong>: <em class="summary">\r
-A pool that assigns persistent connections to different threads.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>psycopg2.pool.SimpleConnectionPool</code></a></strong>: <em class="summary">\r
-A connection pool that can't be shared across different threads.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></strong>: <em class="summary">\r
-A connection pool that works with the threading module.</em>\r
- </li>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></strong>: <em class="summary">\r
-list() -> new list\r
-list(sequence) -> new list initialized from sequence's items</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></strong>: <em class="summary">\r
-A row object that allow by-colun-name access to data.</em>\r
- </li>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.extras.SQL_IN-class.html"><code>psycopg2.extras.SQL_IN</code></a></strong>: <em class="summary">\r
-Adapt any iterable to an SQL quotable object.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></strong>: <em class="summary">\r
-type(object) -> the object's type\r
-type(name, bases, dict) -> a new type</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></strong>: <em class="summary">\r
-Abstract base class for time zone info objects.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></strong>: <em class="summary">\r
-Fixed offset in minutes east from UTC.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></strong>: <em class="summary">\r
-Platform idea of local timezone.</em>\r
- </li>\r
- </ul>\r
- </li>\r
- <ul>\r
- </ul>\r
- <ul>\r
- </ul>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></strong>: <em class="summary">\r
-Common base class for all exceptions.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="exceptions.StandardError-class.html"><code>exceptions.StandardError</code></a></strong>: <em class="summary">\r
-Base class for all standard Python exceptions.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.Error-class.html"><code>psycopg2.Error</code></a></strong>: <em class="summary">\r
-Base class for error exceptions.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.DatabaseError-class.html"><code>psycopg2.DatabaseError</code></a></strong>: <em class="summary">\r
-Error related to the database engine.</em>\r
- <ul>\r
- <li> <strong class="uidlink"><a href="psycopg2.DataError-class.html"><code>psycopg2.DataError</code></a></strong>: <em class="summary">\r
-Error related to problems with the processed data.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.IntegrityError-class.html"><code>psycopg2.IntegrityError</code></a></strong>: <em class="summary">\r
-Error related to database integrity.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.InternalError-class.html"><code>psycopg2.InternalError</code></a></strong>: <em class="summary">\r
-The database encountered an internal error.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.NotSupportedError-class.html"><code>psycopg2.NotSupportedError</code></a></strong>: <em class="summary">\r
-A not supported datbase API was called.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.OperationalError-class.html"><code>psycopg2.OperationalError</code></a></strong>: <em class="summary">\r
-Error related to database operation (disconnect, memory allocation etc).</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.ProgrammingError-class.html"><code>psycopg2.ProgrammingError</code></a></strong>: <em class="summary">\r
-Error related to database programming (SQL error, table not found etc).</em>\r
- </li>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.InterfaceError-class.html"><code>psycopg2.InterfaceError</code></a></strong>: <em class="summary">\r
-Error related to the database interface.</em>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.pool.PoolError-class.html"><code>psycopg2.pool.PoolError</code></a></strong>\r
- </li>\r
- </ul>\r
- </li>\r
- <li> <strong class="uidlink"><a href="psycopg2.Warning-class.html"><code>psycopg2.Warning</code></a></strong>: <em class="summary">\r
-A database warning.</em>\r
- </li>\r
- </ul>\r
- </li>\r
- </ul>\r
- </li>\r
-</ul>\r
-\r
-<!-- =========== START OF NAVBAR =========== -->\r
-<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">\r
- <tr valign="middle">\r
- <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th>\r
- <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>\r
- <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>\r
- <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>\r
- <th class="navbar" width="100%"></th>\r
- </tr>\r
-</table>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr>\r
- <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td>\r
- <td align="right" class="footer">\r
- <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>\r
- </td>\r
- </tr>\r
-</table>\r
-</body>\r
-</html>\r
+++ /dev/null
-psycopg asynchronous API
-************************
-
-** Important: async quaeries are not enabled for 2.0 **
-
-Program code can initiate an asynchronous query by passing an 'async=1' flag
-to the .execute() method. A very simple example, from the connection to the
-query:
-
- conn = psycopg.connect(database='test')
- curs = conn.cursor()
- curs.execute("SEECT * from test WHERE fielda > %s", (1971,), async=1)
-
-From then on any query on other cursors derived from the same connection is
-doomed to fail (and raise an exception) until the original cursor (the one
-executing the query) complete the asynchronous operation. This can happen in
-a number of different ways:
-
- 1) one of the .fetchXXX() methods is called, effectively blocking untill
- data has been sent from the backend to the client, terminating the
- query.
-
- 2) .cancel() is called. This method tries to abort the current query and
- will block until the query is aborted or fully executed. The return
- value is True if the query was successfully aborted or False if it
- was executed. Query result are discarded in both cases.
-
- 3) .execute() is called again on the same cursor (.execute() on a
- different cursor will simply raise an exception.) This waits for the
- complete execution of the current query, discard any data and execute
- the new one.
-
-Note that calling .execute() two times in a row will not abort the former
-query and will temporarily go to synchronous mode until the first of the two
-queries is executed.
-
-Cursors now have some extra methods that make them usefull during
-asynchronous queries:
-
- .fileno()
- Returns the file descriptor associated with the current connection and
- make possible to use a cursor in a context where a file object would be
- expected (like in a select() call.)
-
- .isbusy()
- Returns True if the backend is still processing the query or false if
- data is ready to be fetched (by one of the .fetchXXX() methods.)
-
-A code snippet that shows how to use the cursor object in a select() call:
-
- import psycopg
- import select
-
- conn = psycopg.connect(database='test')
- curs = conn.cursor()
- curs.execute("SEECT * from test WHERE fielda > %s", (1971,), async=1)
-
- # wait for input with a maximum timeout of 5 seconds
- query_ended = False
- while not query_ended:
- rread, rwrite, rspec = select([cursor, another_file], [], [], 5)
- if not cursor.isbusy():
- query_ended = True
- # manage input from other sources like other_file, etc.
- print "Query Results:"
- for row in cursor:
- print row
+++ /dev/null
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.3.9: http://docutils.sourceforge.net/" />
-<title>psycopg 2 extensions to the DBAPI 2.0</title>
-<link rel="stylesheet" href="default.css" type="text/css" />
-</head>
-<body>
-<div class="document" id="psycopg-2-extensions-to-the-dbapi-2-0">
-<h1 class="title">psycopg 2 extensions to the DBAPI 2.0</h1>
-<p>This document is a short summary of the extensions built in psycopg 2.0.x over
-the standard <a class="reference" href="http://www.python.org/peps/pep-0249.html">Python Database API Specification 2.0</a>, usually called simply
-DBAPI-2.0 or even PEP-249. Before reading on this document please make sure
-you already know how to program in Python using a DBAPI-2.0 compliant driver:
-basic concepts like opening a connection, executing queries and commiting or
-rolling back a transaction will not be explained but just used.</p>
-<p>Many objects and extension functions are defined in the <a class="reference" href="api/public/psycopg2.extensions-module.html"><tt class="docutils literal"><span class="pre">psycopg2.extensions</span></tt></a>
-module.</p>
-<div class="section" id="connection-and-cursor-factories">
-<h1><a name="connection-and-cursor-factories">Connection and cursor factories</a></h1>
-<p>psycopg 2 exposes two new-style classes that can be sub-classed and expanded to
-adapt them to the needs of the programmer: <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html"><tt class="docutils literal"><span class="pre">cursor</span></tt></a> and <a class="reference" href="api/private/psycopg2._psycopg.connection-class.html"><tt class="docutils literal"><span class="pre">connection</span></tt></a>. The
-<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html"><tt class="docutils literal"><span class="pre">connection</span></tt></a> class is usually sub-classed only to provide a . <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html"><tt class="docutils literal"><span class="pre">cursor</span></tt></a> is much
-more interesting, because it is the class where query building, execution and
-result type-casting into Python variables happens.</p>
-<div class="section" id="row-factories">
-<h2><a name="row-factories">Row factories</a></h2>
-</div>
-<div class="section" id="tzinfo-factories">
-<h2><a name="tzinfo-factories">tzinfo factories</a></h2>
-</div>
-</div>
-<div class="section" id="setting-transaction-isolation-levels">
-<h1><a name="setting-transaction-isolation-levels">Setting transaction isolation levels</a></h1>
-<p>psycopg2 connection objects hold informations about the PostgreSQL <a class="reference" href="http://www.postgresql.org/docs/8.1/static/transaction-iso.html">transaction
-isolation level</a>. The current transaction level can be read from the
-<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#isolation_level"><tt class="docutils literal"><span class="pre">.isolation_level</span></tt></a> attribute. The default isolation level is <tt class="docutils literal"><span class="pre">READ</span>
-<span class="pre">COMMITTED</span></tt>. A different isolation level con be set through the
-<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#set_isolation_level"><tt class="docutils literal"><span class="pre">.set_isolation_level()</span></tt></a> method. The level can be set to one of the following
-constants, defined in <a class="reference" href="api/public/psycopg2.extensions-module.html"><tt class="docutils literal"><span class="pre">psycopg2.extensions</span></tt></a>:</p>
-<dl class="docutils">
-<dt><a class="reference" href="api/public/psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT"><tt class="docutils literal"><span class="pre">ISOLATION_LEVEL_AUTOCOMMIT</span></tt></a></dt>
-<dd>No transaction is started when command are issued and no
-<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#commit"><tt class="docutils literal"><span class="pre">.commit()</span></tt></a>/<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#rollback"><tt class="docutils literal"><span class="pre">.rollback()</span></tt></a> is required. Some PostgreSQL command such as
-<tt class="docutils literal"><span class="pre">CREATE</span> <span class="pre">DATABASE</span></tt> can't run into a transaction: to run such command use
-<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#set_isolation_level"><tt class="docutils literal"><span class="pre">.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)</span></tt></a>.</dd>
-<dt><a href="#id2" name="id3"><span class="problematic" id="id3">`ISOLATION_LEVEL_READ_COMMITTED`</span></a></dt>
-<dd><div class="first system-message" id="id2">
-<p class="system-message-title">System Message: <a name="id2">ERROR/3</a> (<tt class="docutils">../doc/extensions.rst</tt>, line 54); <em><a href="#id3">backlink</a></em></p>
-Can't find 'ISOLATION_LEVEL_READ_COMMITTED' in any provided module.</div>
-<p class="last">This is the default value. A new transaction is started at the first
-<a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#execute"><tt class="docutils literal"><span class="pre">.execute()</span></tt></a> command on a cursor and at each new <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#execute"><tt class="docutils literal"><span class="pre">.execute()</span></tt></a> after a
-<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#commit"><tt class="docutils literal"><span class="pre">.commit()</span></tt></a> or a <a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#rollback"><tt class="docutils literal"><span class="pre">.rollback()</span></tt></a>. The transaction runs in the PostgreSQL
-<tt class="docutils literal"><span class="pre">READ</span> <span class="pre">COMMITTED</span></tt> isolation level.</p>
-</dd>
-<dt><a class="reference" href="api/public/psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE"><tt class="docutils literal"><span class="pre">ISOLATION_LEVEL_SERIALIZABLE</span></tt></a></dt>
-<dd>Transactions are run at a <tt class="docutils literal"><span class="pre">SERIALIZABLE</span></tt> isolation level.</dd>
-</dl>
-</div>
-<div class="section" id="adaptation-of-python-values-to-sql-types">
-<h1><a name="adaptation-of-python-values-to-sql-types">Adaptation of Python values to SQL types</a></h1>
-<p>psycopg2 casts Python variables to SQL literals by type. Standard Python types
-are already adapted to the proper SQL literal.</p>
-<p>Example: the Python function:</p>
-<pre class="literal-block">
-curs.execute("""INSERT INTO atable (anint, adate, astring)
- VALUES (%s, %s, %s)""",
- (10, datetime.date(2005, 11, 18), "O'Reilly"))
-</pre>
-<p>is converted into the SQL command:</p>
-<pre class="literal-block">
-INSERT INTO atable (anint, adate, astring)
- VALUES (10, '2005-11-18', 'O''Reilly');
-</pre>
-<p>Named arguments are supported too with <tt class="docutils literal"><span class="pre">%(name)s</span></tt> placeholders. Notice that:</p>
-<blockquote>
-<ul class="simple">
-<li>The Python string operator <tt class="docutils literal"><span class="pre">%</span></tt> is not used: the <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#execute"><tt class="docutils literal"><span class="pre">.execute()</span></tt></a> function
-accepts the values tuple or dictionary as second parameter.</li>
-<li>The variables placeholder must always be a <tt class="docutils literal"><span class="pre">%s</span></tt>, even if a different
-placeholder (such as a <tt class="docutils literal"><span class="pre">%d</span></tt> for an integer) may look more appropriate.</li>
-<li>For positional variables binding, the second argument must always be a
-tuple, even if it contains a single variable.</li>
-<li>Only variable values should be bound via this method: it shouldn't be used
-to set table or field names. For these elements, ordinary string formatting
-should be used before running <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#execute"><tt class="docutils literal"><span class="pre">.execute()</span></tt></a>.</li>
-</ul>
-</blockquote>
-<div class="section" id="adapting-new-types">
-<h2><a name="adapting-new-types">Adapting new types</a></h2>
-<p>Any Python class or type can be adapted to an SQL string. Adaptation mechanism
-is similar to the Object Adaptation proposed in the <a class="reference" href="http://www.python.org/peps/pep-0246.html">PEP-246</a> and is exposed
-by the <a class="reference" href="api/private/psycopg2._psycopg-module.html#adapt"><tt class="docutils literal"><span class="pre">adapt()</span></tt></a> function.</p>
-<p>psycopg2 <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#execute"><tt class="docutils literal"><span class="pre">.execute()</span></tt></a> method adapts its <tt class="docutils literal"><span class="pre">vars</span></tt> arguments to the <a class="reference" href="api/private/psycopg2._psycopg.ISQLQuote-class.html"><tt class="docutils literal"><span class="pre">ISQLQuote</span></tt></a>
-protocol. Objects that conform to this protocol expose a <tt class="docutils literal"><span class="pre">getquoted()</span></tt> method
-returning the SQL representation of the object as a string.</p>
-<p>The easiest way to adapt an object to an SQL string is to register an adapter
-function via the <a class="reference" href="api/public/psycopg2.extensions-module.html#register_adapter"><tt class="docutils literal"><span class="pre">register_adapter()</span></tt></a> function. The adapter function must take
-the value to be adapted as argument and return a conform object. A convenient
-object is the <a class="reference" href="api/private/psycopg2._psycopg-module.html#AsIs"><tt class="docutils literal"><span class="pre">AsIs</span></tt></a> wrapper, whose <tt class="docutils literal"><span class="pre">getquoted()</span></tt> result is simply the
-<tt class="docutils literal"><span class="pre">str()</span></tt>ingification of the wrapped object.</p>
-<p>Example: mapping of a <tt class="docutils literal"><span class="pre">Point</span></tt> class into the <tt class="docutils literal"><span class="pre">point</span></tt> PostgreSQL geometric
-type:</p>
-<pre class="literal-block">
-from psycopg2.extensions import adapt, register_adapter, AsIs
-
-class Point(object):
- def __init__(self, x=0.0, y=0.0):
- self.x = x
- self.y = y
-
-def adapt_point(point):
- return AsIs("'(%s,%s)'" % (adapt(point.x), adapt(point.y)))
-
-register_adapter(Point, adapt_point)
-
-curs.execute("INSERT INTO atable (apoint) VALUES (%s)",
- (Point(1.23, 4.56),))
-</pre>
-<p>The above function call results in the SQL command:</p>
-<pre class="literal-block">
-INSERT INTO atable (apoint) VALUES ((1.23, 4.56));
-</pre>
-</div>
-</div>
-<div class="section" id="type-casting-of-sql-types-into-python-values">
-<h1><a name="type-casting-of-sql-types-into-python-values">Type casting of SQL types into Python values</a></h1>
-<p>PostgreSQL objects read from the database can be adapted to Python objects
-through an user-defined adapting function. An adapter function takes two
-argments: the object string representation as returned by PostgreSQL and the
-cursor currently being read, and should return a new Python object. For
-example, the following function parses a PostgreSQL <tt class="docutils literal"><span class="pre">point</span></tt> into the
-previously defined <tt class="docutils literal"><span class="pre">Point</span></tt> class:</p>
-<pre class="literal-block">
-def cast_point(value, curs):
- if value is not None:
- # Convert from (f1, f2) syntax using a regular expression.
- m = re.match("\((.*),(.*)\)", value)
- if m:
- return Point(float(m.group(1)), float(m.group(2)))
-</pre>
-<p>To create a mapping from the PostgreSQL type (either standard or user-defined),
-its <tt class="docutils literal"><span class="pre">oid</span></tt> must be known. It can be retrieved either by the second column of
-the cursor description:</p>
-<pre class="literal-block">
-curs.execute("SELECT NULL::point")
-point_oid = curs.description[0][1] # usually returns 600
-</pre>
-<p>or by querying the system catalogs for the type name and namespace (the
-namespace for system objects is <tt class="docutils literal"><span class="pre">pg_catalog</span></tt>):</p>
-<pre class="literal-block">
-curs.execute("""
- SELECT pg_type.oid
- FROM pg_type JOIN pg_namespace
- ON typnamespace = pg_namespace.oid
- WHERE typname = %(typename)s
- AND nspname = %(namespace)s""",
- {'typename': 'point', 'namespace': 'pg_catalog'})
-
-point_oid = curs.fetchone()[0]
-</pre>
-<p>After you know the object <tt class="docutils literal"><span class="pre">oid</span></tt>, you must can and register the new type:</p>
-<pre class="literal-block">
-POINT = psycopg2.extensions.new_type((point_oid,), "POINT", cast_point)
-psycopg2.extensions.register_type(POINT)
-</pre>
-<p>The <a class="reference" href="api/private/psycopg2._psycopg-module.html#new_type"><tt class="docutils literal"><span class="pre">new_type()</span></tt></a> function binds the object oids (more than one can be
-specified) to the adapter function. <a class="reference" href="api/private/psycopg2._psycopg-module.html#register_type"><tt class="docutils literal"><span class="pre">register_type()</span></tt></a> completes the spell.
-Conversion is automatically performed when a column whose type is a registered
-<tt class="docutils literal"><span class="pre">oid</span></tt> is read:</p>
-<pre class="literal-block">
-curs.execute("SELECT '(10.2,20.3)'::point")
-point = curs.fetchone()[0]
-print type(point), point.x, point.y
-# Prints: "<class '__main__.Point'> 10.2 20.3"
-</pre>
-</div>
-<div class="section" id="working-with-times-and-dates">
-<h1><a name="working-with-times-and-dates">Working with times and dates</a></h1>
-</div>
-<div class="section" id="receiving-notifys">
-<h1><a name="receiving-notifys">Receiving NOTIFYs</a></h1>
-</div>
-<div class="section" id="using-copy-to-and-copy-from">
-<h1><a name="using-copy-to-and-copy-from">Using COPY TO and COPY FROM</a></h1>
-<p>psycopg2 <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html"><tt class="docutils literal"><span class="pre">cursor</span></tt></a> object provides an interface to the efficient <a class="reference" href="http://www.postgresql.org/docs/8.1/static/sql-copy.html">PostgreSQL
-COPY command</a> to move data from files to tables and back.</p>
-<p>The <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#copy_to"><tt class="docutils literal"><span class="pre">.copy_to(file,</span> <span class="pre">table)</span></tt></a> method writes the content of the table
-named <tt class="docutils literal"><span class="pre">table</span></tt> <em>to</em> the file-like object <tt class="docutils literal"><span class="pre">file</span></tt>. <tt class="docutils literal"><span class="pre">file</span></tt> must have a
-<tt class="docutils literal"><span class="pre">write()</span></tt> method.</p>
-<p>The <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#copy_from"><tt class="docutils literal"><span class="pre">.copy_from(file,</span> <span class="pre">table)</span></tt></a> reads data <em>from</em> the file-like object
-<tt class="docutils literal"><span class="pre">file</span></tt> appending them to the table named <tt class="docutils literal"><span class="pre">table</span></tt>. <tt class="docutils literal"><span class="pre">file</span></tt> must have both
-<tt class="docutils literal"><span class="pre">read()</span></tt> and <tt class="docutils literal"><span class="pre">readline()</span></tt> method.</p>
-<p>Both methods accept two optional arguments: <tt class="docutils literal"><span class="pre">sep</span></tt> (defaulting to a tab) is
-the columns separator and <tt class="docutils literal"><span class="pre">null</span></tt> (defaulting to <tt class="docutils literal"><span class="pre">\N</span></tt>) represents <tt class="docutils literal"><span class="pre">NULL</span></tt>
-values in the file.</p>
-</div>
-<div class="section" id="postgresql-status-message-and-executed-query">
-<h1><a name="postgresql-status-message-and-executed-query">PostgreSQL status message and executed query</a></h1>
-<p><a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html"><tt class="docutils literal"><span class="pre">cursor</span></tt></a> objects have two special fields related to the last executed query:</p>
-<blockquote>
-<ul class="simple">
-<li><a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#query"><tt class="docutils literal"><span class="pre">.query</span></tt></a> is the textual representation (str or unicode, depending on what
-was passed to <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#execute"><tt class="docutils literal"><span class="pre">.execute()</span></tt></a> as first argument) of the query <em>after</em> argument
-binding and mogrification has been applied. To put it another way, <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#query"><tt class="docutils literal"><span class="pre">.query</span></tt></a>
-is the <em>exact</em> query that was sent to the PostgreSQL backend.</li>
-<li><a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#statusmessage"><tt class="docutils literal"><span class="pre">.statusmessage</span></tt></a> is the status message that the backend sent upon query
-execution. It usually contains the basic type of the query (SELECT,
-INSERT, UPDATE, ...) and some additional information like the number of
-rows updated and so on. Refer to the PostgreSQL manual for more
-information.</li>
-</ul>
-</blockquote>
-</div>
-</div>
-</body>
-</html>
+++ /dev/null
-=======================================
- psycopg 2 extensions to the DBAPI 2.0
-=======================================
-
-This document is a short summary of the extensions built in psycopg 2.0.x over
-the standard `Python Database API Specification 2.0`__, usually called simply
-DBAPI-2.0 or even PEP-249. Before reading on this document please make sure
-you already know how to program in Python using a DBAPI-2.0 compliant driver:
-basic concepts like opening a connection, executing queries and commiting or
-rolling back a transaction will not be explained but just used.
-
-.. __: http://www.python.org/peps/pep-0249.html
-
-Many objects and extension functions are defined in the `psycopg2.extensions`
-module.
-
-
-Connection and cursor factories
-===============================
-
-psycopg 2 exposes two new-style classes that can be sub-classed and expanded to
-adapt them to the needs of the programmer: `cursor` and `connection`. The
-`connection` class is usually sub-classed only to provide an easy way to create
-customized cursors but other uses are possible. `cursor` is much more
-interesting, because it is the class where query building, execution and result
-type-casting into Python variables happens.
-
-An example of cursor subclass performing logging is::
-
- import psycopg2
- import psycopg2.extensions
- import logging
-
- class LoggingCursor(psycopg2.extensions.cursor):
- def execute(self, sql, args=None):
- logger = logging.getLogger('sql_debug')
- logger.info(self.mogrify(sql, args))
-
- try:
- psycopg2.extensions.cursor.execute(self, sql, args)
- except Exception, exc:
- logger.error("%s: %s" % (exc.__class__.__name__, exc))
- raise
-
- conn = psycopg2.connect(DSN)
- curs = conn.cursor(cursor_factory=LoggingCursor)
- curs.execute("INSERT INTO mytable VALUES (%s, %s, %s);",
- (10, 20, 30))
-
-
-Row factories
--------------
-
-tzinfo factories
-----------------
-
-
-Setting transaction isolation levels
-====================================
-
-psycopg2 connection objects hold informations about the PostgreSQL `transaction
-isolation level`_. The current transaction level can be read from the
-`.isolation_level` attribute. The default isolation level is ``READ
-COMMITTED``. A different isolation level con be set through the
-`.set_isolation_level()` method. The level can be set to one of the following
-constants, defined in `psycopg2.extensions`:
-
-`ISOLATION_LEVEL_AUTOCOMMIT`
- No transaction is started when command are issued and no
- `.commit()`/`.rollback()` is required. Some PostgreSQL command such as
- ``CREATE DATABASE`` can't run into a transaction: to run such command use
- `.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)`.
-
-`ISOLATION_LEVEL_READ_COMMITTED`
- This is the default value. A new transaction is started at the first
- `.execute()` command on a cursor and at each new `.execute()` after a
- `.commit()` or a `.rollback()`. The transaction runs in the PostgreSQL
- ``READ COMMITTED`` isolation level.
-
-`ISOLATION_LEVEL_SERIALIZABLE`
- Transactions are run at a ``SERIALIZABLE`` isolation level.
-
-
-.. _transaction isolation level:
- http://www.postgresql.org/docs/8.1/static/transaction-iso.html
-
-
-Adaptation of Python values to SQL types
-========================================
-
-psycopg2 casts Python variables to SQL literals by type. Standard Python types
-are already adapted to the proper SQL literal.
-
-Example: the Python function::
-
- curs.execute("""INSERT INTO atable (anint, adate, astring)
- VALUES (%s, %s, %s)""",
- (10, datetime.date(2005, 11, 18), "O'Reilly"))
-
-is converted into the SQL command::
-
- INSERT INTO atable (anint, adate, astring)
- VALUES (10, '2005-11-18', 'O''Reilly');
-
-Named arguments are supported too with ``%(name)s`` placeholders. Notice that:
-
- - The Python string operator ``%`` is not used: the `.execute()` function
- accepts the values tuple or dictionary as second parameter.
-
- - The variables placeholder must always be a ``%s``, even if a different
- placeholder (such as a ``%d`` for an integer) may look more appropriate.
-
- - For positional variables binding, the second argument must always be a
- tuple, even if it contains a single variable.
-
- - Only variable values should be bound via this method: it shouldn't be used
- to set table or field names. For these elements, ordinary string formatting
- should be used before running `.execute()`.
-
-
-Adapting new types
-------------------
-
-Any Python class or type can be adapted to an SQL string. Adaptation mechanism
-is similar to the Object Adaptation proposed in the `PEP-246`_ and is exposed
-by the `adapt()` function.
-
-psycopg2 `.execute()` method adapts its ``vars`` arguments to the `ISQLQuote`
-protocol. Objects that conform to this protocol expose a ``getquoted()`` method
-returning the SQL representation of the object as a string.
-
-The easiest way to adapt an object to an SQL string is to register an adapter
-function via the `register_adapter()` function. The adapter function must take
-the value to be adapted as argument and return a conform object. A convenient
-object is the `AsIs` wrapper, whose ``getquoted()`` result is simply the
-``str()``\ ingification of the wrapped object.
-
-Example: mapping of a ``Point`` class into the ``point`` PostgreSQL geometric
-type::
-
- from psycopg2.extensions import adapt, register_adapter, AsIs
-
- class Point(object):
- def __init__(self, x=0.0, y=0.0):
- self.x = x
- self.y = y
-
- def adapt_point(point):
- return AsIs("'(%s,%s)'" % (adapt(point.x), adapt(point.y)))
-
- register_adapter(Point, adapt_point)
-
- curs.execute("INSERT INTO atable (apoint) VALUES (%s)",
- (Point(1.23, 4.56),))
-
-The above function call results in the SQL command::
-
- INSERT INTO atable (apoint) VALUES ((1.23, 4.56));
-
-
-.. _PEP-246: http://www.python.org/peps/pep-0246.html
-
-
-Type casting of SQL types into Python values
-============================================
-
-PostgreSQL objects read from the database can be adapted to Python objects
-through an user-defined adapting function. An adapter function takes two
-argments: the object string representation as returned by PostgreSQL and the
-cursor currently being read, and should return a new Python object. For
-example, the following function parses a PostgreSQL ``point`` into the
-previously defined ``Point`` class::
-
- def cast_point(value, curs):
- if value is not None:
- # Convert from (f1, f2) syntax using a regular expression.
- m = re.match("\((.*),(.*)\)", value)
- if m:
- return Point(float(m.group(1)), float(m.group(2)))
-
-To create a mapping from the PostgreSQL type (either standard or user-defined),
-its ``oid`` must be known. It can be retrieved either by the second column of
-the cursor description::
-
- curs.execute("SELECT NULL::point")
- point_oid = curs.description[0][1] # usually returns 600
-
-or by querying the system catalogs for the type name and namespace (the
-namespace for system objects is ``pg_catalog``)::
-
- curs.execute("""
- SELECT pg_type.oid
- FROM pg_type JOIN pg_namespace
- ON typnamespace = pg_namespace.oid
- WHERE typname = %(typename)s
- AND nspname = %(namespace)s""",
- {'typename': 'point', 'namespace': 'pg_catalog'})
-
- point_oid = curs.fetchone()[0]
-
-After you know the object ``oid``, you must can and register the new type::
-
- POINT = psycopg2.extensions.new_type((point_oid,), "POINT", cast_point)
- psycopg2.extensions.register_type(POINT)
-
-The `new_type()` function binds the object oids (more than one can be
-specified) to the adapter function. `register_type()` completes the spell.
-Conversion is automatically performed when a column whose type is a registered
-``oid`` is read::
-
- curs.execute("SELECT '(10.2,20.3)'::point")
- point = curs.fetchone()[0]
- print type(point), point.x, point.y
- # Prints: "<class '__main__.Point'> 10.2 20.3"
-
-
-Working with times and dates
-============================
-
-
-Receiving NOTIFYs
-=================
-
-
-Using COPY TO and COPY FROM
-===========================
-
-psycopg2 `cursor` object provides an interface to the efficient `PostgreSQL
-COPY command`__ to move data from files to tables and back.
-
-The `.copy_to(file, table)` method writes the content of the table
-named ``table`` *to* the file-like object ``file``. ``file`` must have a
-``write()`` method.
-
-The `.copy_from(file, table)` reads data *from* the file-like object
-``file`` appending them to the table named ``table``. ``file`` must have both
-``read()`` and ``readline()`` method.
-
-Both methods accept two optional arguments: ``sep`` (defaulting to a tab) is
-the columns separator and ``null`` (defaulting to ``\N``) represents ``NULL``
-values in the file.
-
-.. __: http://www.postgresql.org/docs/8.1/static/sql-copy.html
-
-
-PostgreSQL status message and executed query
-============================================
-
-`cursor` objects have two special fields related to the last executed query:
-
- - `.query` is the textual representation (str or unicode, depending on what
- was passed to `.execute()` as first argument) of the query *after* argument
- binding and mogrification has been applied. To put it another way, `.query`
- is the *exact* query that was sent to the PostgreSQL backend.
-
- - `.statusmessage` is the status message that the backend sent upon query
- execution. It usually contains the basic type of the query (SELECT,
- INSERT, UPDATE, ...) and some additional information like the number of
- rows updated and so on. Refer to the PostgreSQL manual for more
- information.
+++ /dev/null
-# binary.py - working with binary data
-#
-# Copyright (C) 2001-2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below tis line (except for experimenting)
-
-import sys
-import psycopg2
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dns:", DSN
-conn = psycopg2.connect(DSN)
-print "Encoding for this connection is", conn.encoding
-
-curs = conn.cursor()
-try:
- curs.execute("CREATE TABLE test_binary (id int4, name text, img bytea)")
-except:
- conn.rollback()
- curs.execute("DROP TABLE test_binary")
- curs.execute("CREATE TABLE test_binary (id int4, name text, img bytea)")
-conn.commit()
-
-# first we try two inserts, one with an explicit Binary call and the other
-# using a buffer on a file object.
-
-data1 = {'id':1, 'name':'somehackers.jpg',
- 'img':psycopg2.Binary(open('somehackers.jpg').read())}
-data2 = {'id':2, 'name':'whereareyou.jpg',
- 'img':buffer(open('whereareyou.jpg').read())}
-
-curs.execute("""INSERT INTO test_binary
- VALUES (%(id)s, %(name)s, %(img)s)""", data1)
-curs.execute("""INSERT INTO test_binary
- VALUES (%(id)s, %(name)s, %(img)s)""", data2)
-
-# now we try to extract the images as simple text strings
-
-print "Extracting the images as strings..."
-curs.execute("SELECT * FROM test_binary")
-
-for row in curs.fetchall():
- name, ext = row[1].split('.')
- new_name = name + '_S.' + ext
- print " writing %s to %s ..." % (name+'.'+ext, new_name),
- open(new_name, 'wb').write(row[2])
- print "done"
- print " python type of image data is", type(row[2])
-
-# extract exactly the same data but using a binary cursor
-
-print "Extracting the images using a binary cursor:"
-
-curs.execute("""DECLARE zot CURSOR FOR
- SELECT img, name FROM test_binary FOR READ ONLY""")
-curs.execute("""FETCH ALL FROM zot""")
-
-for row in curs.fetchall():
- name, ext = row[1].split('.')
- new_name = name + '_B.' + ext
- print " writing %s to %s ..." % (name+'.'+ext, new_name),
- open(new_name, 'wb').write(row[0])
- print "done"
- print " python type of image data is", type(row[0])
-
-# this rollback is requires because we can't drop a table with a binary cusor
-# declared and still open
-conn.rollback()
-
-curs.execute("DROP TABLE test_binary")
-conn.commit()
-
-print "\nNow try to load the new images, to check it worked!"
+++ /dev/null
-# copy_from.py -- example about copy_from
-#
-# Copyright (C) 2002 Tom Jenkins <tjenkins@devis.com>
-# Copyright (C) 2005 Federico Di Gregorio <fog@initd.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below tis line (except for experimenting)
-
-import sys
-import os
-import StringIO
-import psycopg2
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dns:", DSN
-conn = psycopg2.connect(DSN)
-print "Encoding for this connection is", conn.encoding
-
-curs = conn.cursor()
-try:
- curs.execute("CREATE TABLE test_copy (fld1 text, fld2 text, fld3 int4)")
-except:
- conn.rollback()
- curs.execute("DROP TABLE test_copy")
- curs.execute("CREATE TABLE test_copy (fld1 text, fld2 text, fld3 int4)")
-conn.commit()
-
-# copy_from with default arguments, from open file
-
-io = open('copy_from.txt', 'wr')
-data = ['Tom\tJenkins\t37\n',
- 'Madonna\t\N\t45\n',
- 'Federico\tDi Gregorio\t\N\n']
-io.writelines(data)
-io.close()
-
-io = open('copy_from.txt', 'r')
-curs.copy_from(io, 'test_copy')
-print "1) Copy %d records from file object " % len(data) + \
- "using defaults (sep: \\t and null = \\N)"
-io.close()
-
-curs.execute("SELECT * FROM test_copy")
-rows = curs.fetchall()
-print " Select returned %d rows" % len(rows)
-
-for r in rows:
- print " %s %s\t%s" % (r[0], r[1], r[2])
-curs.execute("delete from test_copy")
-conn.commit()
-
-# copy_from using custom separator, from open file
-
-io = open('copy_from.txt', 'wr')
-data = ['Tom:Jenkins:37\n',
- 'Madonna:\N:45\n',
- 'Federico:Di Gregorio:\N\n']
-io.writelines(data)
-io.close()
-
-io = open('copy_from.txt', 'r')
-curs.copy_from(io, 'test_copy', ':')
-print "2) Copy %d records from file object using sep = :" % len(data)
-io.close()
-
-curs.execute("SELECT * FROM test_copy")
-rows = curs.fetchall()
-print " Select returned %d rows" % len(rows)
-
-for r in rows:
- print " %s %s\t%s" % (r[0], r[1], r[2])
-curs.execute("delete from test_copy")
-conn.commit()
-
-# copy_from using custom null identifier, from open file
-
-io = open('copy_from.txt', 'wr')
-data = ['Tom\tJenkins\t37\n',
- 'Madonna\tNULL\t45\n',
- 'Federico\tDi Gregorio\tNULL\n']
-io.writelines(data)
-io.close()
-
-io = open('copy_from.txt', 'r')
-curs.copy_from(io, 'test_copy', null='NULL')
-print "3) Copy %d records from file object using null = NULL" % len(data)
-io.close()
-
-curs.execute("SELECT * FROM test_copy")
-rows = curs.fetchall()
-print " Select using cursor returned %d rows" % len(rows)
-
-for r in rows:
- print " %s %s\t%s" % (r[0], r[1], r[2])
-curs.execute("delete from test_copy")
-conn.commit()
-
-# copy_from using custom separator and null identifier
-
-io = open('copy_from.txt', 'wr')
-data = ['Tom:Jenkins:37\n', 'Madonna:NULL:45\n', 'Federico:Di Gregorio:NULL\n']
-io.writelines(data)
-io.close()
-
-io = open('copy_from.txt', 'r')
-curs.copy_from(io, 'test_copy', ':', 'NULL')
-print "4) Copy %d records from file object " % len(data) + \
- "using sep = : and null = NULL"
-io.close()
-
-curs.execute("SELECT * FROM test_copy")
-rows = curs.fetchall()
-print " Select using cursor returned %d rows" % len(rows)
-
-for r in rows:
- print " %s %s\t%s" % (r[0], r[1], r[2])
-curs.execute("delete from test_copy")
-conn.commit()
-
-# anything can be used as a file if it has .read() and .readline() methods
-
-data = StringIO.StringIO()
-data.write('\n'.join(['Tom\tJenkins\t37',
- 'Madonna\t\N\t45',
- 'Federico\tDi Gregorio\t\N']))
-data.seek(0)
-
-curs.copy_from(data, 'test_copy')
-print "5) Copy 3 records from StringIO object using defaults"
-
-curs.execute("SELECT * FROM test_copy")
-rows = curs.fetchall()
-print " Select using cursor returned %d rows" % len(rows)
-
-for r in rows:
- print " %s %s\t%s" % (r[0], r[1], r[2])
-curs.execute("delete from test_copy")
-conn.commit()
-
-# simple error test
-
-print "6) About to raise an error"
-data = StringIO.StringIO()
-data.write('\n'.join(['Tom\tJenkins\t37',
- 'Madonna\t\N\t45',
- 'Federico\tDi Gregorio\taaa']))
-data.seek(0)
-
-try:
- curs.copy_from(data, 'test_copy')
-except StandardError, err:
- conn.rollback()
- print " Catched error (as expected):\n", err
-
-conn.rollback()
-
-curs.execute("DROP TABLE test_copy")
-os.unlink('copy_from.txt')
-conn.commit()
-
-
-
+++ /dev/null
-# copy_to.py -- example about copy_to
-#
-# Copyright (C) 2002 Tom Jenkins <tjenkins@devis.com>
-# Copyright (C) 2005 Federico Di Gregorio <fog@initd.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below tis line (except for experimenting)
-
-import sys
-import os
-import StringIO
-import psycopg2
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dns:", DSN
-conn = psycopg2.connect(DSN)
-print "Encoding for this connection is", conn.encoding
-
-curs = conn.cursor()
-try:
- curs.execute("CREATE TABLE test_copy (fld1 text, fld2 text, fld3 int4)")
-except:
- conn.rollback()
- curs.execute("DROP TABLE test_copy")
- curs.execute("CREATE TABLE test_copy (fld1 text, fld2 text, fld3 int4)")
-conn.commit()
-
-# demostrate copy_to functionality
-data = [('Tom', 'Jenkins', '37'),
- ('Madonna', None, '45'),
- ('Federico', 'Di Gregorio', None)]
-query = "INSERT INTO test_copy VALUES (%s, %s, %s)"
-curs.executemany(query, data)
-conn.commit()
-
-# copy_to using defaults
-io = open('copy_to.txt', 'w')
-curs.copy_to(io, 'test_copy')
-print "1) Copy %d records into file object using defaults: " % len (data) + \
- "sep = \\t and null = \\N"
-io.close()
-
-rows = open('copy_to.txt', 'r').readlines()
-print " File has %d rows:" % len(rows)
-
-for r in rows:
- print " ", r,
-
-# copy_to using custom separator
-io = open('copy_to.txt', 'w')
-curs.copy_to(io, 'test_copy', ':')
-print "2) Copy %d records into file object using sep = :" % len(data)
-io.close()
-
-rows = open('copy_to.txt', 'r').readlines()
-print " File has %d rows:" % len(rows)
-
-for r in rows:
- print " ", r,
-
-# copy_to using custom null identifier
-io = open('copy_to.txt', 'w')
-curs.copy_to(io, 'test_copy', null='NULL')
-print "3) Copy %d records into file object using null = NULL" % len(data)
-io.close()
-
-rows = open('copy_to.txt', 'r').readlines()
-print " File has %d rows:" % len(rows)
-
-for r in rows:
- print " ", r,
-
-# copy_to using custom separator and null identifier
-io = open('copy_to.txt', 'w')
-curs.copy_to(io, 'test_copy', ':', 'NULL')
-print "4) Copy %d records into file object using sep = : and null ) NULL" % \
- len(data)
-io.close()
-
-rows = open('copy_to.txt', 'r').readlines()
-print " File has %d rows:" % len(rows)
-
-for r in rows:
- print " ", r,
-
-curs.execute("DROP TABLE test_copy")
-os.unlink('copy_to.txt')
-conn.commit()
+++ /dev/null
-# cursor.py - how to subclass the cursor type
-#
-# Copyright (C) 2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below this line (except for experimenting)
-
-import sys
-import psycopg2
-import psycopg2.extensions
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dsn:", DSN
-conn = psycopg2.connect(DSN)
-print "Encoding for this connection is", conn.encoding
-
-
-class NoDataError(psycopg2.ProgrammingError):
- """Exception that will be raised by our cursor."""
- pass
-
-class Cursor(psycopg2.extensions.cursor):
- """A custom cursor."""
-
- def fetchone(self):
- """Like fetchone but raise an exception if no data is available.
-
- Note that to have .fetchmany() and .fetchall() to raise the same
- exception we'll have to override them too; even if internally psycopg
- uses the same function to fetch rows, the code path from Python is
- different.
- """
- d = psycopg2.extensions.cursor.fetchone(self)
- if d is None:
- raise NoDataError("no more data")
- return d
-
-curs = conn.cursor(cursor_factory=Cursor)
-curs.execute("SELECT 1 AS foo")
-print "Result of fetchone():", curs.fetchone()
-
-# now let's raise the exception
-try:
- curs.fetchone()
-except NoDataError, err:
- print "Exception caugth:", err
-
-conn.rollback()
+++ /dev/null
-"""
-This example/recipe has been contributed by Valentino Volonghi (dialtone)
-
-Mapping arbitrary objects to a PostgreSQL database with psycopg2
-
-- Problem
-
-You need to store arbitrary objects in a PostgreSQL database without being
-intrusive for your classes (don't want inheritance from an 'Item' or
-'Persistent' object).
-
-- Solution
-"""
-
-from datetime import datetime
-
-import psycopg2
-from psycopg2.extensions import adapt, register_adapter
-
-try:
- sorted()
-except:
- def sorted(seq):
- seq.sort()
- return seq
-
-# Here is the adapter for every object that we may ever need to
-# insert in the database. It receives the original object and does
-# its job on that instance
-
-class ObjectMapper(object):
- def __init__(self, orig, curs=None):
- self.orig = orig
- self.tmp = {}
- self.items, self.fields = self._gatherState()
-
- def _gatherState(self):
- adaptee_name = self.orig.__class__.__name__
- fields = sorted([(field, getattr(self.orig, field))
- for field in persistent_fields[adaptee_name]])
- items = []
- for item, value in fields:
- items.append(item)
- return items, fields
-
- def getTableName(self):
- return self.orig.__class__.__name__
-
- def getMappedValues(self):
- tmp = []
- for i in self.items:
- tmp.append("%%(%s)s"%i)
- return ", ".join(tmp)
-
- def getValuesDict(self):
- return dict(self.fields)
-
- def getFields(self):
- return self.items
-
- def generateInsert(self):
- qry = "INSERT INTO"
- qry += " " + self.getTableName() + " ("
- qry += ", ".join(self.getFields()) + ") VALUES ("
- qry += self.getMappedValues() + ")"
- return qry, self.getValuesDict()
-
-# Here are the objects
-class Album(object):
- id = 0
- def __init__(self):
- self.creation_time = datetime.now()
- self.album_id = self.id
- Album.id = Album.id + 1
- self.binary_data = buffer('12312312312121')
-
-class Order(object):
- id = 0
- def __init__(self):
- self.items = ['rice','chocolate']
- self.price = 34
- self.order_id = self.id
- Order.id = Order.id + 1
-
-register_adapter(Album, ObjectMapper)
-register_adapter(Order, ObjectMapper)
-
-# Describe what is needed to save on each object
-# This is actually just configuration, you can use xml with a parser if you
-# like to have plenty of wasted CPU cycles ;P.
-
-persistent_fields = {'Album': ['album_id', 'creation_time', 'binary_data'],
- 'Order': ['order_id', 'items', 'price']
- }
-
-print adapt(Album()).generateInsert()
-print adapt(Album()).generateInsert()
-print adapt(Album()).generateInsert()
-print adapt(Order()).generateInsert()
-print adapt(Order()).generateInsert()
-print adapt(Order()).generateInsert()
-
-"""
-- Discussion
-
-Psycopg 2 has a great new feature: adaptation. The big thing about
-adaptation is that it enable the programmer to glue most of the
-code out there without many difficulties.
-
-This recipe tries to focus the attention on a way to generate SQL queries to
-insert completely new objects inside a database. As you can see objects do
-not know anything about the code that is handling them. We specify all the
-fields that we need for each object through the persistent_fields dict.
-
-The most important lines of this recipe are:
- register_adapter(Album, ObjectMapper)
- register_adapter(Order, ObjectMapper)
-
-In these line we notify the system that when we call adapt with an Album instance
-as an argument we want it to istantiate ObjectMapper passing the Album instance
-as argument (self.orig in the ObjectMapper class).
-
-The output is something like this (for each call to generateInsert):
-
-('INSERT INTO Album (album_id, binary_data, creation_time) VALUES
- (%(album_id)s, %(binary_data)s, %(creation_time)s)',
-
- {'binary_data': <read-only buffer for 0x402de070, ...>,
- 'creation_time': datetime.datetime(2004, 9, 10, 20, 48, 29, 633728),
- 'album_id': 1}
-)
-
-This is a tuple of {SQL_QUERY, FILLING_DICT}, and all the quoting/converting
-stuff (from python's datetime to postgres s and from python's buffer to
-postgres' blob) is handled with the same adaptation process hunder the hood
-by psycopg2.
-
-At last, just notice that ObjectMapper is working for both Album and Order
-instances without any glitches at all, and both classes could have easily been
-coming from closed source libraries or C coded ones (which are not easily
-modified), whereas a common pattern in todays ORMs or OODBs is to provide
-a basic 'Persistent' object that already knows how to store itself in the
-database.
-"""
+++ /dev/null
-# dict.py - using DictCUrsor/DictRow
-#
-# Copyright (C) 2005 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below this line (except for experimenting)
-
-import sys
-import psycopg2
-import psycopg2.extras
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dsn:", DSN
-conn = psycopg2.connect(DSN)
-print "Encoding for this connection is", conn.encoding
-
-
-curs = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
-curs.execute("SELECT 1 AS foo, 'cip' AS bar, date(now()) as zot")
-
-data = curs.fetchone()
-print "Some data accessed both as tuple and dict:"
-print " ", data['foo'], data['bar'], data['zot']
-print " ", data[0], data[1], data[2]
-
-# execute another query and demostrate we can still access the row
-curs.execute("SELECT 2 AS foo")
-print "Some more data accessed both as tuple and dict:"
-print " ", data['foo'], data['bar'], data['zot']
-print " ", data[0], data[1], data[2]
+++ /dev/null
-# datetime.py - example of using date and time types
-#
-# Copyright (C) 2001-2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below tis line (except for experimenting)
-
-import sys
-import psycopg2
-import mx.DateTime
-import datetime
-
-from psycopg2.extensions import adapt
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dns:", DSN
-conn = psycopg2.connect(DSN)
-curs = conn.cursor()
-
-try:
- curs.execute("""CREATE TABLE test_dt (
- k int4, d date, t time, dt timestamp, z interval)""")
-except:
- conn.rollback()
- curs.execute("DROP TABLE test_dt")
- curs.execute("""CREATE TABLE test_dt (
- k int4, d date, t time, dt timestamp, z interval)""")
-conn.commit()
-
-# build and insert some data using mx.DateTime
-mx1 = (
- 1,
- mx.DateTime.Date(2004, 10, 19),
- mx.DateTime.Time(0, 11, 17.015),
- mx.DateTime.Timestamp(2004, 10, 19, 0, 11, 17.5),
- mx.DateTime.DateTimeDelta(13, 15, 17, 59.9))
-
-from psycopg2.extensions import adapt
-import psycopg2.extras
-print adapt(mx1)
-
-print "Inserting mx.DateTime values..."
-curs.execute("INSERT INTO test_dt VALUES (%s, %s, %s, %s, %s)", mx1)
-
-# build and insert some values using the datetime adapters
-dt1 = (
- 2,
- datetime.date(2004, 10, 19),
- datetime.time(0, 11, 17, 15000),
- datetime.datetime(2004, 10, 19, 0, 11, 17, 500000),
- datetime.timedelta(13, 15*3600+17*60+59, 900000))
-
-print "Inserting Python datetime values..."
-curs.execute("INSERT INTO test_dt VALUES (%s, %s, %s, %s, %s)", dt1)
-
-# now extract the row from database and print them
-print "Extracting values inserted with mx.DateTime wrappers:"
-curs.execute("SELECT d, t, dt, z FROM test_dt WHERE k = 1")
-for n, x in zip(mx1[1:], curs.fetchone()):
- try:
- # this will work only is psycopg has been compiled with datetime
- # as the default typecaster for date/time values
- s = repr(n) + "\n -> " + str(adapt(n)) + \
- "\n -> " + repr(x) + "\n -> " + x.isoformat()
- except:
- s = repr(n) + "\n -> " + str(adapt(n)) + \
- "\n -> " + repr(x) + "\n -> " + str(x)
- print s
-print
-
-print "Extracting values inserted with Python datetime wrappers:"
-curs.execute("SELECT d, t, dt, z FROM test_dt WHERE k = 2")
-for n, x in zip(dt1[1:], curs.fetchone()):
- try:
- # this will work only is psycopg has been compiled with datetime
- # as the default typecaster for date/time values
- s = repr(n) + "\n -> " + repr(x) + "\n -> " + x.isoformat()
- except:
- s = repr(n) + "\n -> " + repr(x) + "\n -> " + str(x)
- print s
-print
-
-curs.execute("DROP TABLE test_dt")
-conn.commit()
+++ /dev/null
-# enkoding.py - show to change client enkoding (and test it works)
-# -*- encoding: utf8 -*-
-#
-# Copyright (C) 2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below this line (except for experimenting)
-
-import sys
-import psycopg2
-import psycopg2.extensions
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dns:", DSN
-conn = psycopg2.connect(DSN)
-print "Initial encoding for this connection is", conn.encoding
-
-print "\n** This example is supposed to be run in a UNICODE terminal! **\n"
-
-print "Available encodings:"
-encs = psycopg2.extensions.encodings.items()
-encs.sort()
-for a, b in encs:
- print " ", a, "<->", b
-
-print "Using STRING typecaster"
-print "Setting backend encoding to LATIN1 and executing queries:"
-conn.set_client_encoding('LATIN1')
-curs = conn.cursor()
-curs.execute("SELECT %s::TEXT AS foo", ('à èìòù',))
-x = curs.fetchone()[0]
-print " ->", unicode(x, 'latin-1').encode('utf-8'), type(x)
-curs.execute("SELECT %s::TEXT AS foo", (u'à èìòù',))
-x = curs.fetchone()[0]
-print " ->", unicode(x, 'latin-1').encode('utf-8'), type(x)
-
-print "Setting backend encoding to UTF8 and executing queries:"
-conn.set_client_encoding('UNICODE')
-curs = conn.cursor()
-curs.execute("SELECT %s::TEXT AS foo", (u'à èìòù'.encode('utf-8'),))
-x = curs.fetchone()[0]
-print " ->", x, type(x)
-curs.execute("SELECT %s::TEXT AS foo", (u'à èìòù',))
-x = curs.fetchone()[0]
-print " ->", x, type(x)
-
-print "Using UNICODE typecaster"
-psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
-
-print "Setting backend encoding to LATIN1 and executing queries:"
-conn.set_client_encoding('LATIN1')
-curs = conn.cursor()
-curs.execute("SELECT %s::TEXT AS foo", ('à èìòù',))
-x = curs.fetchone()[0]
-print " ->", x.encode('utf-8'), ":", type(x)
-curs.execute("SELECT %s::TEXT AS foo", (u'à èìòù',))
-x = curs.fetchone()[0]
-print " ->", x.encode('utf-8'), ":", type(x)
-
-print "Setting backend encoding to UTF8 and executing queries:"
-conn.set_client_encoding('UNICODE')
-curs = conn.cursor()
-curs.execute("SELECT %s::TEXT AS foo", (u'à èìòù'.encode('utf-8'),))
-x = curs.fetchone()[0]
-print " ->", x.encode('utf-8'), ":", type(x)
-curs.execute("SELECT %s::TEXT AS foo", (u'à èìòù',))
-x = curs.fetchone()[0]
-print " ->", x.encode('utf-8'), ":", type(x)
-
-print "Executing full UNICODE queries"
-
-print "Setting backend encoding to LATIN1 and executing queries:"
-conn.set_client_encoding('LATIN1')
-curs = conn.cursor()
-curs.execute(u"SELECT %s::TEXT AS foo", ('à èìòù',))
-x = curs.fetchone()[0]
-print " ->", x.encode('utf-8'), ":", type(x)
-curs.execute(u"SELECT %s::TEXT AS foo", (u'à èìòù',))
-x = curs.fetchone()[0]
-print " ->", x.encode('utf-8'), ":", type(x)
-
-print "Setting backend encoding to UTF8 and executing queries:"
-conn.set_client_encoding('UNICODE')
-curs = conn.cursor()
-curs.execute(u"SELECT %s::TEXT AS foo", (u'à èìòù'.encode('utf-8'),))
-x = curs.fetchone()[0]
-print " ->", x.encode('utf-8'), ":", type(x)
-curs.execute(u"SELECT %s::TEXT AS foo", (u'à èìòù',))
-x = curs.fetchone()[0]
-print " ->", x.encode('utf-8'), ":", type(x)
+++ /dev/null
-# fetch.py -- example about declaring cursors
-#
-# Copyright (C) 2001-2005 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below tis line (except for experimenting)
-
-import sys
-import psycopg2
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dns:", DSN
-conn = psycopg2.connect(DSN)
-print "Encoding for this connection is", conn.encoding
-
-curs = conn.cursor()
-try:
- curs.execute("CREATE TABLE test_fetch (val int4)")
-except:
- conn.rollback()
- curs.execute("DROP TABLE test_fetch")
- curs.execute("CREATE TABLE test_fetch (val int4)")
-conn.commit()
-
-# we use this function to format the output
-
-def flatten(l):
- """Flattens list of tuples l."""
- return map(lambda x: x[0], l)
-
-# insert 20 rows in the table
-
-for i in range(20):
- curs.execute("INSERT INTO test_fetch VALUES(%s)", (i,))
-conn.commit()
-
-# does some nice tricks with the transaction and postgres cursors
-# (remember to always commit or rollback before a DECLARE)
-#
-# we don't need to DECLARE ourselves, psycopg now support named
-# cursors (but we leave the code here, comments, as an example of
-# what psycopg is doing under the hood)
-#
-#curs.execute("DECLARE crs CURSOR FOR SELECT * FROM test_fetch")
-#curs.execute("FETCH 10 FROM crs")
-#print "First 10 rows:", flatten(curs.fetchall())
-#curs.execute("MOVE -5 FROM crs")
-#print "Moved back cursor by 5 rows (to row 5.)"
-#curs.execute("FETCH 10 FROM crs")
-#print "Another 10 rows:", flatten(curs.fetchall())
-#curs.execute("FETCH 10 FROM crs")
-#print "The remaining rows:", flatten(curs.fetchall())
-
-ncurs = conn.cursor("crs")
-ncurs.execute("SELECT * FROM test_fetch")
-print "First 10 rows:", flatten(ncurs.fetchmany(10))
-ncurs.scroll(-5)
-print "Moved back cursor by 5 rows (to row 5.)"
-print "Another 10 rows:", flatten(ncurs.fetchmany(10))
-print "Another one:", list(ncurs.fetchone())
-print "The remaining rows:", flatten(ncurs.fetchall())
-conn.rollback()
-
-curs.execute("DROP TABLE test_fetch")
-conn.commit()
+++ /dev/null
-# lastrowid.py - example of using .lastrowid attribute
-#
-# Copyright (C) 2001-2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below tis line (except for experimenting)
-
-import sys, psycopg2
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dns:", DSN
-conn = psycopg2.connect(DSN)
-curs = conn.cursor()
-
-try:
- curs.execute("CREATE TABLE test_oid (name text, surname text)")
-except:
- conn.rollback()
- curs.execute("DROP TABLE test_oid")
- curs.execute("CREATE TABLE test_oid (name text, surname text)")
-conn.commit()
-
-data = ({'name':'Federico', 'surname':'Di Gregorio'},
- {'name':'Pierluigi', 'surname':'Di Nunzio'})
-
-curs.execute("""INSERT INTO test_oid
- VALUES (%(name)s, %(surname)s)""", data[0])
-
-foid = curs.lastrowid
-print "Oid for %(name)s %(surname)s" % data[0], "is", foid
-
-curs.execute("""INSERT INTO test_oid
- VALUES (%(name)s, %(surname)s)""", data[1])
-moid = curs.lastrowid
-print "Oid for %(name)s %(surname)s" % data[1], "is", moid
-
-curs.execute("SELECT * FROM test_oid WHERE oid = %s", (foid,))
-print "Oid", foid, "selected %s %s" % curs.fetchone()
-
-curs.execute("SELECT * FROM test_oid WHERE oid = %s", (moid,))
-print "Oid", moid, "selected %s %s" % curs.fetchone()
-
-curs.execute("DROP TABLE test_oid")
-conn.commit()
+++ /dev/null
-# mogrify.py - test all possible simple type mogrifications
-# -*- encoding: latin1 -*-
-#
-# Copyright (C) 2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below this line (except for experimenting)
-
-import sys, psycopg2
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dns:", DSN
-
-conn = psycopg2.connect(DSN)
-print "Encoding for this connection is", conn.encoding
-
-curs = conn.cursor()
-curs.execute("SELECT %(foo)s AS foo", {'foo':'bar'})
-curs.execute("SELECT %(foo)s AS foo", {'foo':None})
-curs.execute("SELECT %(foo)s AS foo", {'foo':True})
-curs.execute("SELECT %(foo)s AS foo", {'foo':42})
-curs.execute("SELECT %(foo)s AS foo", {'foo':u'yatt�!'})
-curs.execute("SELECT %(foo)s AS foo", {'foo':u'bar'})
-
-print curs.mogrify("SELECT %(foo)s AS foo", {'foo':'bar'})
-print curs.mogrify("SELECT %(foo)s AS foo", {'foo':None})
-print curs.mogrify("SELECT %(foo)s AS foo", {'foo':True})
-print curs.mogrify("SELECT %(foo)s AS foo", {'foo':42})
-print curs.mogrify("SELECT %(foo)s AS foo", {'foo':u'yatt�!'})
-print curs.mogrify("SELECT %(foo)s AS foo", {'foo':u'bar'})
-
-conn.rollback()
+++ /dev/null
-"""
-Using a tuple as a bound variable in "SELECT ... IN (...)" clauses
-in PostgreSQL using psycopg 2
-
-Some time ago someone asked on the psycopg mailing list how to have a
-bound variable expand to the right SQL for an SELECT IN clause:
-
- SELECT * FROM atable WHERE afield IN (value1, value2, value3)
-
-with the values to be used in the IN clause to be passed to the cursor
-.execute() method in a tuple as a bound variable, i.e.:
-
- in_values = ("value1", "value2", "value3")
- curs.execute("SELECT ... IN %s", (in_values,))
-
-psycopg 1 does support typecasting from Python to PostgreSQL (and back)
-only for simple types and this problem has no elegant solution (short or
-writing a wrapper class returning the pre-quoted text in an __str__
-method.
-
-But psycopg 2 offers a simple and elegant solution by partially
-implementing the Object Adaptation from PEP 246. psycopg 2 (still in
-beta and currently labeled as 1.99.9) moves the type-casting logic into
-external adapters and a somehow broken adapt() function.
-
-While the original adapt() takes 3 arguments, psycopg's one only takes
-1: the bound variable to be adapted. The result is an object supporting
-a not-yet well defined protocol that we can call IPsycopgSQLQuote:
-
- class IPsycopgSQLQuote:
-
- def getquoted(self):
- "Returns a quoted string representing the bound variable."
-
- def getbinary(self):
- "Returns a binary quoted string representing the bound variable."
-
- def getbuffer(self):
- "Returns the wrapped object itself."
-
- __str__ = getquoted
-
-Then one of the functions (usually .getquoted()) is called by psycopg at
-the right time to obtain the right, sql-quoted representation for the
-corresponding bound variable.
-
-The nice part is that the default, built-in adapters, derived from
-psycopg 1 tyecasting code can be overridden by the programmer, simply
-replacing them in the psycopg.extensions.adapters dictionary.
-
-Then the solution to the original problem is now obvious: write an
-adapter that adapts tuple objects into the right SQL string, by calling
-recursively adapt() on each element.
-
-Note: psycopg 2 adapter code is still very young and will probably move
-to a more 'standard' (3 arguments) implementation for the adapt()
-function; as long as that does not slow down too much query execution.
-
-Psycopg 2 development can be tracked on the psycopg mailing list:
-
- http://lists.initd.org/mailman/listinfo/psycopg
-
-and on the psycopg 2 wiki:
-
- http://wiki.initd.org/Projects/Psycopg2
-
-"""
-
-import psycopg2
-import psycopg2.extensions
-from psycopg2.extensions import adapt as psycoadapt
-from psycopg2.extensions import register_adapter
-
-class AsIs(object):
- """An adapter that just return the object 'as is'.
-
- psycopg 1.99.9 has some optimizations that make impossible to call
- adapt() without adding some basic adapters externally. This limitation
- will be lifted in a future release.
- """
- def __init__(self, obj):
- self.__obj = obj
- def getquoted(self):
- return self.__obj
-
-class SQL_IN(object):
- """Adapt a tuple to an SQL quotable object."""
-
- def __init__(self, seq):
- self._seq = seq
-
- def prepare(self, conn):
- pass
-
- def getquoted(self):
- # this is the important line: note how every object in the
- # list is adapted and then how getquoted() is called on it
-
- qobjs = [str(psycoadapt(o).getquoted()) for o in self._seq]
-
- return '(' + ', '.join(qobjs) + ')'
-
- __str__ = getquoted
-
-
-# add our new adapter class to psycopg list of adapters
-register_adapter(tuple, SQL_IN)
-register_adapter(float, AsIs)
-register_adapter(int, AsIs)
-
-# usually we would call:
-#
-# conn = psycopg.connect("...")
-# curs = conn.cursor()
-# curs.execute("SELECT ...", (("this", "is", "the", "tuple"),))
-#
-# but we have no connection to a database right now, so we just check
-# the SQL_IN class by calling psycopg's adapt() directly:
-
-if __name__ == '__main__':
- print "Note how the string will be SQL-quoted, but the number will not:"
- print psycoadapt(("this is an 'sql quoted' str\\ing", 1, 2.0))
+++ /dev/null
-# notify.py - example of getting notifies
-#
-# Copyright (C) 2001-2005 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below tis line (except for experimenting)
-
-import sys
-import psycopg2
-import select
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dns:", DSN
-conn = psycopg2.connect(DSN)
-print "Encoding for this connection is", conn.encoding
-
-conn.set_isolation_level(0)
-curs = conn.cursor()
-
-curs.execute("listen test")
-
-print "Waiting for 'NOTIFY test'"
-while 1:
- if select.select([curs],[],[],5)==([],[],[]):
- print "Timeout"
- else:
- if curs.isready():
- print "Got NOTIFY: %s" % str(curs.connection.notifies.pop())
+++ /dev/null
-# simple.py - very simple example of plain DBAPI-2.0 usage
-# currently used as test-me-stress-me script for psycopg 2.0
-#
-# Copyright (C) 2001-2003 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below this line (except for experimenting)
-
-class SimpleQuoter(object):
- def sqlquote(x=None):
- return "'bar'"
-
-import sys
-import psycopg2
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dns:", DSN
-conn = psycopg2.connect(DSN)
-print "Encoding for this connection is", conn.encoding
-
-curs = conn.cursor()
-curs.execute("SELECT 1 AS foo")
-print curs.fetchone()
-curs.execute("SELECT 1 AS foo")
-print curs.fetchmany()
-curs.execute("SELECT 1 AS foo")
-print curs.fetchall()
-
-conn.rollback()
-
-sys.exit(0)
-
-curs.execute("SELECT 1 AS foo", async=1)
-
-curs.execute("SELECT %(foo)s AS foo", {'foo':'bar'})
-curs.execute("SELECT %(foo)s AS foo", {'foo':None})
-curs.execute("SELECT %(foo)f AS foo", {'foo':42})
-curs.execute("SELECT %(foo)s AS foo", {'foo':SimpleQuoter()})
+++ /dev/null
-# threads.py -- example of multiple threads using psycopg
-# -*- encoding: latin1 -*-
-#
-# Copyright (C) 2001-2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## some others parameters
-INSERT_THREADS = ('A', 'B', 'C')
-SELECT_THREADS = ('1', '2')
-
-ROWS = 1000
-
-COMMIT_STEP = 20
-SELECT_SIZE = 10000
-SELECT_STEP = 500
-SELECT_DIV = 250
-
-# the available modes are:
-# 0 - one connection for all insert and one for all select threads
-# 1 - connections generated using the connection pool
-
-MODE = 1
-
-## don't modify anything below tis line (except for experimenting)
-
-import sys, psycopg2, threading
-from psycopg2.pool import ThreadedConnectionPool
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-if len(sys.argv) > 2:
- MODE = int(sys.argv[2])
-
-print "Opening connection using dns:", DSN
-conn = psycopg2.connect(DSN)
-curs = conn.cursor()
-
-try:
- curs.execute("""CREATE TABLE test_threads (
- name text, value1 int4, value2 float)""")
-except:
- conn.rollback()
- curs.execute("DROP TABLE test_threads")
- curs.execute("""CREATE TABLE test_threads (
- name text, value1 int4, value2 float)""")
-conn.commit()
-
-
-## this function inserts a big number of rows and creates and destroys
-## a large number of cursors
-
-def insert_func(conn_or_pool, rows):
- name = threading.currentThread().getName()
-
- if MODE == 0:
- conn = conn_or_pool
- else:
- conn = conn_or_pool.getconn()
-
- for i in range(rows):
- if divmod(i, COMMIT_STEP)[1] == 0:
- conn.commit()
- if MODE == 1:
- conn_or_pool.putconn(conn)
- s = name + ": COMMIT STEP " + str(i)
- print s
- if MODE == 1:
- conn = conn_or_pool.getconn()
- c = conn.cursor()
- try:
- c.execute("INSERT INTO test_threads VALUES (%s, %s, %s)",
- (str(i), i, float(i)))
- except psycopg2.ProgrammingError, err:
- print name, ": an error occurred; skipping this insert"
- print err
- conn.commit()
-
-## a nice select function that prints the current number of rows in the
-## database (and transefer them, putting some pressure on the network)
-
-def select_func(conn_or_pool, z):
- name = threading.currentThread().getName()
-
- if MODE == 0:
- conn = conn_or_pool
- conn.set_isolation_level(0)
-
- for i in range(SELECT_SIZE):
- if divmod(i, SELECT_STEP)[1] == 0:
- try:
- if MODE == 1:
- conn = conn_or_pool.getconn()
- conn.set_isolation_level(0)
- c = conn.cursor()
- c.execute("SELECT * FROM test_threads WHERE value2 < %s",
- (int(i/z),))
- l = c.fetchall()
- if MODE == 1:
- conn_or_pool.putconn(conn)
- s = name + ": number of rows fetched: " + str(len(l))
- print s
- except psycopg2.ProgrammingError, err:
- print name, ": an error occurred; skipping this select"
- print err
-
-## create the connection pool or the connections
-if MODE == 0:
- conn_insert = psycopg2.connect(DSN)
- conn_select = psycopg2.connect(DSN)
-else:
- m = len(INSERT_THREADS) + len(SELECT_THREADS)
- n = m/2
- conn_insert = conn_select = ThreadedConnectionPool(n, m, DSN)
-
-## create the threads
-threads = []
-
-print "Creating INSERT threads:"
-for name in INSERT_THREADS:
- t = threading.Thread(None, insert_func, 'Thread-'+name,
- (conn_insert, ROWS))
- t.setDaemon(0)
- threads.append(t)
-
-print "Creating SELECT threads:"
-for name in SELECT_THREADS:
- t = threading.Thread(None, select_func, 'Thread-'+name,
- (conn_select, SELECT_DIV))
- t.setDaemon(0)
- threads.append(t)
-
-## really start the threads now
-for t in threads:
- t.start()
-
-# and wait for them to finish
-for t in threads:
- t.join()
- print t.getName(), "exited OK"
-
-
-conn.commit()
-curs.execute("SELECT count(name) FROM test_threads")
-print "Inserted", curs.fetchone()[0], "rows."
-
-curs.execute("DROP TABLE test_threads")
-conn.commit()
+++ /dev/null
-# tz.py - example of datetime objects with time zones
-# -*- encoding: utf8 -*-
-#
-# Copyright (C) 2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below this line (except for experimenting)
-
-import sys
-import psycopg2
-import datetime
-
-from psycopg2.tz import ZERO, LOCAL, FixedOffsetTimezone
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dns:", DSN
-conn = psycopg2.connect(DSN)
-curs = conn.cursor()
-
-try:
- curs.execute("CREATE TABLE test_tz (t timestamp with time zone)")
-except:
- conn.rollback()
- curs.execute("DROP TABLE test_tz")
- curs.execute("CREATE TABLE test_tz (t timestamp with time zone)")
-conn.commit()
-
-d = datetime.datetime(1971, 10, 19, 22, 30, 0, tzinfo=LOCAL)
-curs.execute("INSERT INTO test_tz VALUES (%s)", (d,))
-print "Inserted timestamp with timezone:", d
-print "Time zone:", d.tzinfo.tzname(d), "offset:", d.tzinfo.utcoffset(d)
-
-tz = FixedOffsetTimezone(-5*60, "EST")
-d = datetime.datetime(1971, 10, 19, 22, 30, 0, tzinfo=tz)
-curs.execute("INSERT INTO test_tz VALUES (%s)", (d,))
-print "Inserted timestamp with timezone:", d
-print "Time zone:", d.tzinfo.tzname(d), "offset:", d.tzinfo.utcoffset(d)
-
-curs.execute("SELECT * FROM test_tz")
-d = curs.fetchone()[0]
-curs.execute("INSERT INTO test_tz VALUES (%s)", (d,))
-print "Inserted SELECTed timestamp:", d
-print "Time zone:", d.tzinfo.tzname(d), "offset:", d.tzinfo.utcoffset(d)
-
-curs.execute("SELECT * FROM test_tz")
-for d in curs:
- u = d[0].utcoffset() or ZERO
- print "UTC time: ", d[0] - u
- print "Local time:", d[0]
- print "Time zone:", d[0].tzinfo.tzname(d[0]), d[0].tzinfo.utcoffset(d[0])
-
-
-curs.execute("DROP TABLE test_tz")
-conn.commit()
+++ /dev/null
-# usercast.py -- example of user defined typecasters
-# -*- encoding: latin-1 -*-
-#
-# Copyright (C) 2001-2005 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-## put in DSN your DSN string
-
-DSN = 'dbname=test'
-
-## don't modify anything below tis line (except for experimenting)
-
-import sys
-import psycopg2
-import psycopg2.extensions
-import whrandom
-
-# importing psycopg.extras will give us a nice tuple adapter: this is wrong
-# because the adapter is meant to be used in SQL IN clauses while we use
-# tuples to represent points but it works and the example is about Rect, not
-# "Point"
-import psycopg2.extras
-
-if len(sys.argv) > 1:
- DSN = sys.argv[1]
-
-print "Opening connection using dns:", DSN
-conn = psycopg2.connect(DSN)
-print "Initial encoding for this connection is", conn.encoding
-
-curs = conn.cursor()
-try:
- curs.execute("CREATE TABLE test_cast (p1 point, p2 point, b box)")
-except:
- conn.rollback()
- curs.execute("DROP TABLE test_cast")
- curs.execute("CREATE TABLE test_cast (p1 point, p2 point, b box)")
-conn.commit()
-
-# this is the callable object we use as a typecast (the typecast is
-# usually a function, but we use a class, just to demonstrate the
-# flexibility of the psycopg casting system
-
-class Rect(object):
- """Very simple rectangle.
-
- Note that we use this type as a data holder, as an adapter of itself for
- the ISQLQuote protocol used by psycopg's adapt() (see __confrom__ below)
- and eventually as a type-caster for the data extracted from the database
- (that's why __init__ takes the curs argument.)
- """
-
- def __init__(self, s=None, curs=None):
- """Init the rectangle from the optional string s."""
- self.x = self.y = self.width = self.height = 0.0
- if s: self.from_string(s)
-
- def __conform__(self, proto):
- """This is a terrible hack, just ignore proto and return self."""
- if proto == psycopg2.extensions.ISQLQuote:
- return self
-
- def from_points(self, x0, y0, x1, y1):
- """Init the rectangle from points."""
- if x0 > x1: (x0, x1) = (x1, x0)
- if y0 > y1: (y0, y1) = (y1, y0)
- self.x = x0
- self.y = y0
- self.width = x1 - x0
- self.height = y1 - y0
-
- def from_string(self, s):
- """Init the rectangle from a string."""
- seq = eval(s)
- self.from_points(seq[0][0], seq[0][1], seq[1][0], seq[1][1])
-
- def getquoted(self):
- """Format self as a string usable by the db to represent a box."""
- s = "'((%d,%d),(%d,%d))'" % (
- self.x, self.y, self.x + self.width, self.y + self.height)
- return s
-
- def show(self):
- """Format a description of the box."""
- s = "X: %d\tY: %d\tWidth: %d\tHeight: %d" % (
- self.x, self.y, self.width, self.height)
- return s
-
-# here we select from the empty table, just to grab the description
-curs.execute("SELECT b FROM test_cast WHERE 0=1")
-boxoid = curs.description[0][1]
-print "Oid for the box datatype is", boxoid
-
-# and build the user cast object
-BOX = psycopg2.extensions.new_type((boxoid,), "BOX", Rect)
-psycopg2.extensions.register_type(BOX)
-
-# now insert 100 random data (2 points and a box in each row)
-for i in range(100):
- p1 = (whrandom.randint(0,100), whrandom.randint(0,100))
- p2 = (whrandom.randint(0,100), whrandom.randint(0,100))
- b = Rect()
- b.from_points(whrandom.randint(0,100), whrandom.randint(0,100),
- whrandom.randint(0,100), whrandom.randint(0,100))
- curs.execute("INSERT INTO test_cast VALUES ('%(p1)s', '%(p2)s', %(box)s)",
- {'box':b, 'p1':p1, 'p2':p2})
-print "Added 100 boxed to the database"
-
-# select and print all boxes with at least one point inside
-curs.execute("SELECT b FROM test_cast WHERE p1 @ b OR p2 @ b")
-boxes = curs.fetchall()
-print "Found %d boxes with at least a point inside:" % len(boxes)
-for box in boxes:
- print " ", box[0].show()
-
-curs.execute("DROP TABLE test_cast")
-conn.commit()
+++ /dev/null
-"""A Python driver for PostgreSQL
-
-psycopg is a PostgreSQL_ database adapter for the Python_ programming
-language. This is version 2, a complete rewrite of the original code to
-provide new-style classes for connection and cursor objects and other sweet
-candies. Like the original, psycopg 2 was written with the aim of being very
-small and fast, and stable as a rock.
-
-Homepage: http://initd.org/projects/psycopg2
-
-.. _PostgreSQL: http://www.postgresql.org/
-.. _Python: http://www.python.org/
-
-:Groups:
- * `Connections creation`: connect
- * `Value objects constructors`: Binary, Date, DateFromTicks, Time,
- TimeFromTicks, Timestamp, TimestampFromTicks
-"""
-# psycopg/__init__.py - initialization of the psycopg module
-#
-# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-# Import modules needed by _psycopg to allow tools like py2exe to do
-# their work without bothering about the module dependencies.
-#
-# TODO: we should probably use the Warnings framework to signal a missing
-# module instead of raising an exception (in case we're running a thin
-# embedded Python or something even more devious.)
-
-import sys, warnings
-if sys.version_info[0] >= 2 and sys.version_info[1] >= 3:
- try:
- import datetime as _psycopg_needs_datetime
- except:
- warnings.warn(
- "can't import datetime module probably needed by _psycopg",
- RuntimeWarning)
-if sys.version_info[0] >= 2 and sys.version_info[1] >= 4:
- try:
- import decimal as _psycopg_needs_decimal
- except:
- warnings.warn(
- "can't import decimal module probably needed by _psycopg",
- RuntimeWarning)
-from psycopg2 import tz
-del sys, warnings
-
-# Import the DBAPI-2.0 stuff into top-level module.
-
-from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
-
-from _psycopg import Binary, Date, Time, Timestamp
-from _psycopg import DateFromTicks, TimeFromTicks, TimestampFromTicks
-
-from _psycopg import Error, Warning, DataError, DatabaseError, ProgrammingError
-from _psycopg import IntegrityError, InterfaceError, InternalError
-from _psycopg import NotSupportedError, OperationalError
-
-from _psycopg import connect, apilevel, threadsafety, paramstyle
-from _psycopg import __version__
-
-__all__ = [ k for k in locals().keys() if not k.startswith('_') ]
+++ /dev/null
-"""psycopg extensions to the DBAPI-2.0
-
-This module holds all the extensions to the DBAPI-2.0 provided by psycopg.
-
-- `connection` -- the new-type inheritable connection class
-- `cursor` -- the new-type inheritable cursor class
-- `adapt()` -- exposes the PEP-246_ compatible adapting mechanism used
- by psycopg to adapt Python types to PostgreSQL ones
-
-.. _PEP-246: http://www.python.org/peps/pep-0246.html
-"""
-# psycopg/extensions.py - DBAPI-2.0 extensions specific to psycopg
-#
-# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-from _psycopg import UNICODE, INTEGER, LONGINTEGER, BOOLEAN, FLOAT
-from _psycopg import TIME, DATE, INTERVAL
-
-from _psycopg import Boolean, QuotedString, AsIs
-try:
- from _psycopg import DateFromMx, TimeFromMx, TimestampFromMx
- from _psycopg import IntervalFromMx
-except:
- pass
-try:
- from _psycopg import DateFromPy, TimeFromPy, TimestampFromPy
- from _psycopg import IntervalFromPy
-except:
- pass
-
-from _psycopg import adapt, adapters, encodings, connection, cursor
-from _psycopg import string_types, binary_types, new_type, register_type
-from _psycopg import ISQLQuote
-
-"""Isolation level values."""
-ISOLATION_LEVEL_AUTOCOMMIT = 0
-ISOLATION_LEVEL_READ_COMMITTED = 1
-ISOLATION_LEVEL_SERIALIZABLE = 2
-
-# PostgreSQL maps the the other standard values to already defined levels
-ISOLATION_LEVEL_REPEATABLE_READ = ISOLATION_LEVEL_SERIALIZABLE
-ISOLATION_LEVEL_READ_UNCOMMITTED = ISOLATION_LEVEL_READ_COMMITTED
-
-"""Transaction status values."""
-STATUS_SETUP = 0
-STATUS_READY = 1
-STATUS_BEGIN = 2
-STATUS_SYNC = 3
-STATUS_ASYNC = 4
-
-# This is a usefull mnemonic to check if the connection is in a transaction
-STATUS_IN_TRANSACTION = STATUS_BEGIN
-
-
-def register_adapter(typ, callable):
- """Register 'callable' as an ISQLQuote adapter for type 'typ'."""
- adapters[(typ, ISQLQuote)] = callable
-
-__all__ = [ k for k in locals().keys() if not k.startswith('_') ]
+++ /dev/null
-"""Miscellaneous goodies for psycopg2
-
-This module is a generic place used to hold little helper functions
-and classes untill a better place in the distribution is found.
-"""
-# psycopg/extras.py - miscellaneous extra goodies for psycopg
-#
-# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-import os
-import time
-
-try:
- import logging
-except:
- logging = None
-
-from psycopg2.extensions import cursor as _cursor
-from psycopg2.extensions import connection as _connection
-from psycopg2.extensions import register_adapter as _RA
-from psycopg2.extensions import adapt as _A
-
-
-class DictConnection(_connection):
- """A connection that uses DictCursor automatically."""
- def cursor(self):
- return _connection.cursor(self, cursor_factory=DictCursor)
-
-class DictCursor(_cursor):
- """A cursor that keeps a list of column name -> index mappings."""
-
- __query_executed = 0
-
- def execute(self, query, vars=None, async=0):
- self.row_factory = DictRow
- self.index = {}
- self.__query_executed = 1
- return _cursor.execute(self, query, vars, async)
-
- def callproc(self, procname, vars=None):
- self.row_factory = DictRow
- self.index = {}
- self.__query_executed = 1
- return _cursor.callproc(self, procname, vars)
-
- def _build_index(self):
- if self.__query_executed == 1 and self.description:
- for i in range(len(self.description)):
- self.index[self.description[i][0]] = i
- self.__query_executed = 0
-
- def fetchone(self):
- res = _cursor.fetchone(self)
- if self.__query_executed:
- self._build_index()
- return res
-
- def fetchmany(self, size=None):
- res = _cursor.fetchmany(self, size)
- if self.__query_executed:
- self._build_index()
- return res
-
- def fetchall(self):
- res = _cursor.fetchall(self)
- if self.__query_executed:
- self._build_index()
- return res
-
- def next(self):
- res = _cursor.fetchone(self)
- if res is None:
- raise StopIteration()
- if self.__query_executed:
- self._build_index()
- return res
-
-class DictRow(list):
- """A row object that allow by-colun-name access to data."""
-
- def __init__(self, cursor):
- self._index = cursor.index
- self[:] = [None] * len(cursor.description)
-
- def __getitem__(self, x):
- if type(x) != int:
- x = self._index[x]
- return list.__getitem__(self, x)
-
- def items(self):
- res = []
- for n, v in self._index.items():
- res.append((n, list.__getitem__(self, v)))
- return res
-
- def keys(self):
- return self._index.keys()
-
- def values(self):
- return tuple(self[:])
-
- def has_key(self, x):
- return self._index.has_key(x)
-
- def get(self, x, default=None):
- try:
- return self[x]
- except:
- return default
-
-
-class SQL_IN(object):
- """Adapt any iterable to an SQL quotable object."""
-
- def __init__(self, seq):
- self._seq = seq
-
- def prepare(self, conn):
- self._conn = conn
-
- def getquoted(self):
- # this is the important line: note how every object in the
- # list is adapted and then how getquoted() is called on it
- pobjs = [_A(o) for o in self._seq]
- for obj in pobjs:
- if hasattr(obj, 'prepare'):
- obj.prepare(self._conn)
- qobjs = [str(o.getquoted()) for o in pobjs]
- return '(' + ', '.join(qobjs) + ')'
-
- __str__ = getquoted
-
-_RA(tuple, SQL_IN)
-
-
-class LoggingConnection(_connection):
- """A connection that logs all queries to a file or logger object."""
-
- def initialize(self, logobj):
- """Initialize the connection to log to `logobj`.
-
- The `logobj` parameter can be an open file object or a Logger instance
- from the standard logging module.
- """
- self._logobj = logobj
- if logging and isinstance(logobj, logging.Logger):
- self.log = self._logtologger
- else:
- self.log = self._logtofile
-
- def filter(self, msg, curs):
- """Filter the query before logging it.
-
- This is the method to overwrite to filter unwanted queries out of the
- log or to add some extra data to the output. The default implementation
- just does nothing.
- """
- return msg
-
- def _logtofile(self, msg, curs):
- msg = self.filter(msg, curs)
- if msg: self._logobj.write(msg + os.linesep)
-
- def _logtologger(self, msg, curs):
- msg = self.filter(msg, curs)
- if msg: self._logobj.debug(msg)
-
- def _check(self):
- if not hasattr(self, '_logobj'):
- raise self.ProgrammingError(
- "LoggingConnection object has not been initialize()d")
-
- def cursor(self):
- self._check()
- return _connection.cursor(self, cursor_factory=LoggingCursor)
-
-class LoggingCursor(_cursor):
- """A cursor that logs queries using its connection logging facilities."""
-
- def execute(self, query, vars=None, async=0):
- try:
- return _cursor.execute(self, query, vars, async)
- finally:
- self.connection.log(self.query, self)
-
- def callproc(self, procname, vars=None):
- try:
- return _cursor.callproc(self, procname, vars)
- finally:
- self.connection.log(self.query, self)
-
-
-class MinTimeLoggingConnection(LoggingConnection):
- """A connection that logs queries based on execution time.
-
- This is just an example of how to sub-class LoggingConnection to provide
- some extra filtering for the logged queries. Both the `.inizialize()` and
- `.filter()` methods are overwritten to make sure that only queries
- executing for more than `mintime` ms are logged.
-
- Note that this connection uses the specialized cursor MinTimeLoggingCursor.
- """
- def initialize(self, logobj, mintime=0):
- LoggingConnection.initialize(self, logobj)
- self._mintime = mintime
-
- def filter(self, msg, curs):
- t = (time.time() - curs.timestamp) * 1000
- if t > self._mintime:
- return msg + os.linesep + " (execution time: %d ms)" % t
-
- def cursor(self):
- self._check()
- return _connection.cursor(self, cursor_factory=MinTimeLoggingCursor)
-
-class MinTimeLoggingCursor(LoggingCursor):
- """The cursor sub-class companion to MinTimeLoggingConnection."""
-
- def execute(self, query, vars=None, async=0):
- self.timestamp = time.time()
- return LoggingCursor.execute(self, query, vars, async)
-
- def callproc(self, procname, vars=None):
- self.timestamp = time.time()
- return LoggingCursor.execute(self, procname, var)
+++ /dev/null
-"""Connection pooling for psycopg2
-
-This module implements thread-safe (and not) connection pools.
-"""
-# psycopg/pool.py - pooling code for psycopg
-#
-# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-import psycopg2
-
-try:
- import logging
- # do basic initialization if the module is not already initialized
- logging.basicConfig(level=logging.INFO,
- format='%(asctime)s %(levelname)s %(message)s')
- # create logger object for psycopg2 module and sub-modules
- _logger = logging.getLogger("psycopg2")
- def dbg(*args):
- _logger.debug("psycopg2", ' '.join([str(x) for x in args]))
- try:
- import App # does this make sure that we're running in Zope?
- _logger.info("installed. Logging using Python logging module")
- except:
- _logger.debug("installed. Logging using Python logging module")
-
-except ImportError:
- from zLOG import LOG, DEBUG, INFO
- def dbg(*args):
- LOG('ZPsycopgDA', DEBUG, "",
- ' '.join([str(x) for x in args])+'\n')
- LOG('ZPsycopgDA', INFO, "Installed", "Logging using Zope's zLOG\n")
-
-except:
- import sys
- def dbg(*args):
- sys.stderr.write(' '.join(args)+'\n')
-
-
-class PoolError(psycopg2.Error):
- pass
-
-
-class AbstractConnectionPool(object):
- """Generic key-based pooling code."""
-
- def __init__(self, minconn, maxconn, *args, **kwargs):
- """Initialize the connection pool.
-
- New 'minconn' connections are created immediately calling 'connfunc'
- with given parameters. The connection pool will support a maximum of
- about 'maxconn' connections.
- """
- self.minconn = minconn
- self.maxconn = maxconn
- self.closed = False
-
- self._args = args
- self._kwargs = kwargs
-
- self._pool = []
- self._used = {}
- self._rused = {} # id(conn) -> key map
- self._keys = 0
-
- for i in range(self.minconn):
- self._connect()
-
- def _connect(self, key=None):
- """Create a new connection and assign it to 'key' if not None."""
- conn = psycopg2.connect(*self._args, **self._kwargs)
- if key is not None:
- self._used[key] = conn
- self._rused[id(conn)] = key
- else:
- self._pool.append(conn)
- return conn
-
- def _getkey(self):
- """Return a new unique key."""
- self._keys += 1
- return self._keys
-
- def _getconn(self, key=None):
- """Get a free connection and assign it to 'key' if not None."""
- if self.closed: raise PoolError("connection pool is closed")
- if key is None: key = self._getkey()
-
- if self._used.has_key(key):
- return self._used[key]
-
- if self._pool:
- self._used[key] = conn = self._pool.pop()
- self._rused[id(conn)] = key
- return conn
- else:
- if len(self._used) == self.maxconn:
- raise PoolError("connection pool exausted")
- return self._connect(key)
-
- def _putconn(self, conn, key=None, close=False):
- """Put away a connection."""
- if self.closed: raise PoolError("connection pool is closed")
- if key is None: key = self._rused[id(conn)]
-
- if not key:
- raise PoolError("trying to put unkeyed connection")
-
- if len(self._pool) < self.minconn and not close:
- self._pool.append(conn)
- else:
- conn.close()
-
- # here we check for the presence of key because it can happen that a
- # thread tries to put back a connection after a call to close
- if not self.closed or key in self._used:
- del self._used[key]
- del self._rused[id(conn)]
-
- def _closeall(self):
- """Close all connections.
-
- Note that this can lead to some code fail badly when trying to use
- an already closed connection. If you call .closeall() make sure
- your code can deal with it.
- """
- if self.closed: raise PoolError("connection pool is closed")
- for conn in self._pool + list(self._used.values()):
- try:
- print "Closing connection", conn
- conn.close()
- except:
- pass
- self.closed = True
-
-
-class SimpleConnectionPool(AbstractConnectionPool):
- """A connection pool that can't be shared across different threads."""
-
- getconn = AbstractConnectionPool._getconn
- putconn = AbstractConnectionPool._putconn
- closeall = AbstractConnectionPool._closeall
-
-
-class ThreadedConnectionPool(AbstractConnectionPool):
- """A connection pool that works with the threading module."""
-
- def __init__(self, minconn, maxconn, *args, **kwargs):
- """Initialize the threading lock."""
- import threading
- AbstractConnectionPool.__init__(
- self, minconn, maxconn, *args, **kwargs)
- self._lock = threading.Lock()
-
- def getconn(self, key=None):
- """Get a free connection and assign it to 'key' if not None."""
- self._lock.acquire()
- try:
- return self._getconn(key)
- finally:
- self._lock.release()
-
- def putconn(self, conn=None, key=None, close=False):
- """Put away an unused connection."""
- self._lock.acquire()
- try:
- self._putconn(conn, key, close)
- finally:
- self._lock.release()
-
- def closeall(self):
- """Close all connections (even the one currently in use.)"""
- self._lock.acquire()
- try:
- self._closeall()
- finally:
- self._lock.release()
-
-
-class PersistentConnectionPool(AbstractConnectionPool):
- """A pool that assigns persistent connections to different threads.
-
- Note that this connection pool generates by itself the required keys
- using the current thread id. This means that untill a thread put away
- a connection it will always get the same connection object by successive
- .getconn() calls. This also means that a thread can't use more than one
- single connection from the pool.
- """
-
- def __init__(self, minconn, maxconn, *args, **kwargs):
- """Initialize the threading lock."""
- import threading
- AbstractConnectionPool.__init__(
- self, minconn, maxconn, *args, **kwargs)
- self._lock = threading.Lock()
-
- # we we'll need the thread module, to determine thread ids, so we
- # import it here and copy it in an instance variable
- import thread
- self.__thread = thread
-
- def getconn(self):
- """Generate thread id and return a connection."""
- key = self.__thread.get_ident()
- self._lock.acquire()
- try:
- return self._getconn(key)
- finally:
- self._lock.release()
-
- def putconn(self, conn=None, close=False):
- """Put away an unused connection."""
- key = self.__thread.get_ident()
- self._lock.acquire()
- try:
- if not conn: conn = self._used[key]
- self._putconn(conn, key, close)
- finally:
- self._lock.release()
-
- def closeall(self):
- """Close all connections (even the one currently in use.)"""
- self._lock.acquire()
- try:
- self._closeall()
- finally:
- self._lock.release()
+++ /dev/null
-"""psycopg 1.1.x compatibility module
-
-This module uses the new style connection and cursor types to build a psycopg
-1.1.1.x compatibility layer. It should be considered a temporary hack to run
-old code while porting to psycopg 2. Import it as follows::
-
- from psycopg2 import psycopg1 as psycopg
-"""
-# psycopg/psycopg1.py - psycopg 1.1.x compatibility module
-#
-# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-import _psycopg as _2psycopg
-from psycopg2.extensions import cursor as _2cursor
-from psycopg2.extensions import connection as _2connection
-
-from psycopg2 import *
-del connect
-
-
-def connect(*args, **kwargs):
- """connect(dsn, ...) -> new psycopg 1.1.x compatible connection object"""
- kwargs['connection_factory'] = connection
- conn = _2psycopg.connect(*args, **kwargs)
- conn.set_isolation_level(2)
- return conn
-
-class connection(_2connection):
- """psycopg 1.1.x connection."""
-
- def cursor(self):
- """cursor() -> new psycopg 1.1.x compatible cursor object"""
- return _2connection.cursor(self, cursor_factory=cursor)
-
- def autocommit(self, on_off=1):
- """autocommit(on_off=1) -> switch autocommit on (1) or off (0)"""
- if on_off > 0:
- self.set_isolation_level(0)
- else:
- self.set_isolation_level(2)
-
-
-class cursor(_2cursor):
- """psycopg 1.1.x cursor.
-
- Note that this cursor implements the exact procedure used by psycopg 1 to
- build dictionaries out of result rows. The DictCursor in the
- psycopg.extras modules implements a much better and faster algorithm.
- """
-
- def __build_dict(self, row):
- res = {}
- for i in range(len(self.description)):
- res[self.description[i][0]] = row[i]
- return res
-
- def dictfetchone(self):
- row = _2cursor.fetchone(self)
- if row:
- return self.__build_dict(row)
- else:
- return row
-
- def dictfetchmany(self, size):
- res = []
- rows = _2cursor.fetchmany(self, size)
- for row in rows:
- res.append(self.__build_dict(row))
- return res
-
- def dictfetchall(self):
- res = []
- rows = _2cursor.fetchall(self)
- for row in rows:
- res.append(self.__build_dict(row))
- return res
-
+++ /dev/null
-"""tzinfo implementations for psycopg2
-
-This module holds two different tzinfo implementations that can be used as
-the 'tzinfo' argument to datetime constructors, directly passed to psycopg
-functions or used to set the .tzinfo_factory attribute in cursors.
-"""
-# psycopg/tz.py - tzinfo implementation
-#
-# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-import datetime
-import time
-
-
-ZERO = datetime.timedelta(0)
-
-class FixedOffsetTimezone(datetime.tzinfo):
- """Fixed offset in minutes east from UTC.
-
- This is exactly the implementation found in Python 2.3.x documentation,
- with a small change to the __init__ method to allow for pickling and a
- default name in the form 'sHH:MM' ('s' is the sign.)
- """
- _name = None
- _offset = ZERO
-
- def __init__(self, offset=None, name=None):
- if offset is not None:
- self._offset = datetime.timedelta(minutes = offset)
- if name is not None:
- self._name = name
-
- def utcoffset(self, dt):
- return self._offset
-
- def tzname(self, dt):
- if self._name is not None:
- return self._name
- else:
- seconds = self._offset.seconds + self._offset.days * 86400
- hours, seconds = divmod(seconds, 3600)
- minutes = seconds/60
- if minutes:
- return "%+03d:%d" % (hours, minutes)
- else:
- return "%+03d" % hours
-
- def dst(self, dt):
- return ZERO
-
-
-STDOFFSET = datetime.timedelta(seconds = -time.timezone)
-if time.daylight:
- DSTOFFSET = datetime.timedelta(seconds = -time.altzone)
-else:
- DSTOFFSET = STDOFFSET
-DSTDIFF = DSTOFFSET - STDOFFSET
-
-class LocalTimezone(datetime.tzinfo):
- """Platform idea of local timezone.
-
- This is the exact implementation from the Pyhton 2.3 documentation.
- """
-
- def utcoffset(self, dt):
- if self._isdst(dt):
- return DSTOFFSET
- else:
- return STDOFFSET
-
- def dst(self, dt):
- if self._isdst(dt):
- return DSTDIFF
- else:
- return ZERO
-
- def tzname(self, dt):
- return time.tzname[self._isdst(dt)]
-
- def _isdst(self, dt):
- tt = (dt.year, dt.month, dt.day,
- dt.hour, dt.minute, dt.second,
- dt.weekday(), 0, -1)
- stamp = time.mktime(tt)
- tt = time.localtime(stamp)
- return tt.tm_isdst > 0
-
-LOCAL = LocalTimezone()
-
-# TODO: pre-generate some interesting time zones?
+++ /dev/null
-/* adapter_asis.c - adapt types as they are
- *
- * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <structmember.h>
-#include <stringobject.h>
-#include <string.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/adapter_asis.h"
-#include "psycopg/microprotocols_proto.h"
-
-/** the AsIs object **/
-
-static PyObject *
-asis_str(asisObject *self)
-{
- if (self->wrapped == Py_None) {
- return PyString_FromString("NULL");
- }
- else {
- return PyObject_Str(self->wrapped);
- }
-}
-
-PyObject *
-asis_getquoted(asisObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
- return asis_str(self);
-}
-
-PyObject *
-asis_conform(asisObject *self, PyObject *args)
-{
- PyObject *res, *proto;
-
- if (!PyArg_ParseTuple(args, "O", &proto)) return NULL;
-
- if (proto == (PyObject*)&isqlquoteType)
- res = (PyObject*)self;
- else
- res = Py_None;
-
- Py_INCREF(res);
- return res;
-}
-
-/** the AsIs object */
-
-/* object member list */
-
-static struct PyMemberDef asisObject_members[] = {
- {"adapted", T_OBJECT, offsetof(asisObject, wrapped), RO},
- {NULL}
-};
-
-/* object method table */
-
-static PyMethodDef asisObject_methods[] = {
- {"getquoted", (PyCFunction)asis_getquoted, METH_VARARGS,
- "getquoted() -> wrapped object value as SQL-quoted string"},
- {"__conform__", (PyCFunction)asis_conform, METH_VARARGS, NULL},
- {NULL} /* Sentinel */
-};
-
-/* initialization and finalization methods */
-
-static int
-asis_setup(asisObject *self, PyObject *obj)
-{
- Dprintf("asis_setup: init asis object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
-
- self->wrapped = obj;
- Py_INCREF(self->wrapped);
-
- Dprintf("asis_setup: good asis object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
- return 0;
-}
-
-static void
-asis_dealloc(PyObject* obj)
-{
- asisObject *self = (asisObject *)obj;
-
- Py_XDECREF(self->wrapped);
-
- Dprintf("asis_dealloc: deleted asis object at %p, refcnt = %d",
- obj, obj->ob_refcnt);
-
- obj->ob_type->tp_free(obj);
-}
-
-static int
-asis_init(PyObject *obj, PyObject *args, PyObject *kwds)
-{
- PyObject *o;
-
- if (!PyArg_ParseTuple(args, "O", &o))
- return -1;
-
- return asis_setup((asisObject *)obj, o);
-}
-
-static PyObject *
-asis_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- return type->tp_alloc(type, 0);
-}
-
-static void
-asis_del(PyObject* self)
-{
- PyObject_Del(self);
-}
-
-static PyObject *
-asis_repr(asisObject *self)
-{
- return PyString_FromFormat("<psycopg2._psycopg.AsIs object at %p>", self);
-}
-
-
-/* object type */
-
-#define asisType_doc \
-"AsIs(str) -> new AsIs adapter object"
-
-PyTypeObject asisType = {
- PyObject_HEAD_INIT(NULL)
- 0,
- "psycopg2._psycopg.AsIs",
- sizeof(asisObject),
- 0,
- asis_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
-
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
-
- 0, /*tp_compare*/
-
- (reprfunc)asis_repr, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
-
- 0, /*tp_call*/
- (reprfunc)asis_str, /*tp_str*/
-
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
-
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- asisType_doc, /*tp_doc*/
-
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
-
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
-
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
-
- /* Attribute descriptor and subclassing stuff */
-
- asisObject_methods, /*tp_methods*/
- asisObject_members, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
-
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
-
- asis_init, /*tp_init*/
- 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/
- asis_new, /*tp_new*/
- (freefunc)asis_del, /*tp_free Low-level free-memory routine */
- 0, /*tp_is_gc For PyObject_IS_GC */
- 0, /*tp_bases*/
- 0, /*tp_mro method resolution order */
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0 /*tp_weaklist*/
-};
-
-
-/** module-level functions **/
-
-PyObject *
-psyco_AsIs(PyObject *module, PyObject *args)
-{
- PyObject *obj;
-
- if (!PyArg_ParseTuple(args, "O", &obj))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&asisType, "O", obj);
-}
+++ /dev/null
-/* adapter_asis.h - definition for the psycopg AsIs type wrapper
- *
- * Copyright (C) 2003-2005 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_ASIS_H
-#define PSYCOPG_ASIS_H 1
-
-#include <Python.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern PyTypeObject asisType;
-
-typedef struct {
- PyObject HEAD;
-
- /* this is the real object we wrap */
- PyObject *wrapped;
-
-} asisObject;
-
-/* functions exported to psycopgmodule.c */
-
-extern PyObject *psyco_AsIs(PyObject *module, PyObject *args);
-#define psyco_AsIs_doc \
- "AsIs(obj) -> new AsIs wrapper object"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_ASIS_H) */
+++ /dev/null
-/* adapter_binary.c - Binary objects
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <structmember.h>
-#include <stringobject.h>
-
-#include <libpq-fe.h>
-#include <string.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/connection.h"
-#include "psycopg/adapter_binary.h"
-#include "psycopg/microprotocols_proto.h"
-
-/** the quoting code */
-
-#ifndef PSYCOPG_OWN_QUOTING
-static unsigned char *
-binary_escape(unsigned char *from, unsigned int from_length,
- unsigned int *to_length, PGconn *conn)
-{
-#if PG_MAJOR_VERSION > 8 || \
- (PG_MAJOR_VERSION == 8 && PG_MINOR_VERSION > 1) || \
- (PG_MAJOR_VERSION == 8 && PG_MINOR_VERSION == 1 && PG_PATCH_VERSION >= 4)
- if (conn)
- return PQescapeByteaConn(conn, from, from_length, to_length);
- else
-#endif
- return PQescapeBytea(from, from_length, to_length);
-}
-#else
-static unsigned char *
-binary_escape(unsigned char *from, unsigned int from_length,
- unsigned int *to_length, PGconn *conn)
-{
- unsigneed char *quoted, *chptr, *newptr;
- int i, space, new_space;
-
- space = from_length + 2;
-
- Py_BEGIN_ALLOW_THREADS;
-
- quoted = (unsigned char*)calloc(space, sizeof(char));
- if (quoted == NULL) return NULL;
-
- chptr = quoted;
-
- for (i=0; i < len; i++) {
- if (chptr - quoted > space - 6) {
- new_space = space * ((space) / (i + 1)) + 2 + 6;
- if (new_space - space < 1024) space += 1024;
- else space = new_space;
- newptr = (unsigned char *)realloc(quoted, space);
- if (newptr == NULL) {
- free(quoted);
- return NULL;
- }
- /* chptr has to be moved to the new location*/
- chptr = newptr + (chptr - quoted);
- quoted = newptr;
- Dprintf("binary_escape: reallocated %i bytes at %p", space,quoted);
- }
- if (from[i]) {
- if (from[i] >= ' ' && from[i] <= '~') {
- if (from[i] == '\'') {
- *chptr = '\'';
- chptr++;
- *chptr = '\'';
- chptr++;
- }
- else if (from[i] == '\\') {
- memcpy(chptr, "\\\\\\\\", 4);
- chptr += 4;
- }
- else {
- /* leave it as it is if ascii printable */
- *chptr = from[i];
- chptr++;
- }
- }
- else {
- unsigned char c;
-
- /* escape to octal notation \nnn */
- *chptr++ = '\\';
- *chptr++ = '\\';
- c = from[i];
- *chptr = ((c >> 6) & 0x07) + 0x30; chptr++;
- *chptr = ((c >> 3) & 0x07) + 0x30; chptr++;
- *chptr = ( c & 0x07) + 0x30; chptr++;
- }
- }
- else {
- /* escape null as \\000 */
- memcpy(chptr, "\\\\000", 5);
- chptr += 5;
- }
- }
- *chptr = '\0';
-
- Py_END_ALLOW_THREADS;
-
- *to_size = chptr - quoted + 1;
- return quoted;
-}
-#endif
-
-/* binary_quote - do the quote process on plain and unicode strings */
-
-static PyObject *
-binary_quote(binaryObject *self)
-{
- char *to;
- const char *buffer;
- int buffer_len;
- size_t len = 0;
-
- /* if we got a plain string or a buffer we escape it and save the buffer */
- if (PyString_Check(self->wrapped) || PyBuffer_Check(self->wrapped)) {
- /* escape and build quoted buffer */
- PyObject_AsCharBuffer(self->wrapped, &buffer, &buffer_len);
-
- to = (char *)binary_escape((unsigned char*)buffer, buffer_len, &len,
- self->conn ? ((connectionObject*)self->conn)->pgconn : NULL);
- if (to == NULL) {
- PyErr_NoMemory();
- return NULL;
- }
-
- if (len > 0)
- self->buffer = PyString_FromFormat("'%s'", to);
- else
- self->buffer = PyString_FromString("''");
- PQfreemem(to);
- }
-
- /* if the wrapped object is not a string or a buffer, this is an error */
- else {
- PyErr_SetString(PyExc_TypeError, "can't escape non-string object");
- return NULL;
- }
-
- return self->buffer;
-}
-
-/* binary_str, binary_getquoted - return result of quoting */
-
-static PyObject *
-binary_str(binaryObject *self)
-{
- if (self->buffer == NULL) {
- binary_quote(self);
- }
- Py_XINCREF(self->buffer);
- return self->buffer;
-}
-
-PyObject *
-binary_getquoted(binaryObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
- return binary_str(self);
-}
-
-PyObject *
-binary_prepare(binaryObject *self, PyObject *args)
-{
- connectionObject *conn;
-
- if (!PyArg_ParseTuple(args, "O", &conn))
- return NULL;
-
- Py_XDECREF(self->conn);
- if (conn) {
- self->conn = (PyObject*)conn;
- Py_INCREF(self->conn);
- }
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-PyObject *
-binary_conform(binaryObject *self, PyObject *args)
-{
- PyObject *res, *proto;
-
- if (!PyArg_ParseTuple(args, "O", &proto)) return NULL;
-
- if (proto == (PyObject*)&isqlquoteType)
- res = (PyObject*)self;
- else
- res = Py_None;
-
- Py_INCREF(res);
- return res;
-}
-
-/** the Binary object **/
-
-/* object member list */
-
-static struct PyMemberDef binaryObject_members[] = {
- {"adapted", T_OBJECT, offsetof(binaryObject, wrapped), RO},
- {"buffer", T_OBJECT, offsetof(binaryObject, buffer), RO},
- {NULL}
-};
-
-/* object method table */
-
-static PyMethodDef binaryObject_methods[] = {
- {"getquoted", (PyCFunction)binary_getquoted, METH_VARARGS,
- "getquoted() -> wrapped object value as SQL-quoted binary string"},
- {"prepare", (PyCFunction)binary_prepare, METH_VARARGS,
- "prepare(conn) -> prepare for binary encoding using conn"},
- {"__conform__", (PyCFunction)binary_conform, METH_VARARGS, NULL},
- {NULL} /* Sentinel */
-};
-
-/* initialization and finalization methods */
-
-static int
-binary_setup(binaryObject *self, PyObject *str)
-{
- Dprintf("binary_setup: init binary object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
-
- self->buffer = NULL;
- self->conn = NULL;
- self->wrapped = str;
- Py_INCREF(self->wrapped);
-
- Dprintf("binary_setup: good binary object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
- return 0;
-}
-
-static void
-binary_dealloc(PyObject* obj)
-{
- binaryObject *self = (binaryObject *)obj;
-
- Py_XDECREF(self->wrapped);
- Py_XDECREF(self->buffer);
- Py_XDECREF(self->conn);
-
- Dprintf("binary_dealloc: deleted binary object at %p, refcnt = %d",
- obj, obj->ob_refcnt);
-
- obj->ob_type->tp_free(obj);
-}
-
-static int
-binary_init(PyObject *obj, PyObject *args, PyObject *kwds)
-{
- PyObject *str;
-
- if (!PyArg_ParseTuple(args, "O", &str))
- return -1;
-
- return binary_setup((binaryObject *)obj, str);
-}
-
-static PyObject *
-binary_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- return type->tp_alloc(type, 0);
-}
-
-static void
-binary_del(PyObject* self)
-{
- PyObject_Del(self);
-}
-
-static PyObject *
-binary_repr(binaryObject *self)
-{
- return PyString_FromFormat("<psycopg2._psycopg.Binary object at %p>", self);
-}
-
-/* object type */
-
-#define binaryType_doc \
-"Binary(buffer) -> new binary object"
-
-PyTypeObject binaryType = {
- PyObject_HEAD_INIT(NULL)
- 0,
- "psycopg2._psycopg.Binary",
- sizeof(binaryObject),
- 0,
- binary_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
-
- 0, /*tp_compare*/
- (reprfunc)binary_repr, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
-
- 0, /*tp_call*/
- (reprfunc)binary_str, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
-
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
-
- binaryType_doc, /*tp_doc*/
-
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
-
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
-
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
-
- /* Attribute descriptor and subclassing stuff */
-
- binaryObject_methods, /*tp_methods*/
- binaryObject_members, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
-
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
-
- binary_init, /*tp_init*/
- 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/
- binary_new, /*tp_new*/
- (freefunc)binary_del, /*tp_free Low-level free-memory routine */
- 0, /*tp_is_gc For PyObject_IS_GC */
- 0, /*tp_bases*/
- 0, /*tp_mro method resolution order */
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0 /*tp_weaklist*/
-};
-
-
-/** module-level functions **/
-
-PyObject *
-psyco_Binary(PyObject *module, PyObject *args)
-{
- PyObject *str;
-
- if (!PyArg_ParseTuple(args, "O", &str))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&binaryType, "O", str);
-}
+++ /dev/null
-/* adapter_binary.h - definition for the Binary type
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_BINARY_H
-#define PSYCOPG_BINARY_H 1
-
-#include <Python.h>
-#include <libpq-fe.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern PyTypeObject binaryType;
-
-typedef struct {
- PyObject HEAD;
-
- PyObject *wrapped;
- PyObject *buffer;
- PyObject *conn;
-} binaryObject;
-
-/* functions exported to psycopgmodule.c */
-
-extern PyObject *psyco_Binary(PyObject *module, PyObject *args);
-#define psyco_Binary_doc \
- "Binary(buffer) -> new binary object\n\n" \
- "Build an object capable to hold a bynary string value."
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_BINARY_H) */
+++ /dev/null
-/* adapter_datetime.c - python date/time objects
- *
- * Copyright (C) 2004 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <structmember.h>
-#include <stringobject.h>
-#include <datetime.h>
-
-#include <time.h>
-#include <string.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/adapter_datetime.h"
-#include "psycopg/microprotocols_proto.h"
-
-
-/* the pointer to the datetime module API is initialized by the module init
- code, we just need to grab it */
-extern PyObject* pyDateTimeModuleP;
-extern PyObject *pyDateTypeP;
-extern PyObject *pyTimeTypeP;
-extern PyObject *pyDateTimeTypeP;
-extern PyObject *pyDeltaTypeP;
-
-extern PyObject *pyPsycopgTzModule;
-extern PyObject *pyPsycopgTzLOCAL;
-
-/* datetime_str, datetime_getquoted - return result of quoting */
-
-static PyObject *
-pydatetime_str(pydatetimeObject *self)
-{
- if (self->type <= PSYCO_DATETIME_TIMESTAMP) {
- PyObject *res = NULL;
- PyObject *iso = PyObject_CallMethod(self->wrapped, "isoformat", NULL);
- if (iso) {
- res = PyString_FromFormat("'%s'", PyString_AsString(iso));
- Py_DECREF(iso);
- }
- return res;
- }
- else {
- PyDateTime_Delta *obj = (PyDateTime_Delta*)self->wrapped;
-
- char buffer[8];
- int i;
- int a = obj->microseconds;
-
- for (i=0; i < 6 ; i++) {
- buffer[5-i] = '0' + (a % 10);
- a /= 10;
- }
- buffer[6] = '\0';
-
- return PyString_FromFormat("'%d days %d.%s seconds'",
- obj->days, obj->seconds, buffer);
- }
-}
-
-PyObject *
-pydatetime_getquoted(pydatetimeObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
- return pydatetime_str(self);
-}
-
-PyObject *
-pydatetime_conform(pydatetimeObject *self, PyObject *args)
-{
- PyObject *res, *proto;
-
- if (!PyArg_ParseTuple(args, "O", &proto)) return NULL;
-
- if (proto == (PyObject*)&isqlquoteType)
- res = (PyObject*)self;
- else
- res = Py_None;
-
- Py_INCREF(res);
- return res;
-}
-
-/** the DateTime wrapper object **/
-
-/* object member list */
-
-static struct PyMemberDef pydatetimeObject_members[] = {
- {"adapted", T_OBJECT, offsetof(pydatetimeObject, wrapped), RO},
- {"type", T_INT, offsetof(pydatetimeObject, type), RO},
- {NULL}
-};
-
-/* object method table */
-
-static PyMethodDef pydatetimeObject_methods[] = {
- {"getquoted", (PyCFunction)pydatetime_getquoted, METH_VARARGS,
- "getquoted() -> wrapped object value as SQL date/time"},
- {"__conform__", (PyCFunction)pydatetime_conform, METH_VARARGS, NULL},
- {NULL} /* Sentinel */
-};
-
-/* initialization and finalization methods */
-
-static int
-pydatetime_setup(pydatetimeObject *self, PyObject *obj, int type)
-{
- Dprintf("pydatetime_setup: init datetime object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
-
- self->type = type;
- self->wrapped = obj;
- Py_INCREF(self->wrapped);
-
- Dprintf("pydatetime_setup: good pydatetime object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
- return 0;
-}
-
-static void
-pydatetime_dealloc(PyObject* obj)
-{
- pydatetimeObject *self = (pydatetimeObject *)obj;
-
- Py_XDECREF(self->wrapped);
-
- Dprintf("mpydatetime_dealloc: deleted pydatetime object at %p, "
- "refcnt = %d", obj, obj->ob_refcnt);
-
- obj->ob_type->tp_free(obj);
-}
-
-static int
-pydatetime_init(PyObject *obj, PyObject *args, PyObject *kwds)
-{
- PyObject *dt;
- int type = -1; /* raise an error if type was not passed! */
-
- if (!PyArg_ParseTuple(args, "O|i", &dt, &type))
- return -1;
-
- return pydatetime_setup((pydatetimeObject *)obj, dt, type);
-}
-
-static PyObject *
-pydatetime_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- return type->tp_alloc(type, 0);
-}
-
-static void
-pydatetime_del(PyObject* self)
-{
- PyObject_Del(self);
-}
-
-static PyObject *
-pydatetime_repr(pydatetimeObject *self)
-{
- return PyString_FromFormat("<psycopg2._psycopg.datetime object at %p>",
- self);
-}
-
-/* object type */
-
-#define pydatetimeType_doc \
-"datetime(datetime, type) -> new datetime wrapper object"
-
-PyTypeObject pydatetimeType = {
- PyObject_HEAD_INIT(NULL)
- 0,
- "psycopg2._psycopg.datetime",
- sizeof(pydatetimeObject),
- 0,
- pydatetime_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
-
- 0, /*tp_compare*/
- (reprfunc)pydatetime_repr, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
-
- 0, /*tp_call*/
- (reprfunc)pydatetime_str, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
-
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
-
- pydatetimeType_doc, /*tp_doc*/
-
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
-
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
-
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
-
- /* Attribute descriptor and subclassing stuff */
-
- pydatetimeObject_methods, /*tp_methods*/
- pydatetimeObject_members, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
-
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
-
- pydatetime_init, /*tp_init*/
- 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/
- pydatetime_new, /*tp_new*/
- (freefunc)pydatetime_del, /*tp_free Low-level free-memory routine */
- 0, /*tp_is_gc For PyObject_IS_GC */
- 0, /*tp_bases*/
- 0, /*tp_mro method resolution order */
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0 /*tp_weaklist*/
-};
-
-
-/** module-level functions **/
-
-#ifdef PSYCOPG_DEFAULT_PYDATETIME
-
-PyObject *
-psyco_Date(PyObject *self, PyObject *args)
-{
- PyObject *res = NULL;
- int year, month, day;
-
- PyObject* obj = NULL;
-
- if (!PyArg_ParseTuple(args, "iii", &year, &month, &day))
- return NULL;
-
- obj = PyObject_CallFunction(pyDateTypeP, "iii", year, month, day);
-
- if (obj) {
- res = PyObject_CallFunction((PyObject *)&pydatetimeType,
- "Oi", obj, PSYCO_DATETIME_DATE);
- Py_DECREF(obj);
- }
-
- return res;
-}
-
-PyObject *
-psyco_Time(PyObject *self, PyObject *args)
-{
- PyObject *res = NULL;
- PyObject *tzinfo = NULL;
- int hours, minutes=0;
- double micro, seconds=0.0;
-
- PyObject* obj = NULL;
-
- if (!PyArg_ParseTuple(args, "iid|O", &hours, &minutes, &seconds,
- &tzinfo))
- return NULL;
-
- micro = (seconds - floor(seconds)) * 1000000.0;
-
- if (tzinfo == NULL)
- obj = PyObject_CallFunction(pyTimeTypeP, "iiii",
- hours, minutes, (int)round(seconds), (int)round(micro));
- else
- obj = PyObject_CallFunction(pyTimeTypeP, "iiiiO",
- hours, minutes, (int)round(seconds), (int)round(micro), tzinfo);
-
- if (obj) {
- res = PyObject_CallFunction((PyObject *)&pydatetimeType,
- "Oi", obj, PSYCO_DATETIME_TIME);
- Py_DECREF(obj);
- }
-
- return res;
-}
-
-PyObject *
-psyco_Timestamp(PyObject *self, PyObject *args)
-{
- PyObject *res = NULL;
- PyObject *tzinfo = NULL;
- int year, month, day;
- int hour=0, minute=0; /* default to midnight */
- double micro, second=0.0;
-
- PyObject* obj = NULL;
-
- if (!PyArg_ParseTuple(args, "lii|iidO", &year, &month, &day,
- &hour, &minute, &second, &tzinfo))
- return NULL;
-
- micro = (second - floor(second)) * 1000000.0;
-
- if (tzinfo == NULL)
- obj = PyObject_CallFunction(pyDateTimeTypeP, "iiiiiii",
- year, month, day, hour, minute, (int)round(second),
- (int)round(micro));
- else
- obj = PyObject_CallFunction(pyDateTimeTypeP, "iiiiiiiO",
- year, month, day, hour, minute, (int)round(second),
- (int)round(micro), tzinfo);
-
- if (obj) {
- res = PyObject_CallFunction((PyObject *)&pydatetimeType,
- "Oi", obj, PSYCO_DATETIME_TIMESTAMP);
- Py_DECREF(obj);
- }
-
- return res;
-}
-
-PyObject *
-psyco_DateFromTicks(PyObject *self, PyObject *args)
-{
- PyObject *res = NULL;
- struct tm tm;
- time_t t;
- double ticks;
-
- if (!PyArg_ParseTuple(args, "d", &ticks))
- return NULL;
-
- t = (time_t)round(ticks);
- if (localtime_r(&t, &tm)) {
- args = Py_BuildValue("iii", tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday);
- if (args) {
- res = psyco_Date(self, args);
- Py_DECREF(args);
- }
- }
- return res;
-}
-
-PyObject *
-psyco_TimeFromTicks(PyObject *self, PyObject *args)
-{
- PyObject *res = NULL;
- struct tm tm;
- time_t t;
- double ticks;
-
- if (!PyArg_ParseTuple(args,"d", &ticks))
- return NULL;
-
- t = (time_t)round(ticks);
- if (localtime_r(&t, &tm)) {
- args = Py_BuildValue("iid", tm.tm_hour, tm.tm_min, (double)tm.tm_sec);
- if (args) {
- res = psyco_Time(self, args);
- Py_DECREF(args);
- }
- }
- return res;
-}
-
-PyObject *
-psyco_TimestampFromTicks(PyObject *self, PyObject *args)
-{
- PyObject *res = NULL;
- struct tm tm;
- time_t t;
- double ticks;
-
- if (!PyArg_ParseTuple(args,"d", &ticks))
- return NULL;
-
- t = (time_t)round(ticks);
- if (localtime_r(&t, &tm)) {
- args = Py_BuildValue("iiiiidO",
- tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
- tm.tm_hour, tm.tm_min, (double)tm.tm_sec,
- pyPsycopgTzLOCAL);
- if (args) {
- res = psyco_Timestamp(self, args);
- Py_DECREF(args);
- }
- }
- return res;
-}
-
-#endif
-
-PyObject *
-psyco_DateFromPy(PyObject *self, PyObject *args)
-{
- PyObject *obj;
-
- if (!PyArg_ParseTuple(args, "O!", pyDateTypeP, &obj))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&pydatetimeType, "Oi", obj,
- PSYCO_DATETIME_DATE);
-}
-
-PyObject *
-psyco_TimeFromPy(PyObject *self, PyObject *args)
-{
- PyObject *obj;
-
- if (!PyArg_ParseTuple(args, "O!", pyTimeTypeP, &obj))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&pydatetimeType, "Oi", obj,
- PSYCO_DATETIME_TIME);
-}
-
-PyObject *
-psyco_TimestampFromPy(PyObject *self, PyObject *args)
-{
- PyObject *obj;
-
- if (!PyArg_ParseTuple(args, "O!", pyDateTimeTypeP, &obj))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&pydatetimeType, "Oi", obj,
- PSYCO_DATETIME_TIMESTAMP);
-}
-
-PyObject *
-psyco_IntervalFromPy(PyObject *self, PyObject *args)
-{
- PyObject *obj;
-
- if (!PyArg_ParseTuple(args, "O!", pyDeltaTypeP, &obj))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&pydatetimeType, "Oi", obj,
- PSYCO_DATETIME_INTERVAL);
-}
+++ /dev/null
-/* adapter_datetime.h - definition for the python date/time types
- *
- * Copyright (C) 2004 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_DATETIME_H
-#define PSYCOPG_DATETIME_H 1
-
-#include <Python.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern PyTypeObject pydatetimeType;
-
-typedef struct {
- PyObject HEAD;
-
- PyObject *wrapped;
- int type;
-#define PSYCO_DATETIME_TIME 0
-#define PSYCO_DATETIME_DATE 1
-#define PSYCO_DATETIME_TIMESTAMP 2
-#define PSYCO_DATETIME_INTERVAL 3
-
-} pydatetimeObject;
-
-
-/* functions exported to psycopgmodule.c */
-#ifdef PSYCOPG_DEFAULT_PYDATETIME
-
-extern PyObject *psyco_Date(PyObject *module, PyObject *args);
-#define psyco_Date_doc \
- "Date(year, month, day) -> new date\n\n" \
- "Build an object holding a date value."
-
-extern PyObject *psyco_Time(PyObject *module, PyObject *args);
-#define psyco_Time_doc \
- "Time(hour, minutes, seconds, tzinfo=None) -> new time\n\n" \
- "Build an object holding a time value."
-
-extern PyObject *psyco_Timestamp(PyObject *module, PyObject *args);
-#define psyco_Timestamp_doc \
- "Timestamp(year, month, day, hour, minutes, seconds, tzinfo=None) -> new timestamp\n\n" \
- "Build an object holding a timestamp value."
-
-extern PyObject *psyco_DateFromTicks(PyObject *module, PyObject *args);
-#define psyco_DateFromTicks_doc \
- "DateFromTicks(ticks) -> new date\n\n" \
- "Build an object holding a date value from the given ticks value.\n\n" \
- "Ticks are the number of seconds since the epoch; see the documentation " \
- "of the standard Python time module for details)."
-
-extern PyObject *psyco_TimeFromTicks(PyObject *module, PyObject *args);
-#define psyco_TimeFromTicks_doc \
- "TimeFromTicks(ticks) -> new time\n\n" \
- "Build an object holding a time value from the given ticks value.\n\n" \
- "Ticks are the number of seconds since the epoch; see the documentation " \
- "of the standard Python time module for details)."
-
-extern PyObject *psyco_TimestampFromTicks(PyObject *module, PyObject *args);
-#define psyco_TimestampFromTicks_doc \
- "TimestampFromTicks(ticks) -> new timestamp\n\n" \
- "Build an object holding a timestamp value from the given ticks value.\n\n" \
- "Ticks are the number of seconds since the epoch; see the documentation " \
- "of the standard Python time module for details)."
-
-#endif /* PSYCOPG_DEFAULT_PYDATETIME */
-
-extern PyObject *psyco_DateFromPy(PyObject *module, PyObject *args);
-#define psyco_DateFromPy_doc \
- "DateFromPy(datetime.date) -> new wrapper"
-
-extern PyObject *psyco_TimeFromPy(PyObject *module, PyObject *args);
-#define psyco_TimeFromPy_doc \
- "TimeFromPy(datetime.time) -> new wrapper"
-
-extern PyObject *psyco_TimestampFromPy(PyObject *module, PyObject *args);
-#define psyco_TimestampFromPy_doc \
- "TimestampFromPy(datetime.datetime) -> new wrapper"
-
-extern PyObject *psyco_IntervalFromPy(PyObject *module, PyObject *args);
-#define psyco_IntervalFromPy_doc \
- "IntervalFromPy(datetime.timedelta) -> new wrapper"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_DATETIME_H) */
+++ /dev/null
-/* adapter_list.c - python list objects
- *
- * Copyright (C) 2004-2005 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <structmember.h>
-#include <stringobject.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/adapter_list.h"
-#include "psycopg/microprotocols.h"
-#include "psycopg/microprotocols_proto.h"
-
-
-/* list_str, list_getquoted - return result of quoting */
-
-static PyObject *
-list_quote(listObject *self)
-{
- /* adapt the list by calling adapt() recursively and then wrapping
- everything into "ARRAY[]" */
- PyObject *tmp = NULL, *str = NULL, *joined = NULL, *res = NULL;
- int i, len;
-
- len = PyList_GET_SIZE(self->wrapped);
-
- /* empty arrays are converted to NULLs (still searching for a way to
- insert an empty array in postgresql */
- if (len == 0) return PyString_FromString("'{}'");
-
- tmp = PyTuple_New(len);
-
- for (i=0; i<len; i++) {
- PyObject *quoted =
- microprotocol_getquoted(PyList_GET_ITEM(self->wrapped, i),
- (connectionObject*)self->connection);
- if (quoted == NULL) goto error;
-
- /* here we don't loose a refcnt: SET_ITEM does not change the
- reference count and we are just transferring ownership of the tmp
- object to the tuple */
- PyTuple_SET_ITEM(tmp, i, quoted);
- }
-
- /* now that we have a tuple of adapted objects we just need to join them
- and put "ARRAY[] around the result */
- str = PyString_FromString(", ");
- joined = PyObject_CallMethod(str, "join", "(O)", tmp);
- if (joined == NULL) goto error;
-
- res = PyString_FromFormat("ARRAY[%s]", PyString_AsString(joined));
-
- error:
- Py_XDECREF(tmp);
- Py_XDECREF(str);
- Py_XDECREF(joined);
- return res;
-}
-
-PyObject *
-list_str(listObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
- return list_quote(self);
-}
-
-PyObject *
-list_getquoted(listObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
- return list_quote(self);
-}
-
-PyObject *
-list_prepare(listObject *self, PyObject *args)
-{
- connectionObject *conn;
-
- if (!PyArg_ParseTuple(args, "O", &conn))
- return NULL;
-
- /* note that we don't copy the encoding from the connection, but take a
- reference to it; we'll need it during the recursive adapt() call (the
- encoding is here for a future expansion that will make .getquoted()
- work even without a connection to the backend. */
- Py_XDECREF(self->connection);
- self->connection = (PyObject*)conn;
- Py_INCREF(self->connection);
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-PyObject *
-list_conform(listObject *self, PyObject *args)
-{
- PyObject *res, *proto;
-
- if (!PyArg_ParseTuple(args, "O", &proto)) return NULL;
-
- if (proto == (PyObject*)&isqlquoteType)
- res = (PyObject*)self;
- else
- res = Py_None;
-
- Py_INCREF(res);
- return res;
-}
-
-/** the DateTime wrapper object **/
-
-/* object member list */
-
-static struct PyMemberDef listObject_members[] = {
- {"adapted", T_OBJECT, offsetof(listObject, wrapped), RO},
- {NULL}
-};
-
-/* object method table */
-
-static PyMethodDef listObject_methods[] = {
- {"getquoted", (PyCFunction)list_getquoted, METH_VARARGS,
- "getquoted() -> wrapped object value as SQL date/time"},
- {"prepare", (PyCFunction)list_prepare, METH_VARARGS,
- "prepare(conn) -> set encoding to conn->encoding"},
- {"__conform__", (PyCFunction)list_conform, METH_VARARGS, NULL},
- {NULL} /* Sentinel */
-};
-
-/* initialization and finalization methods */
-
-static int
-list_setup(listObject *self, PyObject *obj, char *enc)
-{
- Dprintf("list_setup: init list object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
-
- if (!PyList_Check(obj))
- return -1;
-
- /* FIXME: remove this orrible strdup */
- if (enc) self->encoding = strdup(enc);
-
- self->connection = NULL;
- self->wrapped = obj;
- Py_INCREF(self->wrapped);
-
- Dprintf("list_setup: good list object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
- return 0;
-}
-
-static void
-list_dealloc(PyObject* obj)
-{
- listObject *self = (listObject *)obj;
-
- Py_XDECREF(self->wrapped);
- Py_XDECREF(self->connection);
- if (self->encoding) free(self->encoding);
-
- Dprintf("list_dealloc: deleted list object at %p, "
- "refcnt = %d", obj, obj->ob_refcnt);
-
- obj->ob_type->tp_free(obj);
-}
-
-static int
-list_init(PyObject *obj, PyObject *args, PyObject *kwds)
-{
- PyObject *l;
- char *enc = "latin-1"; /* default encoding as in Python */
-
- if (!PyArg_ParseTuple(args, "O|s", &l, &enc))
- return -1;
-
- return list_setup((listObject *)obj, l, enc);
-}
-
-static PyObject *
-list_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- return type->tp_alloc(type, 0);
-}
-
-static void
-list_del(PyObject* self)
-{
- PyObject_Del(self);
-}
-
-static PyObject *
-list_repr(listObject *self)
-{
- return PyString_FromFormat("<psycopg2._psycopg.List object at %p>", self);
-}
-
-/* object type */
-
-#define listType_doc \
-"List(list) -> new list wrapper object"
-
-PyTypeObject listType = {
- PyObject_HEAD_INIT(NULL)
- 0,
- "psycopg2._psycopg.List",
- sizeof(listObject),
- 0,
- list_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
-
- 0, /*tp_compare*/
- (reprfunc)list_repr, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
-
- 0, /*tp_call*/
- (reprfunc)list_str, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
-
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
-
- listType_doc, /*tp_doc*/
-
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
-
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
-
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
-
- /* Attribute descriptor and subclassing stuff */
-
- listObject_methods, /*tp_methods*/
- listObject_members, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
-
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
-
- list_init, /*tp_init*/
- 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/
- list_new, /*tp_new*/
- (freefunc)list_del, /*tp_free Low-level free-memory routine */
- 0, /*tp_is_gc For PyObject_IS_GC */
- 0, /*tp_bases*/
- 0, /*tp_mro method resolution order */
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0 /*tp_weaklist*/
-};
-
-
-/** module-level functions **/
-
-PyObject *
-psyco_List(PyObject *module, PyObject *args)
-{
- PyObject *str;
- char *enc = "latin-1"; /* default encoding as in Python */
-
- if (!PyArg_ParseTuple(args, "O|s", &str, &enc))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&listType, "Os", str, enc);
-}
+++ /dev/null
-/* adapter_list.h - definition for the python list types
- *
- * Copyright (C) 2004-2005 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_LIST_H
-#define PSYCOPG_LIST_H 1
-
-#include <Python.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern PyTypeObject listType;
-
-typedef struct {
- PyObject HEAD;
-
- PyObject *wrapped;
- PyObject *connection;
- char *encoding;
-} listObject;
-
-extern PyObject *psyco_List(PyObject *module, PyObject *args);
-#define psyco_List_doc \
- "List(list, enc) -> new quoted list"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_LIST_H) */
+++ /dev/null
-/* adapter_mxdatetime.c - mx date/time objects
- *
- * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <structmember.h>
-#include <stringobject.h>
-#include <mxDateTime.h>
-#include <string.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/adapter_mxdatetime.h"
-#include "psycopg/microprotocols_proto.h"
-
-/* the pointer to the mxDateTime API is initialized by the module init code,
- we just need to grab it */
-extern mxDateTimeModule_APIObject *mxDateTimeP;
-
-
-/* mxdatetime_str, mxdatetime_getquoted - return result of quoting */
-
-static PyObject *
-mxdatetime_str(mxdatetimeObject *self)
-{
- PyObject *str = NULL, *res = NULL;
-
- switch (self->type) {
-
- case PSYCO_MXDATETIME_DATE:
- case PSYCO_MXDATETIME_TIMESTAMP:
- str = PyObject_Str(self->wrapped);
-
- /* given the limitation of the mx.DateTime module that uses the same
- type for both date and timestamp values we need to do some black
- magic and make sure we're not using an adapt()ed timestamp as a
- simple date */
- if (strncmp(&(PyString_AsString(str)[11]), "00:00:00.000", 12) == 0) {
- PyObject *tmp =
- PyString_FromStringAndSize(PyString_AsString(str), 10);
- Py_DECREF(str);
- str = tmp;
- }
- break;
-
- case PSYCO_MXDATETIME_TIME:
- case PSYCO_MXDATETIME_INTERVAL:
- str = PyObject_Str(self->wrapped);
-
- /* given the limitation of the mx.DateTime module that uses the same
- type for both time and delta values we need to do some black magic
- and make sure we're not using an adapt()ed interval as a simple
- time */
- if (PyString_Size(str) > 8 && PyString_AsString(str)[8] == ':') {
- mxDateTimeDeltaObject *obj = (mxDateTimeDeltaObject*)self->wrapped;
-
- char buffer[8];
- int i, j, x;
-
- double ss = obj->hour*3600.0 + obj->minute*60.0 + obj->second;
- int us = (int)((ss - floor(ss))*1000000);
-
- for (i=1000000, j=0; i > 0 ; i /= 10) {
- x = us/i;
- us -= x*i;
- buffer[j++] = '0'+x;
- }
- buffer[j] = '\0';
-
- res = PyString_FromFormat("'%ld days %d.%s seconds'",
- obj->day, (int)round(ss), buffer);
- }
- break;
- }
-
- if (str != NULL && res == NULL) {
- res = PyString_FromFormat("'%s'", PyString_AsString(str));
- }
- Py_XDECREF(str);
-
- return res;
-}
-
-PyObject *
-mxdatetime_getquoted(mxdatetimeObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
- return mxdatetime_str(self);
-}
-
-PyObject *
-mxdatetime_conform(mxdatetimeObject *self, PyObject *args)
-{
- PyObject *res, *proto;
-
- if (!PyArg_ParseTuple(args, "O", &proto)) return NULL;
-
- if (proto == (PyObject*)&isqlquoteType)
- res = (PyObject*)self;
- else
- res = Py_None;
-
- Py_INCREF(res);
- return res;
-}
-
-/** the MxDateTime object **/
-
-/* object member list */
-
-static struct PyMemberDef mxdatetimeObject_members[] = {
- {"adapted", T_OBJECT, offsetof(mxdatetimeObject, wrapped), RO},
- {"type", T_INT, offsetof(mxdatetimeObject, type), RO},
- {NULL}
-};
-
-/* object method table */
-
-static PyMethodDef mxdatetimeObject_methods[] = {
- {"getquoted", (PyCFunction)mxdatetime_getquoted, METH_VARARGS,
- "getquoted() -> wrapped object value as SQL date/time"},
- {"__conform__", (PyCFunction)mxdatetime_conform, METH_VARARGS, NULL},
- {NULL} /* Sentinel */
-};
-
-/* initialization and finalization methods */
-
-static int
-mxdatetime_setup(mxdatetimeObject *self, PyObject *obj, int type)
-{
- Dprintf("mxdatetime_setup: init mxdatetime object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
-
- self->type = type;
- self->wrapped = obj;
- Py_INCREF(self->wrapped);
-
- Dprintf("mxdatetime_setup: good mxdatetime object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
- return 0;
-}
-
-static void
-mxdatetime_dealloc(PyObject* obj)
-{
- mxdatetimeObject *self = (mxdatetimeObject *)obj;
-
- Py_XDECREF(self->wrapped);
-
- Dprintf("mxdatetime_dealloc: deleted mxdatetime object at %p, refcnt = %d",
- obj, obj->ob_refcnt);
-
- obj->ob_type->tp_free(obj);
-}
-
-static int
-mxdatetime_init(PyObject *obj, PyObject *args, PyObject *kwds)
-{
- PyObject *mx;
- int type = -1; /* raise an error if type was not passed! */
-
- if (!PyArg_ParseTuple(args, "O|i", &mx, &type))
- return -1;
-
- return mxdatetime_setup((mxdatetimeObject *)obj, mx, type);
-}
-
-static PyObject *
-mxdatetime_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- return type->tp_alloc(type, 0);
-}
-
-static void
-mxdatetime_del(PyObject* self)
-{
- PyObject_Del(self);
-}
-
-static PyObject *
-mxdatetime_repr(mxdatetimeObject *self)
-{
- return PyString_FromFormat("<psycopg2._psycopg.MxDateTime object at %p>",
- self);
-}
-
-/* object type */
-
-#define mxdatetimeType_doc \
-"MxDateTime(mx, type) -> new mx.DateTime wrapper object"
-
-PyTypeObject mxdatetimeType = {
- PyObject_HEAD_INIT(NULL)
- 0,
- "psycopg2._psycopg.MxDateTime",
- sizeof(mxdatetimeObject),
- 0,
- mxdatetime_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
-
- 0, /*tp_compare*/
- (reprfunc)mxdatetime_repr, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
-
- 0, /*tp_call*/
- (reprfunc)mxdatetime_str, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
-
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
-
- mxdatetimeType_doc, /*tp_doc*/
-
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
-
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
-
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
-
- /* Attribute descriptor and subclassing stuff */
-
- mxdatetimeObject_methods, /*tp_methods*/
- mxdatetimeObject_members, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
-
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
-
- mxdatetime_init, /*tp_init*/
- PyType_GenericAlloc, /*tp_alloc*/
- mxdatetime_new, /*tp_new*/
- (freefunc)mxdatetime_del, /*tp_free Low-level free-memory routine */
- 0, /*tp_is_gc For PyObject_IS_GC */
- 0, /*tp_bases*/
- 0, /*tp_mro method resolution order */
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0 /*tp_weaklist*/
-};
-
-
-/** module-level functions **/
-
-#ifdef PSYCOPG_DEFAULT_MXDATETIME
-
-PyObject *
-psyco_Date(PyObject *self, PyObject *args)
-{
- PyObject *res, *mx;
- int year, month, day;
-
- if (!PyArg_ParseTuple(args, "iii", &year, &month, &day))
- return NULL;
-
- mx = mxDateTimeP->DateTime_FromDateAndTime(year, month, day, 0, 0, 0.0);
- if (mx == NULL) return NULL;
-
- res = PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx,
- PSYCO_MXDATETIME_DATE);
- Py_DECREF(mx);
- return res;
-}
-
-PyObject *
-psyco_Time(PyObject *self, PyObject *args)
-{
- PyObject *res, *mx;
- int hours, minutes=0;
- double seconds=0.0;
-
- if (!PyArg_ParseTuple(args, "iid", &hours, &minutes, &seconds))
- return NULL;
-
- mx = mxDateTimeP->DateTimeDelta_FromTime(hours, minutes, seconds);
- if (mx == NULL) return NULL;
-
- res = PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx,
- PSYCO_MXDATETIME_TIME);
- Py_DECREF(mx);
- return res;
-}
-
-PyObject *
-psyco_Timestamp(PyObject *self, PyObject *args)
-{
- PyObject *res, *mx;
- int year, month, day;
- int hour=0, minute=0; /* default to midnight */
- double second=0.0;
-
- if (!PyArg_ParseTuple(args, "lii|iid", &year, &month, &day,
- &hour, &minute, &second))
- return NULL;
-
- mx = mxDateTimeP->DateTime_FromDateAndTime(year, month, day,
- hour, minute, second);
- if (mx == NULL) return NULL;
-
- res = PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx,
- PSYCO_MXDATETIME_TIMESTAMP);
- Py_DECREF(mx);
- return res;
-}
-
-PyObject *
-psyco_DateFromTicks(PyObject *self, PyObject *args)
-{
- PyObject *res, *mx;
- double ticks;
-
- if (!PyArg_ParseTuple(args,"d", &ticks))
- return NULL;
-
- if (!(mx = mxDateTimeP->DateTime_FromTicks(ticks)))
- return NULL;
-
- res = PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx,
- PSYCO_MXDATETIME_DATE);
- Py_DECREF(mx);
- return res;
-}
-
-PyObject *
-psyco_TimeFromTicks(PyObject *self, PyObject *args)
-{
- PyObject *res, *mx, *dt;
- double ticks;
-
- if (!PyArg_ParseTuple(args,"d", &ticks))
- return NULL;
-
- if (!(dt = mxDateTimeP->DateTime_FromTicks(ticks)))
- return NULL;
-
- if (!(mx = mxDateTimeP->DateTimeDelta_FromDaysAndSeconds(
- 0, ((mxDateTimeObject*)dt)->abstime)))
- {
- Py_DECREF(dt);
- return NULL;
- }
-
- Py_DECREF(dt);
- res = PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx,
- PSYCO_MXDATETIME_TIME);
- Py_DECREF(mx);
- return res;
-}
-
-PyObject *
-psyco_TimestampFromTicks(PyObject *self, PyObject *args)
-{
- PyObject *mx, *res;
- double ticks;
-
- if (!PyArg_ParseTuple(args, "d", &ticks))
- return NULL;
-
- if (!(mx = mxDateTimeP->DateTime_FromTicks(ticks)))
- return NULL;
-
- res = PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx,
- PSYCO_MXDATETIME_TIMESTAMP);
- Py_DECREF(mx);
- return res;
-}
-
-#endif
-
-PyObject *
-psyco_DateFromMx(PyObject *self, PyObject *args)
-{
- PyObject *mx;
-
- if (!PyArg_ParseTuple(args, "O!", mxDateTimeP->DateTime_Type, &mx))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx,
- PSYCO_MXDATETIME_DATE);
-}
-
-PyObject *
-psyco_TimeFromMx(PyObject *self, PyObject *args)
-{
- PyObject *mx;
-
- if (!PyArg_ParseTuple(args, "O!", mxDateTimeP->DateTimeDelta_Type, &mx))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx,
- PSYCO_MXDATETIME_TIME);
-}
-
-PyObject *
-psyco_TimestampFromMx(PyObject *self, PyObject *args)
-{
- PyObject *mx;
-
- if (!PyArg_ParseTuple(args, "O!", mxDateTimeP->DateTime_Type, &mx))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx,
- PSYCO_MXDATETIME_TIMESTAMP);
-}
-
-PyObject *
-psyco_IntervalFromMx(PyObject *self, PyObject *args)
-{
- PyObject *mx;
-
- if (!PyArg_ParseTuple(args, "O!", mxDateTimeP->DateTime_Type, &mx))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx,
- PSYCO_MXDATETIME_INTERVAL);
-}
+++ /dev/null
-/* adapter_mxdatetime.h - definition for the mx date/time types
- *
- * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_MXDATETIME_H
-#define PSYCOPG_MXDATETIME_H 1
-
-#include <Python.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern PyTypeObject mxdatetimeType;
-
-typedef struct {
- PyObject HEAD;
-
- PyObject *wrapped;
- int type;
-#define PSYCO_MXDATETIME_TIME 0
-#define PSYCO_MXDATETIME_DATE 1
-#define PSYCO_MXDATETIME_TIMESTAMP 2
-#define PSYCO_MXDATETIME_INTERVAL 3
-
-} mxdatetimeObject;
-
-/* functions exported to psycopgmodule.c */
-#ifdef PSYCOPG_DEFAULT_MXDATETIME
-
-extern PyObject *psyco_Date(PyObject *module, PyObject *args);
-#define psyco_Date_doc \
- "Date(year, month, day) -> new date"
-
-extern PyObject *psyco_Time(PyObject *module, PyObject *args);
-#define psyco_Time_doc \
- "Time(hour, minutes, seconds) -> new time"
-
-extern PyObject *psyco_Timestamp(PyObject *module, PyObject *args);
-#define psyco_Timestamp_doc \
- "Time(year, month, day, hour, minutes, seconds) -> new timestamp"
-
-extern PyObject *psyco_DateFromTicks(PyObject *module, PyObject *args);
-#define psyco_DateFromTicks_doc \
- "DateFromTicks(ticks) -> new date"
-
-extern PyObject *psyco_TimeFromTicks(PyObject *module, PyObject *args);
-#define psyco_TimeFromTicks_doc \
- "TimeFromTicks(ticks) -> new time"
-
-extern PyObject *psyco_TimestampFromTicks(PyObject *module, PyObject *args);
-#define psyco_TimestampFromTicks_doc \
- "TimestampFromTicks(ticks) -> new timestamp"
-
-#endif /* PSYCOPG_DEFAULT_MXDATETIME */
-
-extern PyObject *psyco_DateFromMx(PyObject *module, PyObject *args);
-#define psyco_DateFromMx_doc \
- "DateFromMx(mx) -> new date"
-
-extern PyObject *psyco_TimeFromMx(PyObject *module, PyObject *args);
-#define psyco_TimeFromMx_doc \
- "TimeFromMx(mx) -> new time"
-
-extern PyObject *psyco_TimestampFromMx(PyObject *module, PyObject *args);
-#define psyco_TimestampFromMx_doc \
- "TimestampFromMx(mx) -> new timestamp"
-
-extern PyObject *psyco_IntervalFromMx(PyObject *module, PyObject *args);
-#define psyco_IntervalFromMx_doc \
- "IntervalFromMx(mx) -> new interval"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_MXDATETIME_H) */
+++ /dev/null
-/* adapter_pboolean.c - psycopg boolean type wrapper implementation
- *
- * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <structmember.h>
-#include <stringobject.h>
-#include <string.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/adapter_pboolean.h"
-#include "psycopg/microprotocols_proto.h"
-
-
-/** the Boolean object **/
-
-static PyObject *
-pboolean_str(pbooleanObject *self)
-{
-#ifdef PSYCOPG_NEW_BOOLEAN
- if (PyObject_IsTrue(self->wrapped)) {
- return PyString_FromString("true");
- }
- else {
- return PyString_FromString("false");
- }
-#else
- if (PyObject_IsTrue(self->wrapped)) {
- return PyString_FromString("'t'");
- }
- else {
- return PyString_FromString("'f'");
- }
-#endif
-}
-
-PyObject *
-pboolean_getquoted(pbooleanObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
- return pboolean_str(self);
-}
-
-PyObject *
-pboolean_conform(pbooleanObject *self, PyObject *args)
-{
- PyObject *res, *proto;
-
- if (!PyArg_ParseTuple(args, "O", &proto)) return NULL;
-
- if (proto == (PyObject*)&isqlquoteType)
- res = (PyObject*)self;
- else
- res = Py_None;
-
- Py_INCREF(res);
- return res;
-}
-
-/** the Boolean object */
-
-/* object member list */
-
-static struct PyMemberDef pbooleanObject_members[] = {
- {"adapted", T_OBJECT, offsetof(pbooleanObject, wrapped), RO},
- {NULL}
-};
-
-/* object method table */
-
-static PyMethodDef pbooleanObject_methods[] = {
- {"getquoted", (PyCFunction)pboolean_getquoted, METH_VARARGS,
- "getquoted() -> wrapped object value as SQL-quoted string"},
- {"__conform__", (PyCFunction)pboolean_conform, METH_VARARGS, NULL},
- {NULL} /* Sentinel */
-};
-
-/* initialization and finalization methods */
-
-static int
-pboolean_setup(pbooleanObject *self, PyObject *obj)
-{
- Dprintf("pboolean_setup: init pboolean object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
-
- self->wrapped = obj;
- Py_INCREF(self->wrapped);
-
- Dprintf("pboolean_setup: good pboolean object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
- return 0;
-}
-
-static void
-pboolean_dealloc(PyObject* obj)
-{
- pbooleanObject *self = (pbooleanObject *)obj;
-
- Py_XDECREF(self->wrapped);
-
- Dprintf("pboolean_dealloc: deleted pboolean object at %p, refcnt = %d",
- obj, obj->ob_refcnt);
-
- obj->ob_type->tp_free(obj);
-}
-
-static int
-pboolean_init(PyObject *obj, PyObject *args, PyObject *kwds)
-{
- PyObject *o;
-
- if (!PyArg_ParseTuple(args, "O", &o))
- return -1;
-
- return pboolean_setup((pbooleanObject *)obj, o);
-}
-
-static PyObject *
-pboolean_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- return type->tp_alloc(type, 0);
-}
-
-static void
-pboolean_del(PyObject* self)
-{
- PyObject_Del(self);
-}
-
-static PyObject *
-pboolean_repr(pbooleanObject *self)
-{
- return PyString_FromFormat("<psycopg2._psycopg.Boolean object at %p>",
- self);
-}
-
-
-/* object type */
-
-#define pbooleanType_doc \
-"Boolean(str) -> new Boolean adapter object"
-
-PyTypeObject pbooleanType = {
- PyObject_HEAD_INIT(NULL)
- 0,
- "psycopg2._psycopg.Boolean",
- sizeof(pbooleanObject),
- 0,
- pboolean_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
-
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
-
- 0, /*tp_compare*/
-
- (reprfunc)pboolean_repr, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
-
- 0, /*tp_call*/
- (reprfunc)pboolean_str, /*tp_str*/
-
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
-
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- pbooleanType_doc, /*tp_doc*/
-
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
-
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
-
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
-
- /* Attribute descriptor and subclassing stuff */
-
- pbooleanObject_methods, /*tp_methods*/
- pbooleanObject_members, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
-
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
-
- pboolean_init, /*tp_init*/
- 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/
- pboolean_new, /*tp_new*/
- (freefunc)pboolean_del, /*tp_free Low-level free-memory routine */
- 0, /*tp_is_gc For PyObject_IS_GC */
- 0, /*tp_bases*/
- 0, /*tp_mro method resolution order */
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0 /*tp_weaklist*/
-};
-
-
-/** module-level functions **/
-
-PyObject *
-psyco_Boolean(PyObject *module, PyObject *args)
-{
- PyObject *obj;
-
- if (!PyArg_ParseTuple(args, "O", &obj))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&pbooleanType, "O", obj);
-}
+++ /dev/null
-/* adapter_pboolean.h - definition for the psycopg boolean type wrapper
- *
- * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_PBOOLEAN_H
-#define PSYCOPG_PBOOLEAN_H 1
-
-#include <Python.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern PyTypeObject pbooleanType;
-
-typedef struct {
- PyObject HEAD;
-
- /* this is the real object we wrap */
- PyObject *wrapped;
-
-} pbooleanObject;
-
-/* functions exported to psycopgmodule.c */
-
-extern PyObject *psyco_Boolean(PyObject *module, PyObject *args);
-#define psyco_Boolean_doc \
- "Boolean(obj) -> new boolean value"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_PBOOLEAN_H) */
+++ /dev/null
-/* adapter_qstring.c - QuotedString objects
- *
- * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <structmember.h>
-#include <stringobject.h>
-
-#include <libpq-fe.h>
-#include <string.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/connection.h"
-#include "psycopg/adapter_qstring.h"
-#include "psycopg/microprotocols_proto.h"
-
-
-/** the quoting code */
-
-#ifndef PSYCOPG_OWN_QUOTING
-static size_t
-qstring_escape(char *to, char *from, size_t len, PGconn *conn)
-{
-#if PG_MAJOR_VERSION > 8 || \
- (PG_MAJOR_VERSION == 8 && PG_MINOR_VERSION > 1) || \
- (PG_MAJOR_VERSION == 8 && PG_MINOR_VERSION == 1 && PG_PATCH_VERSION >= 4)
- int err;
- if (conn)
- return PQescapeStringConn(conn, to, from, len, &err);
- else
-#endif
- return PQescapeString(to, from, len);
-}
-#else
-static size_t
-qstring_escape(char *to, char *from, size_t len, PGconn *conn)
-{
- int i, j;
-
- for (i=0, j=0; i<len; i++) {
- switch(from[i]) {
-
- case '\'':
- to[j++] = '\'';
- to[j++] = '\'';
- break;
-
- case '\\':
- to[j++] = '\\';
- to[j++] = '\\';
- break;
-
- case '\0':
- /* do nothing, embedded \0 are discarded */
- break;
-
- default:
- to[j++] = from[i];
- }
- }
- to[j] = '\0';
-
- Dprintf("qstring_quote: to = %s", to);
- return strlen(to);
-}
-#endif
-
-/* qstring_quote - do the quote process on plain and unicode strings */
-
-static PyObject *
-qstring_quote(qstringObject *self)
-{
- PyObject *str;
- char *s, *buffer;
- int len;
-
- /* if the wrapped object is an unicode object we can encode it to match
- self->encoding but if the encoding is not specified we don't know what
- to do and we raise an exception */
-
- /* TODO: we need a real translation table from postgres encoding names to
- python ones here */
-
- if (PyUnicode_Check(self->wrapped) && self->encoding) {
- PyObject *enc = PyDict_GetItemString(psycoEncodings, self->encoding);
- /* note that pgenc is a borrowed reference */
-
- if (enc) {
- char *s = PyString_AsString(enc);
- Dprintf("qstring_quote: encoding unicode object to %s", s);
- str = PyUnicode_AsEncodedString(self->wrapped, s, NULL);
- Dprintf("qstring_quote: got encoded object at %p", str);
- if (str == NULL) return NULL;
- }
- else {
- /* can't find the right encoder, raise exception */
- PyErr_Format(InterfaceError,
- "can't encode unicode string to %s", self->encoding);
- return NULL;
- }
- }
-
- /* if the wrapped object is a simple string, we don't know how to
- (re)encode it, so we pass it as-is */
- else if (PyString_Check(self->wrapped)) {
- str = self->wrapped;
- /* INCREF to make it ref-wise identical to unicode one */
- Py_INCREF(str);
- }
-
- /* if the wrapped object is not a string, this is an error */
- else {
- PyErr_SetString(PyExc_TypeError,
- "can't quote non-string object (or missing encoding)");
- return NULL;
- }
-
- /* encode the string into buffer */
- PyString_AsStringAndSize(str, &s, &len);
-
- buffer = (char *)PyMem_Malloc((len*2+3) * sizeof(char));
- if (buffer == NULL) {
- Py_DECREF(str);
- PyErr_NoMemory();
- return NULL;
- }
-
- Py_BEGIN_ALLOW_THREADS;
- len = qstring_escape(buffer+1, s, len,
- self->conn ? ((connectionObject*)self->conn)->pgconn : NULL);
- buffer[0] = '\'' ; buffer[len+1] = '\'';
- Py_END_ALLOW_THREADS;
-
- self->buffer = PyString_FromStringAndSize(buffer, len+2);
- PyMem_Free(buffer);
- Py_DECREF(str);
-
- return self->buffer;
-}
-
-/* qstring_str, qstring_getquoted - return result of quoting */
-
-static PyObject *
-qstring_str(qstringObject *self)
-{
- if (self->buffer == NULL) {
- qstring_quote(self);
- }
- Py_XINCREF(self->buffer);
- return self->buffer;
-}
-
-PyObject *
-qstring_getquoted(qstringObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
- return qstring_str(self);
-}
-
-PyObject *
-qstring_prepare(qstringObject *self, PyObject *args)
-{
- connectionObject *conn;
-
- if (!PyArg_ParseTuple(args, "O", &conn))
- return NULL;
-
- /* we bother copying the encoding only if the wrapped string is unicode,
- we don't need the encoding if that's not the case */
- if (PyUnicode_Check(self->wrapped)) {
- if (self->encoding) free(self->encoding);
- self->encoding = strdup(conn->encoding);
- Dprintf("qstring_prepare: set encoding to %s", conn->encoding);
- }
-
- Py_XDECREF(self->conn);
- if (conn) {
- self->conn = (PyObject*)conn;
- Py_INCREF(self->conn);
- }
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-PyObject *
-qstring_conform(qstringObject *self, PyObject *args)
-{
- PyObject *res, *proto;
-
- if (!PyArg_ParseTuple(args, "O", &proto)) return NULL;
-
- if (proto == (PyObject*)&isqlquoteType)
- res = (PyObject*)self;
- else
- res = Py_None;
-
- Py_INCREF(res);
- return res;
-}
-
-/** the QuotedString object **/
-
-/* object member list */
-
-static struct PyMemberDef qstringObject_members[] = {
- {"adapted", T_OBJECT, offsetof(qstringObject, wrapped), RO},
- {"buffer", T_OBJECT, offsetof(qstringObject, buffer), RO},
- {"encoding", T_STRING, offsetof(qstringObject, encoding), RO},
- {NULL}
-};
-
-/* object method table */
-
-static PyMethodDef qstringObject_methods[] = {
- {"getquoted", (PyCFunction)qstring_getquoted, METH_VARARGS,
- "getquoted() -> wrapped object value as SQL-quoted string"},
- {"prepare", (PyCFunction)qstring_prepare, METH_VARARGS,
- "prepare(conn) -> set encoding to conn->encoding and store conn"},
- {"__conform__", (PyCFunction)qstring_conform, METH_VARARGS, NULL},
- {NULL} /* Sentinel */
-};
-
-/* initialization and finalization methods */
-
-static int
-qstring_setup(qstringObject *self, PyObject *str, char *enc)
-{
- Dprintf("qstring_setup: init qstring object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
-
- self->buffer = NULL;
- self->conn = NULL;
-
- /* FIXME: remove this orrible strdup */
- if (enc) self->encoding = strdup(enc);
-
- self->wrapped = str;
- Py_INCREF(self->wrapped);
-
- Dprintf("qstring_setup: good qstring object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
- return 0;
-}
-
-static void
-qstring_dealloc(PyObject* obj)
-{
- qstringObject *self = (qstringObject *)obj;
-
- Py_XDECREF(self->wrapped);
- Py_XDECREF(self->buffer);
- Py_XDECREF(self->conn);
-
- if (self->encoding) free(self->encoding);
-
- Dprintf("qstring_dealloc: deleted qstring object at %p, refcnt = %d",
- obj, obj->ob_refcnt);
-
- obj->ob_type->tp_free(obj);
-}
-
-static int
-qstring_init(PyObject *obj, PyObject *args, PyObject *kwds)
-{
- PyObject *str;
- char *enc = "latin-1"; /* default encoding as in Python */
-
- if (!PyArg_ParseTuple(args, "O|s", &str, &enc))
- return -1;
-
- return qstring_setup((qstringObject *)obj, str, enc);
-}
-
-static PyObject *
-qstring_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- return type->tp_alloc(type, 0);
-}
-
-static void
-qstring_del(PyObject* self)
-{
- PyObject_Del(self);
-}
-
-static PyObject *
-qstring_repr(qstringObject *self)
-{
- return PyString_FromFormat("<psycopg2._psycopg.QuotedString object at %p>",
- self);
-}
-
-/* object type */
-
-#define qstringType_doc \
-"QuotedString(str, enc) -> new quoted object with 'enc' encoding"
-
-PyTypeObject qstringType = {
- PyObject_HEAD_INIT(NULL)
- 0,
- "psycopg2._psycopg.QuotedString",
- sizeof(qstringObject),
- 0,
- qstring_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
-
- 0, /*tp_compare*/
- (reprfunc)qstring_repr, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
-
- 0, /*tp_call*/
- (reprfunc)qstring_str, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
-
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
-
- qstringType_doc, /*tp_doc*/
-
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
-
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
-
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
-
- /* Attribute descriptor and subclassing stuff */
-
- qstringObject_methods, /*tp_methods*/
- qstringObject_members, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
-
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
-
- qstring_init, /*tp_init*/
- 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/
- qstring_new, /*tp_new*/
- (freefunc)qstring_del, /*tp_free Low-level free-memory routine */
- 0, /*tp_is_gc For PyObject_IS_GC */
- 0, /*tp_bases*/
- 0, /*tp_mro method resolution order */
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0 /*tp_weaklist*/
-};
-
-
-/** module-level functions **/
-
-PyObject *
-psyco_QuotedString(PyObject *module, PyObject *args)
-{
- PyObject *str;
- char *enc = "latin-1"; /* default encoding as in Python */
-
- if (!PyArg_ParseTuple(args, "O|s", &str, &enc))
- return NULL;
-
- return PyObject_CallFunction((PyObject *)&qstringType, "Os", str, enc);
-}
+++ /dev/null
-/* adapter_qstring.h - definition for the QuotedString type
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_QSTRING_H
-#define PSYCOPG_QSTRING_H 1
-
-#include <Python.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern PyTypeObject qstringType;
-
-typedef struct {
- PyObject HEAD;
-
- PyObject *wrapped;
- PyObject *buffer;
- char *encoding;
-
- PyObject *conn;
-} qstringObject;
-
-/* functions exported to psycopgmodule.c */
-
-extern PyObject *psyco_QuotedString(PyObject *module, PyObject *args);
-#define psyco_QuotedString_doc \
- "QuotedString(str, enc) -> new quoted string"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_QSTRING_H) */
+++ /dev/null
-/* config.h - general config and Dprintf macro
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_CONFIG_H
-#define PSYCOPG_CONFIG_H 1
-
-/* debug printf-like function */
-#if defined( __GNUC__) && !defined(__APPLE__)
-#ifdef PSYCOPG_DEBUG
-#include <sys/types.h>
-#include <unistd.h>
-#define Dprintf(fmt, args...) \
- fprintf(stderr, "[%d] " fmt "\n", getpid() , ## args)
-#else
-#define Dprintf(fmt, args...)
-#endif
-#else /* !__GNUC__ or __APPLE__ */
-#ifdef PSYCOPG_DEBUG
-#include <stdarg.h>
-static void Dprintf(const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- vprintf(fmt, ap);
- va_end(ap);
- printf("\n");
-}
-#else
-static void Dprintf(const char *fmt, ...) {}
-#endif
-#endif
-
-/* pthreads work-arounds for mutilated operating systems */
-#if defined(_WIN32) || defined(__BEOS__)
-
-#ifdef _WIN32
-#include <winsock2.h>
-#define pthread_mutex_t HANDLE
-#define pthread_condvar_t HANDLE
-#define pthread_mutex_lock(object) WaitForSingleObject(object, INFINITE)
-#define pthread_mutex_unlock(object) ReleaseMutex(object)
-#define pthread_mutex_destroy(ref) (CloseHandle(*(ref)))
-/* convert pthread mutex to native mutex */
-static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake)
-{
- *mutex = CreateMutex(NULL, FALSE, NULL);
- return 0;
-}
-#endif /* _WIN32 */
-
-#ifdef __BEOS__
-#include <OS.h>
-#define pthread_mutex_t sem_id
-#define pthread_mutex_lock(object) acquire_sem(object)
-#define pthread_mutex_unlock(object) release_sem(object)
-#define pthread_mutex_destroy(ref) delete_sem(*ref)
-static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake)
-{
- *mutex = create_sem(1, "psycopg_mutex");
- if (*mutex < B_OK)
- return *mutex;
- return 0;
-}
-#endif /* __BEOS__ */
-
-#else /* pthread is available */
-#include <pthread.h>
-#endif
-
-/* to work around the fact that Windows does not have a gmtime_r function, or
- a proper gmtime function */
-#ifdef _WIN32
-static struct tm *gmtime_r(time_t *t, struct tm *tm)
-{
- tm = gmtime(t);
- return tm;
-}
-static struct tm *localtime_r(time_t *t, struct tm *tm)
-{
- tm = localtime(t);
- return tm;
-}
-/* remove the inline keyword, since it doesn't work unless C++ file */
-#define inline
-#endif
-
-#if defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__)
-/* what's this, we have no round function either? */
-static double round(double num)
-{
- return (num >= 0) ? floor(num + 0.5) : ceil(num - 0.5);
-}
-#endif
-
-/* postgresql < 7.4 does not have PQfreemem */
-#ifndef HAVE_PQFREEMEM
-#define PQfreemem free
-#endif
-
-#endif /* !defined(PSYCOPG_CONFIG_H) */
+++ /dev/null
-/* connection.h - definition for the psycopg connection type
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_CONNECTION_H
-#define PSYCOPG_CONNECTION_H 1
-
-#include <Python.h>
-#include <libpq-fe.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* connection status */
-#define CONN_STATUS_READY 1
-#define CONN_STATUS_BEGIN 2
-#define CONN_STATUS_SYNC 3
-#define CONN_STATUS_ASYNC 4
-
-extern PyTypeObject connectionType;
-
-typedef struct {
- PyObject HEAD;
-
- pthread_mutex_t lock; /* the global connection lock */
-
- char *dsn; /* data source name */
- char *critical; /* critical error on this connection */
- char *encoding; /* current backend encoding */
-
- long int closed; /* 2 means connection has been closed */
- long int isolation_level; /* isolation level for this connection */
- long int mark; /* number of commits/rollbacks done so far */
- int status; /* status of the connection */
- int protocol; /* protocol version */
-
- PGconn *pgconn; /* the postgresql connection */
-
- PyObject *async_cursor;
-
- /* notice processing */
- PyObject *notice_list;
- PyObject *notice_filter;
-
- /* notifies */
- PyObject *notifies;
-
- /* errors (DBAPI-2.0 extension) */
- PyObject *exc_Error;
- PyObject *exc_Warning;
- PyObject *exc_InterfaceError;
- PyObject *exc_DatabaseError;
- PyObject *exc_InternalError;
- PyObject *exc_OperationalError;
- PyObject *exc_ProgrammingError;
- PyObject *exc_IntegrityError;
- PyObject *exc_DataError;
- PyObject *exc_NotSupportedError;
-
-} connectionObject;
-
-/* C-callable functions in connection_int.c and connection_ext.c */
-extern int conn_connect(connectionObject *self);
-extern void conn_close(connectionObject *self);
-extern int conn_commit(connectionObject *self);
-extern int conn_rollback(connectionObject *self);
-extern int conn_switch_isolation_level(connectionObject *self, int level);
-extern int conn_set_client_encoding(connectionObject *self, char *enc);
-
-/* exception-raising macros */
-#define EXC_IF_CONN_CLOSED(self) if ((self)->closed > 0) { \
- PyErr_SetString(InterfaceError, "connection already closed"); \
- return NULL; }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_CONNECTION_H) */
+++ /dev/null
-/* connection_int.c - code used by the connection object
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <string.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/connection.h"
-#include "psycopg/cursor.h"
-#include "psycopg/pqpath.h"
-
-/* conn_notice_callback - process notices */
-
-void
-conn_notice_callback(void *args, const char *message)
-{
- connectionObject *self = (connectionObject *)args;
-
- Dprintf("conn_notice_callback: %s", message);
-
- /* unfortunately the old protocl return COPY FROM errors only as notices,
- so we need to filter them looking for such errors */
- if (strncmp(message, "ERROR", 5) == 0)
- pq_set_critical(self, message);
- else
- PyList_Append(self->notice_list, PyString_FromString(message));
-}
-
-/* conn_connect - execute a connection to the dataabase */
-
-int
-conn_connect(connectionObject *self)
-{
- PGconn *pgconn;
- PGresult *pgres;
- char *data, *tmp;
- int i;
-
- /* we need the initial date style to be ISO, for typecasters; if the user
- later change it, she must know what she's doing... */
- const char *datestyle = "SET DATESTYLE TO 'ISO'";
- const char *encoding = "SHOW client_encoding";
- const char *isolevel = "SHOW default_transaction_isolation";
-
- const char *lvl1a = "read uncommitted";
- const char *lvl1b = "read committed";
- const char *lvl2a = "repeatable read";
- const char *lvl2b = "serializable";
-
- Py_BEGIN_ALLOW_THREADS;
- pgconn = PQconnectdb(self->dsn);
- Py_END_ALLOW_THREADS;
-
- Dprintf("conn_connect: new postgresql connection at %p", pgconn);
-
- if (pgconn == NULL)
- {
- Dprintf("conn_connect: PQconnectdb(%s) FAILED", self->dsn);
- PyErr_SetString(OperationalError, "PQconnectdb() failed");
- return -1;
- }
- else if (PQstatus(pgconn) == CONNECTION_BAD)
- {
- Dprintf("conn_connect: PQconnectdb(%s) returned BAD", self->dsn);
- PyErr_SetString(OperationalError, PQerrorMessage(pgconn));
- PQfinish(pgconn);
- return -1;
- }
-
- PQsetNoticeProcessor(pgconn, conn_notice_callback, (void*)self);
-
- Py_BEGIN_ALLOW_THREADS;
- pgres = PQexec(pgconn, datestyle);
- Py_END_ALLOW_THREADS;
-
- if (pgres == NULL || PQresultStatus(pgres) != PGRES_COMMAND_OK ) {
- PyErr_SetString(OperationalError, "can't set datestyle to ISO");
- PQfinish(pgconn);
- IFCLEARPGRES(pgres);
- return -1;
- }
- CLEARPGRES(pgres);
-
- Py_BEGIN_ALLOW_THREADS;
- pgres = PQexec(pgconn, encoding);
- Py_END_ALLOW_THREADS;
-
- if (pgres == NULL || PQresultStatus(pgres) != PGRES_TUPLES_OK) {
- PyErr_SetString(OperationalError, "can't fetch client_encoding");
- PQfinish(pgconn);
- IFCLEARPGRES(pgres);
- return -1;
- }
- tmp = PQgetvalue(pgres, 0, 0);
- self->encoding = PyMem_Malloc(strlen(tmp)+1);
- if (self->encoding == NULL) {
- /* exception already set by PyMem_Malloc() */
- PQfinish(pgconn);
- IFCLEARPGRES(pgres);
- return -1;
- }
- for (i=0 ; i < strlen(tmp) ; i++)
- self->encoding[i] = toupper(tmp[i]);
- self->encoding[i] = '\0';
- CLEARPGRES(pgres);
-
- Py_BEGIN_ALLOW_THREADS;
- pgres = PQexec(pgconn, isolevel);
- Py_END_ALLOW_THREADS;
-
- if (pgres == NULL || PQresultStatus(pgres) != PGRES_TUPLES_OK) {
- PyErr_SetString(OperationalError,
- "can't fetch default_isolation_level");
- PQfinish(pgconn);
- IFCLEARPGRES(pgres);
- return -1;
- }
- data = PQgetvalue(pgres, 0, 0);
- if ((strncmp(lvl1a, data, strlen(lvl1a)) == 0)
- || (strncmp(lvl1b, data, strlen(lvl1b)) == 0))
- self->isolation_level = 1;
- else if ((strncmp(lvl2a, data, strlen(lvl2a)) == 0)
- || (strncmp(lvl2b, data, strlen(lvl2b)) == 0))
- self->isolation_level = 2;
- else
- self->isolation_level = 2;
- CLEARPGRES(pgres);
-
- if (PQsetnonblocking(pgconn, 1) != 0) {
- Dprintf("conn_connect: PQsetnonblocking() FAILED");
- PyErr_SetString(OperationalError, "PQsetnonblocking() failed");
- PQfinish(pgconn);
- return -1;
- }
-
-#ifdef HAVE_PQPROTOCOL3
- self->protocol = PQprotocolVersion(pgconn);
-#else
- self->protocol = 2;
-#endif
- Dprintf("conn_connect: using protocol %d", self->protocol);
-
- self->pgconn = pgconn;
- return 0;
-}
-
-/* conn_close - do anything needed to shut down the connection */
-
-void
-conn_close(connectionObject *self)
-{
- /* sets this connection as closed even for other threads; also note that
- we need to check the value of pgconn, because we get called even when
- the connection fails! */
- Py_BEGIN_ALLOW_THREADS;
- pthread_mutex_lock(&self->lock);
-
- self->closed = 1;
-
- /* execute a forced rollback on the connection (but don't check the
- result, we're going to close the pq connection anyway */
- if (self->pgconn) {
- pq_abort(self);
- PQfinish(self->pgconn);
- Dprintf("conn_close: PQfinish called");
- self->pgconn = NULL;
- }
-
- pthread_mutex_unlock(&self->lock);
- Py_END_ALLOW_THREADS;
-
-}
-
-/* conn_commit - commit on a connection */
-
-int
-conn_commit(connectionObject *self)
-{
- int res;
-
- Py_BEGIN_ALLOW_THREADS;
- pthread_mutex_lock(&self->lock);
-
- res = pq_commit(self);
- self->mark++;
-
- pthread_mutex_unlock(&self->lock);
- Py_END_ALLOW_THREADS;
-
- return res;
-}
-
-/* conn_rollback - rollback a connection */
-
-int
-conn_rollback(connectionObject *self)
-{
- int res;
-
- Py_BEGIN_ALLOW_THREADS;
- pthread_mutex_lock(&self->lock);
-
- res = pq_abort(self);
- self->mark++;
-
- pthread_mutex_unlock(&self->lock);
- Py_END_ALLOW_THREADS;
-
- return res;
-}
-
-/* conn_switch_isolation_level - switch isolation level on the connection */
-
-int
-conn_switch_isolation_level(connectionObject *self, int level)
-{
- int res = 0;
-
- Py_BEGIN_ALLOW_THREADS;
- pthread_mutex_lock(&self->lock);
-
- /* if the current isolation level is > 0 we need to abort the current
- transaction before changing; that all folks! */
- if (self->isolation_level != level && self->isolation_level > 0) {
- res = pq_abort(self);
- }
- self->isolation_level = level;
- self->mark++;
-
- Dprintf("conn_switch_isolation_level: switched to level %d", level);
-
- pthread_mutex_unlock(&self->lock);
- Py_END_ALLOW_THREADS;
-
- return res;
-}
-
-/* conn_set_client_encoding - switch client encoding on connection */
-
-int
-conn_set_client_encoding(connectionObject *self, char *enc)
-{
- PGresult *pgres;
- char query[48];
- int res = 0;
-
- /* TODO: check for async query here and raise error if necessary */
-
- Py_BEGIN_ALLOW_THREADS;
- pthread_mutex_lock(&self->lock);
-
- /* set encoding, no encoding string is longer than 24 bytes */
- PyOS_snprintf(query, 47, "SET client_encoding = '%s'", enc);
-
- /* abort the current transaction, to set the encoding ouside of
- transactions */
- res = pq_abort(self);
-
- if (res == 0) {
- pgres = PQexec(self->pgconn, query);
-
- if (pgres == NULL || PQresultStatus(pgres) != PGRES_COMMAND_OK ) {
- res = -1;
- }
- else {
- /* no error, we can proceeed and store the new encoding */
- if (self->encoding) free(self->encoding);
- self->encoding = strdup(enc);
- }
-
- IFCLEARPGRES(pgres);
- }
-
- Dprintf("conn_set_client_encoding: set encoding to %s", self->encoding);
-
- pthread_mutex_unlock(&self->lock);
- Py_END_ALLOW_THREADS;
-
- if (res == -1)
- PyErr_Format(OperationalError, "can't set encoding to %s", enc);
-
- return res;
-}
+++ /dev/null
-/* connection_type.c - python interface to connection objects
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <structmember.h>
-#include <stringobject.h>
-
-#include <string.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/connection.h"
-#include "psycopg/cursor.h"
-
-/** DBAPI methods **/
-
-/* cursor method - allocate a new cursor */
-
-#define psyco_conn_cursor_doc \
-"cursor(cursor_factory=extensions.cursor) -- new cursor\n\n" \
-"Return a new cursor.\n\nThe ``cursor_factory`` argument can be used to\n" \
-"create non-standard cursors by passing a class different from the\n" \
-"default. Note that the new class *should* be a sub-class of\n" \
-"`extensions.cursor`.\n\n" \
-":rtype: `extensions.cursor`"
-
-static PyObject *
-psyco_conn_cursor(connectionObject *self, PyObject *args, PyObject *keywds)
-{
- char *name = NULL;
- PyObject *obj, *factory = NULL;
-
- static char *kwlist[] = {"name", "cursor_factory", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, keywds, "|sO", kwlist,
- &name, &factory)) {
- return NULL;
- }
-
- EXC_IF_CONN_CLOSED(self);
-
- Dprintf("psyco_conn_cursor: new cursor for connection at %p", self);
- Dprintf("psyco_conn_cursor: parameters: name = %s", name);
-
- if (factory == NULL) factory = (PyObject *)&cursorType;
- if (name)
- obj = PyObject_CallFunction(factory, "Os", self, name);
- else
- obj = PyObject_CallFunction(factory, "O", self);
-
- if (obj == NULL) return NULL;
- if (PyObject_IsInstance(obj, (PyObject *)&cursorType) == 0) {
- PyErr_SetString(PyExc_TypeError,
- "cursor factory must be subclass of psycopg2._psycopg.cursor");
- Py_DECREF(obj);
- return NULL;
- }
-
- Dprintf("psyco_conn_cursor: new cursor at %p: refcnt = %d",
- obj, obj->ob_refcnt);
- return obj;
-}
-
-
-/* close method - close the connection and all related cursors */
-
-#define psyco_conn_close_doc "close() -- Close the connection."
-
-static PyObject *
-psyco_conn_close(connectionObject *self, PyObject *args)
-{
- EXC_IF_CONN_CLOSED(self);
-
- if (!PyArg_ParseTuple(args, "")) return NULL;
-
- Dprintf("psyco_conn_close: closing connection at %p", self);
- conn_close(self);
- Dprintf("psyco_conn_close: connection at %p closed", self);
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-/* commit method - commit all changes to the database */
-
-#define psyco_conn_commit_doc "commit() -- Commit all changes to database."
-
-static PyObject *
-psyco_conn_commit(connectionObject *self, PyObject *args)
-{
- EXC_IF_CONN_CLOSED(self);
-
- if (!PyArg_ParseTuple(args, "")) return NULL;
-
- /* FIXME: check return status? */
- conn_commit(self);
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-/* rollback method - roll back all changes done to the database */
-
-#define psyco_conn_rollback_doc \
-"rollback() -- Roll back all changes done to database."
-
-static PyObject *
-psyco_conn_rollback(connectionObject *self, PyObject *args)
-{
- EXC_IF_CONN_CLOSED(self);
-
- if (!PyArg_ParseTuple(args, "")) return NULL;
-
- /* FIXME: check return status? */
- conn_rollback(self);
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-#ifdef PSYCOPG_EXTENSIONS
-/* set_isolation_level method - switch connection isolation level */
-
-#define psyco_conn_set_isolation_level_doc \
-"set_isolation_level(level) -- Switch isolation level to ``level``."
-
-static PyObject *
-psyco_conn_set_isolation_level(connectionObject *self, PyObject *args)
-{
- int level = 1;
-
- EXC_IF_CONN_CLOSED(self);
-
- if (!PyArg_ParseTuple(args, "i", &level)) return NULL;
-
- if (level < 0 || level > 2) {
- PyErr_SetString(PyExc_ValueError,
- "isolation level out of bounds (0,3)");
- return NULL;
- }
-
- /* FIXME: check return status? */
- conn_switch_isolation_level(self, level);
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-\f
-
-/* set_isolation_level method - switch connection isolation level */
-
-#define psyco_conn_set_client_encoding_doc \
-"set_client_encoding(encoding) -- Set client encoding to ``encoding``."
-
-static PyObject *
-psyco_conn_set_client_encoding(connectionObject *self, PyObject *args)
-{
- char *enc = NULL;
-
- EXC_IF_CONN_CLOSED(self);
-
- if (!PyArg_ParseTuple(args, "s", &enc)) return NULL;
-
- if (conn_set_client_encoding(self, enc) == 0) {
- Py_INCREF(Py_None);
- return Py_None;
- }
- else {
- return NULL;
- }
-}
-#endif
-
-
-/** the connection object **/
-
-
-/* object method list */
-
-static struct PyMethodDef connectionObject_methods[] = {
- {"cursor", (PyCFunction)psyco_conn_cursor,
- METH_VARARGS|METH_KEYWORDS, psyco_conn_cursor_doc},
- {"close", (PyCFunction)psyco_conn_close,
- METH_VARARGS, psyco_conn_close_doc},
- {"commit", (PyCFunction)psyco_conn_commit,
- METH_VARARGS, psyco_conn_commit_doc},
- {"rollback", (PyCFunction)psyco_conn_rollback,
- METH_VARARGS, psyco_conn_rollback_doc},
-#ifdef PSYCOPG_EXTENSIONS
- {"set_isolation_level", (PyCFunction)psyco_conn_set_isolation_level,
- METH_VARARGS, psyco_conn_set_isolation_level_doc},
- {"set_client_encoding", (PyCFunction)psyco_conn_set_client_encoding,
- METH_VARARGS, psyco_conn_set_client_encoding_doc},
-#endif
- {NULL}
-};
-
-/* object member list */
-
-static struct PyMemberDef connectionObject_members[] = {
- /* DBAPI-2.0 extensions (exception objects) */
- {"Error", T_OBJECT,
- offsetof(connectionObject, exc_Error), RO, Error_doc},
- {"Warning",
- T_OBJECT, offsetof(connectionObject, exc_Warning), RO, Warning_doc},
- {"InterfaceError", T_OBJECT,
- offsetof(connectionObject, exc_InterfaceError), RO,
- InterfaceError_doc},
- {"DatabaseError", T_OBJECT,
- offsetof(connectionObject, exc_DatabaseError), RO, DatabaseError_doc},
- {"InternalError", T_OBJECT,
- offsetof(connectionObject, exc_InternalError), RO, InternalError_doc},
- {"OperationalError", T_OBJECT,
- offsetof(connectionObject, exc_OperationalError), RO,
- OperationalError_doc},
- {"ProgrammingError", T_OBJECT,
- offsetof(connectionObject, exc_ProgrammingError), RO,
- ProgrammingError_doc},
- {"IntegrityError", T_OBJECT,
- offsetof(connectionObject, exc_IntegrityError), RO,
- IntegrityError_doc},
- {"DataError", T_OBJECT,
- offsetof(connectionObject, exc_DataError), RO, DataError_doc},
- {"NotSupportedError", T_OBJECT,
- offsetof(connectionObject, exc_NotSupportedError), RO,
- NotSupportedError_doc},
-#ifdef PSYCOPG_EXTENSIONS
- {"closed", T_LONG, offsetof(connectionObject, closed), RO,
- "True if the connection is closed."},
- {"isolation_level", T_LONG,
- offsetof(connectionObject, isolation_level), RO,
- "The current isolation level."},
- {"encoding", T_STRING, offsetof(connectionObject, encoding), RO,
- "The current client encoding."},
- {"notices", T_OBJECT, offsetof(connectionObject, notice_list), RO},
- {"notifies", T_OBJECT, offsetof(connectionObject, notifies), RO},
- {"dsn", T_STRING, offsetof(connectionObject, dsn), RO,
- "The current connection string."},
- {"status", T_LONG,
- offsetof(connectionObject, status), RO,
- "The current transaction status."},
-#endif
- {NULL}
-};
-
-/* initialization and finalization methods */
-
-static int
-connection_setup(connectionObject *self, char *dsn)
-{
- Dprintf("connection_setup: init connection object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
-
- self->dsn = strdup(dsn);
- self->notice_list = PyList_New(0);
- self->notifies = PyList_New(0);
- self->closed = 0;
- self->status = CONN_STATUS_READY;
- self->critical = NULL;
- self->async_cursor = NULL;
- self->pgconn = NULL;
- self->mark = 0;
-
- pthread_mutex_init(&(self->lock), NULL);
-
- if (conn_connect(self) != 0) {
- pthread_mutex_destroy(&(self->lock));
- Dprintf("connection_init: FAILED");
- return -1;
- }
-
- Dprintf("connection_setup: good connection object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
- return 0;
-}
-
-static void
-connection_dealloc(PyObject* obj)
-{
- connectionObject *self = (connectionObject *)obj;
-
- if (self->closed == 0) conn_close(self);
-
- if (self->dsn) free(self->dsn);
- if (self->encoding) PyMem_Free(self->encoding);
- if (self->critical) free(self->critical);
-
- Py_XDECREF(self->notice_list);
- Py_XDECREF(self->notifies);
- Py_XDECREF(self->async_cursor);
-
- pthread_mutex_destroy(&(self->lock));
-
- Dprintf("connection_dealloc: deleted connection object at %p, refcnt = %d",
- obj, obj->ob_refcnt);
-
- obj->ob_type->tp_free(obj);
-}
-
-static int
-connection_init(PyObject *obj, PyObject *args, PyObject *kwds)
-{
- char *dsn;
-
- if (!PyArg_ParseTuple(args, "s", &dsn))
- return -1;
-
- return connection_setup((connectionObject *)obj, dsn);
-}
-
-static PyObject *
-connection_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- return type->tp_alloc(type, 0);
-}
-
-static void
-connection_del(PyObject* self)
-{
- PyObject_Del(self);
-}
-
-static PyObject *
-connection_repr(connectionObject *self)
-{
- return PyString_FromFormat(
- "<connection object at %p; dsn: '%s', closed: %ld>",
- self, self->dsn, self->closed);
-}
-
-
-/* object type */
-
-#define connectionType_doc \
-"connection(dsn, ...) -> new connection object\n\n" \
-":Groups:\n" \
-" * `DBAPI-2.0 errors`: Error, Warning, InterfaceError,\n" \
-" DatabaseError, InternalError, OperationalError,\n" \
-" ProgrammingError, IntegrityError, DataError, NotSupportedError"
-
-PyTypeObject connectionType = {
- PyObject_HEAD_INIT(NULL)
- 0,
- "psycopg2._psycopg.connection",
- sizeof(connectionObject),
- 0,
- connection_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_compare*/
- (reprfunc)connection_repr, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
-
- 0, /*tp_call*/
- (reprfunc)connection_repr, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
-
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- connectionType_doc, /*tp_doc*/
-
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
-
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
-
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
-
- /* Attribute descriptor and subclassing stuff */
-
- connectionObject_methods, /*tp_methods*/
- connectionObject_members, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
-
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
-
- connection_init, /*tp_init*/
- 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/
- connection_new, /*tp_new*/
- (freefunc)connection_del, /*tp_free Low-level free-memory routine */
- 0, /*tp_is_gc For PyObject_IS_GC */
- 0, /*tp_bases*/
- 0, /*tp_mro method resolution order */
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0 /*tp_weaklist*/
-};
+++ /dev/null
-/* cursor.h - definition for the psycopg cursor type
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_CURSOR_H
-#define PSYCOPG_CURSOR_H 1
-
-#include <Python.h>
-#include <libpq-fe.h>
-
-#include "psycopg/connection.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern PyTypeObject cursorType;
-
-typedef struct {
- PyObject HEAD;
-
- connectionObject *conn; /* connection owning the cursor */
-
- int closed:1; /* 1 if the cursor is closed */
- int notuples:1; /* 1 if the command was not a SELECT query */
- int needsfetch:1; /* 1 if a call to pq_fetch is pending */
-
- long int rowcount; /* number of rows affected by last execute */
- long int columns; /* number of columns fetched from the db */
- long int arraysize; /* how many rows should fetchmany() return */
- long int row; /* the row counter for fetch*() operations */
- long int mark; /* transaction marker, copied from conn */
-
- PyObject *description; /* read-only attribute: sequence of 7-item
- sequences.*/
-
- /* postgres connection stuff */
- PGresult *pgres; /* result of last query */
- PyObject *pgstatus; /* last message from the server after an execute */
- Oid lastoid; /* last oid from an insert or InvalidOid */
-
- PyObject *casts; /* an array (tuple) of typecast functions */
- PyObject *caster; /* the current typecaster object */
-
- PyObject *copyfile; /* file-like used during COPY TO/FROM ops */
- long int copysize; /* size of the copy buffer during COPY TO/FROM ops */
-#define DEFAULT_COPYSIZE 16384
-
- PyObject *tuple_factory; /* factory for result tuples */
- PyObject *tzinfo_factory; /* factory for tzinfo objects */
-
- PyObject *query; /* last query executed */
-
- char *qattr; /* quoting attr, used when quoting strings */
- char *notice; /* a notice from the backend */
- char *name; /* this cursor name */
-
- PyObject *string_types; /* a set of typecasters for string types */
- PyObject *binary_types; /* a set of typecasters for binary types */
-
-} cursorObject;
-
-/* C-callable functions in cursor_int.c and cursor_ext.c */
-extern void curs_reset(cursorObject *self);
-
-/* exception-raising macros */
-#define EXC_IF_CURS_CLOSED(self) \
-if ((self)->closed || ((self)->conn && (self)->conn->closed)) { \
- PyErr_SetString(InterfaceError, "cursor already closed"); \
- return NULL; }
-
-#define EXC_IF_NO_TUPLES(self) \
-if ((self)->notuples && (self)->name == NULL) { \
- PyErr_SetString(ProgrammingError, "no results to fetch"); \
- return NULL; }
-
-#define EXC_IF_NO_MARK(self) \
-if ((self)->mark != (self)->conn->mark) { \
- PyErr_SetString(ProgrammingError, "named cursor isn't valid anymore"); \
- return NULL; }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_CURSOR_H) */
+++ /dev/null
-/* cursor_int.c - code used by the cursor object
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <string.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/cursor.h"
-#include "psycopg/pqpath.h"
-
-/* curs_reset - reset the cursor to a clean state */
-
-void
-curs_reset(cursorObject *self)
-{
- /* initialize some variables to default values */
- self->notuples = 1;
- self->rowcount = -1;
- self->row = 0;
-
- Py_XDECREF(self->description);
- Py_INCREF(Py_None);
- self->description = Py_None;
-
- Py_XDECREF(self->casts);
- self->casts = NULL;
-}
+++ /dev/null
-/* cursor_type.c - python interface to cursor objects
- *
- * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public Likcense
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <structmember.h>
-#include <string.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/cursor.h"
-#include "psycopg/connection.h"
-#include "psycopg/pqpath.h"
-#include "psycopg/typecast.h"
-#include "psycopg/microprotocols.h"
-#include "psycopg/microprotocols_proto.h"
-#include "pgversion.h"
-
-extern PyObject *pyPsycopgTzFixedOffsetTimezone;
-
-
-/** DBAPI methods **/
-
-/* close method - close the cursor */
-
-#define psyco_curs_close_doc \
-"close() -- Close the cursor."
-
-static PyObject *
-psyco_curs_close(cursorObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
-
- EXC_IF_CURS_CLOSED(self);
-
- if (self->name != NULL) {
- char buffer[128];
-
- EXC_IF_NO_MARK(self);
- PyOS_snprintf(buffer, 127, "CLOSE %s", self->name);
- if (pq_execute(self, buffer, 0) == -1) return NULL;
- }
-
- self->closed = 1;
- Dprintf("psyco_curs_close: cursor at %p closed", self);
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-/* execute method - executes a query */
-
-/* mogrify a query string and build argument array or dict */
-
-static int
-_mogrify(PyObject *var, PyObject *fmt, connectionObject *conn, PyObject **new)
-{
- PyObject *key, *value, *n, *item;
- char *d, *c;
- int index = 0, force = 0;
-
- /* from now on we'll use n and replace its value in *new only at the end,
- just before returning. we also init *new to NULL to exit with an error
- if we can't complete the mogrification */
- n = *new = NULL;
- c = PyString_AsString(fmt);
-
- while(*c) {
- /* handle plain percent symbol in format string */
- if (c[0] == '%' && c[1] == '%') {
- c+=2; force = 1;
- }
-
- /* if we find '%(' then this is a dictionary, we:
- 1/ find the matching ')' and extract the key name
- 2/ locate the value in the dictionary (or return an error)
- 3/ mogrify the value into something usefull (quoting)...
- 4/ ...and add it to the new dictionary to be used as argument
- */
- else if (c[0] == '%' && c[1] == '(') {
-
- /* let's have d point the end of the argument */
- for (d = c + 2; *d && *d != ')'; d++);
-
- if (*d == ')') {
- key = PyString_FromStringAndSize(c+2, d-c-2);
- value = PyObject_GetItem(var, key);
- /* key has refcnt 1, value the original value + 1 */
-
- /* if value is NULL we did not find the key (or this is not a
- dictionary): let python raise a KeyError */
- if (value == NULL) {
- Py_DECREF(key); /* destroy key */
- Py_XDECREF(n); /* destroy n */
- return -1;
- }
-
- Dprintf("_mogrify: value refcnt: %d (+1)", value->ob_refcnt);
-
- if (n == NULL) {
- n = PyDict_New();
- }
-
- if ((item = PyObject_GetItem(n, key)) == NULL) {
- PyObject *t = NULL;
-
- PyErr_Clear();
-
- /* None is always converted to NULL; this is an
- optimization over the adapting code and can go away in
- the future if somebody finds a None adapter usefull. */
- if (value == Py_None) {
- t = PyString_FromString("NULL");
- PyDict_SetItem(n, key, t);
- /* t is a new object, refcnt = 1, key is at 2 */
-
- /* if the value is None we need to substitute the
- formatting char with 's' (FIXME: this should not be
- necessary if we drop support for formats other than
- %s!) */
- while (*d && !isalpha(*d)) d++;
- if (*d) *d = 's';
- }
- else {
- t = microprotocol_getquoted(value, conn);
-
- if (t != NULL) {
- PyDict_SetItem(n, key, t);
- /* both key and t refcnt +1, key is at 2 now */
- }
- else {
- /* no adapter found, raise a BIG exception */
- Py_XDECREF(value);
- Py_DECREF(n);
- return -1;
- }
- }
-
- Py_XDECREF(t); /* t dies here */
- /* after the DECREF value has the original refcnt plus 1
- if it was added to the dictionary directly; good */
- Py_XDECREF(value);
- }
- else {
- /* we have an item with one extra refcnt here, zap! */
- Py_DECREF(item);
- }
- Py_DECREF(key); /* key has the original refcnt now */
- Dprintf("_mogrify: after value refcnt: %d",value->ob_refcnt);
- }
- c = d;
- }
-
- else if (c[0] == '%' && c[1] != '(') {
- /* this is a format that expects a tuple; it is much easier,
- because we don't need to check the old/new dictionary for
- keys */
-
- value = PySequence_GetItem(var, index);
- /* value has refcnt inc'ed by 1 here */
-
- /* if value is NULL this is not a sequence or the index is wrong;
- anyway we let python set its own exception */
- if (value == NULL) {
- Py_XDECREF(n);
- return -1;
- }
-
- if (n == NULL) {
- n = PyTuple_New(PyObject_Length(var));
- }
-
- /* let's have d point just after the '%' */
- d = c+1;
-
- if (value == Py_None) {
- PyTuple_SET_ITEM(n, index, PyString_FromString("NULL"));
- while (*d && !isalpha(*d)) d++;
- if (*d) *d = 's';
- Py_DECREF(value);
- }
- else {
- PyObject *t = microprotocol_getquoted(value, conn);
-
- if (t != NULL) {
- PyTuple_SET_ITEM(n, index, t);
- Py_DECREF(value);
- }
- else {
- Py_DECREF(n);
- Py_DECREF(value);
- return -1;
- }
- }
- c = d;
- index += 1;
- }
- else {
- c++;
- }
- }
-
- if (force && n == NULL)
- n = PyTuple_New(0);
- *new = n;
-
- return 0;
-}
-
-#define psyco_curs_execute_doc \
-"execute(query, vars=None, async=0) -- Execute query with bound vars."
-
-static int
-_psyco_curs_execute(cursorObject *self,
- PyObject *operation, PyObject *vars, long int async)
-{
- int res;
- PyObject *fquery, *cvt = NULL, *uoperation = NULL;
-
- pthread_mutex_lock(&(self->conn->lock));
- if (self->conn->async_cursor != NULL
- && self->conn->async_cursor != (PyObject*)self) {
- pthread_mutex_unlock(&(self->conn->lock));
- psyco_set_error(ProgrammingError, (PyObject*)self,
- "asynchronous query already in execution", NULL, NULL);
- return 0;
- }
- pthread_mutex_unlock(&(self->conn->lock));
-
- if (!PyObject_IsTrue(operation)) {
- psyco_set_error(ProgrammingError, (PyObject*)self,
- "can't execute an empty query", NULL, NULL);
- return 0;
- }
-
- if (PyUnicode_Check(operation)) {
- PyObject *enc = PyDict_GetItemString(psycoEncodings,
- self->conn->encoding);
- /* enc is a borrowed reference, we won't decref it */
-
- if (enc) {
- operation = PyUnicode_AsEncodedString(
- operation, PyString_AsString(enc), NULL);
-
- /* if there was an error during the encoding from unicode to the
- target encoding we just let the exception propagate */
- if (operation == NULL) return 0;
-
- /* we clone operation in uoperation to be sure to free it later */
- uoperation = operation;
- }
- else {
- PyErr_Format(InterfaceError, "can't encode unicode query to %s",
- self->conn->encoding);
- return 0;
- }
- }
- else if (!PyString_Check(operation)) {
- /* the operation is not unicode or string, raise an error */
- PyErr_SetString(PyExc_TypeError,
- "argument 1 must be a string or unicode object");
- return 0;
- }
-
- IFCLEARPGRES(self->pgres);
-
- if (self->query) {
- Py_DECREF(self->query);
- self->query = NULL;
- }
-
- Dprintf("psyco_curs_execute: starting execution of new query");
-
- /* here we are, and we have a sequence or a dictionary filled with
- objects to be substituted (bound variables). we try to be smart and do
- the right thing (i.e., what the user expects) */
-
- if (vars && vars != Py_None)
- {
- if(_mogrify(vars, operation, self->conn, &cvt) == -1) {
- Py_XDECREF(uoperation);
- return 0;
- }
- }
-
- if (vars && cvt) {
- /* if PyString_Format() return NULL an error occured: if the error is
- a TypeError we need to check the exception.args[0] string for the
- values:
-
- "not enough arguments for format string"
- "not all arguments converted"
-
- and return the appropriate ProgrammingError. we do that by grabbing
- the curren exception (we will later restore it if the type or the
- strings do not match.) */
-
- if (!(fquery = PyString_Format(operation, cvt))) {
- PyObject *err, *arg, *trace;
- int pe = 0;
-
- PyErr_Fetch(&err, &arg, &trace);
-
- if (err && PyErr_GivenExceptionMatches(err, PyExc_TypeError)) {
- Dprintf("psyco_curs_execute: TypeError exception catched");
- PyErr_NormalizeException(&err, &arg, &trace);
-
- if (PyObject_HasAttrString(arg, "args")) {
- PyObject *args = PyObject_GetAttrString(arg, "args");
- PyObject *str = PySequence_GetItem(args, 0);
- char *s = PyString_AS_STRING(str);
-
- Dprintf("psyco_curs_execute: -> %s", s);
-
- if (!strcmp(s, "not enough arguments for format string")
- || !strcmp(s, "not all arguments converted")) {
- Dprintf("psyco_curs_execute: -> got a match");
- psyco_set_error(ProgrammingError, (PyObject*)self,
- s, NULL, NULL);
- pe = 1;
- }
-
- Py_DECREF(args);
- Py_DECREF(str);
- }
- }
-
- /* if we did not manage our own exception, restore old one */
- if (pe == 1) {
- Py_XDECREF(err); Py_XDECREF(arg); Py_XDECREF(trace);
- }
- else {
- PyErr_Restore(err, arg, trace);
- }
- Py_XDECREF(uoperation);
- return 0;
- }
-
- if (self->name != NULL) {
- self->query = PyString_FromFormat(
- "DECLARE %s CURSOR WITHOUT HOLD FOR %s",
- self->name, PyString_AS_STRING(fquery));
- Py_DECREF(fquery);
- }
- else {
- self->query = fquery;
- }
-
- Dprintf("psyco_curs_execute: cvt->refcnt = %d", cvt->ob_refcnt);
- Py_DECREF(cvt);
- }
- else {
- if (self->name != NULL) {
- self->query = PyString_FromFormat(
- "DECLARE %s CURSOR WITHOUT HOLD FOR %s",
- self->name, PyString_AS_STRING(operation));
- }
- else {
- Py_INCREF(operation);
- self->query = operation;
- }
- }
-
- res = pq_execute(self, PyString_AS_STRING(self->query), async);
-
- Dprintf("psyco_curs_execute: res = %d, pgres = %p", res, self->pgres);
-
- Py_XDECREF(uoperation);
-
- return res == -1 ? 0 : 1;
-}
-
-static PyObject *
-psyco_curs_execute(cursorObject *self, PyObject *args, PyObject *kwargs)
-{
- long int async = 0;
- PyObject *vars = NULL, *operation = NULL;
-
- static char *kwlist[] = {"query", "vars", "async", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|Oi", kwlist,
- &operation, &vars, &async)) {
- return NULL;
- }
-
- if (self->name != NULL) {
- if (self->query != Py_None) {
- psyco_set_error(ProgrammingError, (PyObject*)self,
- "can't call .execute() on named cursors more than once",
- NULL, NULL);
- return NULL;
- }
- if (self->conn->isolation_level == 0) {
- psyco_set_error(ProgrammingError, (PyObject*)self,
- "can't use a named cursor outside of transactions", NULL, NULL);
- return NULL;
- }
- if (self->conn->mark != self->mark) {
- psyco_set_error(ProgrammingError, (PyObject*)self,
- "named cursor isn't valid anymore", NULL, NULL);
- return NULL;
- }
- }
-
- EXC_IF_CURS_CLOSED(self);
-
- if (_psyco_curs_execute(self, operation, vars, async)) {
- Py_INCREF(Py_None);
- return Py_None;
- }
- else {
- return NULL;
- }
-}
-
-#define psyco_curs_executemany_doc \
-"executemany(query, vars_list) -- Execute many queries with bound vars."
-
-static PyObject *
-psyco_curs_executemany(cursorObject *self, PyObject *args, PyObject *kwargs)
-{
- PyObject *operation = NULL, *vars = NULL;
- PyObject *v, *iter = NULL;
-
- static char *kwlist[] = {"query", "vars_list", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO", kwlist,
- &operation, &vars)) {
- return NULL;
- }
-
- EXC_IF_CURS_CLOSED(self);
-
- if (self->name != NULL) {
- psyco_set_error(ProgrammingError, (PyObject*)self,
- "can't call .executemany() on named cursors", NULL, NULL);
- return NULL;
- }
-
- if (!PyIter_Check(vars)) {
- vars = iter = PyObject_GetIter(vars);
- if (iter == NULL) return NULL;
- }
-
- while ((v = PyIter_Next(vars)) != NULL) {
- if (_psyco_curs_execute(self, operation, v, 0) == 0) {
- Py_DECREF(v);
- return NULL;
- }
- else {
- Py_DECREF(v);
- }
- }
- Py_XDECREF(iter);
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-#ifdef PSYCOPG_EXTENSIONS
-#define psyco_curs_mogrify_doc \
-"mogrify(query, vars=None) -> str -- Return query after vars binding."
-
-static PyObject *
-psyco_curs_mogrify(cursorObject *self, PyObject *args, PyObject *kwargs)
-{
- PyObject *vars = NULL, *cvt = NULL, *operation = NULL;
- PyObject *fquery;
-
- static char *kwlist[] = {"query", "vars", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O", kwlist,
- &operation, &vars)) {
- return NULL;
- }
-
- if (PyUnicode_Check(operation)) {
- PyErr_SetString(NotSupportedError,
- "unicode queries not yet supported");
- return NULL;
- }
-
- EXC_IF_CURS_CLOSED(self);
- IFCLEARPGRES(self->pgres);
-
- /* note that we don't overwrite the last query executed on the cursor, we
- just *return* the new query with bound variables
-
- TODO: refactor the common mogrification code (see psycopg_curs_execute
- for comments, the code is amost identical) */
-
- if (vars)
- {
- if(_mogrify(vars, operation, self->conn, &cvt) == -1) return NULL;
- }
-
- if (vars && cvt) {
- if (!(fquery = PyString_Format(operation, cvt))) {
- PyObject *err, *arg, *trace;
- int pe = 0;
-
- PyErr_Fetch(&err, &arg, &trace);
-
- if (err && PyErr_GivenExceptionMatches(err, PyExc_TypeError)) {
- Dprintf("psyco_curs_execute: TypeError exception catched");
- PyErr_NormalizeException(&err, &arg, &trace);
-
- if (PyObject_HasAttrString(arg, "args")) {
- PyObject *args = PyObject_GetAttrString(arg, "args");
- PyObject *str = PySequence_GetItem(args, 0);
- char *s = PyString_AS_STRING(str);
-
- Dprintf("psyco_curs_execute: -> %s", s);
-
- if (!strcmp(s, "not enough arguments for format string")
- || !strcmp(s, "not all arguments converted")) {
- Dprintf("psyco_curs_execute: -> got a match");
- psyco_set_error(ProgrammingError, (PyObject*)self,
- s, NULL, NULL);
- pe = 1;
- }
-
- Py_DECREF(args);
- Py_DECREF(str);
- }
- }
-
- /* if we did not manage our own exception, restore old one */
- if (pe == 1) {
- Py_XDECREF(err); Py_XDECREF(arg); Py_XDECREF(trace);
- }
- else {
- PyErr_Restore(err, arg, trace);
- }
- return NULL;
- }
-
- Dprintf("psyco_curs_execute: cvt->refcnt = %d, fquery->refcnt = %d",
- cvt->ob_refcnt, fquery->ob_refcnt);
- Py_DECREF(cvt);
- }
- else {
- fquery = operation;
- Py_INCREF(operation);
- }
-
- return fquery;
-}
-#endif
-
-
-/* fetchone method - fetch one row of results */
-
-#define psyco_curs_fetchone_doc \
-"fetchone() -> tuple or None\n\n" \
-"Return the next row of a query result set in the form of a tuple (by\n" \
-"default) or using the sequence factory previously set in the\n" \
-"`row_factory` attribute. Return `None` when no more data is available.\n"
-
-static int
-_psyco_curs_prefetch(cursorObject *self)
-{
- int i = 0;
-
- /* check if the fetching cursor is the one that did the asynchronous query
- and raise an exception if not */
- pthread_mutex_lock(&(self->conn->lock));
- if (self->conn->async_cursor != NULL
- && self->conn->async_cursor != (PyObject*)self) {
- pthread_mutex_unlock(&(self->conn->lock));
- psyco_set_error(ProgrammingError, (PyObject*)self,
- "asynchronous fetch by wrong cursor", NULL, NULL);
- return -2;
- }
- pthread_mutex_unlock(&(self->conn->lock));
-
- if (self->pgres == NULL || self->needsfetch) {
- self->needsfetch = 0;
- Dprintf("_psyco_curs_prefetch: trying to fetch data");
- do {
- i = pq_fetch(self);
- Dprintf("_psycopg_curs_prefetch: result = %d", i);
- } while(i == 1);
- }
-
- Dprintf("_psyco_curs_prefetch: result = %d", i);
- return i;
-}
-
-static PyObject *
-_psyco_curs_buildrow_fill(cursorObject *self, PyObject *res,
- int row, int n, int istuple)
-{
- int i, len;
- unsigned char *str;
- PyObject *val;
-
- for (i=0; i < n; i++) {
- if (PQgetisnull(self->pgres, row, i)) {
- str = NULL;
- len = 0;
- }
- else {
- str = (unsigned char*)PQgetvalue(self->pgres, row, i);
- len = PQgetlength(self->pgres, row, i);
- }
-
- Dprintf("_psyco_curs_buildrow: row %ld, element %d, len %i",
- self->row, i, len);
-
- val = typecast_cast(PyTuple_GET_ITEM(self->casts, i), (char*)str, len,
- (PyObject*)self);
-
- if (val) {
- Dprintf("_psyco_curs_buildrow: val->refcnt = %d", val->ob_refcnt);
- if (istuple) {
- PyTuple_SET_ITEM(res, i, val);
- }
- else {
- PySequence_SetItem(res, i, val);
- Py_DECREF(val);
- }
- }
- else {
- /* an error occurred in the type system, we return NULL to raise
- an exception. the typecast code should already have set the
- exception type and text */
- Py_DECREF(res);
- res = NULL;
- break;
- }
- }
- return res;
-}
-
-static PyObject *
-_psyco_curs_buildrow(cursorObject *self, int row)
-{
- int n;
-
- n = PQnfields(self->pgres);
- return _psyco_curs_buildrow_fill(self, PyTuple_New(n), row, n, 1);
-}
-
-static PyObject *
-_psyco_curs_buildrow_with_factory(cursorObject *self, int row)
-{
- int n;
- PyObject *res;
-
- n = PQnfields(self->pgres);
- if ((res = PyObject_CallFunction(self->tuple_factory, "O", self))== NULL)
- return NULL;
-
- return _psyco_curs_buildrow_fill(self, res, row, n, 0);
-}
-
-PyObject *
-psyco_curs_fetchone(cursorObject *self, PyObject *args)
-{
- PyObject *res;
-
- if (args && !PyArg_ParseTuple(args, "")) return NULL;
-
- EXC_IF_CURS_CLOSED(self)
- if (_psyco_curs_prefetch(self) < 0) return NULL;
- EXC_IF_NO_TUPLES(self);
-
- if (self->name != NULL) {
- char buffer[128];
-
- EXC_IF_NO_MARK(self);
- PyOS_snprintf(buffer, 127, "FETCH FORWARD 1 FROM %s", self->name);
- if (pq_execute(self, buffer, 0) == -1) return NULL;
- if (_psyco_curs_prefetch(self) < 0) return NULL;
- }
-
- Dprintf("psyco_curs_fetchone: fetching row %ld", self->row);
- Dprintf("psyco_curs_fetchone: rowcount = %ld", self->rowcount);
-
- if (self->row >= self->rowcount) {
- /* we exausted available data: return None */
- Py_INCREF(Py_None);
- return Py_None;
- }
-
- if (self->tuple_factory == Py_None)
- res = _psyco_curs_buildrow(self, self->row);
- else
- res = _psyco_curs_buildrow_with_factory(self, self->row);
-
- self->row++; /* move the counter to next line */
-
- /* if the query was async aggresively free pgres, to allow
- successive requests to reallocate it */
- if (self->row >= self->rowcount
- && self->conn->async_cursor == (PyObject*)self)
- IFCLEARPGRES(self->pgres);
-
- return res;
-}
-
-
-/* fetch many - fetch some results */
-
-#define psyco_curs_fetchmany_doc \
-"fetchmany(size=self.arraysize) -> list of tuple\n\n" \
-"Return the next `size` rows of a query result set in the form of a list\n" \
-"of tuples (by default) or using the sequence factory previously set in\n" \
-"the `row_factory` attribute. Return `None` when no more data is available.\n"
-
-PyObject *
-psyco_curs_fetchmany(cursorObject *self, PyObject *args, PyObject *kwords)
-{
- int i;
- PyObject *list, *res;
-
- long int size = self->arraysize;
- static char *kwlist[] = {"size", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwords, "|l", kwlist, &size)) {
- return NULL;
- }
-
- EXC_IF_CURS_CLOSED(self);
- if (_psyco_curs_prefetch(self) < 0) return NULL;
- EXC_IF_NO_TUPLES(self);
-
- if (self->name != NULL) {
- char buffer[128];
-
- EXC_IF_NO_MARK(self);
- PyOS_snprintf(buffer, 127, "FETCH FORWARD %d FROM %s",
- (int)size, self->name);
- if (pq_execute(self, buffer, 0) == -1) return NULL;
- if (_psyco_curs_prefetch(self) < 0) return NULL;
- }
-
- /* make sure size is not > than the available number of rows */
- if (size > self->rowcount - self->row || size < 0) {
- size = self->rowcount - self->row;
- }
-
- Dprintf("psyco_curs_fetchmany: size = %ld", size);
-
- if (size <= 0) {
- return PyList_New(0);
- }
-
- list = PyList_New(size);
-
- for (i = 0; i < size; i++) {
- if (self->tuple_factory == Py_None)
- res = _psyco_curs_buildrow(self, self->row);
- else
- res = _psyco_curs_buildrow_with_factory(self, self->row);
-
- self->row++;
-
- if (res == NULL) {
- Py_DECREF(list);
- return NULL;
- }
-
- PyList_SET_ITEM(list, i, res);
- }
-
- /* if the query was async aggresively free pgres, to allow
- successive requests to reallocate it */
- if (self->row >= self->rowcount
- && self->conn->async_cursor == (PyObject*)self)
- IFCLEARPGRES(self->pgres);
-
- return list;
-}
-
-
-/* fetch all - fetch all results */
-
-#define psyco_curs_fetchall_doc \
-"fetchall() -> list of tuple\n\n" \
-"Return all the remaining rows of a query result set.\n\n" \
-"Rows are returned in the form of a list of tuples (by default) or using\n" \
-"the sequence factory previously set in the `row_factory` attribute.\n" \
-"Return `None` when no more data is available.\n"
-
-PyObject *
-psyco_curs_fetchall(cursorObject *self, PyObject *args)
-{
- int i, size;
- PyObject *list, *res;
-
- if (!PyArg_ParseTuple(args, "")) {
- return NULL;
- }
-
- EXC_IF_CURS_CLOSED(self);
- if (_psyco_curs_prefetch(self) < 0) return NULL;
- EXC_IF_NO_TUPLES(self);
-
- if (self->name != NULL) {
- char buffer[128];
-
- EXC_IF_NO_MARK(self);
- PyOS_snprintf(buffer, 127, "FETCH FORWARD ALL FROM %s", self->name);
- if (pq_execute(self, buffer, 0) == -1) return NULL;
- if (_psyco_curs_prefetch(self) < 0) return NULL;
- }
-
- size = self->rowcount - self->row;
-
- if (size <= 0) {
- return PyList_New(0);
- }
-
- list = PyList_New(size);
-
- for (i = 0; i < size; i++) {
- if (self->tuple_factory == Py_None)
- res = _psyco_curs_buildrow(self, self->row);
- else
- res = _psyco_curs_buildrow_with_factory(self, self->row);
-
- self->row++;
-
- if (res == NULL) {
- Py_DECREF(list);
- return NULL;
- }
-
- PyList_SET_ITEM(list, i, res);
- }
-
- /* if the query was async aggresively free pgres, to allow
- successive requests to reallocate it */
- if (self->row >= self->rowcount
- && self->conn->async_cursor == (PyObject*)self)
- IFCLEARPGRES(self->pgres);
-
- return list;
-}
-
-
-/* callproc method - execute a stored procedure */
-
-#define psyco_curs_callproc_doc \
-"callproc(procname, parameters=None, async=0) -- Execute stored procedure."
-
-static PyObject *
-psyco_curs_callproc(cursorObject *self, PyObject *args, PyObject *kwargs)
-{
- char *procname = NULL, *sql = NULL;
- long int async = 0;
- int i, nparameters = 0, sl = 0;
- PyObject *parameters = NULL;
- PyObject *operation = NULL;
- PyObject *res = NULL;
-
- if (!PyArg_ParseTuple(args, "s|Oi", &procname, ¶meters, &async)) {
- return NULL;
- }
-
- EXC_IF_CURS_CLOSED(self);
-
- if (self->name != NULL) {
- psyco_set_error(ProgrammingError, (PyObject*)self,
- "can't call .callproc() on named cursors", NULL, NULL);
- return NULL;
- }
-
- if(parameters && parameters != Py_None) {
- nparameters = PyObject_Length(parameters);
- if (nparameters < 0) nparameters = 0;
- }
-
- /* allocate some memory, build the SQL and create a PyString from it */
- sl = strlen(procname) + 10 + nparameters*3 - (nparameters ? 1 : 0);
- sql = (char*)PyMem_Malloc(sl);
- if (sql == NULL) return NULL;
-
- sprintf(sql, "SELECT %s(", procname);
- for(i=0; i<nparameters; i++) {
- strcat(sql, "%s,");
- }
- sql[sl-2] = ')';
- sql[sl-1] = '\0';
-
- operation = PyString_FromString(sql);
- PyMem_Free((void*)sql);
-
- if (_psyco_curs_execute(self, operation, parameters, async)) {
- Py_INCREF(Py_None);
- res = Py_None;
- }
-
- Py_DECREF(operation);
- return res;
-}
-
-
-/* nextset method - return the next set of data (not supported) */
-
-#define psyco_curs_nextset_doc \
-"nextset() -- Skip to next set of data.\n\n" \
-"This method is not supported (PostgreSQL does not have multiple data \n" \
-"sets) and will raise a NotSupportedError exception."
-
-static PyObject *
-psyco_curs_nextset(cursorObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
-
- EXC_IF_CURS_CLOSED(self);
-
- PyErr_SetString(NotSupportedError, "not supported by PostgreSQL");
- return NULL;
-}
-
-
-/* setinputsizes - predefine memory areas for execute (does nothing) */
-
-#define psyco_curs_setinputsizes_doc \
-"setinputsizes(sizes) -- Set memory areas before execute.\n\n" \
-"This method currently does nothing but it is safe to call it."
-
-static PyObject *
-psyco_curs_setinputsizes(cursorObject *self, PyObject *args)
-{
- PyObject *sizes;
-
- if (!PyArg_ParseTuple(args, "O", &sizes))
- return NULL;
-
- EXC_IF_CURS_CLOSED(self);
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-/* setoutputsize - predefine memory areas for execute (does nothing) */
-
-#define psyco_curs_setoutputsize_doc \
-"setoutputsize(size, column=None) -- Set column buffer size.\n\n" \
-"This method currently does nothing but it is safe to call it."
-
-static PyObject *
-psyco_curs_setoutputsize(cursorObject *self, PyObject *args)
-{
- long int size, column;
-
- if (!PyArg_ParseTuple(args, "l|l", &size, &column))
- return NULL;
-
- EXC_IF_CURS_CLOSED(self);
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-/* scroll - scroll position in result list */
-
-#define psyco_curs_scroll_doc \
-"scroll(value, mode='relative') -- Scroll to new position according to mode."
-
-static PyObject *
-psyco_curs_scroll(cursorObject *self, PyObject *args, PyObject *kwargs)
-{
- int value, newpos;
- char *mode = "relative";
-
- static char *kwlist[] = {"value", "mode", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|s",
- kwlist, &value, &mode))
- return NULL;
-
- EXC_IF_CURS_CLOSED(self);
-
- /* if the cursor is not named we have the full result set and we can do
- our own calculations to scroll; else we just delegate the scrolling
- to the MOVE SQL statement */
- if (self->name == NULL) {
- if (strcmp(mode, "relative") == 0) {
- newpos = self->row + value;
- } else if (strcmp( mode, "absolute") == 0) {
- newpos = value;
- } else {
- psyco_set_error(ProgrammingError, (PyObject*)self,
- "scroll mode must be 'relative' or 'absolute'", NULL, NULL);
- return NULL;
- }
-
- if (newpos < 0 || newpos >= self->rowcount ) {
- psyco_set_error(ProgrammingError, (PyObject*)self,
- "scroll destination out of bounds", NULL, NULL);
- return NULL;
- }
-
- self->row = newpos;
- }
-
- else {
- char buffer[128];
-
- EXC_IF_NO_MARK(self);
-
- if (strcmp(mode, "absolute") == 0) {
- PyOS_snprintf(buffer, 127, "MOVE ABSOLUTE %d FROM %s",
- value, self->name);
- }
- else {
- PyOS_snprintf(buffer, 127, "MOVE %d FROM %s", value, self->name);
- }
- if (pq_execute(self, buffer, 0) == -1) return NULL;
- if (_psyco_curs_prefetch(self) < 0) return NULL;
- }
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-#ifdef PSYCOPG_EXTENSIONS
-
-/* extension: copy_from - implements COPY FROM */
-
-#define psyco_curs_copy_from_doc \
-"copy_from(file, table, sep='\\t', null='\\N', columns=None) -- Copy table from file."
-
-static int
-_psyco_curs_has_read_check(PyObject* o, void* var)
-{
- if (PyObject_HasAttrString(o, "readline")
- && PyObject_HasAttrString(o, "read")) {
- Py_INCREF(o);
- *((PyObject**)var) = o;
- return 1;
- }
- else {
- PyErr_SetString(PyExc_TypeError,
- "argument 1 must have both .read() and .readline() methods");
- return 0;
- }
-}
-
-static PyObject *
-psyco_curs_copy_from(cursorObject *self, PyObject *args, PyObject *kwargs)
-{
- char query[1024];
- char *table_name;
- char *sep = "\t", *null = NULL;
- long int bufsize = DEFAULT_COPYSIZE;
- PyObject *file, *columns = NULL, *res = NULL;
- char columnlist[1024] = "";
-
- static char *kwlist[] = {"file", "table", "sep", "null", "size",
- "columns", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&s|ssiO", kwlist,
- _psyco_curs_has_read_check, &file,
- &table_name, &sep, &null, &bufsize,
- &columns)) {
- return NULL;
- }
-
- if (columns != NULL && columns != Py_None) {
- PyObject* collistiter = PyObject_GetIter(columns);
- PyObject* col;
- int collistlen = 2;
- int colitemlen;
- char* colname;
- if (collistiter == NULL) {
- return NULL;
- }
- strcpy(columnlist, " (");
- while ((col = PyIter_Next(collistiter)) != NULL) {
- if (!PyString_Check(col)) {
- Py_DECREF(col);
- Py_DECREF(collistiter);
- PyErr_SetString(PyExc_ValueError,
- "Elements in column list must be strings");
- return NULL;
- }
- PyString_AsStringAndSize(col, &colname, &colitemlen);
- if (collistlen + colitemlen > 1022) {
- Py_DECREF(col);
- Py_DECREF(collistiter);
- PyErr_SetString(PyExc_ValueError, "Column list too long");
- return NULL;
- }
- strncpy(&columnlist[collistlen], colname, colitemlen);
- collistlen += colitemlen;
- columnlist[collistlen++] = ',';
- Py_DECREF(col);
- }
- Py_DECREF(collistiter);
-
- if (collistlen == 2) { /* empty list; we printed no comma */
- collistlen++;
- }
-
- columnlist[collistlen - 1] = ')';
- columnlist[collistlen] = '\0';
- }
-
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- EXC_IF_CURS_CLOSED(self);
-
- if (null) {
- PyOS_snprintf(query, 1023, "COPY %s%s FROM stdin USING DELIMITERS '%s'"
- " WITH NULL AS '%s'", table_name, columnlist, sep, null);
- }
- else {
- PyOS_snprintf(query, 1023, "COPY %s%s FROM stdin USING DELIMITERS '%s'",
- table_name, columnlist, sep);
- }
- Dprintf("psyco_curs_copy_from: query = %s", query);
-
- self->copysize = bufsize;
- self->copyfile = file;
-
- if (pq_execute(self, query, 0) == 1) {
- res = Py_None;
- Py_INCREF(Py_None);
- }
-
- self->copyfile =NULL;
-
- return res;
-}
-
-#define psyco_curs_copy_to_doc \
-"copy_to(file, table, sep='\\t', null='\\N') -- Copy table to file."
-
-static int
-_psyco_curs_has_write_check(PyObject* o, void* var)
-{
- if (PyObject_HasAttrString(o, "write")) {
- Py_INCREF(o);
- *((PyObject**)var) = o;
- return 1;
- }
- else {
- PyErr_SetString(PyExc_TypeError,
- "argument 1 must have a .write() method");
- return 0;
- }
-}
-
-static PyObject *
-psyco_curs_copy_to(cursorObject *self, PyObject *args, PyObject *kwargs)
-{
- char query[256];
- char *table_name;
- char *sep = "\t", *null = NULL;
- PyObject *file, *res = NULL;
-
- static char *kwlist[] = {"file", "table", "sep", "null", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&s|ss", kwlist,
- _psyco_curs_has_write_check, &file,
- &table_name, &sep, &null)) {
- return NULL;
- }
-
- EXC_IF_CURS_CLOSED(self);
-
- if (null) {
- PyOS_snprintf(query, 255, "COPY %s TO stdout USING DELIMITERS '%s'"
- " WITH NULL AS '%s'", table_name, sep, null);
- }
- else {
- PyOS_snprintf(query, 255, "COPY %s TO stdout USING DELIMITERS '%s'",
- table_name, sep);
- }
-
- self->copysize = 0;
- self->copyfile = file;
-
- if (pq_execute(self, query, 0) == 1) {
- res = Py_None;
- Py_INCREF(Py_None);
- }
-
- self->copyfile = NULL;
-
- return res;
-}
-/* extension: fileno - return the file descripor of the connection */
-
-#define psyco_curs_fileno_doc \
-"fileno() -> int -- Return file descriptor associated to database connection."
-
-static PyObject *
-psyco_curs_fileno(cursorObject *self, PyObject *args)
-{
- long int socket;
-
- if (!PyArg_ParseTuple(args, "")) return NULL;
- EXC_IF_CURS_CLOSED(self);
-
- /* note how we call PQflush() to make sure the user will use
- select() in the safe way! */
- pthread_mutex_lock(&(self->conn->lock));
- Py_BEGIN_ALLOW_THREADS;
- PQflush(self->conn->pgconn);
- socket = (long int)PQsocket(self->conn->pgconn);
- Py_END_ALLOW_THREADS;
- pthread_mutex_unlock(&(self->conn->lock));
-
- return PyInt_FromLong(socket);
-}
-
-/* extension: isready - return true if data from async execute is ready */
-
-#define psyco_curs_isready_doc \
-"isready() -> bool -- Return True if data is ready after an async query."
-
-static PyObject *
-psyco_curs_isready(cursorObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
- EXC_IF_CURS_CLOSED(self);
-
- /* pq_is_busy does its own locking, we don't need anything special but if
- the cursor is ready we need to fetch the result and free the connection
- for the next query. */
-
- if (pq_is_busy(self->conn)) {
- Py_INCREF(Py_False);
- return Py_False;
- }
- else {
- IFCLEARPGRES(self->pgres);
- pthread_mutex_lock(&(self->conn->lock));
- self->pgres = PQgetResult(self->conn->pgconn);
- self->conn->async_cursor = NULL;
- pthread_mutex_unlock(&(self->conn->lock));
- self->needsfetch = 1;
- Py_INCREF(Py_True);
- return Py_True;
- }
-}
-
-#endif
-
-
-/** the cursor object **/
-
-/* iterator protocol */
-
-static PyObject *
-cursor_iter(PyObject *self)
-{
- EXC_IF_CURS_CLOSED((cursorObject*)self);
- Py_INCREF(self);
- return self;
-}
-
-static PyObject *
-cursor_next(PyObject *self)
-{
- PyObject *res;
-
- /* we don't parse arguments: psyco_curs_fetchone will do that for us */
- res = psyco_curs_fetchone((cursorObject*)self, NULL);
-
- /* convert a None to NULL to signal the end of iteration */
- if (res && res == Py_None) {
- Py_DECREF(res);
- res = NULL;
- }
- return res;
-}
-
-/* object method list */
-
-static struct PyMethodDef cursorObject_methods[] = {
- /* DBAPI-2.0 core */
- {"close", (PyCFunction)psyco_curs_close,
- METH_VARARGS, psyco_curs_close_doc},
- {"execute", (PyCFunction)psyco_curs_execute,
- METH_VARARGS|METH_KEYWORDS, psyco_curs_execute_doc},
- {"executemany", (PyCFunction)psyco_curs_executemany,
- METH_VARARGS|METH_KEYWORDS, psyco_curs_executemany_doc},
- {"fetchone", (PyCFunction)psyco_curs_fetchone,
- METH_VARARGS, psyco_curs_fetchone_doc},
- {"fetchmany", (PyCFunction)psyco_curs_fetchmany,
- METH_VARARGS|METH_KEYWORDS, psyco_curs_fetchmany_doc},
- {"fetchall", (PyCFunction)psyco_curs_fetchall,
- METH_VARARGS, psyco_curs_fetchall_doc},
- {"callproc", (PyCFunction)psyco_curs_callproc,
- METH_VARARGS, psyco_curs_callproc_doc},
- {"nextset", (PyCFunction)psyco_curs_nextset,
- METH_VARARGS, psyco_curs_nextset_doc},
- {"setinputsizes", (PyCFunction)psyco_curs_setinputsizes,
- METH_VARARGS, psyco_curs_setinputsizes_doc},
- {"setoutputsize", (PyCFunction)psyco_curs_setoutputsize,
- METH_VARARGS, psyco_curs_setoutputsize_doc},
- /* DBAPI-2.0 extensions */
- {"scroll", (PyCFunction)psyco_curs_scroll,
- METH_VARARGS|METH_KEYWORDS, psyco_curs_scroll_doc},
- /* psycopg extensions */
-#ifdef PSYCOPG_EXTENSIONS
- {"mogrify", (PyCFunction)psyco_curs_mogrify,
- METH_VARARGS|METH_KEYWORDS, psyco_curs_mogrify_doc},
- {"fileno", (PyCFunction)psyco_curs_fileno,
- METH_VARARGS, psyco_curs_fileno_doc},
- {"isready", (PyCFunction)psyco_curs_isready,
- METH_VARARGS, psyco_curs_isready_doc},
- {"copy_from", (PyCFunction)psyco_curs_copy_from,
- METH_VARARGS|METH_KEYWORDS, psyco_curs_copy_from_doc},
- {"copy_to", (PyCFunction)psyco_curs_copy_to,
- METH_VARARGS|METH_KEYWORDS, psyco_curs_copy_to_doc},
-#endif
- {NULL}
-};
-
-/* object member list */
-
-#define OFFSETOF(x) offsetof(cursorObject, x)
-
-static struct PyMemberDef cursorObject_members[] = {
- /* DBAPI-2.0 basics */
- {"rowcount", T_LONG, OFFSETOF(rowcount), RO,
- "Number of rows read from the backend in the last command."},
- {"arraysize", T_LONG, OFFSETOF(arraysize), 0,
- "Number of records `fetchmany()` must fetch if not explicitely " \
- "specified."},
- {"description", T_OBJECT, OFFSETOF(description), RO,
- "Cursor description as defined in DBAPI-2.0."},
- {"lastrowid", T_LONG, OFFSETOF(lastoid), RO,
- "The ``oid`` of the last row inserted by the cursor."},
- /* DBAPI-2.0 extensions */
- {"rownumber", T_LONG, OFFSETOF(row), RO,
- "The current row position."},
- {"connection", T_OBJECT, OFFSETOF(conn), RO,
- "The connection where the cursor comes from."},
-#ifdef PSYCOPG_EXTENSIONS
- {"name", T_STRING, OFFSETOF(name), RO},
- {"statusmessage", T_OBJECT, OFFSETOF(pgstatus), RO,
- "The return message of the last command."},
- {"query", T_OBJECT, OFFSETOF(query), RO,
- "The last query text sent to the backend."},
- {"row_factory", T_OBJECT, OFFSETOF(tuple_factory), 0},
- {"tzinfo_factory", T_OBJECT, OFFSETOF(tzinfo_factory), 0},
- {"typecaster", T_OBJECT, OFFSETOF(caster), RO},
- {"string_types", T_OBJECT, OFFSETOF(string_types), 0},
- {"binary_types", T_OBJECT, OFFSETOF(binary_types), 0},
-#endif
- {NULL}
-};
-
-/* initialization and finalization methods */
-
-static int
-cursor_setup(cursorObject *self, connectionObject *conn, char *name)
-{
- Dprintf("cursor_setup: init cursor object at %p", self);
- Dprintf("cursor_setup: parameters: name = %s, conn = %p", name, conn);
-
- if (name) {
- self->name = PyMem_Malloc(strlen(name)+1);
- if (self->name == NULL) return 1;
- strncpy(self->name, name, strlen(name)+1);
- }
-
- /* FIXME: why does this raise an excpetion on the _next_ line of code?
- if (PyObject_IsInstance((PyObject*)conn,
- (PyObject *)&connectionType) == 0) {
- PyErr_SetString(PyExc_TypeError,
- "argument 1 must be subclass of psycopg2._psycopg.connection");
- return 1;
- } */
- self->conn = conn;
- Py_INCREF((PyObject*)self->conn);
-
- self->closed = 0;
- self->mark = conn->mark;
- self->pgres = NULL;
- self->notuples = 1;
- self->arraysize = 1;
- self->rowcount = -1;
- self->lastoid = InvalidOid;
-
- self->casts = NULL;
- self->notice = NULL;
-
- self->string_types = NULL;
- self->binary_types = NULL;
-
- self->description = Py_None;
- Py_INCREF(Py_None);
- self->pgstatus = Py_None;
- Py_INCREF(Py_None);
- self->tuple_factory = Py_None;
- Py_INCREF(Py_None);
- self->query = Py_None;
- Py_INCREF(Py_None);
-
- /* default tzinfo factory */
- self->tzinfo_factory = pyPsycopgTzFixedOffsetTimezone;
- Py_INCREF(self->tzinfo_factory);
-
- Dprintf("cursor_setup: good cursor object at %p, refcnt = %d",
- self, ((PyObject *)self)->ob_refcnt);
- return 0;
-}
-
-static void
-cursor_dealloc(PyObject* obj)
-{
- cursorObject *self = (cursorObject *)obj;
-
- if (self->name) PyMem_Free(self->name);
-
- Py_XDECREF((PyObject*)self->conn);
- Py_XDECREF(self->casts);
- Py_XDECREF(self->description);
- Py_XDECREF(self->pgstatus);
- Py_XDECREF(self->tuple_factory);
- Py_XDECREF(self->tzinfo_factory);
- Py_XDECREF(self->query);
-
- IFCLEARPGRES(self->pgres);
-
- Dprintf("cursor_dealloc: deleted cursor object at %p, refcnt = %d",
- obj, obj->ob_refcnt);
-
- obj->ob_type->tp_free(obj);
-}
-
-static int
-cursor_init(PyObject *obj, PyObject *args, PyObject *kwds)
-{
- char *name = NULL;
- PyObject *conn;
-
- if (!PyArg_ParseTuple(args, "O|s", &conn, &name))
- return -1;
-
- return cursor_setup((cursorObject *)obj, (connectionObject *)conn, name);
-}
-
-static PyObject *
-cursor_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- return type->tp_alloc(type, 0);
-}
-
-static void
-cursor_del(PyObject* self)
-{
- PyObject_Del(self);
-}
-
-static PyObject *
-cursor_repr(cursorObject *self)
-{
- return PyString_FromFormat(
- "<cursor object at %p; closed: %d>", self, self->closed);
-}
-
-
-/* object type */
-
-#define cursorType_doc \
-"A database cursor."
-
-PyTypeObject cursorType = {
- PyObject_HEAD_INIT(NULL)
- 0,
- "psycopg2._psycopg.cursor",
- sizeof(cursorObject),
- 0,
- cursor_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_compare*/
- (reprfunc)cursor_repr, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
-
- 0, /*tp_call*/
- (reprfunc)cursor_repr, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
-
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_ITER, /*tp_flags*/
- cursorType_doc, /*tp_doc*/
-
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
-
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
-
- cursor_iter, /*tp_iter*/
- cursor_next, /*tp_iternext*/
-
- /* Attribute descriptor and subclassing stuff */
-
- cursorObject_methods, /*tp_methods*/
- cursorObject_members, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
-
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
-
- cursor_init, /*tp_init*/
- 0, /*tp_alloc Will be set to PyType_GenericAlloc in module init*/
- cursor_new, /*tp_new*/
- (freefunc)cursor_del, /*tp_free Low-level free-memory routine */
- 0, /*tp_is_gc For PyObject_IS_GC */
- 0, /*tp_bases*/
- 0, /*tp_mro method resolution order */
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0 /*tp_weaklist*/
-};
+++ /dev/null
-/* microprotocols.c - minimalist and non-validating protocols implementation
- *
- * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <structmember.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/cursor.h"
-#include "psycopg/connection.h"
-#include "psycopg/microprotocols.h"
-#include "psycopg/microprotocols_proto.h"
-
-
-/** the adapters registry **/
-
-PyObject *psyco_adapters;
-
-/* microprotocols_init - initialize the adapters dictionary */
-
-int
-microprotocols_init(PyObject *dict)
-{
- /* create adapters dictionary and put it in module namespace */
- if ((psyco_adapters = PyDict_New()) == NULL) {
- return -1;
- }
-
- PyDict_SetItemString(dict, "adapters", psyco_adapters);
-
- return 0;
-}
-
-
-/* microprotocols_add - add a reverse type-caster to the dictionary */
-
-int
-microprotocols_add(PyTypeObject *type, PyObject *proto, PyObject *cast)
-{
- if (proto == NULL) proto = (PyObject*)&isqlquoteType;
-
- Dprintf("microprotocols_add: cast %p for (%s, ?)", cast, type->tp_name);
-
- PyDict_SetItem(psyco_adapters,
- Py_BuildValue("(OO)", (PyObject*)type, proto),
- cast);
- return 0;
-}
-
-/* microprotocols_adapt - adapt an object to the built-in protocol */
-
-PyObject *
-microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt)
-{
- PyObject *adapter, *key;
-
- /* we don't check for exact type conformance as specified in PEP 246
- because the ISQLQuote type is abstract and there is no way to get a
- quotable object to be its instance */
-
- Dprintf("microprotocols_adapt: trying to adapt %s", obj->ob_type->tp_name);
-
- /* look for an adapter in the registry */
- key = Py_BuildValue("(OO)", (PyObject*)obj->ob_type, proto);
- adapter = PyDict_GetItem(psyco_adapters, key);
- Py_DECREF(key);
- if (adapter) {
- PyObject *adapted = PyObject_CallFunctionObjArgs(adapter, obj, NULL);
- return adapted;
- }
-
- /* try to have the protocol adapt this object*/
- if (PyObject_HasAttrString(proto, "__adapt__")) {
- PyObject *adapted = PyObject_CallMethod(proto, "__adapt__", "O", obj);
- if (adapted && adapted != Py_None) return adapted;
- Py_XDECREF(adapted);
- if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_TypeError))
- return NULL;
- }
-
- /* and finally try to have the object adapt itself */
- if (PyObject_HasAttrString(obj, "__conform__")) {
- PyObject *adapted = PyObject_CallMethod(obj, "__conform__","O", proto);
- if (adapted && adapted != Py_None) return adapted;
- Py_XDECREF(adapted);
- if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_TypeError))
- return NULL;
- }
-
- /* else set the right exception and return NULL */
- psyco_set_error(ProgrammingError, NULL, "can't adapt", NULL, NULL);
- return NULL;
-}
-
-/* microprotocol_getquoted - utility function that adapt and call getquoted */
-
-PyObject *
-microprotocol_getquoted(PyObject *obj, connectionObject *conn)
-{
- PyObject *res = NULL;
- PyObject *tmp = microprotocols_adapt(
- obj, (PyObject*)&isqlquoteType, NULL);
-
- if (tmp != NULL) {
- Dprintf("microprotocol_getquoted: adapted to %s",
- tmp->ob_type->tp_name);
-
- /* if requested prepare the object passing it the connection */
- if (PyObject_HasAttrString(tmp, "prepare") && conn) {
- res = PyObject_CallMethod(tmp, "prepare", "O", (PyObject*)conn);
- if (res == NULL) {
- Py_DECREF(tmp);
- return NULL;
- }
- else {
- Py_DECREF(res);
- }
- }
-
- /* call the getquoted method on tmp (that should exist because we
- adapted to the right protocol) */
- res = PyObject_CallMethod(tmp, "getquoted", NULL);
- Py_DECREF(tmp);
- }
-
- /* we return res with one extra reference, the caller shall free it */
- return res;
-}
-
-
-/** module-level functions **/
-
-PyObject *
-psyco_microprotocols_adapt(cursorObject *self, PyObject *args)
-{
- PyObject *obj, *alt = NULL;
- PyObject *proto = (PyObject*)&isqlquoteType;
-
- if (!PyArg_ParseTuple(args, "O|OO", &obj, &proto, &alt)) return NULL;
- return microprotocols_adapt(obj, proto, alt);
-}
+++ /dev/null
-/* microprotocols.c - definitions for minimalist and non-validating protocols
- *
- * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_MICROPROTOCOLS_H
-#define PSYCOPG_MICROPROTOCOLS_H 1
-
-#include <Python.h>
-#include "psycopg/connection.h"
-#include "psycopg/cursor.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** adapters registry **/
-
-extern PyObject *psyco_adapters;
-
-/** the names of the three mandatory methods **/
-
-#define MICROPROTOCOLS_GETQUOTED_NAME "getquoted"
-#define MICROPROTOCOLS_GETSTRING_NAME "getstring"
-#define MICROPROTOCOLS_GETBINARY_NAME "getbinary"
-
-/** exported functions **/
-
-/* used by module.c to init the microprotocols system */
-extern int microprotocols_init(PyObject *dict);
-extern int microprotocols_add(
- PyTypeObject *type, PyObject *proto, PyObject *cast);
-
-extern PyObject *microprotocols_adapt(
- PyObject *obj, PyObject *proto, PyObject *alt);
-extern PyObject *microprotocol_getquoted(
- PyObject *obj, connectionObject *conn);
-
-extern PyObject *
- psyco_microprotocols_adapt(cursorObject *self, PyObject *args);
-#define psyco_microprotocols_adapt_doc \
- "adapt(obj, protocol, alternate) -> object -- adapt obj to given protocol"
-
-#endif /* !defined(PSYCOPG_MICROPROTOCOLS_H) */
+++ /dev/null
-/* microprotocol_proto.c - psycopg protocols
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <structmember.h>
-#include <stringobject.h>
-
-#include <string.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/microprotocols_proto.h"
-
-
-/** void protocol implementation **/
-
-
-/* getquoted - return quoted representation for object */
-
-#define psyco_isqlquote_getquoted_doc \
-"getquoted() -- return SQL-quoted representation of this object"
-
-static PyObject *
-psyco_isqlquote_getquoted(isqlquoteObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-/* getbinary - return quoted representation for object */
-
-#define psyco_isqlquote_getbinary_doc \
-"getbinary() -- return SQL-quoted binary representation of this object"
-
-static PyObject *
-psyco_isqlquote_getbinary(isqlquoteObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-/* getbuffer - return quoted representation for object */
-
-#define psyco_isqlquote_getbuffer_doc \
-"getbuffer() -- return this object"
-
-static PyObject *
-psyco_isqlquote_getbuffer(isqlquoteObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, "")) return NULL;
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-\f
-
-/** the ISQLQuote object **/
-
-
-/* object method list */
-
-static struct PyMethodDef isqlquoteObject_methods[] = {
- {"getquoted", (PyCFunction)psyco_isqlquote_getquoted,
- METH_VARARGS, psyco_isqlquote_getquoted_doc},
- {"getbinary", (PyCFunction)psyco_isqlquote_getbinary,
- METH_VARARGS, psyco_isqlquote_getbinary_doc},
- {"getbuffer", (PyCFunction)psyco_isqlquote_getbuffer,
- METH_VARARGS, psyco_isqlquote_getbuffer_doc},
- /* {"prepare", (PyCFunction)psyco_isqlquote_prepare,
- METH_VARARGS, psyco_isqlquote_prepare_doc}, */
- {NULL}
-};
-
-/* object member list */
-
-static struct PyMemberDef isqlquoteObject_members[] = {
- /* DBAPI-2.0 extensions (exception objects) */
- {"_wrapped", T_OBJECT, offsetof(isqlquoteObject, wrapped), RO},
- {NULL}
-};
-
-/* initialization and finalization methods */
-
-static int
-isqlquote_setup(isqlquoteObject *self, PyObject *wrapped)
-{
- self->wrapped = wrapped;
- Py_INCREF(wrapped);
-
- return 0;
-}
-
-static void
-isqlquote_dealloc(PyObject* obj)
-{
- isqlquoteObject *self = (isqlquoteObject *)obj;
-
- Py_XDECREF(self->wrapped);
-
- obj->ob_type->tp_free(obj);
-}
-
-static int
-isqlquote_init(PyObject *obj, PyObject *args, PyObject *kwds)
-{
- PyObject *wrapped = NULL;
-
- if (!PyArg_ParseTuple(args, "O", &wrapped))
- return -1;
-
- return isqlquote_setup((isqlquoteObject *)obj, wrapped);
-}
-
-static PyObject *
-isqlquote_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- return type->tp_alloc(type, 0);
-}
-
-static void
-isqlquote_del(PyObject* self)
-{
- PyObject_Del(self);
-}
-
-
-/* object type */
-
-#define isqlquoteType_doc \
-"Abstract ISQLQuote protocol\n\n" \
-"An object conform to this protocol should expose a ``getquoted()`` method\n" \
-"returning the SQL representation of the object.\n\n"
-
-PyTypeObject isqlquoteType = {
- PyObject_HEAD_INIT(NULL)
- 0,
- "psycopg2._psycopg.ISQLQuote",
- sizeof(isqlquoteObject),
- 0,
- isqlquote_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_compare*/
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
-
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
-
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- isqlquoteType_doc, /*tp_doc*/
-
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
-
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
-
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
-
- /* Attribute descriptor and subclassing stuff */
-
- isqlquoteObject_methods, /*tp_methods*/
- isqlquoteObject_members, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
-
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
-
- isqlquote_init, /*tp_init*/
- 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/
- isqlquote_new, /*tp_new*/
- (freefunc)isqlquote_del, /*tp_free Low-level free-memory routine */
- 0, /*tp_is_gc For PyObject_IS_GC */
- 0, /*tp_bases*/
- 0, /*tp_mro method resolution order */
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0 /*tp_weaklist*/
-};
+++ /dev/null
-/* microporotocols_proto.h - definiton for psycopg's protocols
- *
- * Copyright (C) 2004 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_ISQLQUOTE_H
-#define PSYCOPG_ISQLQUOTE_H 1
-
-#include <Python.h>
-#include <libpq-fe.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern PyTypeObject isqlquoteType;
-
-typedef struct {
- PyObject HEAD;
-
- PyObject *wrapped;
-
-} isqlquoteObject;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_ISQLQUOTE_H) */
+++ /dev/null
-#define BOOLOID 16
-#define BYTEAOID 17
-#define CHAROID 18
-#define NAMEOID 19
-#define INT8OID 20
-#define INT2OID 21
-#define INT2VECTOROID 22
-#define INT4OID 23
-#define REGPROCOID 24
-#define TEXTOID 25
-#define OIDOID 26
-#define TIDOID 27
-#define XIDOID 28
-#define CIDOID 29
-#define OIDVECTOROID 30
-#define PG_TYPE_RELTYPE_OID 71
-#define PG_ATTRIBUTE_RELTYPE_OID 75
-#define PG_PROC_RELTYPE_OID 81
-#define PG_CLASS_RELTYPE_OID 83
-#define POINTOID 600
-#define LSEGOID 601
-#define PATHOID 602
-#define BOXOID 603
-#define POLYGONOID 604
-#define LINEOID 628
-#define FLOAT4OID 700
-#define FLOAT8OID 701
-#define ABSTIMEOID 702
-#define RELTIMEOID 703
-#define TINTERVALOID 704
-#define UNKNOWNOID 705
-#define CIRCLEOID 718
-#define CASHOID 790
-#define MACADDROID 829
-#define INETOID 869
-#define CIDROID 650
-#define INT4ARRAYOID 1007
-#define ACLITEMOID 1033
-#define BPCHAROID 1042
-#define VARCHAROID 1043
-#define DATEOID 1082
-#define TIMEOID 1083
-#define TIMESTAMPOID 1114
-#define TIMESTAMPTZOID 1184
-#define INTERVALOID 1186
-#define TIMETZOID 1266
-#define BITOID 1560
-#define VARBITOID 1562
-#define NUMERICOID 1700
-#define REFCURSOROID 1790
-#define REGPROCEDUREOID 2202
-#define REGOPEROID 2203
-#define REGOPERATOROID 2204
-#define REGCLASSOID 2205
-#define REGTYPEOID 2206
-#define RECORDOID 2249
-#define CSTRINGOID 2275
-#define ANYOID 2276
-#define ANYARRAYOID 2277
-#define VOIDOID 2278
-#define TRIGGEROID 2279
-#define LANGUAGE_HANDLEROID 2280
-#define INTERNALOID 2281
-#define OPAQUEOID 2282
-#define ANYELEMENTOID 2283
+++ /dev/null
-#define PG_VERSION_MAJOR 7
-#define PG_VERSION_MINOR 4
+++ /dev/null
-/* pqpath.c - single path into libpq
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* IMPORTANT NOTE: no function in this file do its own connection locking
- except for pg_execute and pq_fetch (that are somehow high-level. This means
- that all the othe functions should be called while holding a lock to the
- connection.
-*/
-
-#include <Python.h>
-#include <string.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/pqpath.h"
-#include "psycopg/connection.h"
-#include "psycopg/cursor.h"
-#include "psycopg/typecast.h"
-#include "psycopg/pgtypes.h"
-#include "psycopg/pgversion.h"
-
-/* pq_raise - raise a python exception of the right kind
-
- This function should be called while holding the GIL. */
-
-void
-pq_raise(connectionObject *conn, cursorObject *curs, PyObject *exc, char *msg)
-{
- PyObject *pgc = (PyObject*)curs;
-
- char *err = NULL;
- char *err2 = NULL;
- char *code = NULL;
- char *buf = NULL;
-
- if ((conn == NULL && curs == NULL) || (curs != NULL && conn == NULL)) {
- PyErr_SetString(Error, "psycopg went psycotic and raised a null error");
- return;
- }
-
- if (curs && curs->pgres) {
- err = PQresultErrorMessage(curs->pgres);
-#ifdef HAVE_PQPROTOCOL3
- if (err != NULL && conn->protocol == 3) {
- code = PQresultErrorField(curs->pgres, PG_DIAG_SQLSTATE);
- }
-#endif
- }
- if (err == NULL)
- err = PQerrorMessage(conn->pgconn);
-
- /* if the is no error message we probably called pq_raise without reason:
- we need to set an exception anyway because the caller will probably
- raise and a meaningful message is better than an empty one */
- if (err == NULL) {
- PyErr_SetString(Error, "psycopg went psycotic without error set");
- return;
- }
-
- /* if exc is NULL, analyze the message and try to deduce the right
- exception kind (only if we have a pgres, obviously) */
- if (exc == NULL) {
- if (curs && curs->pgres) {
- if (conn->protocol == 3) {
-#ifdef HAVE_PQPROTOCOL3
- char *pgstate =
- PQresultErrorField(curs->pgres, PG_DIAG_SQLSTATE);
- if (pgstate != NULL && !strncmp(pgstate, "23", 2))
- exc = IntegrityError;
- else
- exc = ProgrammingError;
-#endif
- }
- }
- }
-
- /* if exc is still NULL psycopg was not built with HAVE_PQPROTOCOL3 or the
- connection is using protocol 2: in both cases we default to comparing
- error messages */
- if (exc == NULL) {
- if (!strncmp(err, "ERROR: Cannot insert a duplicate key", 37)
- || !strncmp(err, "ERROR: ExecAppend: Fail to add null", 36)
- || strstr(err, "referential integrity violation"))
- exc = IntegrityError;
- else
- exc = ProgrammingError;
- }
-
- /* try to remove the initial "ERROR: " part from the postgresql error */
- if (err && strlen(err) > 8) err2 = &(err[8]);
- else err2 = err;
-
- /* if msg is not NULL, add it to the error message, after a '\n' */
- if (msg && code) {
- int len = strlen(code) + strlen(err) + strlen(msg) + 5;
- if ((buf = PyMem_Malloc(len))) {
- snprintf(buf, len, "[%s] %s\n%s", code, err2, msg);
- psyco_set_error(exc, pgc, buf, err, code);
- }
- }
- else if (msg) {
- int len = strlen(err) + strlen(msg) + 2;
- if ((buf = PyMem_Malloc(len))) {
- snprintf(buf, len, "%s\n%s", err2, msg);
- psyco_set_error(exc, pgc, buf, err, code);
- }
- }
- else {
- psyco_set_error(exc, pgc, err2, err, code);
- }
-
- if (buf != NULL) PyMem_Free(buf);
-}
-
-/* pq_set_critical, pq_resolve_critical - manage critical errors
-
- this function is invoked when a PQexec() call returns NULL, meaning a
- critical condition like out of memory or lost connection. it save the error
- message and mark the connection as 'wanting cleanup'.
-
- both functions do not call any Py_*_ALLOW_THREADS macros.
- pq_resolve_critical should be called while holding the GIL. */
-
-void
-pq_set_critical(connectionObject *conn, const char *msg)
-{
- if (msg == NULL)
- msg = PQerrorMessage(conn->pgconn);
- if (conn->critical) free(conn->critical);
- if (msg && msg[0] != '\0') conn->critical = strdup(msg);
- else conn->critical = NULL;
-}
-
-PyObject *
-pq_resolve_critical(connectionObject *conn, int close)
-{
- Dprintf("pq_resolve_critical: resolving %s", conn->critical);
-
- if (conn->critical) {
- char *msg = &(conn->critical[6]);
- Dprintf("pq_resolve_critical: error = %s", msg);
- /* we can't use pq_raise because the error has already been cleared
- from the connection, so we just raise an OperationalError with the
- critical message */
- PyErr_SetString(OperationalError, msg);
-
- /* we don't want to destroy this connection but just close it */
- if (close == 1) conn_close(conn);
- }
- return NULL;
-}
-
-/* pq_clear_async - clear the effects of a previous async query
-
- note that this function does block because it needs to wait for the full
- result sets of the previous query to clear them.
-
-
- this function does not call any Py_*_ALLOW_THREADS macros */
-
-void
-pq_clear_async(connectionObject *conn)
-{
- PGresult *pgres;
-
- do {
- pgres = PQgetResult(conn->pgconn);
- Dprintf("pq_clear_async: clearing PGresult at %p", pgres);
- IFCLEARPGRES(pgres);
- } while (pgres != NULL);
-}
-
-/* pq_begin - send a BEGIN WORK, if necessary
-
- this function does not call any Py_*_ALLOW_THREADS macros */
-
-int
-pq_begin(connectionObject *conn)
-{
- const char *query[] = {
- NULL,
- "BEGIN; SET TRANSACTION ISOLATION LEVEL READ COMMITTED",
- "BEGIN; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"};
-
- int pgstatus, retvalue = -1;
- PGresult *pgres = NULL;
-
- Dprintf("pq_begin: pgconn = %p, isolevel = %ld, status = %d",
- conn->pgconn, conn->isolation_level, conn->status);
-
- if (conn->isolation_level == 0 || conn->status != CONN_STATUS_READY) {
- Dprintf("pq_begin: transaction in progress");
- return 0;
- }
-
- pq_clear_async(conn);
- pgres = PQexec(conn->pgconn, query[conn->isolation_level]);
- if (pgres == NULL) {
- Dprintf("pq_begin: PQexec() failed");
- pq_set_critical(conn, NULL);
- goto cleanup;
- }
-
- pgstatus = PQresultStatus(pgres);
- if (pgstatus != PGRES_COMMAND_OK ) {
- Dprintf("pq_begin: result is NOT OK");
- pq_set_critical(conn, NULL);
- goto cleanup;
- }
- Dprintf("pq_begin: issued '%s' command", query[conn->isolation_level]);
-
- retvalue = 0;
- conn->status = CONN_STATUS_BEGIN;
-
- cleanup:
- IFCLEARPGRES(pgres);
- return retvalue;
-}
-
-/* pq_commit - send an END, if necessary
-
- this function does not call any Py_*_ALLOW_THREADS macros */
-
-int
-pq_commit(connectionObject *conn)
-{
- const char *query = "END";
- int pgstatus, retvalue = -1;
- PGresult *pgres = NULL;
-
- Dprintf("pq_commit: pgconn = %p, isolevel = %ld, status = %d",
- conn->pgconn, conn->isolation_level, conn->status);
-
- if (conn->isolation_level == 0 || conn->status != CONN_STATUS_BEGIN) {
- Dprintf("pq_commit: no transaction to commit");
- return 0;
- }
-
- pq_clear_async(conn);
- pgres = PQexec(conn->pgconn, query);
- if (pgres == NULL) {
- Dprintf("pq_commit: PQexec() failed");
- pq_set_critical(conn, NULL);
- goto cleanup;
- }
-
- pgstatus = PQresultStatus(pgres);
- if (pgstatus != PGRES_COMMAND_OK ) {
- Dprintf("pq_commit: result is NOT OK");
- pq_set_critical(conn, NULL);
- goto cleanup;
- }
- Dprintf("pq_commit: issued '%s' command", query);
-
- retvalue = 0;
- conn->status = CONN_STATUS_READY;
-
- cleanup:
- IFCLEARPGRES(pgres);
- return retvalue;
-}
-
-/* pq_abort - send an ABORT, if necessary
-
- this function does not call any Py_*_ALLOW_THREADS macros */
-
-int
-pq_abort(connectionObject *conn)
-{
- const char *query = "ABORT";
- int pgstatus, retvalue = -1;
- PGresult *pgres = NULL;
-
- Dprintf("pq_abort: pgconn = %p, isolevel = %ld, status = %d",
- conn->pgconn, conn->isolation_level, conn->status);
-
- if (conn->isolation_level == 0 || conn->status != CONN_STATUS_BEGIN) {
- Dprintf("pq_abort: no transaction to abort");
- return 0;
- }
-
- pq_clear_async(conn);
- pgres = PQexec(conn->pgconn, query);
- if (pgres == NULL) {
- Dprintf("pq_abort: PQexec() failed");
- pq_set_critical(conn, NULL);
- goto cleanup;
- }
-
- pgstatus = PQresultStatus(pgres);
- if (pgstatus != PGRES_COMMAND_OK ) {
- Dprintf("pq_abort: result is NOT OK");
- pq_set_critical(conn, NULL);
- goto cleanup;
- }
- Dprintf("pq_abort: issued '%s' command", query);
-
- retvalue = 0;
- conn->status = CONN_STATUS_READY;
-
- cleanup:
- IFCLEARPGRES(pgres);
- return retvalue;
-}
-
-/* pq_is_busy - consume input and return connection status
-
- a status of 1 means that a call to pq_fetch will block, while a status of 0
- means that there is data available to be collected. -1 means an error, the
- exception will be set accordingly.
-
- this fucntion locks the connection object
- this function call Py_*_ALLOW_THREADS macros */
-
-int
-pq_is_busy(connectionObject *conn)
-{
- PGnotify *pgn;
-
- Dprintf("pq_is_busy: consuming input");
-
- Py_BEGIN_ALLOW_THREADS;
- pthread_mutex_lock(&(conn->lock));
-
- if (PQconsumeInput(conn->pgconn) == 0) {
- Dprintf("pq_is_busy: PQconsumeInput() failed");
- pthread_mutex_unlock(&(conn->lock));
- Py_BLOCK_THREADS;
- PyErr_SetString(OperationalError, PQerrorMessage(conn->pgconn));
- return -1;
- }
-
- pthread_mutex_unlock(&(conn->lock));
- Py_END_ALLOW_THREADS;
-
- /* now check for notifies */
- while ((pgn = PQnotifies(conn->pgconn)) != NULL) {
- PyObject *notify;
-
- Dprintf("curs_is_busy: got NOTIFY from pid %d, msg = %s",
- pgn->be_pid, pgn->relname);
-
- notify = PyTuple_New(2);
- PyTuple_SET_ITEM(notify, 0, PyInt_FromLong((long)pgn->be_pid));
- PyTuple_SET_ITEM(notify, 1, PyString_FromString(pgn->relname));
- PyList_Append(conn->notifies, notify);
- free(pgn);
- }
-
- return PQisBusy(conn->pgconn);
-}
-
-/* pq_execute - execute a query, possibly asyncronously
-
- this fucntion locks the connection object
- this function call Py_*_ALLOW_THREADS macros */
-
-int
-pq_execute(cursorObject *curs, const char *query, int async)
-{
- /* if the status of the connection is critical raise an exception and
- definitely close the connection */
- if (curs->conn->critical) {
- pq_resolve_critical(curs->conn, 1);
- return -1;
- }
-
- /* check status of connection, raise error if not OK */
- if (PQstatus(curs->conn->pgconn) != CONNECTION_OK) {
- Dprintf("pq_execute: connection NOT OK");
- PyErr_SetString(OperationalError, PQerrorMessage(curs->conn->pgconn));
- return -1;
- }
- Dprintf("curs_execute: pg connection at %p OK", curs->conn->pgconn);
-
- Py_BEGIN_ALLOW_THREADS;
- pthread_mutex_lock(&(curs->conn->lock));
-
- pq_begin(curs->conn);
-
- if (async == 0) {
- IFCLEARPGRES(curs->pgres);
- Dprintf("pq_execute: executing SYNC query:");
- Dprintf(" %-.200s", query);
- curs->pgres = PQexec(curs->conn->pgconn, query);
- }
-
- else if (async == 1) {
- /* first of all, let see if the previous query has already ended, if
- not what should we do? just block and discard data or execute
- another query? */
- pq_clear_async(curs->conn);
-
- Dprintf("pq_execute: executing ASYNC query:");
- Dprintf(" %-.200s", query);
-
- /* then we can go on and send a new query without fear */
- IFCLEARPGRES(curs->pgres);
- if (PQsendQuery(curs->conn->pgconn, query) == 0) {
- pthread_mutex_unlock(&(curs->conn->lock));
- Py_BLOCK_THREADS;
- PyErr_SetString(OperationalError,
- PQerrorMessage(curs->conn->pgconn));
- return -1;
- }
- Dprintf("pq_execute: async query sent to backend");
- }
-
- pthread_mutex_unlock(&(curs->conn->lock));
- Py_END_ALLOW_THREADS;
-
- /* if the execute was sync, we call pq_fetch() immediately,
- to respect the old DBAPI-2.0 compatible behaviour */
- if (async == 0) {
- Dprintf("pq_execute: entering syncronous DBAPI compatibility mode");
- if (pq_fetch(curs) == -1) return -1;
- }
- else {
- curs->conn->async_cursor = (PyObject*)curs;
- }
-
- return 1-async;
-}
-
-
-/* pq_fetch - fetch data after a query
-
- this fucntion locks the connection object
- this function call Py_*_ALLOW_THREADS macros
-
- return value:
- -1 - some error occurred while calling libpq
- 0 - no result from the backend but no libpq errors
- 1 - result from backend (possibly data is ready)
-*/
-
-static void
-_pq_fetch_tuples(cursorObject *curs)
-{
- int i, *dsize = NULL;
-
- int pgnfields = PQnfields(curs->pgres);
- int pgbintuples = PQbinaryTuples(curs->pgres);
-
- curs->notuples = 0;
-
- /* create the tuple for description and typecasting */
- Py_XDECREF(curs->description);
- Py_XDECREF(curs->casts);
- curs->description = PyTuple_New(pgnfields);
- curs->casts = PyTuple_New(pgnfields);
- curs->columns = pgnfields;
-
- /* calculate the display size for each column (cpu intensive, can be
- switched off at configuration time) */
-#ifdef PSYCOPG_DISPLAY_SIZE
- dsize = (int *)PyMem_Malloc(pgnfields * sizeof(int));
- if (dsize != NULL) {
- int j, len;
- for (i=0; i < pgnfields; i++) {
- dsize[i] = -1;
- }
- for (j = 0; j < curs->rowcount; j++) {
- for (i = 0; i < pgnfields; i++) {
- len = PQgetlength(curs->pgres, j, i);
- if (len > dsize[i]) dsize[i] = len;
- }
- }
- }
-#endif
-
- /* calculate various parameters and typecasters */
- for (i = 0; i < pgnfields; i++) {
- Oid ftype = PQftype(curs->pgres, i);
- int fsize = PQfsize(curs->pgres, i);
- int fmod = PQfmod(curs->pgres, i);
-
- PyObject *dtitem = PyTuple_New(7);
- PyObject *type = PyInt_FromLong(ftype);
- PyObject *cast = NULL;
-
- PyTuple_SET_ITEM(curs->description, i, dtitem);
-
- /* fill the right cast function by accessing the global dictionary of
- casting objects. if we got no defined cast use the default
- one */
- if (!(cast = PyDict_GetItem(curs->casts, type))) {
- Dprintf("_pq_fetch_tuples: cast %d not in per-cursor dict", ftype);
- if (!(cast = PyDict_GetItem(psyco_types, type))) {
- Dprintf("_pq_fetch_tuples: cast %d not found, using default",
- PQftype(curs->pgres,i));
- cast = psyco_default_cast;
- }
- }
- /* else if we got binary tuples and if we got a field that
- is binary use the default cast
- FIXME: what the hell am I trying to do here? This just can't work..
- */
- else if (pgbintuples && cast == psyco_default_binary_cast) {
- Dprintf("_pq_fetch_tuples: Binary cursor and "
- "binary field: %i using default cast",
- PQftype(curs->pgres,i));
- cast = psyco_default_cast;
- }
- Dprintf("_pq_fetch_tuples: using cast at %p (%s) for type %d",
- cast, PyString_AS_STRING(((typecastObject*)cast)->name),
- PQftype(curs->pgres,i));
- Py_INCREF(cast);
- PyTuple_SET_ITEM(curs->casts, i, cast);
-
-
- /* 1/ fill the other fields */
- PyTuple_SET_ITEM(dtitem, 0,
- PyString_FromString(PQfname(curs->pgres, i)));
- PyTuple_SET_ITEM(dtitem, 1, type);
-
- /* 2/ display size is the maximum size of this field result tuples. */
- if (dsize && dsize[i] >= 0) {
- PyTuple_SET_ITEM(dtitem, 2, PyInt_FromLong(dsize[i]));
- }
- else {
- Py_INCREF(Py_None);
- PyTuple_SET_ITEM(dtitem, 2, Py_None);
- }
-
- /* 3/ size on the backend */
- if (fmod > 0) fmod = fmod - sizeof(int);
- if (fsize == -1) {
- if (ftype == NUMERICOID) {
- PyTuple_SET_ITEM(dtitem, 3,
- PyInt_FromLong((fmod >> 16) & 0xFFFF));
- }
- else { /* If variable length record, return maximum size */
- PyTuple_SET_ITEM(dtitem, 3, PyInt_FromLong(fmod));
- }
- }
- else {
- PyTuple_SET_ITEM(dtitem, 3, PyInt_FromLong(fsize));
- }
-
- /* 4,5/ scale and precision */
- if (ftype == NUMERICOID) {
- PyTuple_SET_ITEM(dtitem, 4, PyInt_FromLong((fmod >> 16) & 0xFFFF));
- PyTuple_SET_ITEM(dtitem, 5, PyInt_FromLong((fmod & 0xFFFF) - 4));
- }
- else {
- Py_INCREF(Py_None);
- PyTuple_SET_ITEM(dtitem, 4, Py_None);
- Py_INCREF(Py_None);
- PyTuple_SET_ITEM(dtitem, 5, Py_None);
- }
-
- /* 6/ FIXME: null_ok??? */
- Py_INCREF(Py_None);
- PyTuple_SET_ITEM(dtitem, 6, Py_None);
- }
-
- if (dsize) PyMem_Free(dsize);
-}
-
-#ifdef HAVE_PQPROTOCOL3
-static int
-_pq_copy_in_v3(cursorObject *curs)
-{
- /* COPY FROM implementation when protocol 3 is available: this function
- uses the new PQputCopyData() and can detect errors and set the correct
- exception */
- PyObject *o;
- int length = 0, error = 0;
-
- while (1) {
- o = PyObject_CallMethod(curs->copyfile, "read", "i", curs->copysize);
- if (!o || !PyString_Check(o) || (length = PyString_Size(o)) == -1) {
- error = 1;
- }
- if (length == 0 || error == 1) break;
-
- Py_BEGIN_ALLOW_THREADS;
- if (PQputCopyData(curs->conn->pgconn,
- PyString_AS_STRING(o), length) == -1) {
- error = 2;
- }
- Py_END_ALLOW_THREADS;
-
- if (error == 2) break;
-
- Py_DECREF(o);
- }
-
- Py_XDECREF(o);
-
- if (error == 0 || error == 2)
- /* 0 means that the copy went well, 2 that there was an error on the
- backend: in both cases we'll get the error message from the
- PQresult */
- PQputCopyEnd(curs->conn->pgconn, NULL);
- else
- PQputCopyEnd(curs->conn->pgconn, "error during .read() call");
-
- /* and finally we grab the operation result from the backend */
- IFCLEARPGRES(curs->pgres);
- while ((curs->pgres = PQgetResult(curs->conn->pgconn)) != NULL) {
- if (PQresultStatus(curs->pgres) == PGRES_FATAL_ERROR)
- pq_raise(curs->conn, curs, NULL, NULL);
- IFCLEARPGRES(curs->pgres);
- }
-
- return 1;
-}
-#endif
-static int
-_pq_copy_in(cursorObject *curs)
-{
- /* COPY FROM implementation when protocol 3 is not available: this
- function can't fail but the backend will send an ERROR notice that will
- be catched by our notice collector */
- PyObject *o;
-
- while (1) {
- o = PyObject_CallMethod(curs->copyfile, "readline", NULL);
- if (!o || o == Py_None || PyString_GET_SIZE(o) == 0) break;
- if (PQputline(curs->conn->pgconn, PyString_AS_STRING(o)) != 0) {
- Py_DECREF(o);
- return -1;
- }
- Py_DECREF(o);
- }
- Py_XDECREF(o);
- PQputline(curs->conn->pgconn, "\\.\n");
- PQendcopy(curs->conn->pgconn);
-
- /* if for some reason we're using a protocol 3 libpq to connect to a
- protocol 2 backend we still need to cycle on the result set */
- IFCLEARPGRES(curs->pgres);
- while ((curs->pgres = PQgetResult(curs->conn->pgconn)) != NULL) {
- if (PQresultStatus(curs->pgres) == PGRES_FATAL_ERROR)
- pq_raise(curs->conn, curs, NULL, NULL);
- IFCLEARPGRES(curs->pgres);
- }
-
- return 1;
-}
-
-#ifdef HAVE_PQPROTOCOL3
-static int
-_pq_copy_out_v3(cursorObject *curs)
-{
- char *buffer;
- int len;
-
- while (1) {
- Py_BEGIN_ALLOW_THREADS;
- len = PQgetCopyData(curs->conn->pgconn, &buffer, 0);
- Py_END_ALLOW_THREADS;
-
- if (len > 0 && buffer) {
- PyObject_CallMethod(curs->copyfile, "write", "s#", buffer, len);
- PQfreemem(buffer);
- }
- /* we break on len == 0 but note that that should *not* happen,
- because we are not doing an async call (if it happens blame
- postgresql authors :/) */
- else if (len <= 0) break;
- }
-
- if (len == -2) {
- pq_raise(curs->conn, NULL, NULL, NULL);
- return -1;
- }
-
- /* and finally we grab the operation result from the backend */
- IFCLEARPGRES(curs->pgres);
- while ((curs->pgres = PQgetResult(curs->conn->pgconn)) != NULL) {
- if (PQresultStatus(curs->pgres) == PGRES_FATAL_ERROR)
- pq_raise(curs->conn, curs, NULL, NULL);
- IFCLEARPGRES(curs->pgres);
- }
- return 1;
-}
-#endif
-
-static int
-_pq_copy_out(cursorObject *curs)
-{
- char buffer[4096];
- int status, len;
-
- while (1) {
- Py_BEGIN_ALLOW_THREADS;
- status = PQgetline(curs->conn->pgconn, buffer, 4096);
- Py_END_ALLOW_THREADS;
- if (status == 0) {
- if (buffer[0] == '\\' && buffer[1] == '.') break;
-
- len = strlen(buffer);
- buffer[len++] = '\n';
- }
- else if (status == 1) {
- len = 4096-1;
- }
- else {
- return -1;
- }
-
- PyObject_CallMethod(curs->copyfile, "write", "s#", buffer, len);
- }
-
- status = 1;
- if (PQendcopy(curs->conn->pgconn) != 0)
- status = -1;
-
- /* if for some reason we're using a protocol 3 libpq to connect to a
- protocol 2 backend we still need to cycle on the result set */
- IFCLEARPGRES(curs->pgres);
- while ((curs->pgres = PQgetResult(curs->conn->pgconn)) != NULL) {
- if (PQresultStatus(curs->pgres) == PGRES_FATAL_ERROR)
- pq_raise(curs->conn, curs, NULL, NULL);
- IFCLEARPGRES(curs->pgres);
- }
-
- return status;
-}
-
-int
-pq_fetch(cursorObject *curs)
-{
- int pgstatus, ex = -1;
-
- /* even if we fail, we remove any information about the previous query */
- curs_reset(curs);
-
- /* we check the result from the previous execute; if the result is not
- already there, we need to consume some input and go to sleep until we
- get something edible to eat */
- if (!curs->pgres) {
-
- Dprintf("pq_fetch: no data: entering polling loop");
-
- while (pq_is_busy(curs->conn) > 0) {
- fd_set rfds;
- struct timeval tv;
- int sval, sock;
-
- Py_BEGIN_ALLOW_THREADS;
- pthread_mutex_lock(&(curs->conn->lock));
-
- sock = PQsocket(curs->conn->pgconn);
- FD_ZERO(&rfds);
- FD_SET(sock, &rfds);
-
- /* set a default timeout of 5 seconds
- TODO: make use of the timeout, maybe allowing the user to
- make a non-blocking (timeouted) call to fetchXXX */
- tv.tv_sec = 5;
- tv.tv_usec = 0;
-
- Dprintf("pq_fetch: entering PDflush() loop");
- while (PQflush(curs->conn->pgconn) != 0);
- sval = select(sock+1, &rfds, NULL, NULL, &tv);
-
- pthread_mutex_unlock(&(curs->conn->lock));
- Py_END_ALLOW_THREADS;
- }
-
- Dprintf("pq_fetch: data is probably ready");
- IFCLEARPGRES(curs->pgres);
- curs->pgres = PQgetResult(curs->conn->pgconn);
- }
-
- /* check for PGRES_FATAL_ERROR result */
- /* FIXME: I am not sure we need to check for critical error here.
- if (curs->pgres == NULL) {
- Dprintf("pq_fetch: got a NULL pgres, checking for critical");
- pq_set_critical(curs->conn);
- if (curs->conn->critical) {
- pq_resolve_critical(curs->conn);
- return -1;
- }
- else {
- return 0;
- }
- }
- */
-
- if (curs->pgres == NULL) return 0;
-
- pgstatus = PQresultStatus(curs->pgres);
- Dprintf("pq_fetch: pgstatus = %s", PQresStatus(pgstatus));
-
- /* backend status message */
- Py_XDECREF(curs->pgstatus);
- curs->pgstatus = PyString_FromString(PQcmdStatus(curs->pgres));
-
- switch(pgstatus) {
-
- case PGRES_COMMAND_OK:
- Dprintf("pq_fetch: command returned OK (no tuples)");
- curs->rowcount = atoi(PQcmdTuples(curs->pgres));
- curs->lastoid = PQoidValue(curs->pgres);
- CLEARPGRES(curs->pgres);
- ex = 1;
- break;
-
- case PGRES_COPY_OUT:
- Dprintf("pq_fetch: data from a COPY TO (no tuples)");
-#ifdef HAVE_PQPROTOCOL3
- if (curs->conn->protocol == 3)
- ex = _pq_copy_out_v3(curs);
- else
-#endif
- ex = _pq_copy_out(curs);
- curs->rowcount = -1;
- /* error caught by out glorious notice handler */
- if (PyErr_Occurred()) ex = -1;
- IFCLEARPGRES(curs->pgres);
- break;
-
- case PGRES_COPY_IN:
- Dprintf("pq_fetch: data from a COPY FROM (no tuples)");
-#ifdef HAVE_PQPROTOCOL3
- if (curs->conn->protocol == 3)
- ex = _pq_copy_in_v3(curs);
- else
-#endif
- ex = _pq_copy_in(curs);
- curs->rowcount = -1;
- /* error caught by out glorious notice handler */
- if (PyErr_Occurred()) ex = -1;
- IFCLEARPGRES(curs->pgres);
- break;
-
- case PGRES_TUPLES_OK:
- Dprintf("pq_fetch: data from a SELECT (got tuples)");
- curs->rowcount = PQntuples(curs->pgres);
- _pq_fetch_tuples(curs); ex = 0;
- /* don't clear curs->pgres, because it contains the results! */
- break;
-
- default:
- Dprintf("pq_fetch: uh-oh, something FAILED");
- pq_raise(curs->conn, curs, NULL, NULL);
- IFCLEARPGRES(curs->pgres);
- ex = -1;
- break;
- }
-
- Dprintf("pq_fetch: fetching done; check for critical errors");
-
- /* error checking, close the connection if necessary (some critical errors
- are not really critical, like a COPY FROM error: if that's the case we
- raise the exception but we avoid to close the connection) */
- if (curs->conn->critical) {
- if (ex == -1) {
- pq_resolve_critical(curs->conn, 1);
- }
- else {
- pq_resolve_critical(curs->conn, 0);
- }
- return -1;
- }
-
- return ex;
-}
+++ /dev/null
-/* pqpath.h - definitions for pqpath.c
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_PQPATH_H
-#define PSYCOPG_PQPATH_H 1
-
-#include "psycopg/cursor.h"
-#include "psycopg/connection.h"
-
-/* macros to clean the pg result */
-#define IFCLEARPGRES(pgres) if (pgres) {PQclear(pgres); pgres = NULL;}
-#define CLEARPGRES(pgres) PQclear(pgres); pgres = NULL
-
-/* exported functions */
-extern int pq_fetch(cursorObject *curs);
-extern int pq_execute(cursorObject *curs, const char *query, int async);
-extern int pq_begin(connectionObject *conn);
-extern int pq_commit(connectionObject *conn);
-extern int pq_abort(connectionObject *conn);
-extern int pq_is_busy(connectionObject *conn);
-extern void pq_set_critical(connectionObject *conn, const char *msg);
-
-#endif /* !defined(PSYCOPG_PQPATH_H) */
+++ /dev/null
-/* psycopg.h - definitions for the psycopg python module
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_H
-#define PSYCOPG_H 1
-
-#include <Python.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* DBAPI compliance parameters */
-#define APILEVEL "2.0"
-#define THREADSAFETY 2
-#define PARAMSTYLE "pyformat"
-
-/* C API functions */
-#define psyco_errors_fill_NUM 0
-#define psyco_errors_fill_RETURN void
-#define psyco_errors_fill_PROTO (PyObject *dict)
-#define psyco_errors_set_NUM 1
-#define psyco_errors_set_RETURN void
-#define psyco_errors_set_PROTO (PyObject *type)
-
-/* Total number of C API pointers */
-#define PSYCOPG_API_pointers 2
-
-#ifdef PSYCOPG_MODULE
- /** This section is used when compiling psycopgmodule.c & co. **/
-extern psyco_errors_fill_RETURN psyco_errors_fill psyco_errors_fill_PROTO;
-extern psyco_errors_set_RETURN psyco_errors_set psyco_errors_set_PROTO;
-
-/* global excpetions */
-extern PyObject *Error, *Warning, *InterfaceError, *DatabaseError,
- *InternalError, *OperationalError, *ProgrammingError,
- *IntegrityError, *DataError, *NotSupportedError;
-
-/* python versions and compatibility stuff */
-#ifndef PyMODINIT_FUNC
-#define PyMODINIT_FUNC void
-#endif
-
-#else
- /** This section is used in modules that use psycopg's C API **/
-
-static void **PSYCOPG_API;
-
-#define psyco_errors_fill \
- (*(psyco_errors_fill_RETURN (*)psyco_errors_fill_PROTO) \
- PSYCOPG_API[psyco_errors_fill_NUM])
-#define psyco_errors_set \
- (*(psyco_errors_set_RETURN (*)psyco_errors_set_PROTO) \
- PSYCOPG_API[psyco_errors_set_NUM])
-
-/* Return -1 and set exception on error, 0 on success. */
-static int
-import_psycopg(void)
-{
- PyObject *module = PyImport_ImportModule("psycopg");
-
- if (module != NULL) {
- PyObject *c_api_object = PyObject_GetAttrString(module, "_C_API");
- if (c_api_object == NULL) return -1;
- if (PyCObject_Check(c_api_object))
- PSYCOPG_API = (void **)PyCObject_AsVoidPtr(c_api_object);
- Py_DECREF(c_api_object);
- }
- return 0;
-}
-
-#endif
-
-/* postgresql<->python encoding map */
-extern PyObject *psycoEncodings;
-
-typedef struct {
- char *pgenc;
- char *pyenc;
-} encodingPair;
-
-/* the Decimal type, used by the DECIMAL typecaster */
-extern PyObject *decimalType;
-
-/* some utility functions */
-extern void psyco_set_error(PyObject *exc, PyObject *curs, char *msg,
- char *pgerror, char *pgcode);
-
-/* Exceptions docstrings */
-#define Error_doc \
-"Base class for error exceptions."
-
-#define Warning_doc \
-"A database warning."
-
-#define InterfaceError_doc \
-"Error related to the database interface."
-
-#define DatabaseError_doc \
-"Error related to the database engine."
-
-#define InternalError_doc \
-"The database encountered an internal error."
-
-#define OperationalError_doc \
-"Error related to database operation (disconnect, memory allocation etc)."
-
-#define ProgrammingError_doc \
-"Error related to database programming (SQL error, table not found etc)."
-
-#define IntegrityError_doc \
-"Error related to database integrity."
-
-#define DataError_doc \
-"Error related to problems with the processed data."
-
-#define NotSupportedError_doc \
-"A not supported datbase API was called."
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_H) */
+++ /dev/null
-/* psycopgmodule.c - psycopg module (will import other C classes)
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/python.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/connection.h"
-#include "psycopg/cursor.h"
-#include "psycopg/typecast.h"
-#include "psycopg/microprotocols.h"
-#include "psycopg/microprotocols_proto.h"
-
-#include "psycopg/adapter_qstring.h"
-#include "psycopg/adapter_binary.h"
-#include "psycopg/adapter_pboolean.h"
-#include "psycopg/adapter_asis.h"
-#include "psycopg/adapter_list.h"
-#include "psycopg/typecast_binary.h"
-
-#ifdef HAVE_MXDATETIME
-#include <mxDateTime.h>
-#include "psycopg/adapter_mxdatetime.h"
-mxDateTimeModule_APIObject *mxDateTimeP = NULL;
-#endif
-
-/* some module-level variables, like the datetime module */
-#ifdef HAVE_PYDATETIME
-#include <datetime.h>
-#include "psycopg/adapter_datetime.h"
-PyObject *pyDateTimeModuleP = NULL;
-PyObject *pyDateTypeP = NULL;
-PyObject *pyTimeTypeP = NULL;
-PyObject *pyDateTimeTypeP = NULL;
-PyObject *pyDeltaTypeP = NULL;
-#endif
-
-/* pointers to the psycopg.tz classes */
-PyObject *pyPsycopgTzModule = NULL;
-PyObject *pyPsycopgTzLOCAL = NULL;
-PyObject *pyPsycopgTzFixedOffsetTimezone = NULL;
-
-PyObject *psycoEncodings = NULL;
-PyObject *decimalType = NULL;
-
-/** connect module-level function **/
-#define psyco_connect_doc \
-"connect(dsn, ...) -- Create a new database connection.\n\n" \
-"This function supports two different but equivalent sets of arguments.\n" \
-"A single data source name or ``dsn`` string can be used to specify the\n" \
-"connection parameters, as follows::\n\n" \
-" psycopg2.connect(\"dbname=xxx user=xxx ...\")\n\n" \
-"If ``dsn`` is not provided it is possible to pass the parameters as\n" \
-"keyword arguments; e.g.::\n\n" \
-" psycopg2.connect(database='xxx', user='xxx', ...)\n\n" \
-"The full list of available parameters is:\n\n" \
-"- ``dbname`` -- database name (only in 'dsn')\n" \
-"- ``database`` -- database name (only as keyword argument)\n" \
-"- ``host`` -- host address (defaults to UNIX socket if not provided)\n" \
-"- ``port`` -- port number (defaults to 5432 if not provided)\n" \
-"- ``user`` -- user name used to authenticate\n" \
-"- ``password`` -- password used to authenticate\n" \
-"- ``sslmode`` -- SSL mode (see PostgreSQL documentation)\n\n" \
-"If the ``connection_factory`` keyword argument is not provided this\n" \
-"function always return an instance of the `connection` class.\n" \
-"Else the given sub-class of `extensions.connection` will be used to\n" \
-"instantiate the connection object.\n\n" \
-":return: New database connection\n" \
-":rtype: `extensions.connection`"
-
-static int
-_psyco_connect_fill_dsn(char *dsn, char *kw, char *v, int i)
-{
- strcpy(&dsn[i], kw); i += strlen(kw);
- strcpy(&dsn[i], v); i += strlen(v);
- return i;
-}
-
-static void
-_psyco_connect_fill_exc(connectionObject *conn)
-{
- /* fill the connection object with the exceptions */
- conn->exc_Error = Error;
- Py_INCREF(Error);
- conn->exc_Warning = Warning;
- Py_INCREF(Warning);
- conn->exc_InterfaceError = InterfaceError;
- Py_INCREF(InterfaceError);
- conn->exc_DatabaseError = DatabaseError;
- Py_INCREF(DatabaseError);
- conn->exc_InternalError = InternalError;
- Py_INCREF(InternalError);
- conn->exc_ProgrammingError = ProgrammingError;
- Py_INCREF(ProgrammingError);
- conn->exc_IntegrityError = IntegrityError;
- Py_INCREF(IntegrityError);
- conn->exc_DataError = DataError;
- Py_INCREF(DataError);
- conn->exc_NotSupportedError = NotSupportedError;
- Py_INCREF(NotSupportedError);
- conn->exc_OperationalError = OperationalError;
- Py_INCREF(OperationalError);
-}
-
-static PyObject *
-psyco_connect(PyObject *self, PyObject *args, PyObject *keywds)
-{
- PyObject *conn, *factory = NULL;
- PyObject *pyport = NULL;
-
- int idsn=-1, iport=-1;
- char *dsn=NULL, *database=NULL, *user=NULL, *password=NULL;
- char *host=NULL, *sslmode=NULL;
- char port[16];
-
- static char *kwlist[] = {"dsn", "database", "host", "port",
- "user", "password", "sslmode",
- "connection_factory", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, keywds, "|sssOsssO", kwlist,
- &dsn, &database, &host, &pyport,
- &user, &password, &sslmode, &factory)) {
- return NULL;
- }
-
- if (pyport && PyString_Check(pyport)) {
- PyObject *pyint = PyInt_FromString(PyString_AsString(pyport), NULL, 10);
- if (!pyint) return NULL;
- iport = PyInt_AsLong(pyint);
- }
- else if (pyport && PyInt_Check(pyport)) {
- iport = PyInt_AsLong(pyport);
- }
- else if (pyport != NULL) {
- PyErr_SetString(PyExc_TypeError, "port must be a string or int");
- return NULL;
- }
-
- if (iport > 0)
- PyOS_snprintf(port, 16, "%d", iport);
-
- if (dsn == NULL) {
- int l = 45; /* len("dbname= user= password= host= port= sslmode=\0") */
-
- if (database) l += strlen(database);
- if (host) l += strlen(host);
- if (iport > 0) l += strlen(port);
- if (user) l += strlen(user);
- if (password) l += strlen(password);
- if (sslmode) l += strlen(sslmode);
-
- dsn = malloc(l*sizeof(char));
- if (dsn == NULL) {
- PyErr_SetString(InterfaceError, "dynamic dsn allocation failed");
- return NULL;
- }
-
- idsn = 0;
- if (database)
- idsn = _psyco_connect_fill_dsn(dsn, " dbname=", database, idsn);
- if (host)
- idsn = _psyco_connect_fill_dsn(dsn, " host=", host, idsn);
- if (iport > 0)
- idsn = _psyco_connect_fill_dsn(dsn, " port=", port, idsn);
- if (user)
- idsn = _psyco_connect_fill_dsn(dsn, " user=", user, idsn);
- if (password)
- idsn = _psyco_connect_fill_dsn(dsn, " password=", password, idsn);
- if (sslmode)
- idsn = _psyco_connect_fill_dsn(dsn, " sslmode=", sslmode, idsn);
-
- if (idsn > 0) {
- dsn[idsn] = '\0';
- memmove(dsn, &dsn[1], idsn);
- }
- else {
- free(dsn);
- PyErr_SetString(InterfaceError, "missing dsn and no parameters");
- return NULL;
- }
- }
-
- Dprintf("psyco_connect: dsn = '%s'", dsn);
-
- /* allocate connection, fill with errors and return it */
- if (factory == NULL) factory = (PyObject *)&connectionType;
- conn = PyObject_CallFunction(factory, "s", dsn);
- if (conn) _psyco_connect_fill_exc((connectionObject*)conn);
-
- return conn;
-}
-
-/** type registration **/
-#define psyco_register_type_doc \
-"register_type(obj) -> None -- register obj with psycopg type system\n\n" \
-":Parameters:\n" \
-" * `obj`: A type adapter created by `new_type()`"
-
-#define typecast_from_python_doc \
-"new_type(oids, name, adapter) -> new type object\n\n" \
-"Create a new binding object. The object can be used with the\n" \
-"`register_type()` function to bind PostgreSQL objects to python objects.\n\n" \
-":Parameters:\n" \
-" * `oids`: Tuple of ``oid`` of the PostgreSQL types to convert.\n" \
-" * `name`: Name for the new type\n" \
-" * `adapter`: Callable to perform type conversion.\n" \
-" It must have the signature ``fun(value, cur)`` where ``value`` is\n" \
-" the string representation returned by PostgreSQL (`None` if ``NULL``)\n" \
-" and ``cur`` is the cursor from which data are read."
-
-static PyObject *
-psyco_register_type(PyObject *self, PyObject *args)
-{
- PyObject *type;
-
- if (!PyArg_ParseTuple(args, "O!", &typecastType, &type)) {
- return NULL;
- }
-
- typecast_add(type, 0);
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-/* default adapters */
-
-static void
-psyco_adapters_init(PyObject *mod)
-{
- PyObject *call;
-
- microprotocols_add(&PyFloat_Type, NULL, (PyObject*)&asisType);
- microprotocols_add(&PyInt_Type, NULL, (PyObject*)&asisType);
- microprotocols_add(&PyLong_Type, NULL, (PyObject*)&asisType);
-
- microprotocols_add(&PyString_Type, NULL, (PyObject*)&qstringType);
- microprotocols_add(&PyUnicode_Type, NULL, (PyObject*)&qstringType);
- microprotocols_add(&PyBuffer_Type, NULL, (PyObject*)&binaryType);
- microprotocols_add(&PyList_Type, NULL, (PyObject*)&listType);
-
-#ifdef HAVE_MXDATETIME
- /* the module has already been initialized, so we can obtain the callable
- objects directly from its dictionary :) */
- call = PyMapping_GetItemString(mod, "TimestampFromMx");
- microprotocols_add(mxDateTimeP->DateTime_Type, NULL, call);
- call = PyMapping_GetItemString(mod, "TimeFromMx");
- microprotocols_add(mxDateTimeP->DateTimeDelta_Type, NULL, call);
-#endif
-
-#ifdef HAVE_PYDATETIME
- /* as above, we use the callable objects from the psycopg module */
- call = PyMapping_GetItemString(mod, "DateFromPy");
- microprotocols_add((PyTypeObject*)pyDateTypeP, NULL, call);
- call = PyMapping_GetItemString(mod, "TimeFromPy");
- microprotocols_add((PyTypeObject*)pyTimeTypeP, NULL, call);
- call = PyMapping_GetItemString(mod, "TimestampFromPy");
- microprotocols_add((PyTypeObject*)pyDateTimeTypeP, NULL, call);
- call = PyMapping_GetItemString(mod, "IntervalFromPy");
- microprotocols_add((PyTypeObject*)pyDeltaTypeP, NULL, call);
-#endif
-
-#ifdef HAVE_PYBOOL
- microprotocols_add(&PyBool_Type, NULL, (PyObject*)&pbooleanType);
-#endif
-
-#ifdef HAVE_DECIMAL
- microprotocols_add((PyTypeObject*)decimalType, NULL, (PyObject*)&asisType);
-#endif
-}
-
-/* psyco_encodings_fill
-
- Fill the module's postgresql<->python encoding table */
-
-static encodingPair encodings[] = {
- {"SQL_ASCII", "ascii"},
- {"LATIN1", "latin_1"},
- {"UNICODE", "utf_8"},
- {"UTF8", "utf_8"},
-
- /* some compatibility stuff */
- {"LATIN-1", "latin_1"},
-
- {NULL, NULL}
-};
-static void psyco_encodings_fill(PyObject *dict)
-{
- encodingPair *enc;
-
- for (enc = encodings; enc->pgenc != NULL; enc++) {
- PyObject *value = PyString_FromString(enc->pyenc);
- PyDict_SetItemString(dict, enc->pgenc, value);
- Py_DECREF(value);
- }
-}
-
-/* psyco_errors_init, psyco_errors_fill (callable from C)
-
- Initialize the module's exceptions and after that a dictionary with a full
- set of exceptions. */
-
-PyObject *Error, *Warning, *InterfaceError, *DatabaseError,
- *InternalError, *OperationalError, *ProgrammingError,
- *IntegrityError, *DataError, *NotSupportedError;
-
-/* mapping between exception names and their PyObject */
-static struct {
- char *name;
- PyObject **exc;
- PyObject **base;
- char *docstr;
-} exctable[] = {
- { "psycopg2.Error", &Error, 0, Error_doc },
- { "psycopg2.Warning", &Warning, 0, Warning_doc },
- { "psycopg2.InterfaceError", &InterfaceError, &Error, InterfaceError_doc },
- { "psycopg2.DatabaseError", &DatabaseError, &Error, DatabaseError_doc },
- { "psycopg2.InternalError", &InternalError, &DatabaseError, InternalError_doc },
- { "psycopg2.OperationalError", &OperationalError, &DatabaseError,
- OperationalError_doc },
- { "psycopg2.ProgrammingError", &ProgrammingError, &DatabaseError,
- ProgrammingError_doc },
- { "psycopg2.IntegrityError", &IntegrityError, &DatabaseError,
- IntegrityError_doc },
- { "psycopg2.DataError", &DataError, &DatabaseError, DataError_doc },
- { "psycopg2.NotSupportedError", &NotSupportedError, &DatabaseError,
- NotSupportedError_doc },
- {NULL} /* Sentinel */
-};
-
-static void
-psyco_errors_init(void)
-{
- /* the names of the exceptions here reflect the oranization of the
- psycopg2 module and not the fact the the original error objects
- live in _psycopg */
-
- int i;
- PyObject *dict;
- PyObject *base;
- PyObject *str;
-
- for (i=0; exctable[i].name; i++) {
- dict = PyDict_New();
-
- if (exctable[i].docstr) {
- str = PyString_FromString(exctable[i].docstr);
- PyDict_SetItemString(dict, "__doc__", str);
- }
-
- if (exctable[i].base == 0)
- base = PyExc_StandardError;
- else
- base = *exctable[i].base;
-
- *exctable[i].exc = PyErr_NewException(exctable[i].name, base, dict);
- }
-}
-
-void
-psyco_errors_fill(PyObject *dict)
-{
- PyDict_SetItemString(dict, "Error", Error);
- PyDict_SetItemString(dict, "Warning", Warning);
- PyDict_SetItemString(dict, "InterfaceError", InterfaceError);
- PyDict_SetItemString(dict, "DatabaseError", DatabaseError);
- PyDict_SetItemString(dict, "InternalError", InternalError);
- PyDict_SetItemString(dict, "OperationalError", OperationalError);
- PyDict_SetItemString(dict, "ProgrammingError", ProgrammingError);
- PyDict_SetItemString(dict, "IntegrityError", IntegrityError);
- PyDict_SetItemString(dict, "DataError", DataError);
- PyDict_SetItemString(dict, "NotSupportedError", NotSupportedError);
-}
-
-void
-psyco_errors_set(PyObject *type)
-{
- PyObject_SetAttrString(type, "Error", Error);
- PyObject_SetAttrString(type, "Warning", Warning);
- PyObject_SetAttrString(type, "InterfaceError", InterfaceError);
- PyObject_SetAttrString(type, "DatabaseError", DatabaseError);
- PyObject_SetAttrString(type, "InternalError", InternalError);
- PyObject_SetAttrString(type, "OperationalError", OperationalError);
- PyObject_SetAttrString(type, "ProgrammingError", ProgrammingError);
- PyObject_SetAttrString(type, "IntegrityError", IntegrityError);
- PyObject_SetAttrString(type, "DataError", DataError);
- PyObject_SetAttrString(type, "NotSupportedError", NotSupportedError);
-}
-
-/* psyco_error_new
-
- Create a new error of the given type with extra attributes. */
-
-void
-psyco_set_error(PyObject *exc, PyObject *curs, char *msg,
- char *pgerror, char *pgcode)
-{
- PyObject *t;
-
- PyObject *err = PyObject_CallFunction(exc, "s", msg);
-
- if (err) {
- if (pgerror) {
- t = PyString_FromString(pgerror);
- }
- else {
- t = Py_None ; Py_INCREF(t);
- }
- PyObject_SetAttrString(err, "pgerror", t);
- Py_DECREF(t);
-
- if (pgcode) {
- t = PyString_FromString(pgcode);
- }
- else {
- t = Py_None ; Py_INCREF(t);
- }
- PyObject_SetAttrString(err, "pgcode", t);
- Py_DECREF(t);
-
- if (curs)
- PyObject_SetAttrString(err, "cursor", curs);
- else
- PyObject_SetAttrString(err, "cursor", Py_None);
-
- PyErr_SetObject(exc, err);
- Py_DECREF(err);
- }
-}
-
-/* psyco_decimal_init
-
- Initialize the module's pointer to the decimal type. */
-
-void
-psyco_decimal_init(void)
-{
-#ifdef HAVE_DECIMAL
- PyObject *decimal = PyImport_ImportModule("decimal");
- if (decimal) {
- decimalType = PyObject_GetAttrString(decimal, "Decimal");
- }
- else {
- PyErr_Clear();
- decimalType = (PyObject *)&PyFloat_Type;
- Py_INCREF(decimalType);
- }
-#endif
-}
-
-
-/** method table and module initialization **/
-
-static PyMethodDef psycopgMethods[] = {
- {"connect", (PyCFunction)psyco_connect,
- METH_VARARGS|METH_KEYWORDS, psyco_connect_doc},
- {"adapt", (PyCFunction)psyco_microprotocols_adapt,
- METH_VARARGS, psyco_microprotocols_adapt_doc},
-
- {"register_type", (PyCFunction)psyco_register_type,
- METH_VARARGS, psyco_register_type_doc},
- {"new_type", (PyCFunction)typecast_from_python,
- METH_VARARGS|METH_KEYWORDS, typecast_from_python_doc},
-
- {"AsIs", (PyCFunction)psyco_AsIs,
- METH_VARARGS, psyco_AsIs_doc},
- {"QuotedString", (PyCFunction)psyco_QuotedString,
- METH_VARARGS, psyco_QuotedString_doc},
- {"Boolean", (PyCFunction)psyco_Boolean,
- METH_VARARGS, psyco_Boolean_doc},
- {"Binary", (PyCFunction)psyco_Binary,
- METH_VARARGS, psyco_Binary_doc},
- {"Date", (PyCFunction)psyco_Date,
- METH_VARARGS, psyco_Date_doc},
- {"Time", (PyCFunction)psyco_Time,
- METH_VARARGS, psyco_Time_doc},
- {"Timestamp", (PyCFunction)psyco_Timestamp,
- METH_VARARGS, psyco_Timestamp_doc},
- {"DateFromTicks", (PyCFunction)psyco_DateFromTicks,
- METH_VARARGS, psyco_DateFromTicks_doc},
- {"TimeFromTicks", (PyCFunction)psyco_TimeFromTicks,
- METH_VARARGS, psyco_TimeFromTicks_doc},
- {"TimestampFromTicks", (PyCFunction)psyco_TimestampFromTicks,
- METH_VARARGS, psyco_TimestampFromTicks_doc},
- {"List", (PyCFunction)psyco_List,
- METH_VARARGS, psyco_List_doc},
-
-#ifdef HAVE_MXDATETIME
- {"DateFromMx", (PyCFunction)psyco_DateFromMx,
- METH_VARARGS, psyco_DateFromMx_doc},
- {"TimeFromMx", (PyCFunction)psyco_TimeFromMx,
- METH_VARARGS, psyco_TimeFromMx_doc},
- {"TimestampFromMx", (PyCFunction)psyco_TimestampFromMx,
- METH_VARARGS, psyco_TimestampFromMx_doc},
- {"IntervalFromMx", (PyCFunction)psyco_IntervalFromMx,
- METH_VARARGS, psyco_IntervalFromMx_doc},
-#endif
-
-#ifdef HAVE_PYDATETIME
- {"DateFromPy", (PyCFunction)psyco_DateFromPy,
- METH_VARARGS, psyco_DateFromPy_doc},
- {"TimeFromPy", (PyCFunction)psyco_TimeFromPy,
- METH_VARARGS, psyco_TimeFromPy_doc},
- {"TimestampFromPy", (PyCFunction)psyco_TimestampFromPy,
- METH_VARARGS, psyco_TimestampFromPy_doc},
- {"IntervalFromPy", (PyCFunction)psyco_IntervalFromPy,
- METH_VARARGS, psyco_IntervalFromPy_doc},
-#endif
-
- {NULL, NULL, 0, NULL} /* Sentinel */
-};
-
-PyMODINIT_FUNC
-init_psycopg(void)
-{
- static void *PSYCOPG_API[PSYCOPG_API_pointers];
-
- PyObject *module, *dict;
- PyObject *c_api_object;
-
- Dprintf("initpsycopg: initializing psycopg %s", PSYCOPG_VERSION);
-
- /* initialize all the new types and then the module */
- connectionType.ob_type = &PyType_Type;
- cursorType.ob_type = &PyType_Type;
- typecastType.ob_type = &PyType_Type;
- qstringType.ob_type = &PyType_Type;
- binaryType.ob_type = &PyType_Type;
- isqlquoteType.ob_type = &PyType_Type;
- asisType.ob_type = &PyType_Type;
- listType.ob_type = &PyType_Type;
- chunkType.ob_type = &PyType_Type;
-
- if (PyType_Ready(&connectionType) == -1) return;
- if (PyType_Ready(&cursorType) == -1) return;
- if (PyType_Ready(&typecastType) == -1) return;
- if (PyType_Ready(&qstringType) == -1) return;
- if (PyType_Ready(&binaryType) == -1) return;
- if (PyType_Ready(&isqlquoteType) == -1) return;
- if (PyType_Ready(&asisType) == -1) return;
- if (PyType_Ready(&listType) == -1) return;
- if (PyType_Ready(&chunkType) == -1) return;
-
-#ifdef HAVE_PYBOOL
- pbooleanType.ob_type = &PyType_Type;
- if (PyType_Ready(&pbooleanType) == -1) return;
-#endif
-
- /* import mx.DateTime module, if necessary */
-#ifdef HAVE_MXDATETIME
- mxdatetimeType.ob_type = &PyType_Type;
- if (PyType_Ready(&mxdatetimeType) == -1) return;
- if (mxDateTime_ImportModuleAndAPI() != 0) {
- Dprintf("initpsycopg: why marc hide mx.DateTime again?!");
- PyErr_SetString(PyExc_ImportError, "can't import mx.DateTime module");
- return;
- }
- mxDateTimeP = &mxDateTime;
-#endif
-
- /* import python builtin datetime module, if available */
-#ifdef HAVE_PYDATETIME
- pyDateTimeModuleP = PyImport_ImportModule("datetime");
- if (pyDateTimeModuleP == NULL) {
- Dprintf("initpsycopg: can't import datetime module");
- PyErr_SetString(PyExc_ImportError, "can't import datetime module");
- return;
- }
- pydatetimeType.ob_type = &PyType_Type;
- if (PyType_Ready(&pydatetimeType) == -1) return;
-
- /* now we define the datetime types, this is crazy because python should
- be doing that, not us! */
- pyDateTypeP = PyObject_GetAttrString(pyDateTimeModuleP, "date");
- pyTimeTypeP = PyObject_GetAttrString(pyDateTimeModuleP, "time");
- pyDateTimeTypeP = PyObject_GetAttrString(pyDateTimeModuleP, "datetime");
- pyDeltaTypeP = PyObject_GetAttrString(pyDateTimeModuleP, "timedelta");
-#endif
-
- /* import psycopg2.tz anyway (TODO: replace with C-level module?) */
- pyPsycopgTzModule = PyImport_ImportModule("psycopg2.tz");
- if (pyPsycopgTzModule == NULL) {
- Dprintf("initpsycopg: can't import psycopg2.tz module");
- PyErr_SetString(PyExc_ImportError, "can't import psycopg2.tz module");
- return;
- }
- pyPsycopgTzLOCAL =
- PyObject_GetAttrString(pyPsycopgTzModule, "LOCAL");
- pyPsycopgTzFixedOffsetTimezone =
- PyObject_GetAttrString(pyPsycopgTzModule, "FixedOffsetTimezone");
-
- /* initialize the module and grab module's dictionary */
- module = Py_InitModule("_psycopg", psycopgMethods);
- dict = PyModule_GetDict(module);
-
- /* initialize all the module's exported functions */
- /* PyBoxer_API[PyBoxer_Fake_NUM] = (void *)PyBoxer_Fake; */
-
- /* Create a CObject containing the API pointer array's address */
- c_api_object = PyCObject_FromVoidPtr((void *)PSYCOPG_API, NULL);
- if (c_api_object != NULL)
- PyModule_AddObject(module, "_C_API", c_api_object);
-
- /* other mixed initializations of module-level variables */
- psycoEncodings = PyDict_New();
- psyco_encodings_fill(psycoEncodings);
- psyco_decimal_init();
-
- /* set some module's parameters */
- PyModule_AddStringConstant(module, "__version__", PSYCOPG_VERSION);
- PyModule_AddStringConstant(module, "__doc__", "psycopg PostgreSQL driver");
- PyModule_AddObject(module, "apilevel", PyString_FromString(APILEVEL));
- PyModule_AddObject(module, "threadsafety", PyInt_FromLong(THREADSAFETY));
- PyModule_AddObject(module, "paramstyle", PyString_FromString(PARAMSTYLE));
-
- /* put new types in module dictionary */
- PyModule_AddObject(module, "connection", (PyObject*)&connectionType);
- PyModule_AddObject(module, "cursor", (PyObject*)&cursorType);
- PyModule_AddObject(module, "ISQLQuote", (PyObject*)&isqlquoteType);
-
- /* encodings dictionary in module dictionary */
- PyModule_AddObject(module, "encodings", psycoEncodings);
-
- /* initialize default set of typecasters */
- typecast_init(dict);
-
- /* initialize microprotocols layer */
- microprotocols_init(dict);
- psyco_adapters_init(dict);
-
- /* create a standard set of exceptions and add them to the module's dict */
- psyco_errors_init();
- psyco_errors_fill(dict);
-
- /* Solve win32 build issue about non-constant initializer element */
- cursorType.tp_alloc = PyType_GenericAlloc;
- binaryType.tp_alloc = PyType_GenericAlloc;
- isqlquoteType.tp_alloc = PyType_GenericAlloc;
- pbooleanType.tp_alloc = PyType_GenericAlloc;
- connectionType.tp_alloc = PyType_GenericAlloc;
- asisType.tp_alloc = PyType_GenericAlloc;
- qstringType.tp_alloc = PyType_GenericAlloc;
- listType.tp_alloc = PyType_GenericAlloc;
- chunkType.tp_alloc = PyType_GenericAlloc;
-
-#ifdef HAVE_PYDATETIME
- pydatetimeType.tp_alloc = PyType_GenericAlloc;
-#endif
-
- Dprintf("initpsycopg: module initialization complete");
-}
+++ /dev/null
-/* python.h - python version compatibility stuff
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_PYTHON_H
-#define PSYCOPG_PYTHON_H 1
-
-#include <Python.h>
-#include <structmember.h>
-
-/* python < 2.2 does not have PyMemeberDef */
-#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 2
-#define PyMemberDef memberlist
-#endif
-
-/* PyObject_TypeCheck introduced in 2.2 */
-#ifndef PyObject_TypeCheck
-#define PyObject_TypeCheck(o, t) ((o)->ob_type == (t))
-#endif
-
-/* python 2.2 does not have freefunc (it has destructor instead) */
-#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 3
-#define freefunc destructor
-#endif
-
-#endif /* !defined(PSYCOPG_PYTHON_H) */
+++ /dev/null
-/* typecast.c - basic utility functions related to typecasting
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <Python.h>
-#include <structmember.h>
-
-#define PSYCOPG_MODULE
-#include "psycopg/config.h"
-#include "psycopg/psycopg.h"
-#include "psycopg/python.h"
-#include "psycopg/typecast.h"
-#include "psycopg/cursor.h"
-
-/* usefull function used by some typecasters */
-
-static char *
-skip_until_space(char *s)
-{
- while (*s && *s != ' ') s++;
- return s;
-}
-
-static char *
-skip_until_space2(char *s, int *len)
-{
- while (*len > 0 && *s && *s != ' ') {
- s++; (*len)--;
- }
- return s;
-}
-
-static int
-typecast_parse_date(char* s, char** t, int* len,
- int* year, int* month, int* day)
-{
- int acc = -1, cz = 0;
-
- Dprintf("typecast_parse_date: len = %d, s = %s", *len, s);
-
- while (cz < 3 && *len > 0 && *s) {
- switch (*s) {
- case '-':
- case ' ':
- case 'T':
- if (cz == 0) *year = acc;
- else if (cz == 1) *month = acc;
- else if (cz == 2) *day = acc;
- acc = -1; cz++;
- break;
- default:
- acc = (acc == -1 ? 0 : acc*10) + ((int)*s - (int)'0');
- break;
- }
-
- s++; (*len)--;
- }
-
- if (acc != -1) {
- *day = acc;
- cz += 1;
- }
- if (t != NULL) *t = s;
-
- return cz;
-}
-
-static int
-typecast_parse_time(char* s, char** t, int* len,
- int* hh, int* mm, int* ss, int* us, int* tz)
-{
- int acc = -1, cz = 0;
- int tzs = 1, tzhh = 0, tzmm = 0;
- int usd = 0;
-
- /* sets microseconds and timezone to 0 because they may be missing */
- *us = *tz = 0;
-
- Dprintf("typecast_parse_time: len = %d, s = %s", *len, s);
-
- while (cz < 6 && *len > 0 && *s) {
- switch (*s) {
- case ':':
- if (cz == 0) *hh = acc;
- else if (cz == 1) *mm = acc;
- else if (cz == 2) *ss = acc;
- else if (cz == 3) *us = acc;
- else if (cz == 4) tzhh = acc;
- acc = -1; cz++;
- break;
- case '.':
- /* we expect seconds and if we don't get them we return an error */
- if (cz != 2) return -1;
- *ss = acc;
- acc = -1; cz++;
- break;
- case '+':
- case '-':
- /* seconds or microseconds here, anything else is an error */
- if (cz < 2 || cz > 3) return -1;
- if (*s == '-') tzs = -1;
- if (cz == 2) *ss = acc;
- else if (cz == 3) *us = acc;
- acc = -1; cz = 4;
- break;
- default:
- acc = (acc == -1 ? 0 : acc*10) + ((int)*s - (int)'0');
- if (cz == 3) usd += 1;
- break;
- }
-
- s++; (*len)--;
- }
-
- if (acc != -1) {
- if (cz == 2) { *ss = acc; cz += 1; }
- else if (cz == 3) { *us = acc; cz += 1; }
- else if (cz == 4) { tzhh = acc; cz += 1; }
- else if (cz == 5) tzmm = acc;
- }
- if (t != NULL) *t = s;
-
- *tz = tzs * tzhh*60 + tzmm;
-
- if (*us != 0.0) {
- while (usd++ < 6) *us *= 10.0;
- }
-
- return cz;
-}
-
-/** include casting objects **/
-#include "psycopg/typecast_basic.c"
-#include "psycopg/typecast_binary.c"
-
-#ifdef HAVE_MXDATETIME
-#include "psycopg/typecast_mxdatetime.c"
-#endif
-
-#ifdef HAVE_PYDATETIME
-#include "psycopg/typecast_datetime.c"
-#endif
-
-#include "psycopg/typecast_array.c"
-#include "psycopg/typecast_builtins.c"
-
-
-/* a list of initializers, used to make the typecasters accessible anyway */
-#ifdef HAVE_PYDATETIME
-typecastObject_initlist typecast_pydatetime[] = {
- {"PYDATETIME", typecast_DATETIME_types, typecast_PYDATETIME_cast},
- {"PYTIME", typecast_TIME_types, typecast_PYTIME_cast},
- {"PYDATE", typecast_DATE_types, typecast_PYDATE_cast},
- {"PYINTERVAL", typecast_INTERVAL_types, typecast_PYINTERVAL_cast},
- {NULL, NULL, NULL}
-};
-#endif
-
-/* a list of initializers, used to make the typecasters accessible anyway */
-#ifdef HAVE_MXDATETIME
-typecastObject_initlist typecast_mxdatetime[] = {
- {"MXDATETIME", typecast_DATETIME_types, typecast_MXDATE_cast},
- {"MXTIME", typecast_TIME_types, typecast_MXTIME_cast},
- {"MXDATE", typecast_DATE_types, typecast_MXDATE_cast},
- {"MXINTERVAL", typecast_INTERVAL_types, typecast_MXINTERVAL_cast},
- {NULL, NULL, NULL}
-};
-#endif
-
-
-/** the type dictionary and associated functions **/
-
-PyObject *psyco_types;
-PyObject *psyco_default_cast;
-PyObject *psyco_binary_types;
-PyObject *psyco_default_binary_cast;
-
-static long int typecast_default_DEFAULT[] = {0};
-static typecastObject_initlist typecast_default = {
- "DEFAULT", typecast_default_DEFAULT, typecast_STRING_cast};
-
-
-/* typecast_init - initialize the dictionary and create default types */
-
-int
-typecast_init(PyObject *dict)
-{
- int i;
-
- /* create type dictionary and put it in module namespace */
- psyco_types = PyDict_New();
- psyco_binary_types = PyDict_New();
-
- if (!psyco_types || !psyco_binary_types) {
- Py_XDECREF(psyco_types);
- Py_XDECREF(psyco_binary_types);
- return -1;
- }
-
- PyDict_SetItemString(dict, "string_types", psyco_types);
- PyDict_SetItemString(dict, "binary_types", psyco_binary_types);
-
- /* insert the cast types into the 'types' dictionary and register them in
- the module dictionary */
- for (i = 0; typecast_builtins[i].name != NULL; i++) {
- typecastObject *t;
-
- Dprintf("typecast_init: initializing %s", typecast_builtins[i].name);
-
- t = (typecastObject *)typecast_from_c(&(typecast_builtins[i]), dict);
- if (t == NULL) return -1;
- if (typecast_add((PyObject *)t, 0) != 0) return -1;
-
- PyDict_SetItem(dict, t->name, (PyObject *)t);
-
- /* export binary object */
- if (typecast_builtins[i].values == typecast_BINARY_types) {
- psyco_default_binary_cast = (PyObject *)t;
- }
- }
-
- /* create and save a default cast object (but does not register it) */
- psyco_default_cast = typecast_from_c(&typecast_default, dict);
-
- /* register the date/time typecasters with their original names */
-#ifdef HAVE_MXDATETIME
- for (i = 0; typecast_mxdatetime[i].name != NULL; i++) {
- typecastObject *t;
- Dprintf("typecast_init: initializing %s", typecast_mxdatetime[i].name);
- t = (typecastObject *)typecast_from_c(&(typecast_mxdatetime[i]), dict);
- if (t == NULL) return -1;
- PyDict_SetItem(dict, t->name, (PyObject *)t);
- }
-#endif
-#ifdef HAVE_PYDATETIME
- for (i = 0; typecast_pydatetime[i].name != NULL; i++) {
- typecastObject *t;
- Dprintf("typecast_init: initializing %s", typecast_pydatetime[i].name);
- t = (typecastObject *)typecast_from_c(&(typecast_pydatetime[i]), dict);
- if (t == NULL) return -1;
- PyDict_SetItem(dict, t->name, (PyObject *)t);
- }
-#endif
-
- return 0;
-}
-
-/* typecast_add - add a type object to the dictionary */
-int
-typecast_add(PyObject *obj, int binary)
-{
- PyObject *val;
- int len, i;
-
- typecastObject *type = (typecastObject *)obj;
-
- Dprintf("typecast_add: object at %p, values refcnt = %d",
- obj, type->values->ob_refcnt);
-
- len = PyTuple_Size(type->values);
- for (i = 0; i < len; i++) {
- val = PyTuple_GetItem(type->values, i);
- Dprintf("typecast_add: adding val: %ld", PyInt_AsLong(val));
- if (binary) {
- PyDict_SetItem(psyco_binary_types, val, obj);
- }
- else {
- PyDict_SetItem(psyco_types, val, obj);
- }
- }
-
- Dprintf("typecast_add: base caster: %p", type->bcast);
-
- return 0;
-}
-
-
-/** typecast type **/
-
-#define OFFSETOF(x) offsetof(typecastObject, x)
-
-static int
-typecast_cmp(PyObject *obj1, PyObject* obj2)
-{
- typecastObject *self = (typecastObject*)obj1;
- typecastObject *other = NULL;
- PyObject *number = NULL;
- int i, j, res = -1;
-
- if (PyObject_TypeCheck(obj2, &typecastType)) {
- other = (typecastObject*)obj2;
- }
- else {
- number = PyNumber_Int(obj2);
- }
-
- Dprintf("typecast_cmp: other = %p, number = %p", other, number);
-
- for (i=0; i < PyObject_Length(self->values) && res == -1; i++) {
- long int val = PyInt_AsLong(PyTuple_GET_ITEM(self->values, i));
-
- if (other != NULL) {
- for (j=0; j < PyObject_Length(other->values); j++) {
- if (PyInt_AsLong(PyTuple_GET_ITEM(other->values, j)) == val) {
- res = 0; break;
- }
- }
- }
-
- else if (number != NULL) {
- if (PyInt_AsLong(number) == val) {
- res = 0; break;
- }
- }
- }
-
- Py_XDECREF(number);
- return res;
-}
-
-static PyObject*
-typecast_richcompare(PyObject *obj1, PyObject* obj2, int opid)
-{
- PyObject *result = NULL;
- int res = typecast_cmp(obj1, obj2);
-
- if (PyErr_Occurred()) return NULL;
-
- if ((opid == Py_EQ && res == 0) || (opid != Py_EQ && res != 0))
- result = Py_True;
- else
- result = Py_False;
-
- Py_INCREF(result);
- return result;
-}
-
-static struct PyMemberDef typecastObject_members[] = {
- {"name", T_OBJECT, OFFSETOF(name), RO},
- {"values", T_OBJECT, OFFSETOF(values), RO},
- {NULL}
-};
-
-static void
-typecast_dealloc(PyObject *obj)
-{
- typecastObject *self = (typecastObject*)obj;
-
- Py_XDECREF(self->values);
- Py_XDECREF(self->name);
- Py_XDECREF(self->pcast);
-
- PyObject_Del(self);
-}
-
-static PyObject *
-typecast_call(PyObject *obj, PyObject *args, PyObject *kwargs)
-{
- PyObject *string, *cursor;
-
- if (!PyArg_ParseTuple(args, "OO", &string, &cursor)) {
- return NULL;
- }
-
- return typecast_cast(obj,
- PyString_AsString(string), PyString_Size(string),
- cursor);
-}
-
-PyTypeObject typecastType = {
- PyObject_HEAD_INIT(NULL)
- 0,
- "psycopg2._psycopg.type",
- sizeof(typecastObject),
- 0,
-
- typecast_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- typecast_cmp, /*tp_compare*/
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
-
- typecast_call, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
-
- Py_TPFLAGS_HAVE_RICHCOMPARE, /*tp_flags*/
- "psycopg type-casting object", /*tp_doc*/
-
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
-
- typecast_richcompare, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
-
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
-
- /* Attribute descriptor and subclassing stuff */
-
- 0, /*tp_methods*/
- typecastObject_members, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
-
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
-
- 0, /*tp_init*/
- 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/
- 0, /*tp_new*/
- 0, /*tp_free Low-level free-memory routine */
- 0, /*tp_is_gc For PyObject_IS_GC */
- 0, /*tp_bases*/
- 0, /*tp_mro method resolution order */
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0 /*tp_weaklist*/
-};
-
-static PyObject *
-typecast_new(PyObject *name, PyObject *values, PyObject *cast, PyObject *base)
-{
- typecastObject *obj;
-
- obj = PyObject_NEW(typecastObject, &typecastType);
- if (obj == NULL) return NULL;
-
- Dprintf("typecast_new: new type at = %p, refcnt = %d", obj, obj->ob_refcnt);
-
- Py_INCREF(values);
- obj->values = values;
-
- if (name) {
- Py_INCREF(name);
- obj->name = name;
- }
- else {
- Py_INCREF(Py_None);
- obj->name = Py_None;
- }
-
- obj->pcast = NULL;
- obj->ccast = NULL;
- obj->bcast = base;
-
- if (obj->bcast) Py_INCREF(obj->bcast);
-
- /* FIXME: raise an exception when None is passed as Python caster */
- if (cast && cast != Py_None) {
- Py_INCREF(cast);
- obj->pcast = cast;
- }
-
- Dprintf("typecast_new: typecast object created at %p", obj);
-
- return (PyObject *)obj;
-}
-
-PyObject *
-typecast_from_python(PyObject *self, PyObject *args, PyObject *keywds)
-{
- PyObject *v, *name, *cast = NULL, *base = NULL;
-
- static char *kwlist[] = {"values", "name", "castobj", "baseobj", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, keywds, "O!|O!OO", kwlist,
- &PyTuple_Type, &v,
- &PyString_Type, &name,
- &cast, &base)) {
- return NULL;
- }
-
- return typecast_new(name, v, cast, base);
-}
-
-PyObject *
-typecast_from_c(typecastObject_initlist *type, PyObject *dict)
-{
- PyObject *tuple, *base = NULL;
- typecastObject *obj;
- int i, len = 0;
-
- /* before doing anything else we look for the base */
- if (type->base) {
- /* NOTE: base is a borrowed reference! */
- base = PyDict_GetItemString(dict, type->base);
- if (!base) {
- PyErr_Format(Error, "typecast base not found: %s", type->base);
- return NULL;
- }
- }
-
- while (type->values[len] != 0) len++;
-
- tuple = PyTuple_New(len);
- if (!tuple) return NULL;
-
- for (i = 0; i < len ; i++) {
- PyTuple_SET_ITEM(tuple, i, PyInt_FromLong(type->values[i]));
- }
-
-
- obj = (typecastObject *)
- typecast_new(PyString_FromString(type->name), tuple, NULL, base);
-
- if (obj) {
- obj->ccast = type->cast;
- obj->pcast = NULL;
- }
- return (PyObject *)obj;
-}
-
-PyObject *
-typecast_cast(PyObject *obj, char *str, int len, PyObject *curs)
-{
- PyObject *old, *res = NULL;
- typecastObject *self = (typecastObject *)obj;
-
- /* we don't incref, the caster *can't* die at this point */
- old = ((cursorObject*)curs)->caster;
- ((cursorObject*)curs)->caster = obj;
-
- if (self->ccast) {
- res = self->ccast(str, len, curs);
- }
- else if (self->pcast) {
- res = PyObject_CallFunction(self->pcast, "s#O", str, len, curs);
- }
- else {
- PyErr_SetString(Error, "internal error: no casting function found");
- }
-
- ((cursorObject*)curs)->caster = old;
-
- return res;
-}
+++ /dev/null
-/* typecast.h - definitions for typecasters
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_TYPECAST_H
-#define PSYCOPG_TYPECAST_H 1
-
-#include <Python.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* type of type-casting functions (both C and Python) */
-typedef PyObject *(*typecast_function)(char *, int len, PyObject *);
-
-/** typecast type **/
-
-extern PyTypeObject typecastType;
-
-typedef struct {
- PyObject_HEAD
-
- PyObject *name; /* the name of this type */
- PyObject *values; /* the different types this instance can match */
-
- typecast_function ccast; /* the C casting function */
- PyObject *pcast; /* the python casting function */
- PyObject *bcast; /* base cast, used by array typecasters */
-} typecastObject;
-
-/* the initialization values are stored here */
-
-typedef struct {
- char *name;
- long int *values;
- typecast_function cast;
-
- /* base is the base typecaster for arrays */
- char *base;
-} typecastObject_initlist;
-
-/* the type dictionary, much faster to access it globally */
-extern PyObject *psyco_types;
-extern PyObject *psyco_binary_types;
-
-/* the default casting objects, used when no other objects are available */
-extern PyObject *psyco_default_cast;
-extern PyObject *psyco_default_binary_cast;
-
-/** exported functions **/
-
-/* used by module.c to init the type system and register types */
-extern int typecast_init(PyObject *dict);
-extern int typecast_add(PyObject *obj, int binary);
-
-/* the C callable typecastObject creator function */
-extern PyObject *typecast_from_c(typecastObject_initlist *type, PyObject *d);
-
-/* the python callable typecast creator function */
-extern PyObject *typecast_from_python(
- PyObject *self, PyObject *args, PyObject *keywds);
-
-/* the function used to dispatch typecasting calls */
-extern PyObject *typecast_cast(
- PyObject *self, char *str, int len, PyObject *curs);
-
-#endif /* !defined(PSYCOPG_TYPECAST_H) */
+++ /dev/null
-/* typecast_array.c - array typecasters
- *
- * Copyright (C) 2005 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of the psycopg module.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#define MAX_DIMENSIONS 16
-
-/** typecast_array_cleanup - remove the horrible [...]= stuff **/
-
-static int
-typecast_array_cleanup(char **str, int *len)
-{
- int i, depth = 1;
-
- if ((*str)[0] != '[') return -1;
-
- for (i=1 ; depth > 0 && i < *len ; i++) {
- if ((*str)[i] == '[')
- depth += 1;
- else if ((*str)[i] == ']')
- depth -= 1;
- }
- if ((*str)[i] != '=') return -1;
-
- *str = &((*str)[i+1]);
- *len = *len - i - 1;
- return 0;
-}
-
-/** typecast_array_scan - scan a string looking for array items **/
-
-#define ASCAN_ERROR -1
-#define ASCAN_EOF 0
-#define ASCAN_BEGIN 1
-#define ASCAN_END 2
-#define ASCAN_TOKEN 3
-#define ASCAN_QUOTED 4
-
-static int
-typecast_array_tokenize(char *str, int strlength,
- int *pos, char** token, int *length)
-{
- /* FORTRAN glory */
- int i, j, q, b, l, res;
-
- Dprintf("typecast_array_tokenize: '%s', %d/%d",
- &str[*pos], *pos, strlength);
-
- /* we always get called with pos pointing at the start of a token, so a
- fast check is enough for ASCAN_EOF, ASCAN_BEGIN and ASCAN_END */
- if (*pos == strlength) {
- return ASCAN_EOF;
- }
- else if (str[*pos] == '{') {
- *pos += 1;
- return ASCAN_BEGIN;
- }
- else if (str[*pos] == '}') {
- *pos += 1;
- if (str[*pos] == ',')
- *pos += 1;
- return ASCAN_END;
- }
-
- /* now we start looking for the first unquoted ',' or '}', the only two
- tokens that can limit an array element */
- q = 0; /* if q is odd we're inside quotes */
- b = 0; /* if b is 1 we just encountered a backslash */
- res = ASCAN_TOKEN;
-
- for (i = *pos ; i < strlength ; i++) {
- switch (str[i]) {
- case '"':
- if (b == 0)
- q += 1;
- else
- b = 0;
- break;
-
- case '\\':
- res = ASCAN_QUOTED;
- if (b == 0)
- b = 1;
- else
- /* we're backslashing a backslash */
- b = 0;
- break;
-
- case '}':
- case ',':
- if (b == 0 && ((q&1) == 0))
- goto tokenize;
- break;
-
- default:
- /* reset the backslash counter */
- b = 0;
- break;
- }
- }
-
- tokenize:
- /* remove initial quoting character and calculate raw length */
- l = i - *pos;
- if (str[*pos] == '"') {
- *pos += 1;
- l -= 2;
- }
-
- if (res == ASCAN_QUOTED) {
- char *buffer = PyMem_Malloc(l+1);
- if (buffer == NULL) return ASCAN_ERROR;
-
- *token = buffer;
-
- for (j = *pos; j < *pos+l; j++) {
- if (str[j] != '\\'
- || (j > *pos && str[j-1] == '\\'))
- *(buffer++) = str[j];
- }
-
- *buffer = '\0';
- *length = buffer - *token;
- }
- else {
- *token = &str[*pos];
- *length = l;
- }
-
- *pos = i;
-
- /* skip the comma and set position to the start of next token */
- if (str[i] == ',') *pos += 1;
-
- return res;
-}
-
-static int
-typecast_array_scan(char *str, int strlength,
- PyObject *curs, PyObject *base, PyObject *array)
-{
- int state, length = 0, pos = 0;
- char *token;
-
- PyObject *stack[MAX_DIMENSIONS];
- int stack_index = 0;
-
- while (1) {
- token = NULL;
- state = typecast_array_tokenize(str, strlength, &pos, &token, &length);
- Dprintf("typecast_array_scan: state = %d, length = %d, token = '%s'",
- state, length, token);
- if (state == ASCAN_TOKEN || state == ASCAN_QUOTED) {
- PyObject *obj = typecast_cast(base, token, length, curs);
-
- /* before anything else we free the memory */
- if (state == ASCAN_QUOTED) PyMem_Free(token);
- if (obj == NULL) return 0;
-
- PyList_Append(array, obj);
- Py_DECREF(obj);
- }
-
- else if (state == ASCAN_BEGIN) {
- PyObject *sub = PyList_New(0);
- if (sub == NULL) return 0;
-
- PyList_Append(array, sub);
- Py_DECREF(sub);
-
- if (stack_index == MAX_DIMENSIONS)
- return 0;
-
- stack[stack_index++] = array;
- array = sub;
- }
-
- else if (state == ASCAN_ERROR) {
- return 0;
- }
-
- else if (state == ASCAN_END) {
- if (--stack_index < 0)
- return 0;
- array = stack[stack_index];
- }
-
- else if (state == ASCAN_EOF)
- break;
- }
-
- return 1;
-}
-
-
-/** GENERIC - a generic typecaster that can be used when no special actions
- have to be taken on the single items **/
-
-static PyObject *
-typecast_GENERIC_ARRAY_cast(char *str, int len, PyObject *curs)
-{
- PyObject *obj = NULL;
- PyObject *base = ((typecastObject*)((cursorObject*)curs)->caster)->bcast;
-
- Dprintf("typecast_GENERIC_ARRAY_cast: str = '%s', len = %d", str, len);
-
- if (str == NULL) {Py_INCREF(Py_None); return Py_None;}
- if (str[0] == '[')
- typecast_array_cleanup(&str, &len);
- if (str[0] != '{') {
- PyErr_SetString(Error, "array does not start with '{'");
- return NULL;
- }
-
- Dprintf("typecast_GENERIC_ARRAY_cast: str = '%s', len = %d", str, len);
-
- obj = PyList_New(0);
-
- /* scan the array skipping the first level of {} */
- if (typecast_array_scan(&str[1], len-2, curs, base, obj) == 0) {
- Py_DECREF(obj);
- obj = NULL;
- }
-
- return obj;
-}
-
-/** almost all the basic array typecasters are derived from GENERIC **/
-
-#define typecast_LONGINTEGERARRAY_cast typecast_GENERIC_ARRAY_cast
-#define typecast_INTEGERARRAY_cast typecast_GENERIC_ARRAY_cast
-#define typecast_FLOATARRAY_cast typecast_GENERIC_ARRAY_cast
-#define typecast_DECIMALARRAY_cast typecast_GENERIC_ARRAY_cast
-#define typecast_STRINGARRAY_cast typecast_GENERIC_ARRAY_cast
-#define typecast_UNICODEARRAY_cast typecast_GENERIC_ARRAY_cast
-#define typecast_BOOLEANARRAY_cast typecast_GENERIC_ARRAY_cast
-#define typecast_DATETIMEARRAY_cast typecast_GENERIC_ARRAY_cast
-#define typecast_DATEARRAY_cast typecast_GENERIC_ARRAY_cast
-#define typecast_TIMEARRAY_cast typecast_GENERIC_ARRAY_cast
-#define typecast_INTERVALARRAY_cast typecast_GENERIC_ARRAY_cast
-#define typecast_BINARYARRAY_cast typecast_GENERIC_ARRAY_cast
-#define typecast_ROWIDARRAY_cast typecast_GENERIC_ARRAY_cast
+++ /dev/null
-/* pgcasts_basic.c - basic typecasting functions to python types
- *
- * Copyright (C) 2001-2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of the psycopg module.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/** INTEGER - cast normal integers (4 bytes) to python int **/
-
-static PyObject *
-typecast_INTEGER_cast(char *s, int len, PyObject *curs)
-{
- char buffer[12];
-
- if (s == NULL) {Py_INCREF(Py_None); return Py_None;}
- if (s[len] != '\0') {
- strncpy(buffer, s, len); buffer[len] = '\0';
- s = buffer;
- }
- return PyInt_FromString(s, NULL, 0);
-}
-
-/** LONGINTEGER - cast long integers (8 bytes) to python long **/
-
-static PyObject *
-typecast_LONGINTEGER_cast(char *s, int len, PyObject *curs)
-{
- char buffer[24];
-
- if (s == NULL) {Py_INCREF(Py_None); return Py_None;}
- if (s[len] != '\0') {
- strncpy(buffer, s, len); buffer[len] = '\0';
- s = buffer;
- }
- return PyLong_FromString(s, NULL, 0);
-}
-
-/** FLOAT - cast floating point numbers to python float **/
-
-static PyObject *
-typecast_FLOAT_cast(char *s, int len, PyObject *curs)
-{
- PyObject *str = NULL, *flo = NULL;
- char *pend;
-
- if (s == NULL) {Py_INCREF(Py_None); return Py_None;}
- str = PyString_FromStringAndSize(s, len);
- flo = PyFloat_FromString(str, &pend);
- Py_DECREF(str);
- return flo;
-}
-
-/** STRING - cast strings of any type to python string **/
-
-static PyObject *
-typecast_STRING_cast(char *s, int len, PyObject *curs)
-{
- if (s == NULL) {Py_INCREF(Py_None); return Py_None;}
- return PyString_FromStringAndSize(s, len);
-}
-
-/** UNICODE - cast strings of any type to a python unicode object **/
-
-static PyObject *
-typecast_UNICODE_cast(char *s, int len, PyObject *curs)
-{
- PyObject *enc;
-
- if (s == NULL) {Py_INCREF(Py_None); return Py_None;}
-
- enc = PyDict_GetItemString(psycoEncodings,
- ((cursorObject*)curs)->conn->encoding);
- if (enc) {
- return PyUnicode_Decode(s, len, PyString_AsString(enc), NULL);
- }
- else {
- PyErr_Format(InterfaceError,
- "can't decode into unicode string from %s",
- ((cursorObject*)curs)->conn->encoding);
- return NULL;
- }
-}
-
-/** BOOLEAN - cast boolean value into right python object **/
-
-static PyObject *
-typecast_BOOLEAN_cast(char *s, int len, PyObject *curs)
-{
- PyObject *res;
-
- if (s == NULL) {Py_INCREF(Py_None); return Py_None;}
-
- if (s[0] == 't')
- res = Py_True;
- else
- res = Py_False;
-
- Py_INCREF(res);
- return res;
-}
-
-/** DECIMAL - cast any kind of number into a Python Decimal object **/
-
-#ifdef HAVE_DECIMAL
-static PyObject *
-typecast_DECIMAL_cast(char *s, int len, PyObject *curs)
-{
- PyObject *res = NULL;
- char *buffer;
-
- if (s == NULL) {Py_INCREF(Py_None); return Py_None;}
-
- if ((buffer = PyMem_Malloc(len+1)) == NULL)
- PyErr_NoMemory();
- strncpy(buffer, s, len); buffer[len] = '\0';
- res = PyObject_CallFunction(decimalType, "s", buffer);
- PyMem_Free(buffer);
-
- return res;
-}
-#else
-#define typecast_DECIMAL_cast typecast_FLOAT_cast
-#endif
-
-/* some needed aliases */
-#define typecast_NUMBER_cast typecast_FLOAT_cast
-#define typecast_ROWID_cast typecast_INTEGER_cast
+++ /dev/null
-/* typecast_binary.c - binary typecasting functions to python types
- *
- * Copyright (C) 2001-2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of the psycopg module.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "typecast_binary.h"
-
-#include <libpq-fe.h>
-#include <stdlib.h>
-
-
-/* Python object holding a memory chunk. The memory is deallocated when
- the object is destroyed. This type is used to let users directly access
- memory chunks holding unescaped binary data through the buffer interface.
- */
-
-static void
-chunk_dealloc(chunkObject *self)
-{
- Dprintf("chunk_dealloc: deallocating memory at %p, size %d",
- self->base, self->len);
- free(self->base);
- self->ob_type->tp_free((PyObject *) self);
-}
-
-static PyObject *
-chunk_repr(chunkObject *self)
-{
- return PyString_FromFormat("<memory chunk at %p size %d>",
- self->base, self->len);
-}
-
-static int
-chunk_getreadbuffer(chunkObject *self, int segment, void **ptr)
-{
- if (segment != 0)
- {
- PyErr_SetString(PyExc_SystemError,
- "acessing non-existant buffer segment");
- return -1;
- }
- *ptr = self->base;
- return self->len;
-}
-
-static int
-chunk_getsegcount(chunkObject *self, int *lenp)
-{
- if (lenp != NULL)
- *lenp = self->len;
- return 1;
-}
-
-static PyBufferProcs chunk_as_buffer =
-{
- (getreadbufferproc) chunk_getreadbuffer,
- (getwritebufferproc) NULL,
- (getsegcountproc) chunk_getsegcount,
- (getcharbufferproc) NULL
-};
-
-#define chunk_doc "memory chunk"
-
-PyTypeObject chunkType = {
- PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
- "psycopg2._psycopg.chunk", /* tp_name */
- sizeof(chunkObject), /* tp_basicsize */
- 0, /* tp_itemsize */
- (destructor) chunk_dealloc, /* tp_dealloc*/
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_compare */
- (reprfunc) chunk_repr, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- &chunk_as_buffer, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- chunk_doc /* tp_doc */
-};
-
-/* the function typecast_BINARY_cast_unescape is used when libpq does not
- provide PQunescapeBytea: it convert all the \xxx octal sequences to the
- proper byte value */
-
-#ifdef PSYCOPG_OWN_QUOTING
-static unsigned char *
-typecast_BINARY_cast_unescape(unsigned char *str, size_t *to_length)
-{
- char *dstptr, *dststr;
- int len, i;
-
- len = strlen(str);
- dststr = (char*)calloc(len, sizeof(char));
- dstptr = dststr;
-
- if (dststr == NULL) return NULL;
-
- Py_BEGIN_ALLOW_THREADS;
-
- for (i = 0; i < len; i++) {
- if (str[i] == '\\') {
- if ( ++i < len) {
- if (str[i] == '\\') {
- *dstptr = '\\';
- }
- else {
- *dstptr = 0;
- *dstptr |= (str[i++] & 7) << 6;
- *dstptr |= (str[i++] & 7) << 3;
- *dstptr |= (str[i] & 7);
- }
- }
- }
- else {
- *dstptr = str[i];
- }
- dstptr++;
- }
-
- Py_END_ALLOW_THREADS;
-
- *to_length = (size_t)(dstptr-dststr);
-
- return dststr;
-}
-
-#define PQunescapeBytea typecast_BINARY_cast_unescape
-#endif
-
-static PyObject *
-typecast_BINARY_cast(char *s, int l, PyObject *curs)
-{
- chunkObject *chunk;
- PyObject *res;
- char *str, *buffer = NULL;
- size_t len;
-
- if (s == NULL) {Py_INCREF(Py_None); return Py_None;}
-
- /* PQunescapeBytea absolutely wants a 0-terminated string and we don't
- want to copy the whole buffer, right? Wrong, but there isn't any other
- way <g> */
- if (s[l] != '\0') {
- if ((buffer = PyMem_Malloc(l+1)) == NULL)
- PyErr_NoMemory();
- strncpy(buffer, s, l);
- buffer[l] = '\0';
- s = buffer;
- }
- str = (char*)PQunescapeBytea((unsigned char*)s, &len);
- Dprintf("typecast_BINARY_cast: unescaped %d bytes", len);
- if (buffer) PyMem_Free(buffer);
-
- chunk = (chunkObject *) PyObject_New(chunkObject, &chunkType);
- if (chunk == NULL) return NULL;
-
- chunk->base = str;
- chunk->len = len;
- if ((res = PyBuffer_FromObject((PyObject *)chunk, 0, len)) == NULL)
- return NULL;
-
- /* PyBuffer_FromObject() created a new reference. Release our reference so
- that the memory can be freed once the buffer is garbage collected. */
- Py_DECREF(chunk);
-
- return res;
-}
+++ /dev/null
-/* typecast_binary.h - definitions for binary typecaster
- *
- * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of psycopg.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PSYCOPG_TYPECAST_BINARY_H
-#define PSYCOPG_TYPECAST_BINARY_H 1
-
-#include <Python.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** chunk type **/
-
-extern PyTypeObject chunkType;
-
-typedef struct {
- PyObject_HEAD
-
- void *base; /* Pointer to the memory chunk. */
- int len; /* Size in bytes of the memory chunk. */
-
-} chunkObject;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_TYPECAST_BINARY_H) */
+++ /dev/null
-static long int typecast_NUMBER_types[] = {20, 23, 21, 701, 700, 1700, 0};
-static long int typecast_LONGINTEGER_types[] = {20, 0};
-static long int typecast_INTEGER_types[] = {23, 21, 0};
-static long int typecast_FLOAT_types[] = {701, 700, 0};
-static long int typecast_DECIMAL_types[] = {1700, 0};
-static long int typecast_UNICODE_types[] = {19, 18, 25, 1042, 1043, 0};
-static long int typecast_STRING_types[] = {19, 18, 25, 1042, 1043, 0};
-static long int typecast_BOOLEAN_types[] = {16, 0};
-static long int typecast_DATETIME_types[] = {1114, 1184, 704, 1186, 0};
-static long int typecast_TIME_types[] = {1083, 1266, 0};
-static long int typecast_DATE_types[] = {1082, 0};
-static long int typecast_INTERVAL_types[] = {704, 1186, 0};
-static long int typecast_BINARY_types[] = {17, 0};
-static long int typecast_ROWID_types[] = {26, 0};
-static long int typecast_LONGINTEGERARRAY_types[] = {1016, 0};
-static long int typecast_INTEGERARRAY_types[] = {1005, 1006, 1007, 0};
-static long int typecast_FLOATARRAY_types[] = {1017, 1021, 1022, 0};
-static long int typecast_DECIMALARRAY_types[] = {1231, 0};
-static long int typecast_UNICODEARRAY_types[] = {1002, 1003, 1009, 1014, 1015, 0};
-static long int typecast_STRINGARRAY_types[] = {1002, 1003, 1009, 1014, 1015, 0};
-static long int typecast_BOOLEANARRAY_types[] = {1000, 0};
-static long int typecast_DATETIMEARRAY_types[] = {1115, 1185, 0};
-static long int typecast_TIMEARRAY_types[] = {1183, 1270, 0};
-static long int typecast_DATEARRAY_types[] = {1182, 0};
-static long int typecast_INTERVALARRAY_types[] = {1187, 0};
-static long int typecast_BINARYARRAY_types[] = {1001, 0};
-static long int typecast_ROWIDARRAY_types[] = {1028, 1013, 0};
-
-
-typecastObject_initlist typecast_builtins[] = {
- {"NUMBER", typecast_NUMBER_types, typecast_NUMBER_cast, NULL},
- {"LONGINTEGER", typecast_LONGINTEGER_types, typecast_LONGINTEGER_cast, NULL},
- {"INTEGER", typecast_INTEGER_types, typecast_INTEGER_cast, NULL},
- {"FLOAT", typecast_FLOAT_types, typecast_FLOAT_cast, NULL},
- {"DECIMAL", typecast_DECIMAL_types, typecast_DECIMAL_cast, NULL},
- {"UNICODE", typecast_UNICODE_types, typecast_UNICODE_cast, NULL},
- {"STRING", typecast_STRING_types, typecast_STRING_cast, NULL},
- {"BOOLEAN", typecast_BOOLEAN_types, typecast_BOOLEAN_cast, NULL},
- {"DATETIME", typecast_DATETIME_types, typecast_DATETIME_cast, NULL},
- {"TIME", typecast_TIME_types, typecast_TIME_cast, NULL},
- {"DATE", typecast_DATE_types, typecast_DATE_cast, NULL},
- {"INTERVAL", typecast_INTERVAL_types, typecast_INTERVAL_cast, NULL},
- {"BINARY", typecast_BINARY_types, typecast_BINARY_cast, NULL},
- {"ROWID", typecast_ROWID_types, typecast_ROWID_cast, NULL},
- {"LONGINTEGERARRAY", typecast_LONGINTEGERARRAY_types, typecast_LONGINTEGERARRAY_cast, "LONGINTEGER"},
- {"INTEGERARRAY", typecast_INTEGERARRAY_types, typecast_INTEGERARRAY_cast, "INTEGER"},
- {"FLOATARRAY", typecast_FLOATARRAY_types, typecast_FLOATARRAY_cast, "FLOAT"},
- {"DECIMALARRAY", typecast_DECIMALARRAY_types, typecast_DECIMALARRAY_cast, "DECIMAL"},
- {"UNICODEARRAY", typecast_UNICODEARRAY_types, typecast_UNICODEARRAY_cast, "UNICODE"},
- {"STRINGARRAY", typecast_STRINGARRAY_types, typecast_STRINGARRAY_cast, "STRING"},
- {"BOOLEANARRAY", typecast_BOOLEANARRAY_types, typecast_BOOLEANARRAY_cast, "BOOLEAN"},
- {"DATETIMEARRAY", typecast_DATETIMEARRAY_types, typecast_DATETIMEARRAY_cast, "DATETIME"},
- {"TIMEARRAY", typecast_TIMEARRAY_types, typecast_TIMEARRAY_cast, "TIME"},
- {"DATEARRAY", typecast_DATEARRAY_types, typecast_DATEARRAY_cast, "DATE"},
- {"INTERVALARRAY", typecast_INTERVALARRAY_types, typecast_INTERVALARRAY_cast, "INTERVAL"},
- {"BINARYARRAY", typecast_BINARYARRAY_types, typecast_BINARYARRAY_cast, "BINARY"},
- {"ROWIDARRAY", typecast_ROWIDARRAY_types, typecast_ROWIDARRAY_cast, "ROWID"},
- {NULL, NULL, NULL, NULL}
-};
-
+++ /dev/null
-/* typecast_datetime.c - date and time typecasting functions to python types
- *
- * Copyright (C) 2001-2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of the psycopg module.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <math.h>
-#include "datetime.h"
-
-
-/* the pointer to the datetime module API is initialized by the module init
- code, we just need to grab it */
-extern PyObject* pyDateTimeModuleP;
-extern PyObject *pyDateTypeP;
-extern PyObject *pyTimeTypeP;
-extern PyObject *pyDateTimeTypeP;
-extern PyObject *pyDeltaTypeP;
-
-/** DATE - cast a date into a date python object **/
-
-static PyObject *
-typecast_PYDATE_cast(char *str, int len, PyObject *curs)
-{
- PyObject* obj = NULL;
- int n, y=0, m=0, d=0;
-
- if (str == NULL) {Py_INCREF(Py_None); return Py_None;}
-
- if (!strcmp(str, "infinity") || !strcmp(str, "-infinity")) {
- if (str[0] == '-') {
- obj = PyObject_GetAttrString(pyDateTypeP, "min");
- }
- else {
- obj = PyObject_GetAttrString(pyDateTypeP, "max");
- }
- }
-
- else {
- n = typecast_parse_date(str, NULL, &len, &y, &m, &d);
- Dprintf("typecast_PYDATE_cast: "
- "n = %d, len = %d, y = %d, m = %d, d = %d",
- n, len, y, m, d);
- if (n != 3) {
- PyErr_SetString(DataError, "unable to parse date");
- }
- else {
- obj = PyObject_CallFunction(pyDateTypeP, "iii", y, m, d);
- }
- }
- return obj;
-}
-
-/** DATETIME - cast a timestamp into a datetime python object **/
-
-static PyObject *
-typecast_PYDATETIME_cast(char *str, int len, PyObject *curs)
-{
- PyObject* obj = NULL;
- int n, y=0, m=0, d=0;
- int hh=0, mm=0, ss=0, us=0, tz=0;
- char *tp = NULL;
-
- if (str == NULL) {Py_INCREF(Py_None); return Py_None;}
-
- /* check for infinity */
- if (!strcmp(str, "infinity") || !strcmp(str, "-infinity")) {
- if (str[0] == '-') {
- obj = PyObject_GetAttrString(pyDateTimeTypeP, "min");
- }
- else {
- obj = PyObject_GetAttrString(pyDateTimeTypeP, "max");
- }
- }
-
- else {
- Dprintf("typecast_PYDATETIME_cast: s = %s", str);
- n = typecast_parse_date(str, &tp, &len, &y, &m, &d);
- Dprintf("typecast_PYDATE_cast: tp = %p "
- "n = %d, len = %d, y = %d, m = %d, d = %d",
- tp, n, len, y, m, d);
- if (n != 3) {
- PyErr_SetString(DataError, "unable to parse date");
- }
-
- if (len > 0) {
- n = typecast_parse_time(tp, NULL, &len, &hh, &mm, &ss, &us, &tz);
- Dprintf("typecast_PYDATETIME_cast: n = %d, len = %d, "
- "hh = %d, mm = %d, ss = %d, us = %d, tz = %d",
- n, len, hh, mm, ss, us, tz);
- if (n < 3 || n > 5) {
- PyErr_SetString(DataError, "unable to parse time");
- }
- }
-
- if (ss > 59) {
- mm += 1;
- ss -= 60;
- }
-
- if (n == 5 && ((cursorObject*)curs)->tzinfo_factory != Py_None) {
- /* we have a time zone, calculate minutes and create
- appropriate tzinfo object calling the factory */
- PyObject *tzinfo;
- Dprintf("typecast_PYDATETIME_cast: UTC offset = %dm", tz);
- tzinfo = PyObject_CallFunction(
- ((cursorObject*)curs)->tzinfo_factory, "i", tz);
- obj = PyObject_CallFunction(pyDateTimeTypeP, "iiiiiiiO",
- y, m, d, hh, mm, ss, us, tzinfo);
- Dprintf("typecast_PYDATETIME_cast: tzinfo: %p, refcnt = %d",
- tzinfo, tzinfo->ob_refcnt);
- Py_XDECREF(tzinfo);
- }
- else {
- obj = PyObject_CallFunction(pyDateTimeTypeP, "iiiiiii",
- y, m, d, hh, mm, ss, us);
- }
- }
- return obj;
-}
-
-/** TIME - parse time into a time object **/
-
-static PyObject *
-typecast_PYTIME_cast(char *str, int len, PyObject *curs)
-{
- PyObject* obj = NULL;
- int n, hh=0, mm=0, ss=0, us=0, tz=0;
-
- if (str == NULL) {Py_INCREF(Py_None); return Py_None;}
-
- n = typecast_parse_time(str, NULL, &len, &hh, &mm, &ss, &us, &tz);
- Dprintf("typecast_PYTIME_cast: n = %d, len = %d, "
- "hh = %d, mm = %d, ss = %d, us = %d, tz = %d",
- n, len, hh, mm, ss, us, tz);
-
- if (n < 3 || n > 5) {
- PyErr_SetString(DataError, "unable to parse time");
- }
- else {
- if (ss > 59) {
- mm += 1;
- ss -= 60;
- }
- obj = PyObject_CallFunction(pyTimeTypeP, "iiii", hh, mm, ss, us);
- }
- return obj;
-}
-
-/** INTERVAL - parse an interval into a timedelta object **/
-
-static PyObject *
-typecast_PYINTERVAL_cast(char *str, int len, PyObject *curs)
-{
- long years = 0, months = 0, days = 0;
- double hours = 0.0, minutes = 0.0, seconds = 0.0, hundredths = 0.0;
- double v = 0.0, sign = 1.0, denominator = 1.0;
- int part = 0, sec;
- double micro;
-
- if (str == NULL) {Py_INCREF(Py_None); return Py_None;}
-
- Dprintf("typecast_PYINTERVAL_cast: s = %s", str);
-
- while (len-- > 0 && *str) {
- switch (*str) {
-
- case '-':
- sign = -1.0;
- break;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- v = v*10 + (double)*str - (double)'0';
- if (part == 6){
- denominator *= 10;
- }
- break;
-
- case 'y':
- if (part == 0) {
- years = (long)(v*sign);
- str = skip_until_space2(str, &len);
- v = 0.0; sign = 1.0; part = 1;
- }
- break;
-
- case 'm':
- if (part <= 1) {
- months = (long)(v*sign);
- str = skip_until_space2(str, &len);
- v = 0.0; sign = 1.0; part = 2;
- }
- break;
-
- case 'd':
- if (part <= 2) {
- days = (long)(v*sign);
- str = skip_until_space2(str, &len);
- v = 0.0; sign = 1.0; part = 3;
- }
- break;
-
- case ':':
- if (part <= 3) {
- hours = v;
- v = 0.0; part = 4;
- }
- else if (part == 4) {
- minutes = v;
- v = 0.0; part = 5;
- }
- break;
-
- case '.':
- if (part == 5) {
- seconds = v;
- v = 0.0; part = 6;
- }
- break;
-
- default:
- break;
- }
-
- str++;
- }
-
- /* manage last value, be it minutes or seconds or hundredths of a second */
- if (part == 4) {
- minutes = v;
- }
- else if (part == 5) {
- seconds = v;
- }
- else if (part == 6) {
- hundredths = v;
- hundredths = hundredths/denominator;
- }
-
- /* calculates seconds */
- if (sign < 0.0) {
- seconds = - (hundredths + seconds + minutes*60 + hours*3600);
- }
- else {
- seconds += hundredths + minutes*60 + hours*3600;
- }
-
- /* calculates days */
- days += years*365 + months*30;
-
- micro = (seconds - floor(seconds)) * 1000000.0;
- sec = (int)floor(seconds);
- return PyObject_CallFunction(pyDeltaTypeP, "iii",
- days, sec, (int)round(micro));
-}
-
-/* psycopg defaults to using python datetime types */
-
-#ifdef PSYCOPG_DEFAULT_PYDATETIME
-#define typecast_DATE_cast typecast_PYDATE_cast
-#define typecast_TIME_cast typecast_PYTIME_cast
-#define typecast_INTERVAL_cast typecast_PYINTERVAL_cast
-#define typecast_DATETIME_cast typecast_PYDATETIME_cast
-#endif
+++ /dev/null
-/* typecast_mxdatetime.c - date and time typecasting functions to mx types
- *
- * Copyright (C) 2001-2003 Federico Di Gregorio <fog@debian.org>
- *
- * This file is part of the psycopg module.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "mxDateTime.h"
-
-/* the pointer to the mxDateTime API is initialized by the module init code,
- we just need to grab it */
-extern mxDateTimeModule_APIObject *mxDateTimeP;
-
-/** DATE - cast a date into mx.DateTime python object **/
-
-static PyObject *
-typecast_MXDATE_cast(char *str, int len, PyObject *curs)
-{
- int n, y=0, m=0, d=0;
- int hh=0, mm=0, ss=0, us=0, tz=0;
- char *tp = NULL;
-
- if (str == NULL) {Py_INCREF(Py_None); return Py_None;}
-
- Dprintf("typecast_MXDATE_cast: s = %s", str);
-
- /* check for infinity */
- if (!strcmp(str, "infinity") || !strcmp(str, "-infinity")) {
- if (str[0] == '-') {
- return mxDateTimeP->DateTime_FromDateAndTime(-999998,1,1, 0,0,0);
- }
- else {
- return mxDateTimeP->DateTime_FromDateAndTime(999999,12,31, 0,0,0);
- }
- }
-
- n = typecast_parse_date(str, &tp, &len, &y, &m, &d);
- Dprintf("typecast_MXDATE_cast: tp = %p n = %d, len = %d, "
- "y = %d, m = %d, d = %d", tp, n, len, y, m, d);
- if (n != 3) {
- PyErr_SetString(DataError, "unable to parse date");
- }
-
- if (len > 0) {
- n = typecast_parse_time(tp, NULL, &len, &hh, &mm, &ss, &us, &tz);
- Dprintf("typecast_MXDATE_cast: n = %d, len = %d, "
- "hh = %d, mm = %d, ss = %d, us = %d, tz = %d",
- n, len, hh, mm, ss, us, tz);
- if (n < 3 || n > 5) {
- PyErr_SetString(DataError, "unable to parse time");
- }
- }
-
- Dprintf("typecast_MXDATE_cast: fractionary seconds: %lf",
- (double)ss + (double)us/(double)1000000.0);
- return mxDateTimeP->DateTime_FromDateAndTime(y, m, d, hh, mm,
- (double)ss + (double)us/(double)1000000.0);
-}
-
-/** TIME - parse time into an mx.DateTime object **/
-
-static PyObject *
-typecast_MXTIME_cast(char *str, int len, PyObject *curs)
-{
- int n, hh=0, mm=0, ss=0, us=0, tz=0;
-
- if (str == NULL) {Py_INCREF(Py_None); return Py_None;}
-
- Dprintf("typecast_MXTIME_cast: s = %s", str);
-
- n = typecast_parse_time(str, NULL, &len, &hh, &mm, &ss, &us, &tz);
- Dprintf("typecast_MXTIME_cast: time parsed, %d components", n);
- Dprintf("typecast_MXTIME_cast: hh = %d, mm = %d, ss = %d, us = %d",
- hh, mm, ss, us);
-
- if (n < 3 || n > 5) {
- PyErr_SetString(DataError, "unable to parse time");
- return NULL;
- }
-
- Dprintf("typecast_MXTIME_cast: fractionary seconds: %lf",
- (double)ss + (double)us/(double)1000000.0);
- return mxDateTimeP->DateTimeDelta_FromTime(hh, mm,
- (double)ss + (double)us/(double)1000000.0);
-}
-
-/** INTERVAL - parse an interval into an mx.DateTimeDelta **/
-
-static PyObject *
-typecast_MXINTERVAL_cast(char *str, int len, PyObject *curs)
-{
- long years = 0, months = 0, days = 0, denominator = 1;
- double hours = 0.0, minutes = 0.0, seconds = 0.0, hundredths = 0.0;
- double v = 0.0, sign = 1.0;
- int part = 0;
-
- if (str == NULL) {Py_INCREF(Py_None); return Py_None;}
-
- Dprintf("typecast_MXINTERVAL_cast: s = %s", str);
-
- while (*str) {
- switch (*str) {
-
- case '-':
- sign = -1.0;
- break;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- v = v*10 + (double)*str - (double)'0';
- Dprintf("typecast_MXINTERVAL_cast: v = %f", v);
- if (part == 6){
- denominator *= 10;
- Dprintf("typecast_MXINTERVAL_cast: denominator = %ld",
- denominator);
- }
- break;
-
- case 'y':
- if (part == 0) {
- years = (long)(v*sign);
- str = skip_until_space(str);
- Dprintf("typecast_MXINTERVAL_cast: years = %ld, rest = %s",
- years, str);
- v = 0.0; sign = 1.0; part = 1;
- }
- break;
-
- case 'm':
- if (part <= 1) {
- months = (long)(v*sign);
- str = skip_until_space(str);
- Dprintf("typecast_MXINTERVAL_cast: months = %ld, rest = %s",
- months, str);
- v = 0.0; sign = 1.0; part = 2;
- }
- break;
-
- case 'd':
- if (part <= 2) {
- days = (long)(v*sign);
- str = skip_until_space(str);
- Dprintf("typecast_MXINTERVAL_cast: days = %ld, rest = %s",
- days, str);
- v = 0.0; sign = 1.0; part = 3;
- }
- break;
-
- case ':':
- if (part <= 3) {
- hours = v;
- Dprintf("typecast_MXINTERVAL_cast: hours = %f", hours);
- v = 0.0; part = 4;
- }
- else if (part == 4) {
- minutes = v;
- Dprintf("typecast_MXINTERVAL_cast: minutes = %f", minutes);
- v = 0.0; part = 5;
- }
- break;
-
- case '.':
- if (part == 5) {
- seconds = v;
- Dprintf("typecast_MXINTERVAL_cast: seconds = %f", seconds);
- v = 0.0; part = 6;
- }
- break;
-
- default:
- break;
- }
-
- str++;
- }
-
- /* manage last value, be it minutes or seconds or hundredths of a second */
- if (part == 4) {
- minutes = v;
- Dprintf("typecast_MXINTERVAL_cast: minutes = %f", minutes);
- }
- else if (part == 5) {
- seconds = v;
- Dprintf("typecast_MXINTERVAL_cast: seconds = %f", seconds);
- }
- else if (part == 6) {
- hundredths = v;
- Dprintf("typecast_MXINTERVAL_cast: hundredths = %f", hundredths);
- hundredths = hundredths/denominator;
- Dprintf("typecast_MXINTERVAL_cast: fractions = %.20f", hundredths);
- }
-
- /* calculates seconds */
- if (sign < 0.0) {
- seconds = - (hundredths + seconds + minutes*60 + hours*3600);
- }
- else {
- seconds += hundredths + minutes*60 + hours*3600;
- }
-
- /* calculates days */
- days += years*365 + months*30;
-
- Dprintf("typecast_MXINTERVAL_cast: days = %ld, seconds = %f",
- days, seconds);
- return mxDateTimeP->DateTimeDelta_FromDaysAndSeconds(days, seconds);
-}
-
-/* psycopg defaults to using mx types */
-
-#ifdef PSYCOPG_DEFAULT_MXDATETIME
-#define typecast_DATE_cast typecast_MXDATE_cast
-#define typecast_TIME_cast typecast_MXTIME_cast
-#define typecast_INTERVAL_cast typecast_MXINTERVAL_cast
-#define typecast_DATETIME_cast typecast_MXDATE_cast
-#endif
-
+++ /dev/null
-# -*- python -*-
-#
-# Copyright (C) 2001-2003 Federico Di Gregorio <fog@debian.org>
-#
-# This file is part of the psycopg module.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2,
-# or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# this a little script that analyze a file with (TYPE, NUMBER) tuples
-# and write out C code ready for inclusion in psycopg. the generated
-# code defines the DBAPITypeObject fundamental types and warns for
-# undefined types.
-
-import sys, os, string, copy
-from string import split, join, strip
-
-
-# here is the list of the foundamental types we want to import from
-# postgresql header files
-
-basic_types = (['NUMBER', ['INT8', 'INT4', 'INT2', 'FLOAT8', 'FLOAT4',
- 'NUMERIC']],
- ['LONGINTEGER', ['INT8']],
- ['INTEGER', ['INT4', 'INT2']],
- ['FLOAT', ['FLOAT8', 'FLOAT4']],
- ['DECIMAL', ['NUMERIC']],
- ['UNICODE', ['NAME', 'CHAR', 'TEXT', 'BPCHAR',
- 'VARCHAR']],
- ['STRING', ['NAME', 'CHAR', 'TEXT', 'BPCHAR',
- 'VARCHAR']],
- ['BOOLEAN', ['BOOL']],
- ['DATETIME', ['TIMESTAMP', 'TIMESTAMPTZ',
- 'TINTERVAL', 'INTERVAL']],
- ['TIME', ['TIME', 'TIMETZ']],
- ['DATE', ['DATE']],
- ['INTERVAL', ['TINTERVAL', 'INTERVAL']],
- ['BINARY', ['BYTEA']],
- ['ROWID', ['OID']])
-
-# unfortunately we don't have a nice way to extract array information
-# from postgresql headers; we'll have to do it hard-coding :/
-array_types = (['LONGINTEGER', [1016]],
- ['INTEGER', [1005, 1006, 1007]],
- ['FLOAT', [1017, 1021, 1022]],
- ['DECIMAL', [1231]],
- ['UNICODE', [1002, 1003, 1009, 1014, 1015]],
- ['STRING', [1002, 1003, 1009, 1014, 1015]],
- ['BOOLEAN', [1000]],
- ['DATETIME', [1115, 1185]],
- ['TIME', [1183, 1270]],
- ['DATE', [1182]],
- ['INTERVAL', [1187]],
- ['BINARY', [1001]],
- ['ROWID', [1028, 1013]])
-
-# this is the header used to compile the data in the C module
-HEADER = """
-typecastObject_initlist typecast_builtins[] = {
-"""
-
-# then comes the footer
-FOOTER = """ {NULL, NULL, NULL, NULL}\n};\n"""
-
-
-# usefull error reporting function
-def error(msg):
- """Report an error on stderr."""
- sys.stderr.write(msg+'\n')
-
-
-# read couples from stdin and build list
-read_types = []
-for l in sys.stdin.readlines():
- oid, val = split(l)
- read_types.append((strip(oid)[:-3], strip(val)))
-
-# look for the wanted types in the read touples
-found_types = {}
-
-for t in basic_types:
- k = t[0]
- found_types[k] = []
- for v in t[1]:
- found = filter(lambda x, y=v: x[0] == y, read_types)
- if len(found) == 0:
- error(v+': value not found')
- elif len(found) > 1:
- error(v+': too many values')
- else:
- found_types[k].append(int(found[0][1]))
-
-# now outputs to stdout the right C-style definitions
-stypes = "" ; sstruct = ""
-for t in basic_types:
- k = t[0]
- s = str(found_types[k])
- s = '{' + s[1:-1] + ', 0}'
- stypes = stypes + ('static long int typecast_%s_types[] = %s;\n' % (k, s))
- sstruct += (' {"%s", typecast_%s_types, typecast_%s_cast, NULL},\n'
- % (k, k, k))
-for t in array_types:
- kt = t[0]
- ka = t[0]+'ARRAY'
- s = str(t[1])
- s = '{' + s[1:-1] + ', 0}'
- stypes = stypes + ('static long int typecast_%s_types[] = %s;\n' % (ka, s))
- sstruct += (' {"%s", typecast_%s_types, typecast_%s_cast, "%s"},\n'
- % (ka, ka, ka, kt))
-sstruct = HEADER + sstruct + FOOTER
-
-print stypes
-print sstruct
+++ /dev/null
-#!/usr/bin/env python\r
-\r
-# Author: Daniele Varrazzo\r
-# Contact: daniele dot varrazzo at gmail dot com\r
-# Revision: $Revision$\r
-# Date: $Date$\r
-# Copyright: This module has been placed in the public domain.\r
-\r
-"""\r
-A minimal front end to the Docutils Publisher, producing HTML.\r
-\r
-Output can refer to Epydoc-generated APIs through the iterpreted text role\r
-"api".\r
-"""\r
-\r
-import types\r
-import sys\r
-\r
-# The url fragment where the api "index.html" resides w.r.t. the generated docs\r
-api_root = "api/"\r
-\r
-try:\r
- import locale\r
- locale.setlocale(locale.LC_ALL, '')\r
-except:\r
- pass\r
-\r
-from docutils.core import publish_cmdline, default_description\r
-from docutils.parsers.rst.roles import register_canonical_role\r
-from docutils import nodes, utils\r
-\r
-# api references are searched for in these modules\r
-api_modules = [\r
- 'psycopg2',\r
- 'psycopg2._psycopg',\r
- 'psycopg2.extensions',\r
-]\r
-\r
-# name starting with a dot are looking as those objects attributes.
-searched_objects = [
- # module_name, object_name
- ('psycopg2.extensions', 'connection'),
- ('psycopg2.extensions', 'cursor'),
-]
-
-# import all the referenced modules\r
-for modname in api_modules:\r
- __import__(modname)\r
- \r
-class EpydocTarget:
- """Representation of an element language."""\r
- def __init__(self, name, element):\r
- self.name = name\r
- \r
- # The python object described\r
- self.element = element\r
- \r
- # The base name of the page\r
- self.page = None\r
- \r
- # The url fragment\r
- self.fragment = None\r
- \r
- def get_url(self):\r
- # is it a private element?\r
- components = self.page.split('.')\r
- if self.fragment: components.append(self.fragment)\r
- \r
- for component in components:\r
- if component.startswith('_'):\r
- private = True\r
- break\r
- else:\r
- private = False\r
- \r
- ref = api_root + (private and "private/" or "public/") \\r
- + self.page + "-" + self.get_type() + ".html"\r
- if self.fragment:\r
- ref = ref + "#" + self.fragment\r
- \r
- return ref\r
-\r
- def get_type(self):\r
- # detect the element type\r
- if isinstance(self.element, types.TypeType):\r
- return 'class'\r
- elif isinstance(self.element, types.ModuleType):\r
- return 'module'\r
- else:\r
- raise ValueError("Can't choose a type for '%s'." % self.name)\r
- \r
-def filter_par(name):\r
- """Filter parenthesis away from a name."""\r
- if name.endswith(")"):\r
- return name.split("(")[0]\r
- else:\r
- return name\r
- \r
-def get_element_target(name):\r
- """Return the life, the death, the miracles about a package element."""\r
- \r
- name = filter_par(name)\r
-
- if name.startswith('.'):
- for modname, objname in searched_objects:
- if hasattr(getattr(sys.modules[modname], objname), name[1:]):
- name = objname + name
- break
- \r
- # is the element a module?\r
- if name in api_modules:\r
- out = EpydocTarget(name, sys.modules[name])\r
- out.page = name\r
- return out\r
- \r
- # look for the element in some module\r
- for modname in api_modules:\r
- element = getattr(sys.modules[modname], name, None)\r
- if element is not None:\r
- \r
- # Check if it is a function defined in a module\r
- if isinstance(element, \r
- (int, types.FunctionType, types.BuiltinFunctionType)):\r
- out = EpydocTarget(name, sys.modules[modname])\r
- out.page = modname\r
- out.fragment = name\r
- else:\r
- out = EpydocTarget(name, element)\r
- out.page = modname + '.' + name\r
- \r
- return out\r
- \r
- # maybe a qualified name?\r
- if '.' in name:\r
- out = get_element_target('.'.join(name.split('.')[:-1]))\r
- if out is not None:\r
- out.fragment = filter_par(name.split('.')[-1])\r
- return out\r
- \r
- raise ValueError("Can't find '%s' in any provided module." % name)\r
- \r
-def api_role(role, rawtext, text, lineno, inliner,
- options={}, content=[]):\r
- try:\r
- target = get_element_target(text)\r
- except Exception, exc:\r
- msg = inliner.reporter.error(str(exc), line=lineno)
- prb = inliner.problematic(rawtext, rawtext, msg)
- return [prb], [msg]
- \r
- ref = target.get_url()\r
- node2 = nodes.literal(rawtext, utils.unescape(text))
- node = nodes.reference(rawtext, '', node2, refuri=ref,\r
- **options)\r
- return [node], []
-\r
-
-register_canonical_role('api', api_role)
-\r
-# Register the 'api' role as canonical role
-from docutils.parsers.rst import roles
-roles.DEFAULT_INTERPRETED_ROLE = 'api'
-\r
-
-description = ('Generates (X)HTML documents from standalone reStructuredText '\r
- 'sources with links to Epydoc API. ' + default_description)\r
-\r
-
-publish_cmdline(writer_name='html', description=description)\r
+++ /dev/null
-#!/usr/bin/env python\r
-"""Build documentation and api."""\r
-\r
-import os\r
-\r
-EPYDOC = "python c:/programmi/python23/scripts/epydoc.py"\r
-PSYCOPG = "c:/programmi/python23/lib/site-packages/psycopg2"\r
-\r
-os.system("python ext2html.py ../doc/extensions.rst > ../doc/extensions.html")\r
-os.system("%s "\r
- "-o ../doc/api "\r
- "--css ../doc/api-screen.css "\r
- "--docformat restructuredtext " \r
- "%s"\r
- % (EPYDOC,PSYCOPG,))\r
+++ /dev/null
-#!/bin/sh
-
-SCRIPTSDIR="`dirname $0`"
-SRCDIR="`dirname $SCRIPTSDIR`/psycopg"
-
-if [ -z "$1" ] ; then
- echo Usage: $0 '<postgresql include directory>'
- exit 1
-fi
-
-echo -n checking for pg_type.h ...
-if [ -f "$1/catalog/pg_type.h" ] ; then
- PGTYPE="$1/catalog/pg_type.h"
-else
- if [ -f "$1/server/catalog/pg_type.h" ] ; then
- PGTYPE="$1/server/catalog/pg_type.h"
- else
- echo
- echo "error: can't find pg_type.h under $1"
- exit 2
- fi
-fi
-echo " found"
-
-PGVERSION="`sed -n -e 's/.*PG_VERSION \"\([0-9]\.[0-9]\).*\"/\1/p' $1/pg_config.h`"
-PGMAJOR="`echo $PGVERSION | cut -d. -f1`"
-PGMINOR="`echo $PGVERSION | cut -d. -f2`"
-
-echo checking for postgresql major: $PGMAJOR
-echo checking for postgresql minor: $PGMINOR
-
-echo -n generating pgtypes.h ...
-awk '/#define .+OID/ {print "#define " $2 " " $3}' "$PGTYPE" \
- > $SRCDIR/pgtypes.h
-echo " done"
-echo -n generating typecast_builtins.c ...
-awk '/#define .+OID/ {print $2 " " $3}' "$PGTYPE" | \
- python $SCRIPTSDIR/buildtypes.py >$SRCDIR/typecast_builtins.c
-echo " done"
-
-
+++ /dev/null
-[build_ext]
-define=PSYCOPG_EXTENSIONS,PSYCOPG_DISPLAY_SIZE,PSYCOPG_NEW_BOOLEAN,HAVE_PQFREEMEM,HAVE_PQPROTOCOL3
-# PSYCOPG_EXTENSIONS enables extensions to PEP-249 (you really want this)
-# PSYCOPG_DISPLAY_SIZE enable display size calculation (a little slower)
-# HAVE_PQFREEMEM should be defined on PostgreSQL >= 7.3
-# HAVE_PQPROTOCOL3 should be defined on PostgreSQL >= 7.4
-# PSYCOPG_DEBUG can be added to enable verbose debug information
-# PSYCOPG_OWN_QUOTING can be added, but it is deprecated (will go away in 2.1)
-# PSYCOPG_NEW_BOOLEAN to format booleans as true/false vs 't'/'f'
-
-# Set to 1 to use Python datatime objects for default date/time representation
-use_pydatetime=1
-
-# Set to 1 if you want to enable "Decimal" type on python 2.3.
-# If the "decimal" module is found in the PYTHONPATH it will be used, else
-# fall back on the float type (this is disabled by default to be compatible
-# with old versions of psycopg 1 and pre-beta versions of psycopg 2.)
-use_decimal=0
-
-# If the build system does not find the mx.DateTime headers, try
-# uncommenting the following line and setting its value to the right path.
-#mx_include_dir=
-
-# "pg_config" is the preferred method to locate PostgreSQL headers and
-# libraries needed to build psycopg2. If pg_config is not in the path or
-# is installed under a different name uncomment the following option and
-# set it to the pg_config full path.
-#pg_config=
-
-# If "pg_config" is not available, "include_dirs" can be used to locate
-# postgresql headers and libraries. Some extra checks on sys.platform will
-# still be done in setup.py.
-# The next line is the default as used on psycopg author Debian laptop:
-#include_dirs=/usr/include/postgresql:/usr/include/postgresql/server
-
-# Uncomment next line on Mandrake 10.x (and comment previous ones):
-#include_dirs=/usr/include/pgsql/8.0:/usr/include/pgsql/8.0/server
-
-# Uncomment next line on SUSE 9.3 (and comment previous ones):
-#include_dirs=/usr/include/pgsql:/usr/include/pgsql/server
-
-# If postgresql is installed somewhere weird (i.e., not in your runtime library
-# path like /usr/lib), just add the right path in "library_dirs" and any extra
-# libraries required to link in "libraries".
-#library_dirs=
-#libraries=
+++ /dev/null
-# setup.py - distutils packaging
-#
-# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-"""Python-PostgreSQL Database Adapter
-
-psycopg is a PostgreSQL database adapter for the Python programming
-language. This is version 2, a complete rewrite of the original code to
-provide new-style classes for connection and cursor objects and other sweet
-candies. Like the original, psycopg 2 was written with the aim of being
-very small and fast, and stable as a rock.
-
-psycopg is different from the other database adapter because it was
-designed for heavily multi-threaded applications that create and destroy
-lots of cursors and make a conspicuous number of concurrent INSERTs or
-UPDATEs. psycopg 2 also provide full asycronous operations for the really
-brave programmer.
-"""
-
-classifiers = """\
-Development Status :: 4 - Beta
-Intended Audience :: Developers
-License :: OSI Approved :: GNU General Public License (GPL)
-License :: OSI Approved :: Zope Public License
-Programming Language :: Python
-Programming Language :: C
-Programming Language :: SQL
-Topic :: Database
-Topic :: Database :: Front-Ends
-Topic :: Software Development
-Topic :: Software Development :: Libraries :: Python Modules
-Operating System :: Microsoft :: Windows
-Operating System :: Unix
-"""
-
-import os
-import sys
-import popen2
-from distutils.core import setup, Extension
-from distutils.errors import DistutilsFileError
-from distutils.command.build_ext import build_ext
-from distutils.sysconfig import get_python_inc
-from distutils.ccompiler import get_default_compiler
-
-PSYCOPG_VERSION = '2.0.5.1'
-version_flags = []
-
-# to work around older distutil limitations
-if sys.version < '2.2.3':
- from distutils.dist import DistributionMetadata
- DistributionMetadata.classifiers = None
- DistributionMetadata.download_url = None
-
-def get_pg_config(kind, pg_config="pg_config"):
- p = popen2.popen3(pg_config + " --" + kind)
- r = p[0].readline().strip()
- if not r:
- raise Warning(p[2].readline())
- return r
-
-class psycopg_build_ext(build_ext):
- """Conditionally complement the setup.cfg options file.
-
- This class configures the include_dirs, libray_dirs, libraries
- options as required by the system. Most of the configuration happens
- in finalize_options() method.
-
- If you want to set up the build step for a peculiar platform, add a
- method finalize_PLAT(), where PLAT matches your sys.platform.
- """
- user_options = build_ext.user_options[:]
- user_options.extend([
- ('use-pydatetime', None,
- "Use Python datatime objects for date and time representation."),
- ('pg-config=', None,
- "The name of the pg_config binary and/or full path to find it"),
- ('use-decimal', None,
- "Use Decimal type even on Python 2.3 if the module is provided."),
- ])
-
- boolean_options = build_ext.boolean_options[:]
- boolean_options.extend(('use-pydatetime', 'use-decimal'))
-
- DEFAULT_PG_CONFIG = "pg_config"
-
- def initialize_options(self):
- build_ext.initialize_options(self)
- self.use_pg_dll = 1
- self.pgdir = None
- self.pg_config = self.DEFAULT_PG_CONFIG
- self.mx_include_dir = None
-
- def get_compiler(self):
- """Return the c compiler to compile extensions.
-
- If a compiler was not explicitely set (on the command line, for
- example), fall back on the default compiler.
- """
- return self.compiler or get_default_compiler()
-
- def get_pg_config(self, kind):
- return get_pg_config(kind, self.pg_config)
-
- def build_extensions(self):
- # Linking against this library causes psycopg2 to crash
- # on Python >= 2.4. Maybe related to strdup calls, cfr.
- # http://mail.python.org/pipermail/distutils-sig/2005-April/004433.html
- if self.get_compiler().compiler_type == "mingw32" \
- and 'msvcr71' in self.compiler.dll_libraries:
- self.compiler.dll_libraries.remove('msvcr71')
-
- build_ext.build_extensions(self)
-
- def finalize_win32(self):
- """Finalize build system configuration on win32 platform."""
- self.libraries.append("ws2_32")
- self.libraries.append("advapi32")
- if self.get_compiler() == "msvc":
- # MSVC requires an explicit "libpq"
- self.libraries.remove("pq")
- self.libraries.append("libpq")
- self.libraries.append("shfolder")
- for path in self.library_dirs:
- if os.path.isfile(os.path.join(path, "ms", "libpq.lib")):
- self.library_dirs.append(os.path.join(path, "ms"))
- break
-
- def finalize_darwin(self):
- """Finalize build system configuration on darwin platform."""
- self.libraries.append('ssl')
- self.libraries.append('crypto')
-
- def finalize_options(self):
- """Complete the build system configuation."""
- build_ext.finalize_options(self)
-
- self.include_dirs.append(".")
- self.libraries.append("pq")
-
- try:
- self.library_dirs.append(self.get_pg_config("libdir"))
- self.include_dirs.append(self.get_pg_config("includedir"))
- self.include_dirs.append(self.get_pg_config("includedir-server"))
- try:
- # Here we take a conservative approach: we suppose that
- # *at least* PostgreSQL 7.4 is available (this is the only
- # 7.x series supported by psycopg 2)
- pgversion = self.get_pg_config("version").split()[1]
- pgmajor, pgminor, pgpatch = pgversion.split('.')
- except:
- pgmajor, pgminor, pgpatch = 7, 4, 0
- define_macros.append(("PG_MAJOR_VERSION", pgmajor))
- define_macros.append(("PG_MINOR_VERSION", pgminor))
- define_macros.append(("PG_PATCH_VERSION", pgpatch))
- except Warning, w:
- if self.pg_config == self.DEFAULT_PG_CONFIG:
- sys.stderr.write("Warning: %s" % str(w))
- else:
- sys.stderr.write("Error: %s" % str(w))
- sys.exit(1)
-
- if hasattr(self, "finalize_" + sys.platform):
- getattr(self, "finalize_" + sys.platform)()
-
-# let's start with macro definitions (the ones not already in setup.cfg)
-define_macros = []
-include_dirs = []
-
-# python version
-define_macros.append(('PY_MAJOR_VERSION', str(sys.version_info[0])))
-define_macros.append(('PY_MINOR_VERSION', str(sys.version_info[1])))
-
-# some macros related to python versions and features
-if sys.version_info[0] >= 2 and sys.version_info[1] >= 3:
- define_macros.append(('HAVE_PYBOOL','1'))
-
-# gather information to build the extension module
-ext = [] ; data_files = []
-
-# sources
-
-sources = [
- 'psycopgmodule.c', 'pqpath.c', 'typecast.c',
- 'microprotocols.c', 'microprotocols_proto.c',
- 'connection_type.c', 'connection_int.c', 'cursor_type.c', 'cursor_int.c',
- 'adapter_qstring.c', 'adapter_pboolean.c', 'adapter_binary.c',
- 'adapter_asis.c', 'adapter_list.c']
-
-from ConfigParser import ConfigParser
-parser = ConfigParser()
-parser.read('setup.cfg')
-
-# Choose if to use Decimal type
-use_decimal = int(parser.get('build_ext', 'use_decimal'))
-if sys.version_info[0] >= 2 and (
- sys.version_info[1] >= 4 or (sys.version_info[1] == 3 and use_decimal)):
- define_macros.append(('HAVE_DECIMAL','1'))
- version_flags.append('dec')
-
-# Choose a datetime module
-have_pydatetime = False
-have_mxdatetime = False
-use_pydatetime = int(parser.get('build_ext', 'use_pydatetime'))
-
-# check for mx package
-if parser.has_option('build_ext', 'mx_include_dir'):
- mxincludedir = parser.get('build_ext', 'mx_include_dir')
-else:
- mxincludedir = os.path.join(get_python_inc(plat_specific=1), "mx")
-if os.path.exists(mxincludedir):
- include_dirs.append(mxincludedir)
- define_macros.append(('HAVE_MXDATETIME','1'))
- sources.append('adapter_mxdatetime.c')
- have_mxdatetime = True
- version_flags.append('mx')
-
-# check for python datetime package
-if os.path.exists(os.path.join(get_python_inc(plat_specific=1),"datetime.h")):
- define_macros.append(('HAVE_PYDATETIME','1'))
- sources.append('adapter_datetime.c')
- have_pydatetime = True
- version_flags.append('dt')
-
-# now decide which package will be the default for date/time typecasts
-if have_pydatetime and use_pydatetime \
- or have_pydatetime and not have_mxdatetime:
- define_macros.append(('PSYCOPG_DEFAULT_PYDATETIME','1'))
-elif have_mxdatetime:
- define_macros.append(('PSYCOPG_DEFAULT_MXDATETIME','1'))
-else:
- def e(msg):
- sys.stderr.write("error: " + msg + "\n")
- e("psycopg requires a datetime module:")
- e(" mx.DateTime module not found")
- e(" python datetime module not found")
- e("Note that psycopg needs the module headers and not just the module")
- e("itself. If you installed Python or mx.DateTime from a binary package")
- e("you probably need to install its companion -dev or -devel package.")
- sys.exit(1)
-
-# generate a nice version string to avoid confusion when users report bugs
-for have in parser.get('build_ext', 'define').split(','):
- if have == 'PSYCOPG_EXTENSIONS':
- version_flags.append('ext')
- elif have == 'HAVE_PQPROTOCOL3':
- version_flags.append('pq3')
-if version_flags:
- PSYCOPG_VERSION_EX = PSYCOPG_VERSION + " (%s)" % ' '.join(version_flags)
-else:
- PSYCOPG_VERSION_EX = PSYCOPG_VERSION
-
-if sys.platform != 'win32':
- define_macros.append(('PSYCOPG_VERSION', '"'+PSYCOPG_VERSION_EX+'"'))
-else:
- define_macros.append(('PSYCOPG_VERSION', '\\"'+PSYCOPG_VERSION_EX+'\\"'))
-
-# build the extension
-
-sources = map(lambda x: os.path.join('psycopg', x), sources)
-
-ext.append(Extension("psycopg2._psycopg", sources,
- define_macros=define_macros,
- include_dirs=include_dirs,
- undef_macros=[]))
-
-setup(name="psycopg2",
- version=PSYCOPG_VERSION,
- maintainer="Federico Di Gregorio",
- maintainer_email="fog@initd.org",
- author="Federico Di Gregorio",
- author_email="fog@initd.org",
- url="http://initd.org/tracker/psycopg",
- download_url = "http://initd.org/pub/software/psycopg2",
- license="GPL with exceptions or ZPL",
- platforms = ["any"],
- description=__doc__.split("\n")[0],
- long_description="\n".join(__doc__.split("\n")[2:]),
- classifiers=filter(None, classifiers.split("\n")),
- data_files=data_files,
- package_dir={'psycopg2':'lib'},
- packages=['psycopg2'],
- cmdclass={ 'build_ext': psycopg_build_ext },
- ext_modules=ext)
+++ /dev/null
-#!/usr/bin/env python
-''' Python DB API 2.0 driver compliance unit test suite.
-
- This software is Public Domain and may be used without restrictions.
-
- "Now we have booze and barflies entering the discussion, plus rumours of
- DBAs on drugs... and I won't tell you what flashes through my mind each
- time I read the subject line with 'Anal Compliance' in it. All around
- this is turning out to be a thoroughly unwholesome unit test."
-
- -- Ian Bicking
-'''
-
-__rcs_id__ = '$Id$'
-__version__ = '$Revision$'[11:-2]
-__author__ = 'Stuart Bishop <zen@shangri-la.dropbear.id.au>'
-
-import unittest
-import time
-
-# $Log: dbapi20.py,v $
-# Revision 1.10 2003/10/09 03:14:14 zenzen
-# Add test for DB API 2.0 optional extension, where database exceptions
-# are exposed as attributes on the Connection object.
-#
-# Revision 1.9 2003/08/13 01:16:36 zenzen
-# Minor tweak from Stefan Fleiter
-#
-# Revision 1.8 2003/04/10 00:13:25 zenzen
-# Changes, as per suggestions by M.-A. Lemburg
-# - Add a table prefix, to ensure namespace collisions can always be avoided
-#
-# Revision 1.7 2003/02/26 23:33:37 zenzen
-# Break out DDL into helper functions, as per request by David Rushby
-#
-# Revision 1.6 2003/02/21 03:04:33 zenzen
-# Stuff from Henrik Ekelund:
-# added test_None
-# added test_nextset & hooks
-#
-# Revision 1.5 2003/02/17 22:08:43 zenzen
-# Implement suggestions and code from Henrik Eklund - test that cursor.arraysize
-# defaults to 1 & generic cursor.callproc test added
-#
-# Revision 1.4 2003/02/15 00:16:33 zenzen
-# Changes, as per suggestions and bug reports by M.-A. Lemburg,
-# Matthew T. Kromer, Federico Di Gregorio and Daniel Dittmar
-# - Class renamed
-# - Now a subclass of TestCase, to avoid requiring the driver stub
-# to use multiple inheritance
-# - Reversed the polarity of buggy test in test_description
-# - Test exception heirarchy correctly
-# - self.populate is now self._populate(), so if a driver stub
-# overrides self.ddl1 this change propogates
-# - VARCHAR columns now have a width, which will hopefully make the
-# DDL even more portible (this will be reversed if it causes more problems)
-# - cursor.rowcount being checked after various execute and fetchXXX methods
-# - Check for fetchall and fetchmany returning empty lists after results
-# are exhausted (already checking for empty lists if select retrieved
-# nothing
-# - Fix bugs in test_setoutputsize_basic and test_setinputsizes
-#
-
-class DatabaseAPI20Test(unittest.TestCase):
- ''' Test a database self.driver for DB API 2.0 compatibility.
- This implementation tests Gadfly, but the TestCase
- is structured so that other self.drivers can subclass this
- test case to ensure compiliance with the DB-API. It is
- expected that this TestCase may be expanded in the future
- if ambiguities or edge conditions are discovered.
-
- The 'Optional Extensions' are not yet being tested.
-
- self.drivers should subclass this test, overriding setUp, tearDown,
- self.driver, connect_args and connect_kw_args. Class specification
- should be as follows:
-
- import dbapi20
- class mytest(dbapi20.DatabaseAPI20Test):
- [...]
-
- Don't 'import DatabaseAPI20Test from dbapi20', or you will
- confuse the unit tester - just 'import dbapi20'.
- '''
-
- # The self.driver module. This should be the module where the 'connect'
- # method is to be found
- driver = None
- connect_args = () # List of arguments to pass to connect
- connect_kw_args = {} # Keyword arguments for connect
- table_prefix = 'dbapi20test_' # If you need to specify a prefix for tables
-
- ddl1 = 'create table %sbooze (name varchar(20))' % table_prefix
- ddl2 = 'create table %sbarflys (name varchar(20))' % table_prefix
- xddl1 = 'drop table %sbooze' % table_prefix
- xddl2 = 'drop table %sbarflys' % table_prefix
-
- lowerfunc = 'lower' # Name of stored procedure to convert string->lowercase
-
- # Some drivers may need to override these helpers, for example adding
- # a 'commit' after the execute.
- def executeDDL1(self,cursor):
- cursor.execute(self.ddl1)
-
- def executeDDL2(self,cursor):
- cursor.execute(self.ddl2)
-
- def setUp(self):
- ''' self.drivers should override this method to perform required setup
- if any is necessary, such as creating the database.
- '''
- pass
-
- def tearDown(self):
- ''' self.drivers should override this method to perform required cleanup
- if any is necessary, such as deleting the test database.
- The default drops the tables that may be created.
- '''
- con = self._connect()
- try:
- cur = con.cursor()
- for ddl in (self.xddl1,self.xddl2):
- try:
- cur.execute(ddl)
- con.commit()
- except self.driver.Error:
- # Assume table didn't exist. Other tests will check if
- # execute is busted.
- pass
- finally:
- con.close()
-
- def _connect(self):
- try:
- return self.driver.connect(
- *self.connect_args,**self.connect_kw_args
- )
- except AttributeError:
- self.fail("No connect method found in self.driver module")
-
- def test_connect(self):
- con = self._connect()
- con.close()
-
- def test_apilevel(self):
- try:
- # Must exist
- apilevel = self.driver.apilevel
- # Must equal 2.0
- self.assertEqual(apilevel,'2.0')
- except AttributeError:
- self.fail("Driver doesn't define apilevel")
-
- def test_threadsafety(self):
- try:
- # Must exist
- threadsafety = self.driver.threadsafety
- # Must be a valid value
- self.failUnless(threadsafety in (0,1,2,3))
- except AttributeError:
- self.fail("Driver doesn't define threadsafety")
-
- def test_paramstyle(self):
- try:
- # Must exist
- paramstyle = self.driver.paramstyle
- # Must be a valid value
- self.failUnless(paramstyle in (
- 'qmark','numeric','named','format','pyformat'
- ))
- except AttributeError:
- self.fail("Driver doesn't define paramstyle")
-
- def test_Exceptions(self):
- # Make sure required exceptions exist, and are in the
- # defined heirarchy.
- self.failUnless(issubclass(self.driver.Warning,StandardError))
- self.failUnless(issubclass(self.driver.Error,StandardError))
- self.failUnless(
- issubclass(self.driver.InterfaceError,self.driver.Error)
- )
- self.failUnless(
- issubclass(self.driver.DatabaseError,self.driver.Error)
- )
- self.failUnless(
- issubclass(self.driver.OperationalError,self.driver.Error)
- )
- self.failUnless(
- issubclass(self.driver.IntegrityError,self.driver.Error)
- )
- self.failUnless(
- issubclass(self.driver.InternalError,self.driver.Error)
- )
- self.failUnless(
- issubclass(self.driver.ProgrammingError,self.driver.Error)
- )
- self.failUnless(
- issubclass(self.driver.NotSupportedError,self.driver.Error)
- )
-
- def test_ExceptionsAsConnectionAttributes(self):
- # OPTIONAL EXTENSION
- # Test for the optional DB API 2.0 extension, where the exceptions
- # are exposed as attributes on the Connection object
- # I figure this optional extension will be implemented by any
- # driver author who is using this test suite, so it is enabled
- # by default.
- con = self._connect()
- drv = self.driver
- self.failUnless(con.Warning is drv.Warning)
- self.failUnless(con.Error is drv.Error)
- self.failUnless(con.InterfaceError is drv.InterfaceError)
- self.failUnless(con.DatabaseError is drv.DatabaseError)
- self.failUnless(con.OperationalError is drv.OperationalError)
- self.failUnless(con.IntegrityError is drv.IntegrityError)
- self.failUnless(con.InternalError is drv.InternalError)
- self.failUnless(con.ProgrammingError is drv.ProgrammingError)
- self.failUnless(con.NotSupportedError is drv.NotSupportedError)
-
-
- def test_commit(self):
- con = self._connect()
- try:
- # Commit must work, even if it doesn't do anything
- con.commit()
- finally:
- con.close()
-
- def test_rollback(self):
- con = self._connect()
- # If rollback is defined, it should either work or throw
- # the documented exception
- if hasattr(con,'rollback'):
- try:
- con.rollback()
- except self.driver.NotSupportedError:
- pass
-
- def test_cursor(self):
- con = self._connect()
- try:
- cur = con.cursor()
- finally:
- con.close()
-
- def test_cursor_isolation(self):
- con = self._connect()
- try:
- # Make sure cursors created from the same connection have
- # the documented transaction isolation level
- cur1 = con.cursor()
- cur2 = con.cursor()
- self.executeDDL1(cur1)
- cur1.execute("insert into %sbooze values ('Victoria Bitter')" % (
- self.table_prefix
- ))
- cur2.execute("select name from %sbooze" % self.table_prefix)
- booze = cur2.fetchall()
- self.assertEqual(len(booze),1)
- self.assertEqual(len(booze[0]),1)
- self.assertEqual(booze[0][0],'Victoria Bitter')
- finally:
- con.close()
-
- def test_description(self):
- con = self._connect()
- try:
- cur = con.cursor()
- self.executeDDL1(cur)
- self.assertEqual(cur.description,None,
- 'cursor.description should be none after executing a '
- 'statement that can return no rows (such as DDL)'
- )
- cur.execute('select name from %sbooze' % self.table_prefix)
- self.assertEqual(len(cur.description),1,
- 'cursor.description describes too many columns'
- )
- self.assertEqual(len(cur.description[0]),7,
- 'cursor.description[x] tuples must have 7 elements'
- )
- self.assertEqual(cur.description[0][0].lower(),'name',
- 'cursor.description[x][0] must return column name'
- )
- self.assertEqual(cur.description[0][1],self.driver.STRING,
- 'cursor.description[x][1] must return column type. Got %r'
- % cur.description[0][1]
- )
-
- # Make sure self.description gets reset
- self.executeDDL2(cur)
- self.assertEqual(cur.description,None,
- 'cursor.description not being set to None when executing '
- 'no-result statements (eg. DDL)'
- )
- finally:
- con.close()
-
- def test_rowcount(self):
- con = self._connect()
- try:
- cur = con.cursor()
- self.executeDDL1(cur)
- self.assertEqual(cur.rowcount,-1,
- 'cursor.rowcount should be -1 after executing no-result '
- 'statements'
- )
- cur.execute("insert into %sbooze values ('Victoria Bitter')" % (
- self.table_prefix
- ))
- self.failUnless(cur.rowcount in (-1,1),
- 'cursor.rowcount should == number or rows inserted, or '
- 'set to -1 after executing an insert statement'
- )
- cur.execute("select name from %sbooze" % self.table_prefix)
- self.failUnless(cur.rowcount in (-1,1),
- 'cursor.rowcount should == number of rows returned, or '
- 'set to -1 after executing a select statement'
- )
- self.executeDDL2(cur)
- self.assertEqual(cur.rowcount,-1,
- 'cursor.rowcount not being reset to -1 after executing '
- 'no-result statements'
- )
- finally:
- con.close()
-
- lower_func = 'lower'
- def test_callproc(self):
- con = self._connect()
- try:
- cur = con.cursor()
- if self.lower_func and hasattr(cur,'callproc'):
- r = cur.callproc(self.lower_func,('FOO',))
- self.assertEqual(len(r),1)
- self.assertEqual(r[0],'FOO')
- r = cur.fetchall()
- self.assertEqual(len(r),1,'callproc produced no result set')
- self.assertEqual(len(r[0]),1,
- 'callproc produced invalid result set'
- )
- self.assertEqual(r[0][0],'foo',
- 'callproc produced invalid results'
- )
- finally:
- con.close()
-
- def test_close(self):
- con = self._connect()
- try:
- cur = con.cursor()
- finally:
- con.close()
-
- # cursor.execute should raise an Error if called after connection
- # closed
- self.assertRaises(self.driver.Error,self.executeDDL1,cur)
-
- # connection.commit should raise an Error if called after connection'
- # closed.'
- self.assertRaises(self.driver.Error,con.commit)
-
- # connection.close should raise an Error if called more than once
- self.assertRaises(self.driver.Error,con.close)
-
- def test_execute(self):
- con = self._connect()
- try:
- cur = con.cursor()
- self._paraminsert(cur)
- finally:
- con.close()
-
- def _paraminsert(self,cur):
- self.executeDDL1(cur)
- cur.execute("insert into %sbooze values ('Victoria Bitter')" % (
- self.table_prefix
- ))
- self.failUnless(cur.rowcount in (-1,1))
-
- if self.driver.paramstyle == 'qmark':
- cur.execute(
- 'insert into %sbooze values (?)' % self.table_prefix,
- ("Cooper's",)
- )
- elif self.driver.paramstyle == 'numeric':
- cur.execute(
- 'insert into %sbooze values (:1)' % self.table_prefix,
- ("Cooper's",)
- )
- elif self.driver.paramstyle == 'named':
- cur.execute(
- 'insert into %sbooze values (:beer)' % self.table_prefix,
- {'beer':"Cooper's"}
- )
- elif self.driver.paramstyle == 'format':
- cur.execute(
- 'insert into %sbooze values (%%s)' % self.table_prefix,
- ("Cooper's",)
- )
- elif self.driver.paramstyle == 'pyformat':
- cur.execute(
- 'insert into %sbooze values (%%(beer)s)' % self.table_prefix,
- {'beer':"Cooper's"}
- )
- else:
- self.fail('Invalid paramstyle')
- self.failUnless(cur.rowcount in (-1,1))
-
- cur.execute('select name from %sbooze' % self.table_prefix)
- res = cur.fetchall()
- self.assertEqual(len(res),2,'cursor.fetchall returned too few rows')
- beers = [res[0][0],res[1][0]]
- beers.sort()
- self.assertEqual(beers[0],"Cooper's",
- 'cursor.fetchall retrieved incorrect data, or data inserted '
- 'incorrectly'
- )
- self.assertEqual(beers[1],"Victoria Bitter",
- 'cursor.fetchall retrieved incorrect data, or data inserted '
- 'incorrectly'
- )
-
- def test_executemany(self):
- con = self._connect()
- try:
- cur = con.cursor()
- self.executeDDL1(cur)
- largs = [ ("Cooper's",) , ("Boag's",) ]
- margs = [ {'beer': "Cooper's"}, {'beer': "Boag's"} ]
- if self.driver.paramstyle == 'qmark':
- cur.executemany(
- 'insert into %sbooze values (?)' % self.table_prefix,
- largs
- )
- elif self.driver.paramstyle == 'numeric':
- cur.executemany(
- 'insert into %sbooze values (:1)' % self.table_prefix,
- largs
- )
- elif self.driver.paramstyle == 'named':
- cur.executemany(
- 'insert into %sbooze values (:beer)' % self.table_prefix,
- margs
- )
- elif self.driver.paramstyle == 'format':
- cur.executemany(
- 'insert into %sbooze values (%%s)' % self.table_prefix,
- largs
- )
- elif self.driver.paramstyle == 'pyformat':
- cur.executemany(
- 'insert into %sbooze values (%%(beer)s)' % (
- self.table_prefix
- ),
- margs
- )
- else:
- self.fail('Unknown paramstyle')
- self.failUnless(cur.rowcount in (-1,2),
- 'insert using cursor.executemany set cursor.rowcount to '
- 'incorrect value %r' % cur.rowcount
- )
- cur.execute('select name from %sbooze' % self.table_prefix)
- res = cur.fetchall()
- self.assertEqual(len(res),2,
- 'cursor.fetchall retrieved incorrect number of rows'
- )
- beers = [res[0][0],res[1][0]]
- beers.sort()
- self.assertEqual(beers[0],"Boag's",'incorrect data retrieved')
- self.assertEqual(beers[1],"Cooper's",'incorrect data retrieved')
- finally:
- con.close()
-
- def test_fetchone(self):
- con = self._connect()
- try:
- cur = con.cursor()
-
- # cursor.fetchone should raise an Error if called before
- # executing a select-type query
- self.assertRaises(self.driver.Error,cur.fetchone)
-
- # cursor.fetchone should raise an Error if called after
- # executing a query that cannnot return rows
- self.executeDDL1(cur)
- self.assertRaises(self.driver.Error,cur.fetchone)
-
- cur.execute('select name from %sbooze' % self.table_prefix)
- self.assertEqual(cur.fetchone(),None,
- 'cursor.fetchone should return None if a query retrieves '
- 'no rows'
- )
- self.failUnless(cur.rowcount in (-1,0))
-
- # cursor.fetchone should raise an Error if called after
- # executing a query that cannnot return rows
- cur.execute("insert into %sbooze values ('Victoria Bitter')" % (
- self.table_prefix
- ))
- self.assertRaises(self.driver.Error,cur.fetchone)
-
- cur.execute('select name from %sbooze' % self.table_prefix)
- r = cur.fetchone()
- self.assertEqual(len(r),1,
- 'cursor.fetchone should have retrieved a single row'
- )
- self.assertEqual(r[0],'Victoria Bitter',
- 'cursor.fetchone retrieved incorrect data'
- )
- self.assertEqual(cur.fetchone(),None,
- 'cursor.fetchone should return None if no more rows available'
- )
- self.failUnless(cur.rowcount in (-1,1))
- finally:
- con.close()
-
- samples = [
- 'Carlton Cold',
- 'Carlton Draft',
- 'Mountain Goat',
- 'Redback',
- 'Victoria Bitter',
- 'XXXX'
- ]
-
- def _populate(self):
- ''' Return a list of sql commands to setup the DB for the fetch
- tests.
- '''
- populate = [
- "insert into %sbooze values ('%s')" % (self.table_prefix,s)
- for s in self.samples
- ]
- return populate
-
- def test_fetchmany(self):
- con = self._connect()
- try:
- cur = con.cursor()
-
- # cursor.fetchmany should raise an Error if called without
- #issuing a query
- self.assertRaises(self.driver.Error,cur.fetchmany,4)
-
- self.executeDDL1(cur)
- for sql in self._populate():
- cur.execute(sql)
-
- cur.execute('select name from %sbooze' % self.table_prefix)
- r = cur.fetchmany()
- self.assertEqual(len(r),1,
- 'cursor.fetchmany retrieved incorrect number of rows, '
- 'default of arraysize is one.'
- )
- cur.arraysize=10
- r = cur.fetchmany(3) # Should get 3 rows
- self.assertEqual(len(r),3,
- 'cursor.fetchmany retrieved incorrect number of rows'
- )
- r = cur.fetchmany(4) # Should get 2 more
- self.assertEqual(len(r),2,
- 'cursor.fetchmany retrieved incorrect number of rows'
- )
- r = cur.fetchmany(4) # Should be an empty sequence
- self.assertEqual(len(r),0,
- 'cursor.fetchmany should return an empty sequence after '
- 'results are exhausted'
- )
- self.failUnless(cur.rowcount in (-1,6))
-
- # Same as above, using cursor.arraysize
- cur.arraysize=4
- cur.execute('select name from %sbooze' % self.table_prefix)
- r = cur.fetchmany() # Should get 4 rows
- self.assertEqual(len(r),4,
- 'cursor.arraysize not being honoured by fetchmany'
- )
- r = cur.fetchmany() # Should get 2 more
- self.assertEqual(len(r),2)
- r = cur.fetchmany() # Should be an empty sequence
- self.assertEqual(len(r),0)
- self.failUnless(cur.rowcount in (-1,6))
-
- cur.arraysize=6
- cur.execute('select name from %sbooze' % self.table_prefix)
- rows = cur.fetchmany() # Should get all rows
- self.failUnless(cur.rowcount in (-1,6))
- self.assertEqual(len(rows),6)
- self.assertEqual(len(rows),6)
- rows = [r[0] for r in rows]
- rows.sort()
-
- # Make sure we get the right data back out
- for i in range(0,6):
- self.assertEqual(rows[i],self.samples[i],
- 'incorrect data retrieved by cursor.fetchmany'
- )
-
- rows = cur.fetchmany() # Should return an empty list
- self.assertEqual(len(rows),0,
- 'cursor.fetchmany should return an empty sequence if '
- 'called after the whole result set has been fetched'
- )
- self.failUnless(cur.rowcount in (-1,6))
-
- self.executeDDL2(cur)
- cur.execute('select name from %sbarflys' % self.table_prefix)
- r = cur.fetchmany() # Should get empty sequence
- self.assertEqual(len(r),0,
- 'cursor.fetchmany should return an empty sequence if '
- 'query retrieved no rows'
- )
- self.failUnless(cur.rowcount in (-1,0))
-
- finally:
- con.close()
-
- def test_fetchall(self):
- con = self._connect()
- try:
- cur = con.cursor()
- # cursor.fetchall should raise an Error if called
- # without executing a query that may return rows (such
- # as a select)
- self.assertRaises(self.driver.Error, cur.fetchall)
-
- self.executeDDL1(cur)
- for sql in self._populate():
- cur.execute(sql)
-
- # cursor.fetchall should raise an Error if called
- # after executing a a statement that cannot return rows
- self.assertRaises(self.driver.Error,cur.fetchall)
-
- cur.execute('select name from %sbooze' % self.table_prefix)
- rows = cur.fetchall()
- self.failUnless(cur.rowcount in (-1,len(self.samples)))
- self.assertEqual(len(rows),len(self.samples),
- 'cursor.fetchall did not retrieve all rows'
- )
- rows = [r[0] for r in rows]
- rows.sort()
- for i in range(0,len(self.samples)):
- self.assertEqual(rows[i],self.samples[i],
- 'cursor.fetchall retrieved incorrect rows'
- )
- rows = cur.fetchall()
- self.assertEqual(
- len(rows),0,
- 'cursor.fetchall should return an empty list if called '
- 'after the whole result set has been fetched'
- )
- self.failUnless(cur.rowcount in (-1,len(self.samples)))
-
- self.executeDDL2(cur)
- cur.execute('select name from %sbarflys' % self.table_prefix)
- rows = cur.fetchall()
- self.failUnless(cur.rowcount in (-1,0))
- self.assertEqual(len(rows),0,
- 'cursor.fetchall should return an empty list if '
- 'a select query returns no rows'
- )
-
- finally:
- con.close()
-
- def test_mixedfetch(self):
- con = self._connect()
- try:
- cur = con.cursor()
- self.executeDDL1(cur)
- for sql in self._populate():
- cur.execute(sql)
-
- cur.execute('select name from %sbooze' % self.table_prefix)
- rows1 = cur.fetchone()
- rows23 = cur.fetchmany(2)
- rows4 = cur.fetchone()
- rows56 = cur.fetchall()
- self.failUnless(cur.rowcount in (-1,6))
- self.assertEqual(len(rows23),2,
- 'fetchmany returned incorrect number of rows'
- )
- self.assertEqual(len(rows56),2,
- 'fetchall returned incorrect number of rows'
- )
-
- rows = [rows1[0]]
- rows.extend([rows23[0][0],rows23[1][0]])
- rows.append(rows4[0])
- rows.extend([rows56[0][0],rows56[1][0]])
- rows.sort()
- for i in range(0,len(self.samples)):
- self.assertEqual(rows[i],self.samples[i],
- 'incorrect data retrieved or inserted'
- )
- finally:
- con.close()
-
- def help_nextset_setUp(self,cur):
- ''' Should create a procedure called deleteme
- that returns two result sets, first the
- number of rows in booze then "name from booze"
- '''
- raise NotImplementedError,'Helper not implemented'
- #sql="""
- # create procedure deleteme as
- # begin
- # select count(*) from booze
- # select name from booze
- # end
- #"""
- #cur.execute(sql)
-
- def help_nextset_tearDown(self,cur):
- 'If cleaning up is needed after nextSetTest'
- raise NotImplementedError,'Helper not implemented'
- #cur.execute("drop procedure deleteme")
-
- def test_nextset(self):
- con = self._connect()
- try:
- cur = con.cursor()
- if not hasattr(cur,'nextset'):
- return
-
- try:
- self.executeDDL1(cur)
- sql=self._populate()
- for sql in self._populate():
- cur.execute(sql)
-
- self.help_nextset_setUp(cur)
-
- cur.callproc('deleteme')
- numberofrows=cur.fetchone()
- assert numberofrows[0]== len(self.samples)
- assert cur.nextset()
- names=cur.fetchall()
- assert len(names) == len(self.samples)
- s=cur.nextset()
- assert s == None,'No more return sets, should return None'
- finally:
- self.help_nextset_tearDown(cur)
-
- finally:
- con.close()
-
- def test_nextset(self):
- raise NotImplementedError,'Drivers need to override this test'
-
- def test_arraysize(self):
- # Not much here - rest of the tests for this are in test_fetchmany
- con = self._connect()
- try:
- cur = con.cursor()
- self.failUnless(hasattr(cur,'arraysize'),
- 'cursor.arraysize must be defined'
- )
- finally:
- con.close()
-
- def test_setinputsizes(self):
- con = self._connect()
- try:
- cur = con.cursor()
- cur.setinputsizes( (25,) )
- self._paraminsert(cur) # Make sure cursor still works
- finally:
- con.close()
-
- def test_setoutputsize_basic(self):
- # Basic test is to make sure setoutputsize doesn't blow up
- con = self._connect()
- try:
- cur = con.cursor()
- cur.setoutputsize(1000)
- cur.setoutputsize(2000,0)
- self._paraminsert(cur) # Make sure the cursor still works
- finally:
- con.close()
-
- def test_setoutputsize(self):
- # Real test for setoutputsize is driver dependant
- raise NotImplementedError,'Driver need to override this test'
-
- def test_None(self):
- con = self._connect()
- try:
- cur = con.cursor()
- self.executeDDL1(cur)
- cur.execute('insert into %sbooze values (NULL)' % self.table_prefix)
- cur.execute('select name from %sbooze' % self.table_prefix)
- r = cur.fetchall()
- self.assertEqual(len(r),1)
- self.assertEqual(len(r[0]),1)
- self.assertEqual(r[0][0],None,'NULL value not returned as None')
- finally:
- con.close()
-
- def test_Date(self):
- d1 = self.driver.Date(2002,12,25)
- d2 = self.driver.DateFromTicks(time.mktime((2002,12,25,0,0,0,0,0,0)))
- # Can we assume this? API doesn't specify, but it seems implied
- # self.assertEqual(str(d1),str(d2))
-
- def test_Time(self):
- t1 = self.driver.Time(13,45,30)
- t2 = self.driver.TimeFromTicks(time.mktime((2001,1,1,13,45,30,0,0,0)))
- # Can we assume this? API doesn't specify, but it seems implied
- # self.assertEqual(str(t1),str(t2))
-
- def test_Timestamp(self):
- t1 = self.driver.Timestamp(2002,12,25,13,45,30)
- t2 = self.driver.TimestampFromTicks(
- time.mktime((2002,12,25,13,45,30,0,0,0))
- )
- # Can we assume this? API doesn't specify, but it seems implied
- # self.assertEqual(str(t1),str(t2))
-
- def test_Binary(self):
- b = self.driver.Binary('Something')
- b = self.driver.Binary('')
-
- def test_STRING(self):
- self.failUnless(hasattr(self.driver,'STRING'),
- 'module.STRING must be defined'
- )
-
- def test_BINARY(self):
- self.failUnless(hasattr(self.driver,'BINARY'),
- 'module.BINARY must be defined.'
- )
-
- def test_NUMBER(self):
- self.failUnless(hasattr(self.driver,'NUMBER'),
- 'module.NUMBER must be defined.'
- )
-
- def test_DATETIME(self):
- self.failUnless(hasattr(self.driver,'DATETIME'),
- 'module.DATETIME must be defined.'
- )
-
- def test_ROWID(self):
- self.failUnless(hasattr(self.driver,'ROWID'),
- 'module.ROWID must be defined.'
- )
-
+++ /dev/null
-# extras_dictcursor - test if DictCursor extension class works
-#
-# Copyright (C) 2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-import psycopg2
-import psycopg2.extras
-from unittest import TestCase, TestSuite, main
-
-
-class ExtrasDictCursorTests(TestCase):
- """Test if DictCursor extension class works."""
-
- def setUp(self):
- self.conn = psycopg2.connect("dbname=test")
- curs = self.conn.cursor()
- curs.execute("CREATE TABLE ExtrasDictCursorTests (foo text)")
-
- def testDictCursor(self):
- curs = self.conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
- curs.execute("INSERT INTO ExtrasDictCursorTests VALUES ('bar')")
- curs.execute("SELECT * FROM ExtrasDictCursorTests")
- row = curs.fetchone()
- self.failUnless(row['foo'] == 'bar')
- self.failUnless(row[0] == 'bar')
-
-class ExtrasDictCursorSuite(TestSuite):
- """Build a suite of all tests."""
-
- def __init__(self):
- """Build a list of tests."""
- self.tests = [x for x in dir(ExtrasDictCursorTests)
- if x.startswith('test')]
- TestSuite.__init__(self, map(TestModule, self.tests))
-
-
-if __name__ == "__main__":
- main()
+++ /dev/null
-#!/usr/bin/env python
-import dbapi20
-import unittest
-import psycopg2
-import popen2
-
-class test_Psycopg(dbapi20.DatabaseAPI20Test):
- driver = psycopg2
- connect_args = ()
- connect_kw_args = {'dsn': 'dbname=dbapi20_test'}
-
- lower_func = 'lower' # For stored procedure test
-
- def setUp(self):
- # Call superclass setUp In case this does something in the
- # future
- dbapi20.DatabaseAPI20Test.setUp(self)
-
- try:
- con = self._connect()
- con.close()
- except:
- cmd = "psql -c 'create database dbapi20_test' template1"
- cout,cin = popen2.popen2(cmd)
- cin.close()
- cout.read()
-
- def tearDown(self):
- dbapi20.DatabaseAPI20Test.tearDown(self)
-
- def test_nextset(self): pass
- def test_setoutputsize(self): pass
-
-if __name__ == '__main__':
- unittest.main()
+++ /dev/null
-# types_basic.py - tests for basic types conversions
-#
-# Copyright (C) 2004 Federico Di Gregorio <fog@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-import sys
-try:
- import decimal
-except:
- pass
-import psycopg2
-from unittest import TestCase, TestSuite, main
-
-
-class TypesBasicTests(TestCase):
- """Test presence of mandatory attributes and methods."""
-
- def setUp(self):
- self.conn = psycopg2.connect("dbname=test")
-
- def execute(self, *args):
- curs = self.conn.cursor()
- curs.execute(*args)
- return curs.fetchone()[0]
-
- def testQuoting(self):
- s = "Quote'this\\! ''ok?''"
- self.failUnless(self.execute("SELECT %s AS foo", (s,)) == s,
- "wrong quoting: " + s)
-
- def testUnicode(self):
- s = u"Quote'this\\! ''ok?''"
- self.failUnless(self.execute("SELECT %s AS foo", (s,)) == s,
- "wrong unicode quoting: " + s)
-
- def testNumber(self):
- s = self.execute("SELECT %s AS foo", (1971,))
- self.failUnless(s == 1971, "wrong integer quoting: " + str(s))
- s = self.execute("SELECT %s AS foo", (1971L,))
- self.failUnless(s == 1971L, "wrong integer quoting: " + str(s))
- # Python 2.4 defaults to Decimal?
- if sys.version_info[0] >= 2 and sys.version_info[1] >= 4:
- s = self.execute("SELECT %s AS foo", (19.10,))
- self.failUnless(s - decimal.Decimal("19.10") == 0,
- "wrong decimal quoting: " + str(s))
- else:
- s = self.execute("SELECT %s AS foo", (19.10,))
- self.failUnless(abs(s - 19.10) < 0.001,
- "wrong float quoting: " + str(s))
-
- def testBinary(self):
- s = ''.join([chr(x) for x in range(256)])
- b = psycopg2.Binary(s)
- r = str(self.execute("SELECT %s::bytea AS foo", (b,)))
- self.failUnless(r == s, "wrong binary quoting")
- # test to make sure an empty Binary is converted to an empty string
- b = psycopg2.Binary('')
- self.assertEqual(str(b), "''")
-
- def testArray(self):
- s = self.execute("SELECT %s AS foo", ([[1,2],[3,4]],))
- self.failUnless(s == [[1,2],[3,4]], "wrong array quoting " + str(s))
- s = self.execute("SELECT %s AS foo", (['one', 'two', 'three'],))
- self.failUnless(s == ['one', 'two', 'three'],
- "wrong array quoting " + str(s))
-
-
-class TypesBasicSuite(TestSuite):
- """Build a suite of all tests."""
-
- def __init__(self):
- """Build a list of tests."""
- self.tests = [x for x in dir(TypesBasicTests) if x.startswith('test')]
- TestSuite.__init__(self, map(TestModule, self.tests))
-
-
-if __name__ == "__main__":
- main()
+++ /dev/null
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-\f
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-\f
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-\f
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-\f
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-\f
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-\f
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-\f
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-\f
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-\f
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
+++ /dev/null
-Version 7.13.1 [requires libcurl-7.13.1 or better]
---------------
-
-2005-03-04 Kjetil Jacobsen <kjetilja>
-
- * Use METH_NOARGS where appropriate.
-
-2005-03-03 Kjetil Jacobsen <kjetilja>
-
- * Added support for CURLFORM API with HTTPPOST: Supports a
- a tuple with pairs of options and values instead of just
- supporting string contents. See tests/test_post2.py
- for example usage. Options are FORM_CONTENTS, FORM_FILE and
- FORM_CONTENTTYPE, corresponding to the CURLFORM_* options,
- and values are strings.
-
-2005-02-13 Markus F.X.J. Oberhumer <mfx>
-
- * Read callbacks (pycurl.READFUNCTION) can now return
- pycurl.READFUNC_ABORT to immediately abort the current transfer.
-
- * The INFILESIZE, MAXFILESIZE, POSTFIELDSIZE and RESUME_FROM
- options now automatically use the largefile version to handle
- files > 2GB.
-
- * Added missing pycurl.PORT constant.
-
-
-Version 7.13.0
---------------
-
-2005-02-10 Kjetil Jacobsen <kjetilja>
-
- * Added file_upload.py to examples, shows how to upload
- a file.
-
- * Added CURLOPT_IOCTLFUNCTION/DATA.
-
- * Added options from libcurl 7.13.0: FTP_ACCOUNT, SOURCE_URL,
- SOURCE_QUOTE.
-
- * Obsoleted options: SOURCE_HOST, SOURCE_PATH, SOURCE_PORT,
- PASV_HOST.
-
-
-Version 7.12.3
---------------
-
-2004-12-22 Markus F.X.J. Oberhumer <mfx>
-
- * Added CURLINFO_NUM_CONNECTS and CURLINFO_SSL_ENGINES.
-
- * Added some other missing constants.
-
- * Updated pycurl.version_info() to return a 12-tuple
- instead of a 9-tuple.
-
-
-Version 7.12.2
---------------
-
-2004-10-15 Kjetil Jacobsen <kjetilja>
-
- * Added CURLOPT_FTPSSLAUTH (and CURLFTPAUTH_*).
-
- * Added CURLINFO_OS_ERRNO.
-
-2004-08-17 Kjetil Jacobsen <kjetilja>
-
- * Use LONG_LONG instead of PY_LONG_LONG to make pycurl compile
- on Python versions < 2.3 (fix from Domenico Andreoli
- <cavok at libero.it>).
-
-
-Version 7.12.1
---------------
-
-2004-08-02 Kjetil Jacobsen <kjetilja>
-
- * Added INFOTYPE_SSL_DATA_IN/OUT.
-
-2004-07-16 Markus F.X.J. Oberhumer <mfx>
-
- * WARNING: removed deprecated PROXY_, TIMECOND_ and non-prefixed
- INFOTYPE constant names. See ChangeLog entry 2003-06-10.
-
-2004-06-21 Kjetil Jacobsen <kjetilja>
-
- * Added test program for HTTP post using the read callback (see
- tests/test_post3.py for details).
-
- * Use the new CURL_READFUNC_ABORT return code where appropriate
- to avoid hanging in perform() when read callbacks are used.
-
- * Added support for libcurl 7.12.1 CURLOPT features:
- SOURCE_HOST, SOURCE_USERPWD, SOURCE_PATH, SOURCE_PORT,
- PASV_HOST, SOURCE_PREQUOTE, SOURCE_POSTQUOTE.
-
-2004-06-08 Markus F.X.J. Oberhumer <mfx>
-
- * Setting CURLOPT_POSTFIELDS now allows binary data and
- automatically sets CURLOPT_POSTFIELDSIZE for you. If you really
- want a different size you have to manually set POSTFIELDSIZE
- after setting POSTFIELDS.
- (Based on a patch by Martin Muenstermann).
-
-2004-06-05 Markus F.X.J. Oberhumer <mfx>
-
- * Added stricter checks within the callback handlers.
-
- * Unify the behaviour of int and long parameters where appropriate.
-
-
-Version 7.12
-------------
-
-2004-05-18 Kjetil Jacobsen <kjetilja>
-
- * WARNING: To simplify code maintenance pycurl now requires
- libcurl 7.11.2 and Python 2.2 or newer to work.
-
- * GC support is now always enabled.
-
-
-Version 7.11.3
---------------
-
-2004-04-30 Kjetil Jacobsen <kjetilja>
-
- * Do not use the deprecated curl_formparse function.
- API CHANGE: HTTPPOST now takes a list of tuples where each
- tuple contains a form name and a form value, both strings
- (see test/test_post2.py for example usage).
-
- * Found a possible reference count bug in the multithreading
- code which may have contributed to the long-standing GC
- segfault which has haunted pycurl. Fingers crossed.
-
-
-Version 7.11.2
---------------
-
-2004-04-21 Kjetil Jacobsen <kjetilja>
-
- * Added support for libcurl 7.11.2 CURLOPT features:
- CURLOPT_TCP_NODELAY.
-
-2004-03-25 Kjetil Jacobsen <kjetilja>
-
- * Store Python longs in off_t with PyLong_AsLongLong instead
- of PyLong_AsLong. Should make the options which deal
- with large files behave a little better. Note that this
- requires the long long support in Python 2.2 or newer to
- work properly.
-
-
-Version 7.11.1
---------------
-
-2004-03-16 Kjetil Jacobsen <kjetilja>
-
- * WARNING: Removed support for the PASSWDFUNCTION callback, which
- is no longer supported by libcurl.
-
-2004-03-15 Kjetil Jacobsen <kjetilja>
-
- * Added support for libcurl 7.11.1 CURLOPT features:
- CURLOPT_POSTFIELDSIZE_LARGE.
-
-
-Version 7.11.0
---------------
-
-2004-02-11 Kjetil Jacobsen <kjetilja>
-
- * Added support for libcurl 7.11.0 CURLOPT features:
- INFILESIZE_LARGE, RESUME_FROM_LARGE, MAXFILESIZE_LARGE
- and FTP_SSL.
-
- * Circular garbage collection support can now be enabled or
- disabled by passing the '--use-gc=[1|0]' parameter to setup.py
- when building pycurl.
-
- * HTTP_VERSION options are known as CURL_HTTP_VERSION_NONE,
- CURL_HTTP_VERSION_1_0, CURL_HTTP_VERSION_1_1 and
- CURL_HTTP_VERSION_LAST.
-
-2003-11-16 Markus F.X.J. Oberhumer <mfx>
-
- * Added support for these new libcurl 7.11.0 features:
- CURLOPT_NETRC_FILE.
-
-
-Version 7.10.8
---------------
-
-2003-11-04 Markus F.X.J. Oberhumer <mfx>
-
- * Added support for these new libcurl 7.10.8 features:
- CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_IPRESOLVE,
- CURLOPT_MAXFILESIZE,
- CURLINFO_HTTPAUTH_AVAIL, CURLINFO_PROXYAUTH_AVAIL,
- CURL_IPRESOLVE_* constants.
-
- * Added support for these new libcurl 7.10.7 features:
- CURLOPT_FTP_CREATE_MISSING_DIRS, CURLOPT_PROXYAUTH,
- CURLINFO_HTTP_CONNECTCODE.
-
-
-2003-10-28 Kjetil Jacobsen <kjetilja>
-
- * Added missing CURLOPT_ENCODING option (patch by Martijn
- Boerwinkel <xim@xs4all.nl>)
-
-
-Version 7.10.6
---------------
-
-2003-07-29 Markus F.X.J. Oberhumer <mfx>
-
- * Started working on support for CURLOPT_SSL_CTX_FUNCTION and
- CURLOPT_SSL_CTX_DATA (libcurl-7.10.6) - not yet finished.
-
-2003-06-10 Markus F.X.J. Oberhumer <mfx>
-
- * Added support for CURLOPT_HTTPAUTH (libcurl-7.10.6), including
- the new HTTPAUTH_BASIC, HTTPAUTH_DIGEST, HTTPAUTH_GSSNEGOTIATE
- and HTTPAUTH_NTML constants.
-
- * Some constants were renamed for consistency:
-
- All curl_infotype constants are now prefixed with "INFOTYPE_",
- all curl_proxytype constants are prefixed with "PROXYTYPE_" instead
- of "PROXY_", and all curl_TimeCond constants are now prefixed
- with "TIMECONDITION_" instead of "TIMECOND_".
-
- (The old names are still available but will get removed
- in a future release.)
-
- * WARNING: Removed the deprecated pycurl.init() and pycurl.multi_init()
- names - use pycurl.Curl() and pycurl.CurlMulti() instead.
-
- * WARNING: Removed the deprecated Curl.cleanup() and
- CurlMulti.cleanup() methods - use Curl.close() and
- CurlMulti.close() instead.
-
-
-Version 7.10.5
---------------
-
-2003-05-15 Markus F.X.J. Oberhumer <mfx>
-
- * Added support for CURLOPT_FTP_USE_EPRT (libcurl-7.10.5).
-
- * Documentation updates.
-
-2003-05-07 Eric S. Raymond <esr@snark.thyrsus.com>
-
- * Lifted all HTML docs to clean XHTML, verified by tidy.
-
-2003-05-02 Markus F.X.J. Oberhumer <mfx>
-
- * Fixed some `int' vs. `long' mismatches that affected 64-bit systems.
-
- * Fixed wrong pycurl.CAPATH constant.
-
-2003-05-01 Markus F.X.J. Oberhumer <mfx>
-
- * Added new method Curl.errstr() which returns the internal
- libcurl error buffer string of the handle.
-
-
-Version 7.10.4.2
-----------------
-
-2003-04-15 Markus F.X.J. Oberhumer <mfx>
-
- * Allow compilation against the libcurl-7.10.3 release - some
- recent Linux distributions (e.g. Mandrake 9.1) ship with 7.10.3,
- and apart from the new CURLOPT_UNRESTRICTED_AUTH option there is
- no need that we require libcurl-7.10.4.
-
-
-Version 7.10.4
---------------
-
-2003-04-01 Kjetil Jacobsen <kjetilja>
-
- * Markus added CURLOPT_UNRESTRICTED_AUTH (libcurl-7.10.4).
-
-2003-02-25 Kjetil Jacobsen <kjetilja>
-
- * Fixed some broken test code and removed the fileupload test
- since it didn't work properly.
-
-2003-01-28 Kjetil Jacobsen <kjetilja>
-
- * Some documentation updates by Markus and me.
-
-2003-01-22 Kjetil Jacobsen <kjetilja>
-
- * API CHANGE: the CurlMulti.info_read() method now returns
- a separate array with handles that failed. Each entry in this array
- is a tuple with (curl object, error number, error message).
- This addition makes it simpler to do error checking of individual
- curl objects when using the multi interface.
-
-
-Version 7.10.3
---------------
-
-2003-01-13 Kjetil Jacobsen <kjetilja>
-
- * PycURL memory usage has been reduced.
-
-2003-01-10 Kjetil Jacobsen <kjetilja>
-
- * Added 'examples/retriever-multi.py' which shows how to retrieve
- a set of URLs concurrently using the multi interface.
-
-2003-01-09 Kjetil Jacobsen <kjetilja>
-
- * Added support for CURLOPT_HTTP200ALIASES.
-
-2002-11-22 Kjetil Jacobsen <kjetilja>
-
- * Updated pycurl documentation in the 'doc' directory.
-
-2002-11-21 Kjetil Jacobsen <kjetilja>
-
- * Updated and improved 'examples/curl.py'.
-
- * Added 'tests/test_multi6.py' which shows how to use the
- info_read method with CurlMulti.
-
-2002-11-19 Kjetil Jacobsen <kjetilja>
-
- * Added new method CurlMulti.info_read().
-
-
-Version 7.10.2
---------------
-
-2002-11-14 Kjetil Jacobsen <kjetilja>
-
- * Free options set with setopt after cleanup is called, as cleanup
- assumes that options are still valid when invoked. This fixes the
- bug with COOKIEJAR reported by Bastiaan Naber
- <bastiaan@ricardis.tudelft.nl>.
-
-2002-11-06 Markus F.X.J. Oberhumer <mfx>
-
- * Install documentation under /usr/share/doc instead of /usr/doc.
- Also, start shipping the (unfinished) HTML docs and some
- basic test scripts.
-
-2002-10-30 Markus F.X.J. Oberhumer <mfx>
-
- * API CHANGE: For integral values, Curl.getinfo() now returns a
- Python-int instead of a Python-long.
-
-
-Version 7.10.1
---------------
-
-2002-10-03 Markus F.X.J. Oberhumer <mfx>
-
- * Added new module-level function version_info() from
- libcurl-7.10.
-
-
-Version 7.10
-------------
-
-2002-09-13 Kjetil Jacobsen <kjetilja>
-
- * Added commandline options to setup.py for specifying the path to
- 'curl-config' (non-windows) and the curl installation directory
- (windows). See the 'INSTALL' file for details.
-
- * Added CURLOPT_ENCODING, CURLOPT_NOSIGNAL and CURLOPT_BUFFERSIZE
- from libcurl-7.10 (by Markus Oberhumer).
-
-
-Version 7.9.8.4
----------------
-
-2002-08-28 Kjetil Jacobsen <kjetilja>
-
- * Added a simple web-browser example based on gtkhtml and pycurl.
- See the file 'examples/gtkhtml_demo.py' for details. The example
- requires a working installation of gnome-python with gtkhtml
- bindings enabled (pass --with-gtkhtml to gnome-python configure).
-
-2002-08-14 Kjetil Jacobsen <kjetilja>
-
- * Added new method 'select' on CurlMulti objects. Example usage
- in 'tests/test_multi5.py'. This method is just an optimization of
- the combined use of fdset and select.
-
-2002-08-12 Kjetil Jacobsen <kjetilja>
-
- * Added support for curl_multi_fdset. See the file
- 'tests/test_multi4.py' for example usage. Contributed by Conrad
- Steenberg <conrad@hep.caltech.edu>.
-
- * perform() on multi objects now returns a tuple (result, number
- of handles) like the libcurl interface does.
-
-2002-08-08 Kjetil Jacobsen <kjetilja>
-
- * Added the 'sfquery' script which retrieves a SourceForge XML
- export object for a given project. See the file 'examples/sfquery.py'
- for details and usage. 'sfquery' was contributed by Eric
- S. Raymond <esr@thyrsus.com>.
-
-2002-07-20 Markus F.X.J. Oberhumer <mfx>
-
- * API enhancements: added Curl() and CurlMulti() as aliases for
- init() and multi_init(), and added close() methods as aliases
- for the cleanup() methods. The new names much better match
- the actual intended use of the objects, and they also nicely
- correspond to Python's file object.
-
- * Also, all constants for Curl.setopt() and Curl.getinfo() are now
- visible from within Curl objects.
-
- All changes are fully backward-compatible.
-
-
-Version 7.9.8.3
----------------
-
-2002-07-16 Markus F.X.J. Oberhumer <mfx>
-
- * Under Python 2.2 or better, Curl and CurlMulti objects now
- automatically participate in cyclic garbarge collection
- (using the gc module).
-
-
-Version 7.9.8.2
----------------
-
-2002-07-05 Markus F.X.J. Oberhumer <mfx>
-
- * Curl and CurlMulti objects now support standard Python attributes.
- See tests/test_multi2.py for an example.
-
-2002-07-02 Kjetil Jacobsen <kjetilja>
-
- * Added support for the multi-interface.
-
-
-Version 7.9.8.1
----------------
-
-2002-06-25 Markus F.X.J. Oberhumer <mfx>
-
- * Fixed a couple of `int' vs. `size_t' mismatches in callbacks
- and Py_BuildValue() calls.
-
-2002-06-25 Kjetil Jacobsen <kjetilja>
-
- * Use 'double' type instead of 'size_t' for progress callbacks
- (by Conrad Steenberg <conrad@hep.caltech.edu>). Also cleaned up
- some other type mismatches in the callback interfaces.
-
-2002-06-24 Kjetil Jacobsen <kjetilja>
-
- * Added example code on how to upload a file using HTTPPOST in
- pycurl (code by Amit Mongia <amit_mongia@hotmail.com>). See the
- file 'test_fileupload.py' for details.
-
-
-Version 7.9.8
--------------
-
-2002-06-24 Kjetil Jacobsen <kjetilja>
-
- * Resolved some build problems on Windows (by Markus Oberhumer).
-
-2002-06-19 Kjetil Jacobsen <kjetilja>
-
- * Added CURLOPT_CAPATH.
-
- * Added option constants for CURLOPT_NETRC: CURL_NETRC_OPTIONAL,
- CURL_NETRC_IGNORED and CURL_NETRC_REQUIRED.
-
- * Added option constants for CURLOPT_TIMECONDITION:
- TIMECOND_IFMODSINCE and TIMECOND_IFUNMODSINCE.
-
- * Added an simple example crawler, which downloads documents
- listed in a file with a configurable number of worker threads.
- See the file 'crawler.py' in the 'tests' directory for details.
-
- * Removed the redundant 'test_xmlrpc2.py' test script.
-
- * Disallow recursive callback invocations (by Markus Oberhumer).
-
-2002-06-18 Kjetil Jacobsen <kjetilja>
-
- * Made some changes to setup.py which should fix the build
- problems on RedHat 7.3 (suggested by Benji <benji@kioza.net>).
-
- * Use CURLOPT_READDATA instead of CURLOPT_INFILE, and
- CURLOPT_WRITEDATA instead of CURLOPT_FILE. Also fixed some
- reference counting bugs with file objects.
-
- * CURLOPT_FILETIME and CURLINFO_FILETIME had a namespace clash
- which caused them not to work. Use OPT_FILETIME for setopt() and
- INFO_FILETIME for getinfo(). See example usage in
- 'test_getinfo.py' for details.
-
-
-Version 7.9.7
--------------
-
-2002-05-20 Kjetil Jacobsen <kjetilja>
-
- * New versioning scheme. Pycurl now has the same version number
- as the libcurl version it was built with. The pycurl version
- number thus indicates which version of libcurl is required to run.
-
-2002-05-17 Kjetil Jacobsen <kjetilja>
-
- * Added CURLINFO_REDIRECT_TIME and CURLINFO_REDIRECT_COUNT.
-
-2002-04-27 Kjetil Jacobsen <kjetilja>
-
- * Fixed potential memory leak and thread race (by Markus
- Oberhumer).
-
-
-Version 0.4.9
--------------
-
-2002-04-15 Kjetil Jacobsen <kjetilja>
-
- * Added CURLOPT_DEBUGFUNCTION to allow debug callbacks to be
- specified (see the file 'test_debug.py' for details on how to use
- debug callbacks).
-
- * Added CURLOPT_DNS_USE_GLOBAL_CACHE and
- CURLOPT_DNS_CACHE_TIMEOUT.
-
- * Fixed a segfault when finalizing curl objects in Python 1.5.2.
-
- * Now requires libcurl 7.9.6 or greater.
-
-2002-04-12 Kjetil Jacobsen <kjetilja>
-
- * Added 'test_post2.py' file which is another example on how to
- issue POST requests.
-
-2002-04-11 Markus F.X.J. Oberhumer <mfx>
-
- * Added the 'test_post.py' file which demonstrates the use of
- POST requests.
-
-
-Version 0.4.8
--------------
-
-2002-03-07 Kjetil Jacobsen <kjetilja>
-
- * Added CURLOPT_PREQUOTE.
-
- * Now requires libcurl 7.9.5 or greater.
-
- * Other minor code cleanups and bugfixes.
-
-2002-03-05 Kjetil Jacobsen <kjetilja>
-
- * Do not allow WRITEFUNCTION and WRITEHEADER on the same handle.
-
-
-Version 0.4.7
--------------
-
-2002-02-27 Kjetil Jacobsen <kjetilja>
-
- * Abort callback if the thread state of the calling thread cannot
- be determined.
-
- * Check that the installed version of libcurl matches the
- requirements of pycurl.
-
-2002-02-26 Kjetil Jacobsen <kjetilja>
-
- * Clarence Garnder <clarence@silcom.com> found a bug where string
- arguments to setopt sometimes were prematurely deallocated, this
- should now be fixed.
-
-2002-02-21 Kjetil Jacobsen <kjetilja>
-
- * Added the 'xmlrpc_curl.py' file which implements a transport
- for xmlrpclib (xmlrpclib is part of Python 2.2).
-
- * Added CURLINFO_CONTENT_TYPE.
-
- * Added CURLOPT_SSLCERTTYPE, CURLOPT_SSLKEY, CURLOPT_SSLKEYTYPE,
- CURLOPT_SSLKEYPASSWD, CURLOPT_SSLENGINE and
- CURLOPT_SSLENGINE_DEFAULT.
-
- * When thrown, the pycurl.error exception is now a tuple consisting
- of the curl error code and the error message.
-
- * Now requires libcurl 7.9.4 or greater.
-
-2002-02-19 Kjetil Jacobsen <kjetilja>
-
- * Fixed docstring for getopt() function.
-
-2001-12-18 Kjetil Jacobsen <kjetilja>
-
- * Updated the INSTALL information for Win32.
-
-2001-12-12 Kjetil Jacobsen <kjetilja>
-
- * Added missing link flag to make pycurl build on MacOS X (by Matt
- King <matt@gnik.com>).
-
-2001-12-06 Kjetil Jacobsen <kjetilja>
-
- * Added CURLINFO_STARTTRANSFER_TIME and CURLOPT_FTP_USE_EPSV from
- libcurl 7.9.2.
-
-2001-12-01 Markus F.X.J. Oberhumer <mfx>
-
- * Added the 'test_stringio.py' file which demonstrates the use of
- StringIO objects as callback.
-
-2001-12-01 Markus F.X.J. Oberhumer <mfx>
-
- * setup.py: Do not remove entries from a list while iterating
- over it.
-
-2001-11-29 Kjetil Jacobsen <kjetilja>
-
- * Added code in setup.py to install on Windows. Requires some
- manual configuration (by Tino Lange <Tino.Lange@gmx.de>).
-
-2001-11-27 Kjetil Jacobsen <kjetilja>
-
- * Improved detection of where libcurl is installed in setup.py.
- Should make it easier to install pycurl when libcurl is not
- located in regular lib/include paths.
-
-2001-11-05 Kjetil Jacobsen <kjetilja>
-
- * Some of the newer options to setopt were missing, this should
- now be fixed.
-
-2001-11-04 Kjetil Jacobsen <kjetilja>
-
- * Exception handling has been improved and should no longer throw
- spurious exceptions (by Markus F.X.J. Oberhumer
- <markus@oberhumer.com>).
-
-2001-10-15 Kjetil Jacobsen <kjetilja>
-
- * Refactored the test_gtk.py script to avoid global variables.
-
-2001-10-12 Kjetil Jacobsen <kjetilja>
-
- * Added module docstrings, terse perhaps, but better than nothing.
-
- * Added the 'basicfirst.py' file which is a Python version of the
- corresponding Perl script by Daniel.
-
- * PycURL now works properly under Python 1.5 and 1.6 (by Markus
- F.X.J. Oberhumer <markus@oberhumer.com>).
-
- * Allow C-functions and Python methods as callbacks (by Markus
- F.X.J. Oberhumer <markus@oberhumer.com>).
-
- * Allow None as success result of write, header and progress
- callback invocations (by Markus F.X.J. Oberhumer
- <markus@oberhumer.com>).
-
- * Added the 'basicfirst2.py' file which demonstrates the use of a
- class method as callback instead of just a function.
-
-2001-08-21 Kjetil Jacobsen <kjetilja>
-
- * Cleaned up the script with GNOME/PycURL integration.
-
-2001-08-20 Kjetil Jacobsen <kjetilja>
-
- * Added another test script for shipping XML-RPC requests which
- uses py-xmlrpc to encode the arguments (tests/test_xmlrpc2.py).
-
-2001-08-20 Kjetil Jacobsen <kjetilja>
-
- * Added test script for using PycURL and GNOME (tests/test_gtk.py).
-
-2001-08-20 Kjetil Jacobsen <kjetilja>
-
- * Added test script for using XML-RPC (tests/test_xmlrpc.py).
-
- * Added more comments to the test sources.
-
-2001-08-06 Kjetil Jacobsen <kjetilja>
-
- * Renamed module namespace to pycurl instead of curl.
-
-2001-08-06 Kjetil Jacobsen <kjetilja>
-
- * Set CURLOPT_VERBOSE to 0 by default.
-
-2001-06-29 Kjetil Jacobsen <kjetilja>
-
- * Updated INSTALL, curl version 7.8 or greater is now mandatory to
- use pycurl.
-
-2001-06-13 Kjetil Jacobsen <kjetilja>
-
- * Set NOPROGRESS to 1 by default.
-
-2001-06-07 Kjetil Jacobsen <kjetilja>
-
- * Added global_init/cleanup.
-
-2001-06-06 Kjetil Jacobsen <kjetilja>
-
- * Added HEADER/PROGRESSFUNCTION callbacks (see files in tests/).
-
- * Added PASSWDFUNCTION callback (untested).
-
- * Added READFUNCTION callback (untested).
-
-2001-06-05 Kjetil Jacobsen <kjetilja>
-
- * WRITEFUNCTION callbacks now work (see tests/test_cb.py for details).
-
- * Preliminary distutils installation.
-
- * Added CLOSEPOLICY constants to module namespace.
-
-2001-06-04 Kjetil Jacobsen <kjetilja>
-
- * Return -1 on error from Python callback in WRITEFUNCTION callback.
-
-2001-06-01 Kjetil Jacobsen <kjetilja>
-
- * Moved source to src and tests to tests directory.
-
-2001-05-31 Kjetil Jacobsen <kjetilja>
-
- * Added better type checking for setopt.
-
-2001-05-30 Kjetil Jacobsen <kjetilja>
-
- * Moved code to sourceforge.
-
- * Added getinfo support.
-
-
-# vi:ts=8:et
+++ /dev/null
-NOTE: You need Python and libcurl installed on your system to use or
-build pycurl. Some RPM distributions of curl/libcurl do not include
-everything necessary to build pycurl, in which case you need to
-install the developer specific RPM which is usually called curl-dev.
-
-
-Distutils
----------
-
-Assuming that distutils is installed (which it is by default on Python
-versions greater than 1.5.2) build and install pycurl with the
-following commands:
-
- (if necessary, become root)
- tar -zxvf pycurl-$VER.tar.gz
- cd pycurl-$VER
- python setup.py install
-
-$VER should be substituted with the version number, e.g. 7.10.5.
-
-Note that the installation script assumes that 'curl-config' can be
-located in your path setting. If curl-config is installed outside
-your path or you want to force installation to use a particular
-version of curl-config, use the '--curl-config' commandline option to
-specify the location of curl-config. Example:
-
- python setup.py install --curl-config=/usr/local/bin/curl-config
-
-If libcurl is linked dynamically with pycurl, you may have to alter the
-LD_LIBRARY_PATH environment variable accordingly. This normally
-applies only if there is more than one version of libcurl installed,
-e.g. one in /usr/lib and one in /usr/local/lib.
-
-
-Windows
--------
-
-When installing on Windows, you need to manually configure the path to
-the curl source tree, specified with the CURL_DIR variable in the file
-'setup.py'. The CURL_DIR variable can also be set using the
-commandline option '--curl-dir' when invoking setup.py:
-
- python setup.py install --curl-dir=c:\curl-7.10.5
-
+++ /dev/null
-#
-# MANIFEST.in
-# Manifest template for creating the source distribution.
-#
-
-include ChangeLog
-include COPYING
-include INSTALL
-include Makefile
-include README
-include TODO
-include MANIFEST.in
-include src/Makefile
-include src/pycurl.c
-include python/curl/*.py
-include examples/*.py
-include tests/*.py
-include doc/*.html
-include setup_win32_ssl.py
-
-# exclude unfinished test scripts
-#exclude tests/test_multi_vs_thread.py
+++ /dev/null
-#
-# to use a specific python version call
-# `make PYTHON=python2.2'
-#
-
-SHELL = /bin/sh
-
-PYTHON = python2.3
-PYTHON = python
-
-all build:
- $(PYTHON) setup.py build
-
-build-7.10.8:
- $(PYTHON) setup.py build --curl-config=/home/hosts/localhost/packages/curl-7.10.8/bin/curl-config
-
-test: build
- $(PYTHON) tests/test_internals.py -q
-
-# (needs GNU binutils)
-strip: build
- strip -p --strip-unneeded build/lib*/*.so
- chmod -x build/lib*/*.so
-
-install install_lib:
- $(PYTHON) setup.py $@
-
-clean:
- -rm -rf build dist
- -rm -f *.pyc *.pyo */*.pyc */*.pyo */*/*.pyc */*/*.pyo
- -rm -f MANIFEST
- cd src && $(MAKE) clean
-
-distclean: clean
-
-maintainer-clean: distclean
-
-dist sdist: distclean
- $(PYTHON) setup.py sdist
-
-# target for maintainer
-windist: distclean
- rm -rf build
- python2.2 setup.py bdist_wininst
- rm -rf build
- python2.3 setup.py bdist_wininst
- rm -rf build
- python2.4 setup.py bdist_wininst
- rm -rf build
- python2.2 setup_win32_ssl.py bdist_wininst
- rm -rf build
- python2.3 setup_win32_ssl.py bdist_wininst
- rm -rf build
- python2.4 setup_win32_ssl.py bdist_wininst
- rm -rf build
-
-
-.PHONY: all build test strip install install_lib clean distclean maintainer-clean dist sdist windist
-
-.NOEXPORT:
+++ /dev/null
-Metadata-Version: 1.0
-Name: pycurl
-Version: 7.13.1
-Summary: PycURL -- cURL library module for Python
-Home-page: http://pycurl.sourceforge.net/
-Author: Kjetil Jacobsen, Markus F.X.J. Oberhumer
-Author-email: kjetilja@cs.uit.no, markus@oberhumer.com
-License: GNU Lesser General Public License (LGPL)
-Description:
- This module provides Python bindings for the cURL library.
-Platform: All
+++ /dev/null
-LICENSE
--------
-
-Copyright (C) 2001-2005 by Kjetil Jacobsen <kjetilja@cs.uit.no>
-Copyright (C) 2001-2005 by Markus F.X.J. Oberhumer <markus@oberhumer.com>
-
-PycURL is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-A full copy of the LGPL license is included in the file COPYING.
+++ /dev/null
-# $Id$
-# vi:ts=4:et
-
-If you want to hack on pycurl, here's our list of unresolved issues:
-
-
-NEW FEATURES/IMPROVEMENTS:
-
- * Add docs to the high-level interface.
-
- * Add more options to the undocumented and currently mostly useless
- Curl.unsetopt() method. Have to carefully check the libcurl source
- code for each option we want to support.
-
- * curl_easy_reset() should probably be supported. But we have to be
- careful since curl_easy_reset() e.g. modifies callbacks and other
- pointers which could leave pycurl and libcurl out of sync.
-
-
-DEFICIENICES:
-
- * Using certain invalid options, it may be possible to cause a crash.
- This is un-Pythonic behaviour, but you somewhere have to draw a line
- between efficiency (and feature completeness) and safety.
- There _are_ quite a number of internal error checks, but tracking and
- catching all possible (deliberate) misuses is not a goal (and probably
- impossible anyway, due to the complexity of libcurl).
+++ /dev/null
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>PyCurl: Callbacks</title>
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
- <meta name="revisit-after" content="30 days" />
- <meta name="robots" content="noarchive, index, follow" />
-</head>
-<body>
-
-<h1>Callbacks</h1>
-
-<p>For more fine-grained control, libcurl allows a
-number of callbacks to be associated with each connection. In
-pycurl, callbacks are defined using the <code>setopt()</code> method for
-Curl objects with options WRITEFUNCTION, READFUNCTION, HEADERFUNCTION,
-PROGRESSFUNCTION, IOCTLFUNCTION, or DEBUGFUNCTION. These options
-correspond to the libcurl options with CURLOPT_* prefix removed. A
-callback in pycurl must be either a regular Python function, a class
-method or an extension type function.</p>
-
-<p>There are some limitations to some of the options which can be used
-concurrently with the pycurl callbacks compared to the libcurl callbacks.
-This is to allow different callback functions to be associated with
-different Curl objects. More specifically, WRITEDATA cannot
-be used with WRITEFUNCTION, READDATA cannot be used with READFUNCTION,
-WRITEHEADER cannot be used with HEADERFUNCTION, PROGRESSDATA cannot be
-used with PROGRESSFUNCTION, IOCTLDATA cannot be used with IOCTLFUNCTION,
-and DEBUGDATA cannot be used with DEBUGFUNCTION.
-In practice, these limitations can be overcome by having a callback
-function be a class instance method and rather use the class instance
-attributes to store per object data such as files used in the callbacks.
-</p>
-
-The signature of each callback used in pycurl is as follows:<br/>
-<br/>
-<code>WRITEFUNCTION(</code><em>string</em><code>) </code><em>-> number of characters written<br/>
-</em>
-<br/>
-<code>READFUNCTION(</code><em>number of characters to read</em><code>)</code><em>->
-string</em><br/>
-<br/>
-<code>HEADERFUNCTION(</code><em>string</em><code>)</code><em> -> number of characters written<br/>
-</em><br/>
-<code>PROGRESSFUNCTION(</code><em>download total, downloaded, upload total, uploaded</em><code>) </code><em>-> status</em><br/>
-<br/>
-<code>DEBUGFUNCTION(</code><em>debug message type, debug message string</em><code>)</code>
-<em>-> None<br/></em>
-<br/>
-<code>IOCTLFUNCTION(</code><em>ioctl cmd</em><code>)</code>
-<em>-> status<br/></em>
-<br/>
-<hr/>
-
-<h2>Example: Callbacks for document header and body</h2>
-
-<p>This example prints the header data to stderr and the body data to
-stdout. Also note that neither callback returns the number of bytes
-written. For WRITEFUNCTION and HEADERFUNCTION callbacks, returning
-None implies that all bytes where written.</p>
-
-<pre>
- ## Callback function invoked when body data is ready
- def body(buf):
- # Print body data to stdout
- import sys
- sys.stdout.write(buf)
- # Returning None implies that all bytes were written
-
- ## Callback function invoked when header data is ready
- def header(buf):
- # Print header data to stderr
- import sys
- sys.stderr.write(buf)
- # Returning None implies that all bytes were written
-
- c = pycurl.Curl()
- c.setopt(pycurl.URL, "http://www.python.org/")
- c.setopt(pycurl.WRITEFUNCTION, body)
- c.setopt(pycurl.HEADERFUNCTION, header)
- c.perform()
-</pre>
-
-<h2>Example: Download/upload progress callback</h2>
-
-<p>This example shows how to use the progress callback. When downloading
-a document, the arguments related to uploads are zero, and vice versa.</p>
-
-<pre>
- ## Callback function invoked when download/upload has progress
- def progress(download_t, download_d, upload_t, upload_d):
- print "Total to download", download_t
- print "Total downloaded", download_d
- print "Total to upload", upload_t
- print "Total uploaded", upload_d
-
- c.setopt(c.URL, "http://slashdot.org/")
- c.setopt(c.NOPROGRESS, 0)
- c.setopt(c.PROGRESSFUNCTION, progress)
- c.perform()
-</pre>
-
-<h2>Example: Debug callbacks</h2>
-
-<p>This example shows how to use the debug callback. The debug message
-type is an integer indicating the type of debug message. The
-VERBOSE option must be enabled for this callback to be invoked.</p>
-
-<pre>
- def test(debug_type, debug_msg):
- print "debug(%d): %s" % (debug_type, debug_msg)
-
- c = pycurl.Curl()
- c.setopt(pycurl.URL, "http://curl.haxx.se/")
- c.setopt(pycurl.VERBOSE, 1)
- c.setopt(pycurl.DEBUGFUNCTION, test)
- c.perform()
-</pre>
-
-<h2>Other examples</h2>
-The pycurl distribution also contains a number of test scripts and
-examples which show how to use the various callbacks in libcurl.
-For instance, the file 'examples/file_upload.py' in the distribution contains
-example code for using READFUNCTION, 'tests/test_cb.py' shows
-WRITEFUNCTION and HEADERFUNCTION, 'tests/test_debug.py' shows DEBUGFUNCTION,
-and 'tests/test_getinfo.py' shows PROGRESSFUNCTION.</p>
-
-
-<hr />
-<p>
- <a href="http://validator.w3.org/check/referer"><img align="right"
- src="http://www.w3.org/Icons/valid-xhtml10"
- alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a>
- $Id$
-</p>
-
-</body>
-</html>
+++ /dev/null
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>PycURL: CurlMulti Objects</title>
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
- <meta name="revisit-after" content="30 days" />
- <meta name="robots" content="noarchive, index, follow" />
-</head>
-<body>
-
-<h1>CurlMulti Object</h1>
-
-<p>CurlMulti objects have the following methods: </p>
-
-<dl>
-<dt><code>close()</code> -> <em>None</em></dt>
-<dd>
-<p>Corresponds to
-<a href="http://curl.haxx.se/libcurl/c/curl_multi_cleanup.html"><code>curl_multi_cleanup()</code></a> in libcurl.
-This method is automatically called by pycurl when a CurlMulti object no
-longer has any references to it, but can also be called
-explicitly.</p>
-</dd>
-
-<dt><code>perform()</code> -> <em>tuple of status and the number of active Curl objects</em></dt>
-<dd>
-<p>Corresponds to
-<a href="http://curl.haxx.se/libcurl/c/curl_multi_perform.html"><code>curl_multi_perform()</code></a> in libcurl.</p>
-</dd>
-
-<dt><code> add_handle(</code><em>Curl object</em><code>) </code>-> <em>None</em></dt>
-<dd>
-<p>Corresponds to
-<a href="http://curl.haxx.se/libcurl/c/curl_multi_add_handle.html"><code>curl_multi_add_handle()</code></a> in libcurl.
-This method adds an existing and valid Curl object to the CurlMulti
-object.</p>
-
-<p>IMPORTANT NOTE: add_handle does not implicitly add a Python reference
-to the Curl object (and thus does not increase the reference count on the Curl
-object).</p>
-</dd>
-
-<dt><code>remove_handle(</code><em>Curl object</em><code>)</code> -> <em>None</em></dt>
-<dd>
-<p>Corresponds to
-<a href="http://curl.haxx.se/libcurl/c/curl_multi_remove_handle.html"><code>curl_multi_remove_handle()</code></a> in libcurl.
-This method removes an existing and valid Curl object from the CurlMulti
-object.</p>
-
-<p>IMPORTANT NOTE: remove_handle does not implicitly remove a Python reference
-from the Curl object (and thus does not decrease the reference count on the Curl
-object).</p>
-</dd>
-
-<dt><code>fdset()</code> ->
-<em>triple of lists with active file descriptors,
-readable, writeable, exceptions.</em></dt>
-<dd>
-<p>Corresponds to
-<a href="http://curl.haxx.se/libcurl/c/curl_multi_fdset.html"><code>curl_multi_fdset()</code></a> in libcurl.
-This method extracts the file descriptor information from a CurlMulti object.
-The returned lists can be used with the <code>select</code> module to
-poll for events.</p>
-
-<p>Example usage:</p>
-
-<pre>
-import pycurl
-c = pycurl.Curl()
-c.setopt(pycurl.URL, "http://curl.haxx.se")
-m = pycurl.CurlMulti()
-m.add_handle(c)
-while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM: break
-while num_handles:
- apply(select.select, m.fdset() + (1,))
- while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM: break
-</pre>
-</dd>
-
-<dt><code>select(</code><em>[timeout]</em><code>)</code> ->
-<em>number of ready file descriptors or -1 on timeout</em></dt>
-<dd>
-<p>This is a convenience function which simplifies the combined
-use of <code>fdset()</code> and the <code>select</code> module.</p>
-
-<p>Example usage:</p>
-
-<pre>import pycurl
-c = pycurl.Curl()
-c.setopt(pycurl.URL, "http://curl.haxx.se")
-m = pycurl.CurlMulti()
-m.add_handle(c)
-while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM: break
-while num_handles:
- ret = m.select()
- if ret == -1: continue
- while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM: break
-</pre>
-</dd>
-
-<dt><code>info_read(</code><em>[max]</em><code>)</code> ->
-<em>numberof queued messages, a list of successful objects, a list of
-failed objects</em></dt>
-<dd>
-<p>Corresponds to the
-<a href="http://curl.haxx.se/libcurl/c/curl_multi_info_read.html"><code>curl_multi_info_read()</code></a> function in libcurl.
-This method extracts at most <em>max</em> messages
-from the multi stack and returns them in two lists. The first
-list contains the handles which completed successfully and the second
-list contains a tuple <em><curl object, curl error number, curl
-error message></em> for each failed curl object. The number
-of queued messages after this method has been called is also
-returned.</p>
-</dd>
-</dl>
-
-<hr />
-<p>
- <a href="http://validator.w3.org/check/referer"><img align="right"
- src="http://www.w3.org/Icons/valid-xhtml10"
- alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a>
- $Id$
-</p>
-
-</body>
-</html>
+++ /dev/null
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>PycURL: Curl Objects</title>
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
- <meta name="revisit-after" content="30 days" />
- <meta name="robots" content="noarchive, index, follow" />
-</head>
-<body>
-
-<h1>Curl Object</h1>
-
-<p>Curl objects have the following methods:</p>
-
-<dl>
-<dt><code>close()</code> -> <em>None</em></dt>
-<dd>
-<p>Corresponds to
-<a href="http://curl.haxx.se/libcurl/c/curl_easy_cleanup.html"><code>curl_easy_cleanup</code></a> in libcurl.
-This method is automatically called by pycurl when a Curl object no longer has
-any references to it, but can also be called explicitly.</p>
-</dd>
-
-<dt><code>perform()</code> -> <em>None</em></dt>
-<dd>
-<p>Corresponds to
-<a href="http://curl.haxx.se/libcurl/c/curl_easy_perform.html"><code>curl_easy_perform</code></a> in libcurl.</p>
-</dd>
-
-<dt><code>setopt(</code><em>option, value</em><code>)</code> -> <em>None</em></dt>
-<dd>
-
-<p>Corresponds to
-<a href="http://curl.haxx.se/libcurl/c/curl_easy_setopt.html"><code>curl_easy_setopt</code></a> in libcurl, where
-<em>option</em> is specified with the CURLOPT_* constants in libcurl,
-except that the CURLOPT_ prefix has been removed. The type for
-<em>value</em> depends on the option, and can be either a string,
-integer, long integer, file objects, lists, or functions.</p>
-
-<p>Example usage:</p>
-
-<pre>
-import pycurl
-c = pycurl.Curl()
-c.setopt(pycurl.URL, "http://www.python.org/")
-c.setopt(pycurl.HTTPHEADER, ["Accept:"])
-import StringIO
-b = StringIO.StringIO()
-c.setopt(pycurl.WRITEFUNCTION, b.write)
-c.setopt(pycurl.FOLLOWLOCATION, 1)
-c.setopt(pycurl.MAXREDIRS, 5)
-c.perform()
-print b.getvalue()
-...
-</pre>
-</dd>
-
-<dt><code>getinfo(</code><em>option</em><code>) </code>-> <em>Result</em></dt>
-<dd>
-
-<p>Corresponds to
-<a href="http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html"><code>curl_easy_getinfo</code></a> in libcurl, where
-<em>option</em> is the same as the CURLINFO_* constants in libcurl,
-except that the CURLINFO_ prefix has been removed.
-<em>Result</em> contains an integer, float or string, depending on
-which option is given. The <code>getinfo</code> method should
-not be called unless <code>perform</code> has been called and
-finished.</p>
-
-<p>Example usage:</p>
-
-<pre>
-import pycurl
-c = pycurl.Curl()
-c.setopt(pycurl.URL, "http://sf.net")
-c.setopt(pycurl.FOLLOWLOCATION, 1)
-c.perform()
-print c.getinfo(pycurl.HTTP_CODE), c.getinfo(pycurl.EFFECTIVE_URL)
-...
---> 200 "http://sourceforge.net/"
-</pre>
-</dd>
-
-<dt><code>errstr()</code> -> <em>String</em></dt>
-<dd>
-<p>Returns the internal libcurl error buffer of this handle as a string.</p>
-</dd>
-</dl>
-
-
-<hr />
-<p>
- <a href="http://validator.w3.org/check/referer"><img align="right"
- src="http://www.w3.org/Icons/valid-xhtml10"
- alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a>
- $Id$
-</p>
-
-</body>
-</html>
+++ /dev/null
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>PycURL Documentation</title>
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
- <meta name="revisit-after" content="30 days" />
- <meta name="robots" content="noarchive, index, follow" />
-</head>
-<body>
-
-<h1><tt>pycurl</tt> — A Python interface to the cURL library</h1>
-
-<p>The pycurl package is a Python interface to libcurl (<a
-href="http://curl.haxx.se/libcurl/">http://curl.haxx.se/libcurl/</a>). pycurl
-has been successfully built and tested with Python versions from
-2.2 to the current 2.4.x releases.</p>
-
-<p>libcurl is a client-side URL transfer library supporting FTP, FTPS,
-HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. libcurl
-also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploads, proxies,
-cookies, basic authentication, file transfer resume of FTP sessions, HTTP
-proxy tunneling and more.</p>
-
-<p>All the functionality provided by libcurl can used through the
-pycurl interface. The following subsections describe how to use the
-pycurl interface, and assume familiarity with how libcurl works. For
-information on how libcurl works, please consult the curl library web pages
-(<a href="http://curl.haxx.se/libcurl/c/">http://curl.haxx.se/libcurl/c/</a>).</p>
-
-<hr/>
-
-<h1>Module Functionality</h1>
-
-<dl>
-<dt><code>pycurl.global_init(</code><em>option</em><code>)</code> -><em>None</em></dt>
-
-<dd><p><em>option</em> is one of the constants
-pycurl.GLOBAL_SSL, pycurl.GLOBAL_WIN32, pycurl.GLOBAL_ALL,
-pycurl.GLOBAL_NOTHING, pycurl.GLOBAL_DEFAULT. Corresponds to
-<a href="http://curl.haxx.se/libcurl/c/curl_global_init.html"><code>curl_global_init()</code></a> in libcurl.</p>
-</dd>
-
-<dt><code>pycurl.global_cleanup()</code> -> <em>None</em></dt>
-<dd>
-<p>Corresponds to
-<a href="http://curl.haxx.se/libcurl/c/curl_global_cleanup.html"><code>curl_global_cleanup()</code></a> in libcurl.</p>
-</dd>
-
-<dt><code>pycurl.version</code></dt>
-
-<dd><p>This is a string with version information on libcurl,
-corresponding to
-<a href="http://curl.haxx.se/libcurl/c/curl_version.html"><code>curl_version()</code></a> in libcurl.</p>
-
-<p>Example usage:</p>
-<pre>
->>> import pycurl
->>> pycurl.version
-'libcurl/7.12.3 OpenSSL/0.9.7e zlib/1.2.2.1 libidn/0.5.12'
-</pre>
-</dd>
-
-<dt><code>pycurl.version_info()</code> -> <em>Tuple</em></dt>
-<dd>
-<p>Corresponds to
-<a href="http://curl.haxx.se/libcurl/c/curl_version_info.html"><code>curl_version_info()</code></a> in libcurl.
-Returns a tuple of information which is similar to the
-<code>curl_version_info_data</code> struct returned by
-<code>curl_version_info()</code> in libcurl.</p>
-
-<p>Example usage:</p>
-<pre>
->>> import pycurl
->>> pycurl.version_info()
-(2, '7.12.3', 461827, 'i586-pc-linux-gnu', 1565, 'OpenSSL/0.9.7e', 9465951,
-'1.2.2.1', ('ftp', 'gopher', 'telnet', 'dict', 'ldap', 'http', 'file',
-'https', 'ftps'), None, 0, '0.5.12')
-</pre>
-</dd>
-
-<dt><code>pycurl.Curl()</code> -> <em>Curl object</em></dt>
-<dd>
-<p>This function creates a new
-<a href="curlobject.html">Curl object</a> which corresponds to a
-<code>CURL</code> handle in libcurl. Curl objects automatically
-set CURLOPT_VERBOSE to 0, CURLOPT_NOPROGRESS to 1,
-provide a default CURLOPT_USERAGENT and setup
-CURLOPT_ERRORBUFFER to point to a private error buffer.</p>
-</dd>
-
-<dt><code>pycurl.CurlMulti()</code> -> <em>CurlMulti object</em></dt>
-<dd>
-<p>This function creates a new
-<a href="curlmultiobject.html">CurlMulti object</a> which corresponds to
-a <code>CURLM</code> handle in libcurl.</p>
-</dd>
-</dl>
-
-<hr/>
-
-<h1>Subsections</h1>
-
-<ul>
- <li><a href="curlobject.html">Curl objects</a></li>
- <li><a href="curlmultiobject.html">CurlMulti objects</a></li>
- <li><a href="callbacks.html">Callbacks</a></li>
-</ul>
-
-<hr />
-<p>
- <a href="http://validator.w3.org/check/referer"><img align="right"
- src="http://www.w3.org/Icons/valid-xhtml10"
- alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a>
- $Id$
-</p>
-
-</body>
-</html>
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import sys
-import pycurl
-
-class Test:
- def __init__(self):
- self.contents = ''
-
- def body_callback(self, buf):
- self.contents = self.contents + buf
-
-print >>sys.stderr, 'Testing', pycurl.version
-
-t = Test()
-c = pycurl.Curl()
-c.setopt(c.URL, 'http://curl.haxx.se/dev/')
-c.setopt(c.WRITEFUNCTION, t.body_callback)
-c.perform()
-c.close()
-
-print t.contents
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-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 len(sys.argv) < 3:
- print "Usage: %s <url> <file to upload>" % sys.argv[0]
- raise SystemExit
-url = sys.argv[1]
-filename = sys.argv[2]
-
-if not os.path.exists(filename):
- print "Error: the file '%s' does not exist" % filename
- raise SystemExit
-
-# Initialize pycurl
-c = pycurl.Curl()
-c.setopt(pycurl.URL, url)
-c.setopt(pycurl.UPLOAD, 1)
-
-# Two versions with the same semantics here, but the filereader version
-# is useful when you have to process the data which is read before returning
-if 1:
- c.setopt(pycurl.READFUNCTION, FileReader(open(filename, 'rb')).read_callback)
-else:
- c.setopt(pycurl.READFUNCTION, open(filename, 'rb').read)
-
-# Set size of file to be uploaded.
-filesize = os.path.getsize(filename)
-c.setopt(pycurl.INFILESIZE, filesize)
-
-# Start transfer
-print 'Uploading file %s to url %s' % (filename, url)
-c.perform()
-c.close()
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# 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 interface. Commands
-# are taken from the command line first, then standard input.
-#
-# The somewhat spotty coverage of status queries is because I only did the
-# ones that were either (a) easy, or (b) necessary. If you want to know the
-# status of the box, look at the web interface.
-#
-# This code has been tested against the following hardware:
-#
-# Hardware Firmware
-# ---------- ---------------------
-# BEFW11S4v2 1.44.2.1, Dec 20 2002
-#
-# The code is, of course, sensitive to changes in the names of CGI pages
-# and field names.
-#
-# Note: to make the no-arguments form work, you'll need to have the following
-# entry in your ~/.netrc file. If you have changed the router IP address or
-# name/password, modify accordingly.
-#
-# machine 192.168.1.1
-# login ""
-# password admin
-#
-# By Eric S. Raymond, August April 2003. All rites reversed.
-
-import sys, re, copy, curl, exceptions
-
-class LinksysError(exceptions.Exception):
- def __init__(self, *args):
- self.args = args
-
-class LinksysSession:
- months = 'Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec'
-
- WAN_CONNECT_AUTO = '1'
- WAN_CONNECT_STATIC = '2'
- WAN_CONNECT_PPOE = '3'
- WAN_CONNECT_RAS = '4'
- WAN_CONNECT_PPTP = '5'
- WAN_CONNECT_HEARTBEAT = '6'
-
- # Substrings to check for on each page load.
- # This may enable us to detect when a firmware change has hosed us.
- check_strings = {
- "": "basic setup functions",
- "Passwd.htm": "For security reasons,",
- "DHCP.html": "You can configure the router to act as a DHCP",
- "Log.html": "There are some log settings and lists in this page.",
- "Forward.htm":"Port forwarding can be used to set up public services",
- }
-
- def __init__(self):
- self.actions = []
- self.host = "http://192.168.1.1"
- self.verbosity = False
- self.pagecache = {}
-
- def set_verbosity(self, flag):
- self.verbosity = flag
-
- # This is not a performance hack -- we need the page cache to do
- # sanity checks at configure time.
- def cache_load(self, page):
- if page not in self.pagecache:
- fetch = curl.Curl(self.host)
- fetch.set_verbosity(self.verbosity)
- fetch.get(page)
- self.pagecache[page] = fetch.body()
- if fetch.answered("401"):
- raise LinksysError("authorization failure.", True)
- elif not fetch.answered(LinksysSession.check_strings[page]):
- del self.pagecache[page]
- raise LinksysError("check string for page %s missing!" % os.path.join(self.host, page), False)
- fetch.close()
- def cache_flush(self):
- self.pagecache = {}
-
- # Primitives
- def screen_scrape(self, page, template):
- self.cache_load(page)
- match = re.compile(template).search(self.pagecache[page])
- if match:
- result = match.group(1)
- else:
- result = None
- return result
- def get_MAC_address(self, page, prefix):
- return self.screen_scrape("", prefix+r":[^M]*\(MAC Address: *([^)]*)")
- def set_flag(page, flag, value):
- if value:
- self.actions.append(page, flag, "1")
- else:
- self.actions.append(page, flag, "0")
- def set_IP_address(self, page, cgi, role, ip):
- ind = 0
- for octet in ip.split("."):
- self.actions.append(("", "F1", role + `ind+1`, octet))
- ind += 1
-
- # Scrape configuration data off the main page
- def get_firmware_version(self):
- # This is fragile. There is no distinguishing tag before the firmware
- # version, so we have to key off the pattern of the version number.
- # Our model is ">1.44.2.1, Dec 20 2002<"
- return self.screen_scrape("", ">([0-9.v]*, (" + \
- LinksysSession.months + ")[^<]*)<", )
- def get_LAN_MAC(self):
- return self.get_MAC_address("", r"LAN IP Address")
- def get_Wireless_MAC(self):
- return self.get_MAC_address("", r"Wireless")
- def get_WAN_MAC(self):
- return self.get_MAC_address("", r"WAN Connection Type")
-
- # Set configuration data on the main page
- def set_host_name(self, name):
- self.actions.append(("", "hostName", name))
- def set_domain_name(self, name):
- self.actions.append(("", "DomainName", name))
- def set_LAN_IP(self, ip):
- self.set_IP_address("", "ipAddr", ip)
- def set_LAN_netmask(self, ip):
- if not ip.startswith("255.255.255."):
- raise ValueError
- lastquad = ip.split(".")[-1]
- if lastquad not in ("0", "128", "192", "240", "252"):
- raise ValueError
- self.actions.append("", "netMask", lastquad)
- def set_wireless(self, flag):
- self.set_flag("", "wirelessStatus")
- def set_SSID(self, ssid):
- self.actions.append(("", "wirelessESSID", ssid))
- def set_SSID_broadcast(self, flag):
- self.set_flag("", "broadcastSSID")
- def set_channel(self, channel):
- self.actions.append(("", "wirelessChannel", channel))
- def set_WEP(self, flag):
- self.set_flag("", "WepType")
- # FIXME: Add support for setting WEP keys
- def set_connection_type(self, type):
- self.actions.append(("", "WANConnectionType", type))
- def set_WAN_IP(self, ip):
- self.set_IP_address("", "aliasIP", ip)
- def set_WAN_netmask(self, ip):
- self.set_IP_address("", "aliasMaskIP", ip)
- def set_WAN_gateway_address(self, ip):
- self.set_IP_address("", "routerIP", ip)
- def set_DNS_server(self, index, ip):
- self.set_IP_address("", "dns" + "ABC"[index], ip)
-
- # Set configuration data on the password page
- def set_password(self, str):
- self.actions.append("Passwd.htm","sysPasswd", str)
- self.actions.append("Passwd.htm","sysPasswdConfirm", str)
- def set_UPnP(self, flag):
- self.set_flag("Passwd.htm", "UPnP_Work")
- def reset(self):
- self.actions.append("Passwd.htm", "FactoryDefaults")
-
- # DHCP features
- def set_DHCP(self, flag):
- if flag:
- self.actions.append("DHCP.htm","dhcpStatus","Enable")
- else:
- self.actions.append("DHCP.htm","dhcpStatus","Disable")
- def set_DHCP_starting_IP(self, val):
- self.actions.append("DHCP.htm","dhcpS4", str(val))
- def set_DHCP_users(self, val):
- self.actions.append("DHCP.htm","dhcpLen", str(val))
- def set_DHCP_lease_time(self, val):
- self.actions.append("DHCP.htm","leaseTime", str(val))
- def set_DHCP_DNS_server(self, index, ip):
- self.set_IP_address("DHCP.htm", "dns" + "ABC"[index], ip)
- # FIXME: add support for setting WINS key
-
- # Logging features
- def set_logging(self, flag):
- if flag:
- self.actions.append("Log.htm", "rLog", "Enable")
- else:
- self.actions.append("Log.htm", "rLog", "Disable")
- def set_log_address(self, val):
- self.actions.append("DHCP.htm","trapAddr3", str(val))
-
- # The AOL parental control flag is not supported by design.
-
- # FIXME: add Filters and other advanced features
-
- def configure(self):
- "Write configuration changes to the Linksys."
- if self.actions:
- fields = []
- self.cache_flush()
- for (page, field, value) in self.actions:
- self.cache_load(page)
- if self.pagecache[page].find(field) == -1:
- print >>sys.stderr, "linksys: field %s not found where expected in page %s!" % (field, os.path.join(self.host, page))
- continue
- else:
- fields.append((field, value))
- # Clearing the action list before fieldsping is deliberate.
- # Otherwise we could get permanently wedged by a 401.
- self.actions = []
- transaction = curl.Curl(self.host)
- transaction.set_verbosity(self.verbosity)
- transaction.get("Gozila.cgi", tuple(fields))
- transaction.close()
-
-if __name__ == "__main__":
- import os, cmd
-
- class LinksysInterpreter(cmd.Cmd):
- """Interpret commands to perform LinkSys programming actions."""
- def __init__(self):
- self.session = LinksysSession()
- if os.isatty(0):
- import readline
- print "Type ? or `help' for help."
- self.prompt = self.session.host + ": "
- else:
- self.prompt = ""
- print "Bar1"
-
- def flag_command(self, func):
- if line.strip() in ("on", "enable", "yes"):
- func(True)
- elif line.strip() in ("off", "disable", "no"):
- func(False)
- else:
- print >>sys.stderr, "linksys: unknown switch value"
- return 0
-
- def do_connect(self, line):
- newhost = line.strip()
- if newhost:
- self.session.host = newhost
- self.session.cache_flush()
- self.prompt = self.session.host + ": "
- else:
- print self.session.host
- return 0
- def help_connect(self):
- print "Usage: connect [<hostname-or-IP>]"
- print "Connect to a Linksys by name or IP address."
- print "If no argument is given, print the current host."
-
- def do_status(self, line):
- self.session.cache_load("")
- if "" in self.session.pagecache:
- print "Firmware:", self.session.get_firmware_version()
- print "LAN MAC:", self.session.get_LAN_MAC()
- print "Wireless MAC:", self.session.get_Wireless_MAC()
- print "WAN MAC:", self.session.get_WAN_MAC()
- print "."
- return 0
- def help_status(self):
- print "Usage: status"
- print "The status command shows the status of the Linksys."
- print "It is mainly useful as a sanity check to make sure"
- print "the box is responding correctly."
-
- def do_verbose(self, line):
- self.flag_command(self.session.set_verbosity)
- def help_verbose(self):
- print "Usage: verbose {on|off|enable|disable|yes|no}"
- print "Enables display of HTTP requests."
-
- def do_host(self, line):
- self.session.set_host_name(line)
- return 0
- def help_host(self):
- print "Usage: host <hostname>"
- print "Sets the Host field to be queried by the ISP."
-
- def do_domain(self, line):
- print "Usage: host <domainname>"
- self.session.set_domain_name(line)
- return 0
- def help_domain(self):
- print "Sets the Domain field to be queried by the ISP."
-
- def do_lan_address(self, line):
- self.session.set_LAN_IP(line)
- return 0
- def help_lan_address(self):
- print "Usage: lan_address <ip-address>"
- print "Sets the LAN IP address."
-
- def do_lan_netmask(self, line):
- self.session.set_LAN_netmask(line)
- return 0
- def help_lan_netmask(self):
- print "Usage: lan_netmask <ip-mask>"
- print "Sets the LAN subnetwork mask."
-
- def do_wireless(self, line):
- self.flag_command(self.session.set_wireless)
- return 0
- def help_wireless(self):
- print "Usage: wireless {on|off|enable|disable|yes|no}"
- print "Switch to enable or disable wireless features."
-
- def do_ssid(self, line):
- self.session.set_SSID(line)
- return 0
- def help_ssid(self):
- print "Usage: ssid <string>"
- print "Sets the SSID used to control wireless access."
-
- def do_ssid_broadcast(self, line):
- self.flag_command(self.session.set_SSID_broadcast)
- return 0
- def help_ssid_broadcast(self):
- print "Usage: ssid_broadcast {on|off|enable|disable|yes|no}"
- print "Switch to enable or disable SSID broadcast."
-
- def do_channel(self, line):
- self.session.set_channel(line)
- return 0
- def help_channel(self):
- print "Usage: channel <number>"
- print "Sets the wireless channel."
-
- def do_wep(self, line):
- self.flag_command(self.session.set_WEP)
- return 0
- def help_wep(self):
- print "Usage: wep {on|off|enable|disable|yes|no}"
- print "Switch to enable or disable WEP security."
-
- def do_wan_type(self, line):
- try:
- type=eval("LinksysSession.WAN_CONNECT_"+line.strip().upper())
- self.session.set_connection_type(type)
- except ValueError:
- print >>sys.stderr, "linksys: unknown connection type."
- return 0
- def help_wan_type(self):
- print "Usage: wan_type {auto|static|ppoe|ras|pptp|heartbeat}"
- print "Set the WAN connection type."
-
- def do_wan_address(self, line):
- self.session.set_WAN_IP(line)
- return 0
- def help_wan_address(self):
- print "Usage: wan_address <ip-address>"
- print "Sets the WAN IP address."
-
- def do_wan_netmask(self, line):
- self.session.set_WAN_netmask(line)
- return 0
- def help_wan_netmask(self):
- print "Usage: wan_netmask <ip-mask>"
- print "Sets the WAN subnetwork mask."
-
- def do_wan_gateway(self, line):
- self.session.set_WAN_gateway(line)
- return 0
- def help_wan_gateway(self):
- print "Usage: wan_gateway <ip-address>"
- print "Sets the LAN subnetwork mask."
-
- def do_dns(self, line):
- (index, address) = line.split()
- if index in ("1", "2", "3"):
- self.session.set_DNS_server(eval(index), address)
- else:
- print >>sys.stderr, "linksys: server index out of bounds."
- return 0
- def help_dns(self):
- print "Usage: dns {1|2|3} <ip-mask>"
- print "Sets a primary, secondary, or tertiary DNS server address."
-
- def do_password(self, line):
- self.session.set_password(line)
- return 0
- def help_password(self):
- print "Usage: password <string>"
- print "Sets the router password."
-
- def do_upnp(self, line):
- self.flag_command(self.session.set_UPnP)
- return 0
- def help_upnp(self):
- print "Usage: upnp {on|off|enable|disable|yes|no}"
- print "Switch to enable or disable Universal Plug and Play."
-
- def do_reset(self, line):
- self.session.reset()
- def help_reset(self):
- print "Usage: reset"
- print "Reset Linksys settings to factory defaults."
-
- def do_dhcp(self, line):
- self.flag_command(self.session.set_DHCP)
- def help_dhcp(self):
- print "Usage: dhcp {on|off|enable|disable|yes|no}"
- print "Switch to enable or disable DHCP features."
-
- def do_dhcp_start(self, line):
- self.session.set_DHCP_starting_IP(line)
- def help_dhcp_start(self):
- print "Usage: dhcp_start <number>"
- print "Set the start address of the DHCP pool."
-
- def do_dhcp_users(self, line):
- self.session.set_DHCP_users(line)
- def help_dhcp_users(self):
- print "Usage: dhcp_users <number>"
- print "Set number of address slots to allocate in the DHCP pool."
-
- def do_dhcp_lease(self, line):
- self.session.set_DHCP_lease(line)
- def help_dhcp_lease(self):
- print "Usage: dhcp_lease <number>"
- print "Set number of address slots to allocate in the DHCP pool."
-
- def do_dhcp_dns(self, line):
- (index, address) = line.split()
- if index in ("1", "2", "3"):
- self.session.set_DHCP_DNS_server(eval(index), address)
- else:
- print >>sys.stderr, "linksys: server index out of bounds."
- return 0
- def help_dhcp_dns(self):
- print "Usage: dhcp_dns {1|2|3} <ip-mask>"
- print "Sets primary, secondary, or tertiary DNS server address."
-
- def do_logging(self, line):
- self.flag_command(self.session.set_logging)
- def help_logging(self):
- print "Usage: logging {on|off|enable|disable|yes|no}"
- print "Switch to enable or disable session logging."
-
- def do_log_address(self, line):
- self.session.set_Log_address(line)
- def help_log_address(self):
- print "Usage: log_address <number>"
- print "Set the last quad of the address to which to log."
-
- def do_configure(self, line):
- self.session.configure()
- return 0
- def help_configure(self):
- print "Usage: configure"
- print "Writes the configuration to the Linksys."
-
- def do_cache(self, line):
- print self.session.pagecache
- def help_cache(self):
- print "Usage: cache"
- print "Display the page cache."
-
- def do_quit(self, line):
- return 1
- def help_quit(self, line):
- print "The quit command ends your linksys session without"
- print "writing configuration changes to the Linksys."
- def do_EOF(self, line):
- print ""
- self.session.configure()
- return 1
- def help_EOF(self):
- print "The EOF command writes the configuration to the linksys"
- print "and ends your session."
-
- def default(self, line):
- """Pass the command through to be executed by the shell."""
- os.system(line)
- return 0
-
- def help_help(self):
- print "On-line help is available through this command."
- print "? is a convenience alias for help."
-
- def help_introduction(self):
- print """\
-
-This program supports changing the settings on Linksys blue-box routers. This
-capability may come in handy when they freeze up and have to be reset. Though
-it can be used interactively (and will command-prompt when standard input is a
-terminal) it is really designed to be used in batch mode. Commands are taken
-from the command line first, then standard input.
-
-By default, it is assumed that the Linksys is at http://192.168.1.1, the
-default LAN address. You can connect to a different address or IP with the
-'connect' command. Note that your .netrc must contain correct user/password
-credentials for the router. The entry corresponding to the defaults is:
-
-machine 192.168.1.1
- login ""
- password admin
-
-Most commands queue up changes but don't actually send them to the Linksys.
-You can force pending changes to be written with 'configure'. Otherwise, they
-will be shipped to the Linksys at the end of session (e.g. when the program
-running in batch mode encounters end-of-file or you type a control-D). If you
-end the session with `quit', pending changes will be discarded.
-
-For more help, read the topics 'wan', 'lan', and 'wireless'."""
-
- def help_lan(self):
- print """\
-The `lan_address' and `lan_netmask' commands let you set the IP location of
-the Linksys on your LAN, or inside. Normally you'll want to leave these
-untouched."""
-
- def help_wan(self):
- print """\
-The WAN commands become significant if you are using the BEFSR41 or any of
-the other Linksys boxes designed as DSL or cable-modem gateways. You will
-need to use `wan_type' to declare how you expect to get your address.
-
-If your ISP has issued you a static address, you'll need to use the
-`wan_address', `wan_netmask', and `wan_gateway' commands to set the address
-of the router as seen from the WAN, the outside. In this case you will also
-need to use the `dns' command to declare which remote servers your DNS
-requests should be forwarded to.
-
-Some ISPs may require you to set host and domain for use with dynamic-address
-allocation."""
-
- def help_wireless(self):
- print """\
-The channel, ssid, ssid_broadcast, wep, and wireless commands control
-wireless routing."""
-
- def help_switches(self):
- print "Switches may be turned on with 'on', 'enable', or 'yes'."
- print "Switches may be turned off with 'off', 'disable', or 'no'."
- print "Switch commands include: wireless, ssid_broadcast."
-
- def help_addresses(self):
- print "An address argument must be a valid IP address;"
- print "four decimal numbers separated by dots, each "
- print "between 0 and 255."
-
- def emptyline(self):
- pass
-
- interpreter = LinksysInterpreter()
- for arg in sys.argv[1:]:
- interpreter.onecmd(arg)
- fatal = False
- while not fatal:
- try:
- interpreter.cmdloop()
- fatal = True
- except LinksysError, (message, fatal):
- print "linksys:", message
-
-# The following sets edit modes for GNU EMACS
-# Local Variables:
-# mode:python
-# End:
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-#
-# 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
- from signal import SIGPIPE, SIG_IGN
- signal.signal(signal.SIGPIPE, signal.SIG_IGN)
-except ImportError:
- pass
-
-
-# Get args
-num_conn = 10
-try:
- if sys.argv[1] == "-":
- urls = sys.stdin.readlines()
- else:
- urls = open(sys.argv[1]).readlines()
- if len(sys.argv) >= 3:
- num_conn = int(sys.argv[2])
-except:
- print "Usage: %s <file with URLs to fetch> [<# of concurrent connections>]" % sys.argv[0]
- raise SystemExit
-
-
-# Make a queue with (url, filename) tuples
-queue = []
-for url in urls:
- url = url.strip()
- if not url or url[0] == "#":
- continue
- filename = "doc_%03d.dat" % (len(queue) + 1)
- queue.append((url, filename))
-
-
-# Check args
-assert queue, "no URLs given"
-num_urls = len(queue)
-num_conn = min(num_conn, num_urls)
-assert 1 <= num_conn <= 10000, "invalid number of concurrent connections"
-print "PycURL %s (compiled against 0x%x)" % (pycurl.version, pycurl.COMPILE_LIBCURL_VERSION_NUM)
-print "----- Getting", num_urls, "URLs using", num_conn, "connections -----"
-
-
-# Pre-allocate a list of curl objects
-m = pycurl.CurlMulti()
-m.handles = []
-for i in range(num_conn):
- c = pycurl.Curl()
- c.fp = None
- c.setopt(pycurl.FOLLOWLOCATION, 1)
- c.setopt(pycurl.MAXREDIRS, 5)
- c.setopt(pycurl.CONNECTTIMEOUT, 30)
- c.setopt(pycurl.TIMEOUT, 300)
- c.setopt(pycurl.NOSIGNAL, 1)
- m.handles.append(c)
-
-
-# Main loop
-freelist = m.handles[:]
-num_processed = 0
-while num_processed < num_urls:
- # If there is an url to process and a free curl object, add to multi stack
- while queue and freelist:
- url, filename = queue.pop(0)
- c = freelist.pop()
- c.fp = open(filename, "wb")
- c.setopt(pycurl.URL, url)
- c.setopt(pycurl.WRITEDATA, c.fp)
- m.add_handle(c)
- # store some info
- c.filename = filename
- c.url = url
- # Run the internal curl state machine for the multi stack
- while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM:
- break
- # Check for curl objects which have terminated, and add them to the freelist
- while 1:
- num_q, ok_list, err_list = m.info_read()
- for c in ok_list:
- c.fp.close()
- c.fp = None
- m.remove_handle(c)
- print "Success:", c.filename, c.url, c.getinfo(pycurl.EFFECTIVE_URL)
- freelist.append(c)
- for c, errno, errmsg in err_list:
- c.fp.close()
- c.fp = None
- m.remove_handle(c)
- print "Failed: ", c.filename, c.url, errno, errmsg
- freelist.append(c)
- num_processed = num_processed + len(ok_list) + len(err_list)
- if num_q == 0:
- break
- # Currently no more I/O is pending, could do something in the meantime
- # (display a progress bar, etc.).
- # We just call select() to sleep until some more data is available.
- m.select()
-
-
-# Cleanup
-for c in m.handles:
- if c.fp is not None:
- c.fp.close()
- c.fp = None
- c.close()
-m.close()
-
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-#
-# Usage: python retriever.py <file with URLs to fetch> [<# of
-# concurrent connections>]
-#
-
-import sys, threading, Queue
-import pycurl
-
-# We should ignore SIGPIPE when using pycurl.NOSIGNAL - see
-# the libcurl tutorial for more info.
-try:
- import signal
- from signal import SIGPIPE, SIG_IGN
- signal.signal(signal.SIGPIPE, signal.SIG_IGN)
-except ImportError:
- pass
-
-
-# Get args
-num_conn = 10
-try:
- if sys.argv[1] == "-":
- urls = sys.stdin.readlines()
- else:
- urls = open(sys.argv[1]).readlines()
- if len(sys.argv) >= 3:
- num_conn = int(sys.argv[2])
-except:
- print "Usage: %s <file with URLs to fetch> [<# of concurrent connections>]" % sys.argv[0]
- raise SystemExit
-
-
-# Make a queue with (url, filename) tuples
-queue = Queue.Queue()
-for url in urls:
- url = url.strip()
- if not url or url[0] == "#":
- continue
- filename = "doc_%03d.dat" % (len(queue.queue) + 1)
- queue.put((url, filename))
-
-
-# Check args
-assert queue.queue, "no URLs given"
-num_urls = len(queue.queue)
-num_conn = min(num_conn, num_urls)
-assert 1 <= num_conn <= 10000, "invalid number of concurrent connections"
-print "PycURL %s (compiled against 0x%x)" % (pycurl.version, pycurl.COMPILE_LIBCURL_VERSION_NUM)
-print "----- Getting", num_urls, "URLs using", num_conn, "connections -----"
-
-
-class WorkerThread(threading.Thread):
- def __init__(self, queue):
- threading.Thread.__init__(self)
- self.queue = queue
-
- def run(self):
- while 1:
- try:
- url, filename = self.queue.get_nowait()
- except Queue.Empty:
- raise SystemExit
- fp = open(filename, "wb")
- curl = pycurl.Curl()
- curl.setopt(pycurl.URL, url)
- curl.setopt(pycurl.FOLLOWLOCATION, 1)
- curl.setopt(pycurl.MAXREDIRS, 5)
- curl.setopt(pycurl.CONNECTTIMEOUT, 30)
- curl.setopt(pycurl.TIMEOUT, 300)
- curl.setopt(pycurl.NOSIGNAL, 1)
- curl.setopt(pycurl.WRITEDATA, fp)
- try:
- curl.perform()
- except:
- import traceback
- traceback.print_exc(file=sys.stderr)
- sys.stderr.flush()
- curl.close()
- fp.close()
- sys.stdout.write(".")
- sys.stdout.flush()
-
-
-# Start a bunch of threads
-threads = []
-for dummy in range(num_conn):
- t = WorkerThread(queue)
- t.start()
- threads.append(t)
-
-
-# Wait for all threads to finish
-for thread in threads:
- thread.join()
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# 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 ~/.netrc entry for sourceforge.net,
-# you can just give the project ID.
-#
-# By Eric S. Raymond, August 2002. All rites reversed.
-
-import os, sys, netrc
-import curl
-
-assert sys.version[:3] >= "2.2", "requires Python 2.2 or better"
-
-class SourceForgeUserSession(curl.Curl):
- # SourceForge-specific methods. Sensitive to changes in site design.
- def login(self, name, password):
- "Establish a login session."
- self.post("account/login.php", (("form_loginname", name),
- ("form_pw", password),
- ("return_to", ""),
- ("stay_in_ssl", "1"),
- ("login", "Login With SSL")))
- def logout(self):
- "Log out of SourceForge."
- self.get("account/logout.php")
- def fetch_xml(self, numid):
- self.get("export/xml_export.php?group_id=%s" % numid)
-
-if __name__ == "__main__":
- if len(sys.argv) == 1:
- project_id = '28236' # PyCurl project ID
- else:
- project_id = sys.argv[1]
- # Try to grab authenticators out of your .netrc
- try:
- auth = netrc.netrc().authenticators("sourceforge.net")
- name, account, password = auth
- except:
- name = sys.argv[2]
- password = sys.argv[3]
- session = SourceForgeUserSession("https://sourceforge.net/")
- session.set_verbosity(0)
- session.login(name, password)
- # Login could fail.
- if session.answered("Invalid Password or User Name"):
- sys.stderr.write("Login/password not accepted (%d bytes)\n" % len(session.body()))
- sys.exit(1)
- # We'll see this if we get the right thing.
- elif session.answered("Personal Page For: " + name):
- session.fetch_xml(project_id)
- sys.stdout.write(session.body())
- session.logout()
- sys.exit(0)
- # Or maybe SourceForge has changed its site design so our check strings
- # are no longer valid.
- else:
- sys.stderr.write("Unexpected page (%d bytes)\n"%len(session.body()))
- sys.exit(1)
-
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-# We should ignore SIGPIPE when using pycurl.NOSIGNAL - see
-# the libcurl tutorial for more info.
-try:
- import signal
- from signal import SIGPIPE, SIG_IGN
- signal.signal(signal.SIGPIPE, signal.SIG_IGN)
-except ImportError:
- pass
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
-import xmlrpclib, pycurl
-
-
-class CURLTransport(xmlrpclib.Transport):
- """Handles a cURL HTTP transaction to an XML-RPC server."""
-
- xmlrpc_h = [ "Content-Type: text/xml" ]
-
- def __init__(self, username=None, password=None):
- self.c = pycurl.Curl()
- self.c.setopt(pycurl.POST, 1)
- self.c.setopt(pycurl.NOSIGNAL, 1)
- self.c.setopt(pycurl.CONNECTTIMEOUT, 30)
- self.c.setopt(pycurl.HTTPHEADER, self.xmlrpc_h)
- if username != None and password != None:
- self.c.setopt(pycurl.USERPWD, '%s:%s' % (username, password))
-
- def request(self, host, handler, request_body, verbose=0):
- b = StringIO()
- self.c.setopt(pycurl.URL, 'http://%s%s' % (host, handler))
- self.c.setopt(pycurl.POSTFIELDS, request_body)
- self.c.setopt(pycurl.WRITEFUNCTION, b.write)
- self.c.setopt(pycurl.VERBOSE, verbose)
- self.verbose = verbose
- try:
- self.c.perform()
- except pycurl.error, v:
- raise xmlrpclib.ProtocolError(
- host + handler,
- v[0], v[1], None
- )
- b.seek(0)
- return self.parse_response(b)
-
-
-if __name__ == "__main__":
- ## Test
- server = xmlrpclib.ServerProxy("http://betty.userland.com",
- transport=CURLTransport())
- print server
- try:
- print server.examples.getStateName(41)
- except xmlrpclib.Error, v:
- print "ERROR", v
+++ /dev/null
-# A high-level interface to the pycurl extension
-#
-# ** mfx NOTE: the CGI class uses "black magic" using COOKIEFILE in
-# combination with a non-existant file name. See the libcurl docs
-# for more info.
-#
-# If you want thread-safe operation, you'll have to set the NOSIGNAL option
-# yourself.
-#
-# By Eric S. Raymond, April 2003.
-
-import os, sys, urllib, exceptions, mimetools, pycurl
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
-
-
-class Curl:
- "High-level interface to cURL functions."
- def __init__(self, base_url="", fakeheaders=[]):
- self.handle = pycurl.Curl()
- # These members might be set.
- self.set_url(base_url)
- self.verbosity = 0
- self.fakeheaders = fakeheaders
- # Nothing past here should be modified by the caller.
- self.payload = ""
- self.header = StringIO()
- # Verify that we've got the right site; harmless on a non-SSL connect.
- self.set_option(pycurl.SSL_VERIFYHOST, 2)
- # Follow redirects in case it wants to take us to a CGI...
- self.set_option(pycurl.FOLLOWLOCATION, 1)
- self.set_option(pycurl.MAXREDIRS, 5)
- # Setting this option with even a nonexistent file makes libcurl
- # handle cookie capture and playback automatically.
- self.set_option(pycurl.COOKIEFILE, "/dev/null")
- # Set timeouts to avoid hanging too long
- self.set_timeout(30)
- # Use password identification from .netrc automatically
- self.set_option(pycurl.NETRC, 1)
- # Set up a callback to capture the payload
- def payload_callback(x):
- self.payload += x
- self.set_option(pycurl.WRITEFUNCTION, payload_callback)
- def header_callback(x):
- self.header.write(x)
- self.set_option(pycurl.HEADERFUNCTION, header_callback)
-
- def set_timeout(self, timeout):
- "Set timeout for connect and object retrieval (applies for both)"
- self.set_option(pycurl.CONNECTTIMEOUT, timeout)
- self.set_option(pycurl.TIMEOUT, timeout)
-
- def set_url(self, url):
- "Set the base URL to be retrieved."
- self.base_url = url
- self.set_option(pycurl.URL, self.base_url)
-
- def set_option(self, *args):
- "Set an option on the retrieval,"
- apply(self.handle.setopt, args)
-
- def set_verbosity(self, level):
- "Set verbosity to 1 to see transactions."
- self.set_option(pycurl.VERBOSE, level)
-
- def __request(self, relative_url=None):
- "Perform the pending request."
- if self.fakeheaders:
- self.set_option(pycurl.HTTPHEADER, self.fakeheaders)
- if relative_url:
- self.set_option(pycurl.URL,os.path.join(self.base_url,relative_url))
- self.header.seek(0,0)
- self.payload = ""
- self.handle.perform()
- return self.payload
-
- def get(self, url="", params=None):
- "Ship a GET request for a specified URL, capture the response."
- if params:
- url += "?" + urllib.urlencode(params)
- self.set_option(pycurl.HTTPGET, 1)
- return self.__request(url)
-
- def post(self, cgi, params):
- "Ship a POST request to a specified CGI, capture the response."
- self.set_option(pycurl.POST, 1)
- self.set_option(pycurl.POSTFIELDS, urllib.urlencode(params))
- return self.__request(cgi)
-
- def body(self):
- "Return the body from the last response."
- return self.payload
-
- def info(self):
- "Return an RFC822 object with info on the page."
- self.header.seek(0,0)
- url = self.handle.getinfo(pycurl.EFFECTIVE_URL)
- if url[:5] == 'http:':
- self.header.readline()
- m = mimetools.Message(self.header)
- else:
- m = mimetools.Message(StringIO())
- m['effective-url'] = url
- m['http-code'] = str(self.handle.getinfo(pycurl.HTTP_CODE))
- m['total-time'] = str(self.handle.getinfo(pycurl.TOTAL_TIME))
- m['namelookup-time'] = str(self.handle.getinfo(pycurl.NAMELOOKUP_TIME))
- m['connect-time'] = str(self.handle.getinfo(pycurl.CONNECT_TIME))
- m['pretransfer-time'] = str(self.handle.getinfo(pycurl.PRETRANSFER_TIME))
- m['redirect-time'] = str(self.handle.getinfo(pycurl.REDIRECT_TIME))
- m['redirect-count'] = str(self.handle.getinfo(pycurl.REDIRECT_COUNT))
- m['size-upload'] = str(self.handle.getinfo(pycurl.SIZE_UPLOAD))
- m['size-download'] = str(self.handle.getinfo(pycurl.SIZE_DOWNLOAD))
- m['speed-upload'] = str(self.handle.getinfo(pycurl.SPEED_UPLOAD))
- m['header-size'] = str(self.handle.getinfo(pycurl.HEADER_SIZE))
- m['request-size'] = str(self.handle.getinfo(pycurl.REQUEST_SIZE))
- m['content-length-download'] = str(self.handle.getinfo(pycurl.CONTENT_LENGTH_DOWNLOAD))
- m['content-length-upload'] = str(self.handle.getinfo(pycurl.CONTENT_LENGTH_UPLOAD))
- m['content-type'] = (self.handle.getinfo(pycurl.CONTENT_TYPE) or '').strip(';')
- return m
-
- def answered(self, check):
- "Did a given check string occur in the last payload?"
- return self.payload.find(check) >= 0
-
- def close(self):
- "Close a session, freeing resources."
- self.handle.close()
- self.header.close()
-
- def __del__(self):
- self.close()
-
-
-if __name__ == "__main__":
- if len(sys.argv) < 2:
- url = 'http://curl.haxx.se'
- else:
- url = sys.argv[1]
- c = Curl()
- c.get(url)
- print c.body()
- print '='*74 + '\n'
- print c.info()
- c.close()
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-"""Setup script for the PycURL module distribution."""
-
-PACKAGE = "pycurl"
-PY_PACKAGE = "curl"
-VERSION = "7.13.1"
-
-import glob, os, re, sys, string
-import distutils
-from distutils.core import setup
-from distutils.extension import Extension
-from distutils.util import split_quoted
-from distutils.version import LooseVersion
-
-include_dirs = []
-define_macros = []
-library_dirs = []
-libraries = []
-runtime_library_dirs = []
-extra_objects = []
-extra_compile_args = []
-extra_link_args = []
-
-
-def scan_argv(s, default):
- p = default
- i = 1
- while i < len(sys.argv):
- arg = sys.argv[i]
- if string.find(arg, s) == 0:
- p = arg[len(s):]
- assert p, arg
- del sys.argv[i]
- else:
- i = i + 1
- ##print sys.argv
- return p
-
-
-# append contents of an environment variable to library_dirs[]
-def add_libdirs(envvar, sep, fatal=0):
- v = os.environ.get(envvar)
- if not v:
- return
- for dir in string.split(v, sep):
- dir = string.strip(dir)
- if not dir:
- continue
- dir = os.path.normpath(dir)
- if os.path.isdir(dir):
- if not dir in library_dirs:
- library_dirs.append(dir)
- elif fatal:
- print "FATAL: bad directory %s in environment variable %s" % (dir, envvar)
- sys.exit(1)
-
-
-if sys.platform == "win32":
- # Windows users have to configure the CURL_DIR path parameter to match
- # their cURL source installation. The path set here is just an example
- # and thus unlikely to match your installation.
- CURL_DIR = r"c:\src\build\pycurl\curl-7.13.1"
- CURL_DIR = scan_argv("--curl-dir=", CURL_DIR)
- print "Using curl directory:", CURL_DIR
- assert os.path.isdir(CURL_DIR), "please check CURL_DIR in setup.py"
- include_dirs.append(os.path.join(CURL_DIR, "include"))
- extra_objects.append(os.path.join(CURL_DIR, "lib", "libcurl.lib"))
- extra_link_args.extend(["gdi32.lib", "winmm.lib", "ws2_32.lib",])
- add_libdirs("LIB", ";")
- if string.find(sys.version, "MSC") >= 0:
- extra_compile_args.append("-O2")
- extra_compile_args.append("-GF") # enable read-only string pooling
- extra_compile_args.append("-WX") # treat warnings as errors
- extra_link_args.append("/opt:nowin98") # use small section alignment
-else:
- # Find out the rest the hard way
- CURL_CONFIG = "curl-config"
- CURL_CONFIG = scan_argv("--curl-config=", CURL_CONFIG)
- d = os.popen("'%s' --version" % CURL_CONFIG).read()
- if d:
- d = string.strip(d)
- if not d:
- raise Exception, ("`%s' not found -- please install the libcurl development files" % CURL_CONFIG)
- print "Using %s (%s)" % (CURL_CONFIG, d)
- for e in split_quoted(os.popen("'%s' --cflags" % CURL_CONFIG).read()):
- if e[:2] == "-I":
- # do not add /usr/include
- if not re.search(r"^\/+usr\/+include\/*$", e[2:]):
- include_dirs.append(e[2:])
- else:
- extra_compile_args.append(e)
- for e in split_quoted(os.popen("'%s' --libs" % CURL_CONFIG).read()):
- if e[:2] == "-l":
- libraries.append(e[2:])
- elif e[:2] == "-L":
- library_dirs.append(e[2:])
- else:
- extra_link_args.append(e)
- if not libraries:
- libraries.append("curl")
- # Add extra compile flag for MacOS X
- if sys.platform[:-1] == "darwin":
- extra_link_args.append("-flat_namespace")
-
-
-###############################################################################
-
-def get_kw(**kw): return kw
-
-ext = Extension(
- name=PACKAGE,
- sources=[
- os.path.join("src", "pycurl.c"),
- ],
- include_dirs=include_dirs,
- define_macros=define_macros,
- library_dirs=library_dirs,
- libraries=libraries,
- runtime_library_dirs=runtime_library_dirs,
- extra_objects=extra_objects,
- extra_compile_args=extra_compile_args,
- extra_link_args=extra_link_args,
-)
-##print ext.__dict__; sys.exit(1)
-
-
-###############################################################################
-
-# prepare data_files
-
-def get_data_files():
- # a list of tuples with (path to install to, a list of local files)
- data_files = []
- if sys.platform == "win32":
- datadir = os.path.join("doc", PACKAGE)
- else:
- datadir = os.path.join("share", "doc", PACKAGE)
- #
- files = ["ChangeLog", "COPYING", "INSTALL", "README", "TODO",]
- if files:
- data_files.append((os.path.join(datadir), files))
- files = glob.glob(os.path.join("doc", "*.html"))
- if files:
- data_files.append((os.path.join(datadir, "html"), files))
- files = glob.glob(os.path.join("examples", "*.py"))
- if files:
- data_files.append((os.path.join(datadir, "examples"), files))
- files = glob.glob(os.path.join("tests", "*.py"))
- if files:
- data_files.append((os.path.join(datadir, "tests"), files))
- #
- assert data_files
- for install_dir, files in data_files:
- assert files
- for f in files:
- assert os.path.isfile(f), (f, install_dir)
- return data_files
-
-##print get_data_files(); sys.exit(1)
-
-
-###############################################################################
-
-setup_args = get_kw(
- name=PACKAGE,
- version=VERSION,
- description="PycURL -- cURL library module for Python",
- author="Kjetil Jacobsen, Markus F.X.J. Oberhumer",
- author_email="kjetilja@cs.uit.no, markus@oberhumer.com",
- maintainer="Kjetil Jacobsen, Markus F.X.J. Oberhumer",
- maintainer_email="kjetilja@cs.uit.no, markus@oberhumer.com",
- url="http://pycurl.sourceforge.net/",
- license="GNU Lesser General Public License (LGPL)",
- data_files=get_data_files(),
- ext_modules=[ext],
- long_description="""
-This module provides Python bindings for the cURL library.""",
-)
-
-if sys.version >= "2.2":
- setup_args["packages"] = [PY_PACKAGE]
- setup_args["package_dir"] = { PY_PACKAGE: os.path.join('python', 'curl') }
-
-
-##print distutils.__version__
-if LooseVersion(distutils.__version__) > LooseVersion("1.0.1"):
- setup_args["platforms"] = "All"
-if LooseVersion(distutils.__version__) < LooseVersion("1.0.3"):
- setup_args["licence"] = setup_args["license"]
-
-if __name__ == "__main__":
- for o in ext.extra_objects:
- assert os.path.isfile(o), o
- # We can live with the deprecationwarning for a while
- apply(setup, (), setup_args)
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import os, sys, string
-assert sys.platform == "win32", "Only for building on Win32 with SSL and zlib"
-
-
-CURL_DIR = r"c:\src\build\pycurl\curl-7.13.1-ssl"
-OPENSSL_DIR = r"c:\src\build\pycurl\openssl-0.9.7e"
-sys.argv.insert(1, "--curl-dir=" + CURL_DIR)
-
-from setup import *
-
-setup_args["name"] = "pycurl-ssl"
-
-
-for l in ("libeay32.lib", "ssleay32.lib",):
- ext.extra_objects.append(os.path.join(OPENSSL_DIR, "out32", l))
-
-pool = "\\" + r"pool\win32\vc6" + "\\"
-if string.find(sys.version, "MSC v.1310") >= 0:
- pool = "\\" + r"pool\win32\vc71" + "\\"
-ext.extra_objects.append(r"c:\src\pool\zlib-1.2.2" + pool + "zlib.lib")
-ext.extra_objects.append(r"c:\src\pool\c-ares-20041212" + pool + "ares.lib")
-ext.extra_objects.append(r"c:\src\pool\libidn-0.5.13" + pool + "idn.lib")
-
-
-if __name__ == "__main__":
- for o in ext.extra_objects:
- assert os.path.isfile(o), o
- apply(setup, (), setup_args)
-
+++ /dev/null
-CC=gcc
-RM=rm
-CP=cp
-PYINCLUDE=/usr/include/python2.2
-CURLINCLUDE=/usr/include/curl
-INCLUDE=-I$(PYINCLUDE) -I$(CURLINCLUDE)
-LIBS=-L/usr/lib -lcurl
-LDOPTS=-shared
-CCOPTS=-g -O2 -Wall -Wstrict-prototypes -fPIC
-
-all:
- $(CC) $(INCLUDE) $(CCOPTS) -c pycurl.c -o pycurl.o
- $(CC) $(LIBS) $(LDOPTS) -lcurl pycurl.o -o pycurl.so
-
-install: all
- $(CP) pycurl.so /usr/lib/python2.2/site-packages
-
-clean:
- $(RM) -f *~ *.o *obj *.so
+++ /dev/null
-/* $Id$ */
-
-/* PycURL -- cURL Python module
- *
- * Authors:
- * Copyright (C) 2001-2005 by Kjetil Jacobsen <kjetilja at cs.uit.no>
- * Copyright (C) 2001-2005 by Markus F.X.J. Oberhumer <markus at oberhumer.com>
- *
- * Contributions:
- * Tino Lange <Tino.Lange at gmx.de>
- * Matt King <matt at gnik.com>
- * Conrad Steenberg <conrad at hep.caltech.edu>
- * Amit Mongia <amit_mongia at hotmail.com>
- * Eric S. Raymond <esr at thyrsus.com>
- * Martin Muenstermann <mamuema at sourceforge.net>
- * Domenico Andreoli <cavok at libero.it>
- *
- * See file COPYING for license information.
- *
- * Some quick info on Python's refcount:
- * Py_BuildValue does incref the item(s)
- * PyArg_ParseTuple does NOT incref the item
- * PyList_Append does incref the item
- * PyTuple_SET_ITEM does NOT incref the item
- * PyTuple_SetItem does NOT incref the item
- * PyXXX_GetItem returns a borrowed reference
- */
-
-#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
-# define WIN32 1
-#endif
-#if defined(WIN32)
-# define CURL_STATICLIB 1
-#endif
-#include <Python.h>
-#include <sys/types.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <limits.h>
-#include <curl/curl.h>
-#include <curl/multi.h>
-#undef NDEBUG
-#include <assert.h>
-
-/* Ensure we have updated versions */
-#if !defined(PY_VERSION_HEX) || (PY_VERSION_HEX < 0x02020000)
-# error "Need Python version 2.2 or greater to compile pycurl."
-#endif
-#if !defined(LIBCURL_VERSION_NUM) || (LIBCURL_VERSION_NUM < 0x070d01)
-# error "Need libcurl version 7.13.1 or greater to compile pycurl."
-#endif
-
-#undef UNUSED
-#define UNUSED(var) ((void)&var)
-
-#undef COMPILE_TIME_ASSERT
-#define COMPILE_TIME_ASSERT(expr) \
- { typedef int compile_time_assert_fail__[1 - 2 * !(expr)]; }
-
-
-/* Calculate the number of OBJECTPOINT options we need to store */
-#define OPTIONS_SIZE ((int)CURLOPT_LASTENTRY % 10000)
-static int OPT_INDEX(int o)
-{
- assert(o >= CURLOPTTYPE_OBJECTPOINT);
- assert(o < CURLOPTTYPE_OBJECTPOINT + OPTIONS_SIZE);
- return o - CURLOPTTYPE_OBJECTPOINT;
-}
-
-
-static PyObject *ErrorObject = NULL;
-static PyTypeObject *p_Curl_Type = NULL;
-static PyTypeObject *p_CurlMulti_Type = NULL;
-
-typedef struct {
- PyObject_HEAD
- PyObject *dict; /* Python attributes dictionary */
- CURLM *multi_handle;
- PyThreadState *state;
- fd_set read_fd_set;
- fd_set write_fd_set;
- fd_set exc_fd_set;
-} CurlMultiObject;
-
-typedef struct {
- PyObject_HEAD
- PyObject *dict; /* Python attributes dictionary */
- CURL *handle;
- PyThreadState *state;
- CurlMultiObject *multi_stack;
- struct curl_httppost *httppost;
- struct curl_slist *httpheader;
- struct curl_slist *http200aliases;
- struct curl_slist *quote;
- struct curl_slist *postquote;
- struct curl_slist *prequote;
- struct curl_slist *source_prequote;
- struct curl_slist *source_postquote;
- /* callbacks */
- PyObject *w_cb;
- PyObject *h_cb;
- PyObject *r_cb;
- PyObject *pro_cb;
- PyObject *debug_cb;
- PyObject *ioctl_cb;
- /* file objects */
- PyObject *readdata_fp;
- PyObject *writedata_fp;
- PyObject *writeheader_fp;
- /* misc */
- void *options[OPTIONS_SIZE]; /* for OBJECTPOINT options */
- char error[CURL_ERROR_SIZE+1];
-} CurlObject;
-
-/* Throw exception based on return value `res' and `self->error' */
-#define CURLERROR_RETVAL() do {\
- PyObject *v; \
- self->error[sizeof(self->error) - 1] = 0; \
- v = Py_BuildValue("(is)", (int) (res), self->error); \
- if (v != NULL) { PyErr_SetObject(ErrorObject, v); Py_DECREF(v); } \
- return NULL; \
-} while (0)
-
-/* Throw exception based on return value `res' and custom message */
-#define CURLERROR_MSG(msg) do {\
- PyObject *v; const char *m = (msg); \
- v = Py_BuildValue("(is)", (int) (res), (m)); \
- if (v != NULL) { PyErr_SetObject(ErrorObject, v); Py_DECREF(v); } \
- return NULL; \
-} while (0)
-
-
-/* Safe XDECREF for object states that handles nested deallocations */
-#define ZAP(v) do {\
- PyObject *tmp = (PyObject *)(v); \
- (v) = NULL; \
- Py_XDECREF(tmp); \
-} while (0)
-
-
-/*************************************************************************
-// python utility functions
-**************************************************************************/
-
-#if (PY_VERSION_HEX < 0x02030000) && !defined(PY_LONG_LONG)
-# define PY_LONG_LONG LONG_LONG
-#endif
-
-/* Like PyString_AsString(), but set an exception if the string contains
- * embedded NULs. Actually PyString_AsStringAndSize() already does that for
- * us if the `len' parameter is NULL - see Objects/stringobject.c.
- */
-
-static char *PyString_AsString_NoNUL(PyObject *obj)
-{
- char *s = NULL;
- int r;
- r = PyString_AsStringAndSize(obj, &s, NULL);
- if (r != 0)
- return NULL; /* exception already set */
- assert(s != NULL);
- return s;
-}
-
-
-/* Convert a curl slist (a list of strings) to a Python list.
- * In case of error return NULL with an exception set.
- */
-static PyObject *convert_slist(struct curl_slist *slist, int free_flags)
-{
- PyObject *ret = NULL;
-
- ret = PyList_New(0);
- if (ret == NULL) goto error;
-
- for ( ; slist != NULL; slist = slist->next) {
- PyObject *v = NULL;
-
- if (slist->data != NULL) {
- v = PyString_FromString(slist->data);
- if (v == NULL || PyList_Append(ret, v) != 0) {
- Py_XDECREF(v);
- goto error;
- }
- Py_DECREF(v);
- }
- }
-
- if ((free_flags & 1) && slist)
- curl_slist_free_all(slist);
- return ret;
-
-error:
- Py_XDECREF(ret);
- if ((free_flags & 2) && slist)
- curl_slist_free_all(slist);
- return NULL;
-}
-
-
-/*************************************************************************
-// static utility functions
-**************************************************************************/
-
-static PyThreadState *
-get_thread_state(const CurlObject *self)
-{
- /* Get the thread state for callbacks to run in.
- * This is either `self->state' when running inside perform() or
- * `self->multi_stack->state' when running inside multi_perform().
- * When the result is != NULL we also implicitly assert
- * a valid `self->handle'.
- */
- if (self == NULL)
- return NULL;
- assert(self->ob_type == p_Curl_Type);
- if (self->state != NULL)
- {
- /* inside perform() */
- assert(self->handle != NULL);
- if (self->multi_stack != NULL) {
- assert(self->multi_stack->state == NULL);
- }
- return self->state;
- }
- if (self->multi_stack != NULL && self->multi_stack->state != NULL)
- {
- /* inside multi_perform() */
- assert(self->handle != NULL);
- assert(self->multi_stack->multi_handle != NULL);
- assert(self->state == NULL);
- return self->multi_stack->state;
- }
- return NULL;
-}
-
-
-/* assert some CurlObject invariants */
-static void
-assert_curl_state(const CurlObject *self)
-{
- assert(self != NULL);
- assert(self->ob_type == p_Curl_Type);
- (void) get_thread_state(self);
-}
-
-
-/* assert some CurlMultiObject invariants */
-static void
-assert_multi_state(const CurlMultiObject *self)
-{
- assert(self != NULL);
- assert(self->ob_type == p_CurlMulti_Type);
- if (self->state != NULL) {
- assert(self->multi_handle != NULL);
- }
-}
-
-
-/* check state for methods */
-static int
-check_curl_state(const CurlObject *self, int flags, const char *name)
-{
- assert_curl_state(self);
- if ((flags & 1) && self->handle == NULL) {
- PyErr_Format(ErrorObject, "cannot invoke %s() - no curl handle", name);
- return -1;
- }
- if ((flags & 2) && get_thread_state(self) != NULL) {
- PyErr_Format(ErrorObject, "cannot invoke %s() - perform() is currently running", name);
- return -1;
- }
- return 0;
-}
-
-static int
-check_multi_state(const CurlMultiObject *self, int flags, const char *name)
-{
- assert_multi_state(self);
- if ((flags & 1) && self->multi_handle == NULL) {
- PyErr_Format(ErrorObject, "cannot invoke %s() - no multi handle", name);
- return -1;
- }
- if ((flags & 2) && self->state != NULL) {
- PyErr_Format(ErrorObject, "cannot invoke %s() - multi_perform() is currently running", name);
- return -1;
- }
- return 0;
-}
-
-
-/*************************************************************************
-// CurlObject
-**************************************************************************/
-
-/* --------------- construct/destruct (i.e. open/close) --------------- */
-
-/* Allocate a new python curl object */
-static CurlObject *
-util_curl_new(void)
-{
- CurlObject *self;
-
- self = (CurlObject *) PyObject_GC_New(CurlObject, p_Curl_Type);
- if (self == NULL)
- return NULL;
- PyObject_GC_Track(self);
-
- /* Set python curl object initial values */
- self->dict = NULL;
- self->handle = NULL;
- self->state = NULL;
- self->multi_stack = NULL;
- self->httppost = NULL;
- self->httpheader = NULL;
- self->http200aliases = NULL;
- self->quote = NULL;
- self->postquote = NULL;
- self->prequote = NULL;
- self->source_postquote = NULL;
- self->source_prequote = NULL;
-
- /* Set callback pointers to NULL by default */
- self->w_cb = NULL;
- self->h_cb = NULL;
- self->r_cb = NULL;
- self->pro_cb = NULL;
- self->debug_cb = NULL;
- self->ioctl_cb = NULL;
-
- /* Set file object pointers to NULL by default */
- self->readdata_fp = NULL;
- self->writedata_fp = NULL;
- self->writeheader_fp = NULL;
-
- /* Zero string pointer memory buffer used by setopt */
- memset(self->options, 0, sizeof(self->options));
- memset(self->error, 0, sizeof(self->error));
-
- return self;
-}
-
-
-/* constructor - this is a module-level function returning a new instance */
-static CurlObject *
-do_curl_new(PyObject *dummy)
-{
- CurlObject *self = NULL;
- int res;
- char *s = NULL;
-
- UNUSED(dummy);
-
- /* Allocate python curl object */
- self = util_curl_new();
- if (self == NULL)
- return NULL;
-
- /* Initialize curl handle */
- self->handle = curl_easy_init();
- if (self->handle == NULL)
- goto error;
-
- /* Set curl error buffer and zero it */
- res = curl_easy_setopt(self->handle, CURLOPT_ERRORBUFFER, self->error);
- if (res != CURLE_OK)
- goto error;
- memset(self->error, 0, sizeof(self->error));
-
- /* Set backreference */
- res = curl_easy_setopt(self->handle, CURLOPT_PRIVATE, (char *) self);
- if (res != CURLE_OK)
- goto error;
-
- /* Enable NOPROGRESS by default, i.e. no progress output */
- res = curl_easy_setopt(self->handle, CURLOPT_NOPROGRESS, (long)1);
- if (res != CURLE_OK)
- goto error;
-
- /* Disable VERBOSE by default, i.e. no verbose output */
- res = curl_easy_setopt(self->handle, CURLOPT_VERBOSE, (long)0);
- if (res != CURLE_OK)
- goto error;
-
- /* Set FTP_ACCOUNT to NULL by default */
- res = curl_easy_setopt(self->handle, CURLOPT_FTP_ACCOUNT, NULL);
- if (res != CURLE_OK)
- goto error;
-
- /* Set default USERAGENT */
- s = (char *) malloc(7 + strlen(LIBCURL_VERSION) + 1);
- if (s == NULL)
- goto error;
- strcpy(s, "PycURL/"); strcpy(s+7, LIBCURL_VERSION);
- res = curl_easy_setopt(self->handle, CURLOPT_USERAGENT, (char *) s);
- if (res != CURLE_OK) {
- free(s);
- goto error;
- }
- self->options[ OPT_INDEX(CURLOPT_USERAGENT) ] = s; s = NULL;
-
- /* Success - return new object */
- return self;
-
-error:
- Py_DECREF(self); /* this also closes self->handle */
- PyErr_SetString(ErrorObject, "initializing curl failed");
- return NULL;
-}
-
-
-/* util function shared by close() and clear() */
-static void
-util_curl_xdecref(CurlObject *self, int flags, CURL *handle)
-{
- if (flags & 1) {
- /* Decrement refcount for attributes dictionary. */
- ZAP(self->dict);
- }
-
- if (flags & 2) {
- /* Decrement refcount for multi_stack. */
- if (self->multi_stack != NULL) {
- CurlMultiObject *multi_stack = self->multi_stack;
- self->multi_stack = NULL;
- if (multi_stack->multi_handle != NULL && handle != NULL) {
- (void) curl_multi_remove_handle(multi_stack->multi_handle, handle);
- }
- Py_DECREF(multi_stack);
- }
- }
-
- if (flags & 4) {
- /* Decrement refcount for python callbacks. */
- ZAP(self->w_cb);
- ZAP(self->h_cb);
- ZAP(self->r_cb);
- ZAP(self->pro_cb);
- ZAP(self->debug_cb);
- ZAP(self->ioctl_cb);
- }
-
- if (flags & 8) {
- /* Decrement refcount for python file objects. */
- ZAP(self->readdata_fp);
- ZAP(self->writedata_fp);
- ZAP(self->writeheader_fp);
- }
-}
-
-
-static void
-util_curl_close(CurlObject *self)
-{
- CURL *handle;
- int i;
-
- /* Zero handle and thread-state to disallow any operations to be run
- * from now on */
- assert(self != NULL);
- assert(self->ob_type == p_Curl_Type);
- handle = self->handle;
- self->handle = NULL;
- if (handle == NULL) {
- /* Some paranoia assertions just to make sure the object
- * deallocation problem is finally really fixed... */
- assert(self->state == NULL);
- assert(self->multi_stack == NULL);
- return; /* already closed */
- }
- self->state = NULL;
-
- /* Decref multi stuff which uses this handle */
- util_curl_xdecref(self, 2, handle);
-
- /* Cleanup curl handle - must be done without the gil */
- Py_BEGIN_ALLOW_THREADS
- curl_easy_cleanup(handle);
- Py_END_ALLOW_THREADS
- handle = NULL;
-
- /* Decref callbacks and file handles */
- util_curl_xdecref(self, 4 | 8, handle);
-
- /* Free all variables allocated by setopt */
-#undef SFREE
-#define SFREE(v) if ((v) != NULL) (curl_formfree(v), (v) = NULL)
- SFREE(self->httppost);
-#undef SFREE
-#define SFREE(v) if ((v) != NULL) (curl_slist_free_all(v), (v) = NULL)
- SFREE(self->httpheader);
- SFREE(self->http200aliases);
- SFREE(self->quote);
- SFREE(self->postquote);
- SFREE(self->prequote);
- SFREE(self->source_postquote);
- SFREE(self->source_prequote);
-#undef SFREE
-
- /* Last, free the options. This must be done after the curl handle
- * is closed since libcurl assumes that some options are valid when
- * invoking curl_easy_cleanup(). */
- for (i = 0; i < OPTIONS_SIZE; i++) {
- if (self->options[i] != NULL) {
- free(self->options[i]);
- self->options[i] = NULL;
- }
- }
-}
-
-
-static void
-do_curl_dealloc(CurlObject *self)
-{
- PyObject_GC_UnTrack(self);
- Py_TRASHCAN_SAFE_BEGIN(self)
-
- ZAP(self->dict);
- util_curl_close(self);
-
- PyObject_GC_Del(self);
- Py_TRASHCAN_SAFE_END(self)
-}
-
-
-static PyObject *
-do_curl_close(CurlObject *self)
-{
- if (check_curl_state(self, 2, "close") != 0) {
- return NULL;
- }
- util_curl_close(self);
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-static PyObject *
-do_curl_errstr(CurlObject *self)
-{
- if (check_curl_state(self, 1 | 2, "errstr") != 0) {
- return NULL;
- }
- self->error[sizeof(self->error) - 1] = 0;
- return PyString_FromString(self->error);
-}
-
-
-/* --------------- GC support --------------- */
-
-/* Drop references that may have created reference cycles. */
-static int
-do_curl_clear(CurlObject *self)
-{
- assert(get_thread_state(self) == NULL);
- util_curl_xdecref(self, 1 | 2 | 4 | 8, self->handle);
- return 0;
-}
-
-/* Traverse all refcounted objects. */
-static int
-do_curl_traverse(CurlObject *self, visitproc visit, void *arg)
-{
- int err;
-#undef VISIT
-#define VISIT(v) if ((v) != NULL && ((err = visit(v, arg)) != 0)) return err
-
- VISIT(self->dict);
- VISIT((PyObject *) self->multi_stack);
-
- VISIT(self->w_cb);
- VISIT(self->h_cb);
- VISIT(self->r_cb);
- VISIT(self->pro_cb);
- VISIT(self->debug_cb);
- VISIT(self->ioctl_cb);
-
- VISIT(self->readdata_fp);
- VISIT(self->writedata_fp);
- VISIT(self->writeheader_fp);
-
- return 0;
-#undef VISIT
-}
-
-
-/* --------------- perform --------------- */
-
-static PyObject *
-do_curl_perform(CurlObject *self)
-{
- int res;
-
- if (check_curl_state(self, 1 | 2, "perform") != 0) {
- return NULL;
- }
-
- /* Save handle to current thread (used as context for python callbacks) */
- self->state = PyThreadState_Get();
- assert(self->state != NULL);
-
- /* Release global lock and start */
- Py_BEGIN_ALLOW_THREADS
- res = curl_easy_perform(self->handle);
- Py_END_ALLOW_THREADS
-
- /* Zero thread-state to disallow callbacks to be run from now on */
- self->state = NULL;
-
- if (res != CURLE_OK) {
- CURLERROR_RETVAL();
- }
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-/* --------------- callback handlers --------------- */
-
-/* IMPORTANT NOTE: due to threading issues, we cannot call _any_ Python
- * function without acquiring the thread state in the callback handlers.
- */
-
-static size_t
-util_write_callback(int flags, char *ptr, size_t size, size_t nmemb, void *stream)
-{
- CurlObject *self;
- PyThreadState *tmp_state;
- PyObject *arglist;
- PyObject *result = NULL;
- size_t ret = 0; /* assume error */
- PyObject *cb;
- int total_size;
-
- /* acquire thread */
- self = (CurlObject *)stream;
- tmp_state = get_thread_state(self);
- if (tmp_state == NULL)
- return ret;
- PyEval_AcquireThread(tmp_state);
-
- /* check args */
- cb = flags ? self->h_cb : self->w_cb;
- if (cb == NULL)
- goto silent_error;
- if (size <= 0 || nmemb <= 0)
- goto done;
- total_size = (int)(size * nmemb);
- if (total_size < 0 || (size_t)total_size / size != nmemb) {
- PyErr_SetString(ErrorObject, "integer overflow in write callback");
- goto verbose_error;
- }
-
- /* run callback */
- arglist = Py_BuildValue("(s#)", ptr, total_size);
- if (arglist == NULL)
- goto verbose_error;
- result = PyEval_CallObject(cb, arglist);
- Py_DECREF(arglist);
- if (result == NULL)
- goto verbose_error;
-
- /* handle result */
- if (result == Py_None) {
- ret = total_size; /* None means success */
- }
- else if (PyInt_Check(result)) {
- long obj_size = PyInt_AsLong(result);
- if (obj_size < 0 || obj_size > total_size) {
- PyErr_Format(ErrorObject, "invalid return value for write callback %ld %ld", (long)obj_size, (long)total_size);
- goto verbose_error;
- }
- ret = (size_t) obj_size; /* success */
- }
- else if (PyLong_Check(result)) {
- long obj_size = PyLong_AsLong(result);
- if (obj_size < 0 || obj_size > total_size) {
- PyErr_Format(ErrorObject, "invalid return value for write callback %ld %ld", (long)obj_size, (long)total_size);
- goto verbose_error;
- }
- ret = (size_t) obj_size; /* success */
- }
- else {
- PyErr_SetString(ErrorObject, "write callback must return int or None");
- goto verbose_error;
- }
-
-done:
-silent_error:
- Py_XDECREF(result);
- PyEval_ReleaseThread(tmp_state);
- return ret;
-verbose_error:
- PyErr_Print();
- goto silent_error;
-}
-
-
-static size_t
-write_callback(char *ptr, size_t size, size_t nmemb, void *stream)
-{
- return util_write_callback(0, ptr, size, nmemb, stream);
-}
-
-static size_t
-header_callback(char *ptr, size_t size, size_t nmemb, void *stream)
-{
- return util_write_callback(1, ptr, size, nmemb, stream);
-}
-
-
-static size_t
-read_callback(char *ptr, size_t size, size_t nmemb, void *stream)
-{
- CurlObject *self;
- PyThreadState *tmp_state;
- PyObject *arglist;
- PyObject *result = NULL;
-
- size_t ret = CURL_READFUNC_ABORT; /* assume error, this actually works */
- int total_size;
-
- /* acquire thread */
- self = (CurlObject *)stream;
- tmp_state = get_thread_state(self);
- if (tmp_state == NULL)
- return ret;
- PyEval_AcquireThread(tmp_state);
-
- /* check args */
- if (self->r_cb == NULL)
- goto silent_error;
- if (size <= 0 || nmemb <= 0)
- goto done;
- total_size = (int)(size * nmemb);
- if (total_size < 0 || (size_t)total_size / size != nmemb) {
- PyErr_SetString(ErrorObject, "integer overflow in read callback");
- goto verbose_error;
- }
-
- /* run callback */
- arglist = Py_BuildValue("(i)", total_size);
- if (arglist == NULL)
- goto verbose_error;
- result = PyEval_CallObject(self->r_cb, arglist);
- Py_DECREF(arglist);
- if (result == NULL)
- goto verbose_error;
-
- /* handle result */
- if (PyString_Check(result)) {
- char *buf = NULL;
- int obj_size = -1;
- int r;
- r = PyString_AsStringAndSize(result, &buf, &obj_size);
- if (r != 0 || obj_size < 0 || obj_size > total_size) {
- PyErr_Format(ErrorObject, "invalid return value for read callback %ld %ld", (long)obj_size, (long)total_size);
- goto verbose_error;
- }
- memcpy(ptr, buf, obj_size);
- ret = obj_size; /* success */
- }
- else if (PyInt_Check(result)) {
- long r = PyInt_AsLong(result);
- if (r != CURL_READFUNC_ABORT) {
- goto type_error;
- }
- /* ret is CURL_READUNC_ABORT */
- }
- else if (PyLong_Check(result)) {
- long r = PyLong_AsLong(result);
- if (r != CURL_READFUNC_ABORT) {
- goto type_error;
- }
- /* ret is CURL_READUNC_ABORT */
- }
- else {
- type_error:
- PyErr_SetString(ErrorObject, "read callback must return string");
- goto verbose_error;
- }
-
-done:
-silent_error:
- Py_XDECREF(result);
- PyEval_ReleaseThread(tmp_state);
- return ret;
-verbose_error:
- PyErr_Print();
- goto silent_error;
-}
-
-
-static int
-progress_callback(void *stream,
- double dltotal, double dlnow, double ultotal, double ulnow)
-{
- CurlObject *self;
- PyThreadState *tmp_state;
- PyObject *arglist;
- PyObject *result = NULL;
- int ret = 1; /* assume error */
-
- /* acquire thread */
- self = (CurlObject *)stream;
- tmp_state = get_thread_state(self);
- if (tmp_state == NULL)
- return ret;
- PyEval_AcquireThread(tmp_state);
-
- /* check args */
- if (self->pro_cb == NULL)
- goto silent_error;
-
- /* run callback */
- arglist = Py_BuildValue("(dddd)", dltotal, dlnow, ultotal, ulnow);
- if (arglist == NULL)
- goto verbose_error;
- result = PyEval_CallObject(self->pro_cb, arglist);
- Py_DECREF(arglist);
- if (result == NULL)
- goto verbose_error;
-
- /* handle result */
- if (result == Py_None) {
- ret = 0; /* None means success */
- }
- else if (PyInt_Check(result)) {
- ret = (int) PyInt_AsLong(result);
- }
- else {
- ret = PyObject_IsTrue(result); /* FIXME ??? */
- }
-
-silent_error:
- Py_XDECREF(result);
- PyEval_ReleaseThread(tmp_state);
- return ret;
-verbose_error:
- PyErr_Print();
- goto silent_error;
-}
-
-
-static int
-debug_callback(CURL *curlobj, curl_infotype type,
- char *buffer, size_t total_size, void *stream)
-{
- CurlObject *self;
- PyThreadState *tmp_state;
- PyObject *arglist;
- PyObject *result = NULL;
- int ret = 0; /* always success */
-
- UNUSED(curlobj);
-
- /* acquire thread */
- self = (CurlObject *)stream;
- tmp_state = get_thread_state(self);
- if (tmp_state == NULL)
- return ret;
- PyEval_AcquireThread(tmp_state);
-
- /* check args */
- if (self->debug_cb == NULL)
- goto silent_error;
- if ((int)total_size < 0 || (size_t)((int)total_size) != total_size) {
- PyErr_SetString(ErrorObject, "integer overflow in debug callback");
- goto verbose_error;
- }
-
- /* run callback */
- arglist = Py_BuildValue("(is#)", (int)type, buffer, (int)total_size);
- if (arglist == NULL)
- goto verbose_error;
- result = PyEval_CallObject(self->debug_cb, arglist);
- Py_DECREF(arglist);
- if (result == NULL)
- goto verbose_error;
-
- /* return values from debug callbacks should be ignored */
-
-silent_error:
- Py_XDECREF(result);
- PyEval_ReleaseThread(tmp_state);
- return ret;
-verbose_error:
- PyErr_Print();
- goto silent_error;
-}
-
-
-static curlioerr
-ioctl_callback(CURL *curlobj, int cmd, void *stream)
-{
- CurlObject *self;
- PyThreadState *tmp_state;
- PyObject *arglist;
- PyObject *result = NULL;
- int ret = CURLIOE_FAILRESTART; /* assume error */
-
- UNUSED(curlobj);
-
- /* acquire thread */
- self = (CurlObject *)stream;
- tmp_state = get_thread_state(self);
- if (tmp_state == NULL)
- return (curlioerr) ret;
- PyEval_AcquireThread(tmp_state);
-
- /* check args */
- if (self->ioctl_cb == NULL)
- goto silent_error;
-
- /* run callback */
- arglist = Py_BuildValue("(i)", (int)cmd);
- if (arglist == NULL)
- goto verbose_error;
- result = PyEval_CallObject(self->ioctl_cb, arglist);
- Py_DECREF(arglist);
- if (result == NULL)
- goto verbose_error;
-
- /* handle result */
- if (result == Py_None) {
- ret = CURLIOE_OK; /* None means success */
- }
- else if (PyInt_Check(result)) {
- ret = (int) PyInt_AsLong(result);
- if (ret >= CURLIOE_LAST || ret < 0) {
- PyErr_SetString(ErrorObject, "ioctl callback returned invalid value");
- goto verbose_error;
- }
- }
-
-silent_error:
- Py_XDECREF(result);
- PyEval_ReleaseThread(tmp_state);
- return (curlioerr) ret;
-verbose_error:
- PyErr_Print();
- goto silent_error;
-}
-
-
-/* --------------- unsetopt/setopt/getinfo --------------- */
-
-static PyObject *
-util_curl_unsetopt(CurlObject *self, int option)
-{
- int res;
- int opt_index = -1;
-
-#define SETOPT2(o,x) \
- if ((res = curl_easy_setopt(self->handle, (o), (x))) != CURLE_OK) goto error
-#define SETOPT(x) SETOPT2((CURLoption)option, (x))
-
- /* FIXME: implement more options. Have to carefully check lib/url.c in the
- * libcurl source code to see if it's actually safe to simply
- * unset the option. */
- switch (option)
- {
- case CURLOPT_HTTPPOST:
- SETOPT((void *) 0);
- curl_formfree(self->httppost);
- self->httppost = NULL;
- /* FIXME: what about data->set.httpreq ?? */
- break;
- case CURLOPT_INFILESIZE:
- SETOPT((long) -1);
- break;
- case CURLOPT_WRITEHEADER:
- SETOPT((void *) 0);
- ZAP(self->writeheader_fp);
- break;
- case CURLOPT_CAINFO:
- case CURLOPT_CAPATH:
- case CURLOPT_COOKIE:
- case CURLOPT_COOKIEJAR:
- case CURLOPT_CUSTOMREQUEST:
- case CURLOPT_EGDSOCKET:
- case CURLOPT_FTPPORT:
- case CURLOPT_PROXYUSERPWD:
- case CURLOPT_RANDOM_FILE:
- case CURLOPT_SSL_CIPHER_LIST:
- case CURLOPT_USERPWD:
- SETOPT((char *) 0);
- opt_index = OPT_INDEX(option);
- break;
-
- /* info: we explicitly list unsupported options here */
- case CURLOPT_COOKIEFILE:
- default:
- PyErr_SetString(PyExc_TypeError, "unsetopt() is not supported for this option");
- return NULL;
- }
-
- if (opt_index >= 0 && self->options[opt_index] != NULL) {
- free(self->options[opt_index]);
- self->options[opt_index] = NULL;
- }
-
- Py_INCREF(Py_None);
- return Py_None;
-
-error:
- CURLERROR_RETVAL();
-
-#undef SETOPT
-#undef SETOPT2
-}
-
-
-static PyObject *
-do_curl_unsetopt(CurlObject *self, PyObject *args)
-{
- int option;
-
- if (!PyArg_ParseTuple(args, "i:unsetopt", &option)) {
- return NULL;
- }
- if (check_curl_state(self, 1 | 2, "unsetopt") != 0) {
- return NULL;
- }
-
- /* early checks of option value */
- if (option <= 0)
- goto error;
- if (option >= (int)CURLOPTTYPE_OFF_T + OPTIONS_SIZE)
- goto error;
- if (option % 10000 >= OPTIONS_SIZE)
- goto error;
-
- return util_curl_unsetopt(self, option);
-
-error:
- PyErr_SetString(PyExc_TypeError, "invalid arguments to unsetopt");
- return NULL;
-}
-
-
-static PyObject *
-do_curl_setopt(CurlObject *self, PyObject *args)
-{
- int option;
- PyObject *obj;
- int res;
-
- if (!PyArg_ParseTuple(args, "iO:setopt", &option, &obj))
- return NULL;
- if (check_curl_state(self, 1 | 2, "setopt") != 0)
- return NULL;
-
- /* early checks of option value */
- if (option <= 0)
- goto error;
- if (option >= (int)CURLOPTTYPE_OFF_T + OPTIONS_SIZE)
- goto error;
- if (option % 10000 >= OPTIONS_SIZE)
- goto error;
-
-#if 0 /* XXX - should we ??? */
- /* Handle the case of None */
- if (obj == Py_None) {
- return util_curl_unsetopt(self, option);
- }
-#endif
-
- /* Handle the case of string arguments */
- if (PyString_Check(obj)) {
- char *str = NULL;
- int len = -1;
- char *buf;
- int opt_index;
-
- /* Check that the option specified a string as well as the input */
- switch (option) {
- case CURLOPT_CAINFO:
- case CURLOPT_CAPATH:
- case CURLOPT_COOKIE:
- case CURLOPT_COOKIEFILE:
- case CURLOPT_COOKIEJAR:
- case CURLOPT_CUSTOMREQUEST:
- case CURLOPT_EGDSOCKET:
- case CURLOPT_ENCODING:
- case CURLOPT_FTPPORT:
- case CURLOPT_INTERFACE:
- case CURLOPT_KRB4LEVEL:
- case CURLOPT_NETRC_FILE:
- case CURLOPT_PROXY:
- case CURLOPT_PROXYUSERPWD:
- case CURLOPT_RANDOM_FILE:
- case CURLOPT_RANGE:
- case CURLOPT_REFERER:
- case CURLOPT_SSLCERT:
- case CURLOPT_SSLCERTTYPE:
- case CURLOPT_SSLENGINE:
- case CURLOPT_SSLKEY:
- case CURLOPT_SSLKEYPASSWD:
- case CURLOPT_SSLKEYTYPE:
- case CURLOPT_SSL_CIPHER_LIST:
- case CURLOPT_URL:
- case CURLOPT_USERAGENT:
- case CURLOPT_USERPWD:
- case CURLOPT_SOURCE_HOST:
- case CURLOPT_SOURCE_USERPWD:
- case CURLOPT_SOURCE_PATH:
-/* FIXME: check if more of these options allow binary data */
- str = PyString_AsString_NoNUL(obj);
- if (str == NULL)
- return NULL;
- break;
- case CURLOPT_POSTFIELDS:
- if (PyString_AsStringAndSize(obj, &str, &len) != 0)
- return NULL;
- /* automatically set POSTFIELDSIZE */
- res = curl_easy_setopt(self->handle, CURLOPT_POSTFIELDSIZE, (long)len);
- if (res != CURLE_OK) {
- CURLERROR_RETVAL();
- }
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "strings are not supported for this option");
- return NULL;
- }
- /* Allocate memory to hold the string */
- assert(str != NULL);
- if (len <= 0)
- buf = strdup(str);
- else {
- buf = (char *) malloc(len);
- if (buf) memcpy(buf, str, len);
- }
- if (buf == NULL)
- return PyErr_NoMemory();
- /* Call setopt */
- res = curl_easy_setopt(self->handle, (CURLoption)option, buf);
- /* Check for errors */
- if (res != CURLE_OK) {
- free(buf);
- CURLERROR_RETVAL();
- }
- /* Save allocated option buffer */
- opt_index = OPT_INDEX(option);
- if (self->options[opt_index] != NULL) {
- free(self->options[opt_index]);
- self->options[opt_index] = NULL;
- }
- self->options[opt_index] = buf;
- Py_INCREF(Py_None);
- return Py_None;
- }
-
-#define IS_LONG_OPTION(o) (o < CURLOPTTYPE_OBJECTPOINT)
-#define IS_OFF_T_OPTION(o) (o >= CURLOPTTYPE_OFF_T)
-
- /* Handle the case of integer arguments */
- if (PyInt_Check(obj)) {
- long d = PyInt_AsLong(obj);
-
- if (IS_LONG_OPTION(option))
- res = curl_easy_setopt(self->handle, (CURLoption)option, (long)d);
- else if (IS_OFF_T_OPTION(option))
- res = curl_easy_setopt(self->handle, (CURLoption)option, (curl_off_t)d);
- else {
- PyErr_SetString(PyExc_TypeError, "integers are not supported for this option");
- return NULL;
- }
- if (res != CURLE_OK) {
- CURLERROR_RETVAL();
- }
- Py_INCREF(Py_None);
- return Py_None;
- }
-
- /* Handle the case of long arguments (used by *_LARGE options) */
- if (PyLong_Check(obj)) {
- PY_LONG_LONG d = PyLong_AsLongLong(obj);
- if (d == -1 && PyErr_Occurred())
- return NULL;
-
- if (IS_LONG_OPTION(option) && (long)d == d)
- res = curl_easy_setopt(self->handle, (CURLoption)option, (long)d);
- else if (IS_OFF_T_OPTION(option) && (curl_off_t)d == d)
- res = curl_easy_setopt(self->handle, (CURLoption)option, (curl_off_t)d);
- else {
- PyErr_SetString(PyExc_TypeError, "longs are not supported for this option");
- return NULL;
- }
- if (res != CURLE_OK) {
- CURLERROR_RETVAL();
- }
- Py_INCREF(Py_None);
- return Py_None;
- }
-
-#undef IS_LONG_OPTION
-#undef IS_OFF_T_OPTION
-
- /* Handle the case of file objects */
- if (PyFile_Check(obj)) {
- FILE *fp;
-
- /* Ensure the option specified a file as well as the input */
- switch (option) {
- case CURLOPT_READDATA:
- case CURLOPT_WRITEDATA:
- break;
- case CURLOPT_WRITEHEADER:
- if (self->w_cb != NULL) {
- PyErr_SetString(ErrorObject, "cannot combine WRITEHEADER with WRITEFUNCTION.");
- return NULL;
- }
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "files are not supported for this option");
- return NULL;
- }
-
- fp = PyFile_AsFile(obj);
- if (fp == NULL) {
- PyErr_SetString(PyExc_TypeError, "second argument must be open file");
- return NULL;
- }
- res = curl_easy_setopt(self->handle, (CURLoption)option, fp);
- if (res != CURLE_OK) {
- CURLERROR_RETVAL();
- }
- Py_INCREF(obj);
-
- switch (option) {
- case CURLOPT_READDATA:
- ZAP(self->readdata_fp);
- self->readdata_fp = obj;
- break;
- case CURLOPT_WRITEDATA:
- ZAP(self->writedata_fp);
- self->writedata_fp = obj;
- break;
- case CURLOPT_WRITEHEADER:
- ZAP(self->writeheader_fp);
- self->writeheader_fp = obj;
- break;
- default:
- assert(0);
- break;
- }
- /* Return success */
- Py_INCREF(Py_None);
- return Py_None;
- }
-
- /* Handle the case of list objects */
- if (PyList_Check(obj)) {
- struct curl_slist **old_slist = NULL;
- struct curl_slist *slist = NULL;
- int i, len;
-
- switch (option) {
- case CURLOPT_HTTP200ALIASES:
- old_slist = &self->http200aliases;
- break;
- case CURLOPT_HTTPHEADER:
- old_slist = &self->httpheader;
- break;
- case CURLOPT_QUOTE:
- old_slist = &self->quote;
- break;
- case CURLOPT_POSTQUOTE:
- old_slist = &self->postquote;
- break;
- case CURLOPT_PREQUOTE:
- old_slist = &self->prequote;
- break;
- case CURLOPT_SOURCE_PREQUOTE:
- old_slist = &self->source_prequote;
- break;
- case CURLOPT_SOURCE_POSTQUOTE:
- old_slist = &self->source_postquote;
- break;
- case CURLOPT_HTTPPOST:
- break;
- default:
- /* None of the list options were recognized, throw exception */
- PyErr_SetString(PyExc_TypeError, "lists are not supported for this option");
- return NULL;
- }
-
- len = PyList_Size(obj);
- if (len == 0) {
- /* Empty list - do nothing */
- Py_INCREF(Py_None);
- return Py_None;
- }
-
- /* Handle HTTPPOST different since we construct a HttpPost form struct */
- if (option == CURLOPT_HTTPPOST) {
- struct curl_httppost *post = NULL;
- struct curl_httppost *last = NULL;
-
- for (i = 0; i < len; i++) {
- char *nstr = NULL, *cstr = NULL;
- int nlen = -1, clen = -1;
- PyObject *listitem = PyList_GetItem(obj, i);
-
- if (!PyTuple_Check(listitem)) {
- curl_formfree(post);
- PyErr_SetString(PyExc_TypeError, "list items must be tuple objects");
- return NULL;
- }
- if (PyTuple_GET_SIZE(listitem) != 2) {
- curl_formfree(post);
- PyErr_SetString(PyExc_TypeError, "tuple must contain two elements (name, value)");
- return NULL;
- }
- if (PyString_AsStringAndSize(PyTuple_GET_ITEM(listitem, 0), &nstr, &nlen) != 0) {
- curl_formfree(post);
- PyErr_SetString(PyExc_TypeError, "tuple must contain string as first element");
- return NULL;
- }
- if (PyString_Check(PyTuple_GET_ITEM(listitem, 1))) {
- /* Handle strings as second argument for backwards compatibility */
- PyString_AsStringAndSize(PyTuple_GET_ITEM(listitem, 1), &cstr, &clen);
- /* INFO: curl_formadd() internally does memdup() the data, so
- * embedded NUL characters _are_ allowed here. */
- res = curl_formadd(&post, &last,
- CURLFORM_COPYNAME, nstr,
- CURLFORM_NAMELENGTH, (long) nlen,
- CURLFORM_COPYCONTENTS, cstr,
- CURLFORM_CONTENTSLENGTH, (long) clen,
- CURLFORM_END);
- if (res != CURLE_OK) {
- curl_formfree(post);
- CURLERROR_RETVAL();
- }
- }
- else if (PyTuple_Check(PyTuple_GET_ITEM(listitem, 1))) {
- /* Supports content, file and content-type */
- PyObject *t = PyTuple_GET_ITEM(listitem, 1);
- int tlen = PyTuple_Size(t);
- int j, k, l;
- struct curl_forms *forms = NULL;
-
- /* Sanity check that there are at least two tuple items */
- if (tlen < 2) {
- curl_formfree(post);
- PyErr_SetString(PyExc_TypeError, "tuple must contain at least one option and one value");
- return NULL;
- }
-
- /* Allocate enough space to accommodate length options for content */
- forms = PyMem_Malloc(sizeof(struct curl_forms) * ((tlen*2) + 1));
- if (forms == NULL) {
- curl_formfree(post);
- PyErr_NoMemory();
- return NULL;
- }
-
- /* Iterate all the tuple members pairwise */
- for (j = 0, k = 0, l = 0; j < tlen; j += 2, l++) {
- char *ostr;
- int olen, val;
-
- if (j == (tlen-1)) {
- PyErr_SetString(PyExc_TypeError, "expected value");
- PyMem_Free(forms);
- curl_formfree(post);
- return NULL;
- }
- if (!PyInt_Check(PyTuple_GET_ITEM(t, j))) {
- PyErr_SetString(PyExc_TypeError, "option must be long");
- PyMem_Free(forms);
- curl_formfree(post);
- return NULL;
- }
- if (!PyString_Check(PyTuple_GET_ITEM(t, j+1))) {
- PyErr_SetString(PyExc_TypeError, "value must be string");
- PyMem_Free(forms);
- curl_formfree(post);
- return NULL;
- }
-
- val = PyLong_AsLong(PyTuple_GET_ITEM(t, j));
- if (val != CURLFORM_COPYCONTENTS &&
- val != CURLFORM_FILE &&
- val != CURLFORM_CONTENTTYPE)
- {
- PyErr_SetString(PyExc_TypeError, "unsupported option");
- PyMem_Free(forms);
- curl_formfree(post);
- return NULL;
- }
- PyString_AsStringAndSize(PyTuple_GET_ITEM(t, j+1), &ostr, &olen);
- forms[k].option = val;
- forms[k].value = ostr;
- ++k;
- if (val == CURLFORM_COPYCONTENTS) {
- /* Contents can contain \0 bytes so we specify the length */
- forms[k].option = CURLFORM_CONTENTSLENGTH;
- forms[k].value = (char *)olen;
- ++k;
- }
- }
- forms[k].option = CURLFORM_END;
- res = curl_formadd(&post, &last,
- CURLFORM_COPYNAME, nstr,
- CURLFORM_NAMELENGTH, (long) nlen,
- CURLFORM_ARRAY, forms,
- CURLFORM_END);
- PyMem_Free(forms);
- if (res != CURLE_OK) {
- curl_formfree(post);
- CURLERROR_RETVAL();
- }
- } else {
- /* Some other type was given, ignore */
- curl_formfree(post);
- PyErr_SetString(PyExc_TypeError, "unsupported second type in tuple");
- return NULL;
- }
- }
- res = curl_easy_setopt(self->handle, CURLOPT_HTTPPOST, post);
- /* Check for errors */
- if (res != CURLE_OK) {
- curl_formfree(post);
- CURLERROR_RETVAL();
- }
- /* Finally, free previously allocated httppost and update */
- curl_formfree(self->httppost);
- self->httppost = post;
-
- Py_INCREF(Py_None);
- return Py_None;
- }
-
- /* Just to be sure we do not bug off here */
- assert(old_slist != NULL && slist == NULL);
-
- /* Handle regular list operations on the other options */
- for (i = 0; i < len; i++) {
- PyObject *listitem = PyList_GetItem(obj, i);
- struct curl_slist *nlist;
- char *str;
-
- if (!PyString_Check(listitem)) {
- curl_slist_free_all(slist);
- PyErr_SetString(PyExc_TypeError, "list items must be string objects");
- return NULL;
- }
- /* INFO: curl_slist_append() internally does strdup() the data, so
- * no embedded NUL characters allowed here. */
- str = PyString_AsString_NoNUL(listitem);
- if (str == NULL) {
- curl_slist_free_all(slist);
- return NULL;
- }
- nlist = curl_slist_append(slist, str);
- if (nlist == NULL || nlist->data == NULL) {
- curl_slist_free_all(slist);
- return PyErr_NoMemory();
- }
- slist = nlist;
- }
- res = curl_easy_setopt(self->handle, (CURLoption)option, slist);
- /* Check for errors */
- if (res != CURLE_OK) {
- curl_slist_free_all(slist);
- CURLERROR_RETVAL();
- }
- /* Finally, free previously allocated list and update */
- curl_slist_free_all(*old_slist);
- *old_slist = slist;
-
- Py_INCREF(Py_None);
- return Py_None;
- }
-
- /* Handle the case of function objects for callbacks */
- if (PyFunction_Check(obj) || PyCFunction_Check(obj) || PyMethod_Check(obj)) {
- /* We use function types here to make sure that our callback
- * definitions exactly match the <curl/curl.h> interface.
- */
- const curl_write_callback w_cb = write_callback;
- const curl_write_callback h_cb = header_callback;
- const curl_read_callback r_cb = read_callback;
- const curl_progress_callback pro_cb = progress_callback;
- const curl_debug_callback debug_cb = debug_callback;
- const curl_ioctl_callback ioctl_cb = ioctl_callback;
-
- switch(option) {
- case CURLOPT_WRITEFUNCTION:
- if (self->writeheader_fp != NULL) {
- PyErr_SetString(ErrorObject, "cannot combine WRITEFUNCTION with WRITEHEADER option.");
- return NULL;
- }
- Py_INCREF(obj);
- ZAP(self->writedata_fp);
- ZAP(self->w_cb);
- self->w_cb = obj;
- curl_easy_setopt(self->handle, CURLOPT_WRITEFUNCTION, w_cb);
- curl_easy_setopt(self->handle, CURLOPT_WRITEDATA, self);
- break;
- case CURLOPT_HEADERFUNCTION:
- Py_INCREF(obj);
- ZAP(self->h_cb);
- self->h_cb = obj;
- curl_easy_setopt(self->handle, CURLOPT_HEADERFUNCTION, h_cb);
- curl_easy_setopt(self->handle, CURLOPT_WRITEHEADER, self);
- break;
- case CURLOPT_READFUNCTION:
- Py_INCREF(obj);
- ZAP(self->readdata_fp);
- ZAP(self->r_cb);
- self->r_cb = obj;
- curl_easy_setopt(self->handle, CURLOPT_READFUNCTION, r_cb);
- curl_easy_setopt(self->handle, CURLOPT_READDATA, self);
- break;
- case CURLOPT_PROGRESSFUNCTION:
- Py_INCREF(obj);
- ZAP(self->pro_cb);
- self->pro_cb = obj;
- curl_easy_setopt(self->handle, CURLOPT_PROGRESSFUNCTION, pro_cb);
- curl_easy_setopt(self->handle, CURLOPT_PROGRESSDATA, self);
- break;
- case CURLOPT_DEBUGFUNCTION:
- Py_INCREF(obj);
- ZAP(self->debug_cb);
- self->debug_cb = obj;
- curl_easy_setopt(self->handle, CURLOPT_DEBUGFUNCTION, debug_cb);
- curl_easy_setopt(self->handle, CURLOPT_DEBUGDATA, self);
- break;
- case CURLOPT_IOCTLFUNCTION:
- Py_INCREF(obj);
- ZAP(self->ioctl_cb);
- self->ioctl_cb = obj;
- curl_easy_setopt(self->handle, CURLOPT_IOCTLFUNCTION, ioctl_cb);
- curl_easy_setopt(self->handle, CURLOPT_IOCTLDATA, self);
- break;
-
- default:
- /* None of the function options were recognized, throw exception */
- PyErr_SetString(PyExc_TypeError, "functions are not supported for this option");
- return NULL;
- }
- Py_INCREF(Py_None);
- return Py_None;
- }
-
- /* Failed to match any of the function signatures -- return error */
-error:
- PyErr_SetString(PyExc_TypeError, "invalid arguments to setopt");
- return NULL;
-}
-
-
-static PyObject *
-do_curl_getinfo(CurlObject *self, PyObject *args)
-{
- int option;
- int res;
-
- if (!PyArg_ParseTuple(args, "i:getinfo", &option)) {
- return NULL;
- }
- if (check_curl_state(self, 1 | 2, "getinfo") != 0) {
- return NULL;
- }
-
- switch (option) {
- case CURLINFO_FILETIME:
- case CURLINFO_HEADER_SIZE:
- case CURLINFO_HTTP_CODE:
- case CURLINFO_REDIRECT_COUNT:
- case CURLINFO_REQUEST_SIZE:
- case CURLINFO_SSL_VERIFYRESULT:
- case CURLINFO_HTTP_CONNECTCODE:
- case CURLINFO_HTTPAUTH_AVAIL:
- case CURLINFO_PROXYAUTH_AVAIL:
- case CURLINFO_OS_ERRNO:
- case CURLINFO_NUM_CONNECTS:
- {
- /* Return PyInt as result */
- long l_res = -1;
-
- res = curl_easy_getinfo(self->handle, (CURLINFO)option, &l_res);
- /* Check for errors and return result */
- if (res != CURLE_OK) {
- CURLERROR_RETVAL();
- }
- return PyInt_FromLong(l_res);
- }
-
- case CURLINFO_CONTENT_TYPE:
- case CURLINFO_EFFECTIVE_URL:
- {
- /* Return PyString as result */
- char *s_res = NULL;
-
- res = curl_easy_getinfo(self->handle, (CURLINFO)option, &s_res);
- if (res != CURLE_OK) {
- CURLERROR_RETVAL();
- }
- /* If the resulting string is NULL, return None */
- if (s_res == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
- }
- return PyString_FromString(s_res);
- }
-
- case CURLINFO_CONNECT_TIME:
- case CURLINFO_CONTENT_LENGTH_DOWNLOAD:
- case CURLINFO_CONTENT_LENGTH_UPLOAD:
- case CURLINFO_NAMELOOKUP_TIME:
- case CURLINFO_PRETRANSFER_TIME:
- case CURLINFO_REDIRECT_TIME:
- case CURLINFO_SIZE_DOWNLOAD:
- case CURLINFO_SIZE_UPLOAD:
- case CURLINFO_SPEED_DOWNLOAD:
- case CURLINFO_SPEED_UPLOAD:
- case CURLINFO_STARTTRANSFER_TIME:
- case CURLINFO_TOTAL_TIME:
- {
- /* Return PyFloat as result */
- double d_res = 0.0;
-
- res = curl_easy_getinfo(self->handle, (CURLINFO)option, &d_res);
- if (res != CURLE_OK) {
- CURLERROR_RETVAL();
- }
- return PyFloat_FromDouble(d_res);
- }
-
- case CURLINFO_SSL_ENGINES:
- {
- /* Return a list of strings */
- struct curl_slist *slist = NULL;
-
- res = curl_easy_getinfo(self->handle, (CURLINFO)option, &slist);
- if (res != CURLE_OK) {
- CURLERROR_RETVAL();
- }
- return convert_slist(slist, 1 | 2);
- }
- }
-
- /* Got wrong option on the method call */
- PyErr_SetString(PyExc_ValueError, "invalid argument to getinfo");
- return NULL;
-}
-
-
-/*************************************************************************
-// CurlMultiObject
-**************************************************************************/
-
-/* --------------- construct/destruct (i.e. open/close) --------------- */
-
-/* constructor - this is a module-level function returning a new instance */
-static CurlMultiObject *
-do_multi_new(PyObject *dummy)
-{
- CurlMultiObject *self;
-
- UNUSED(dummy);
-
- /* Allocate python curl-multi object */
- self = (CurlMultiObject *) PyObject_GC_New(CurlMultiObject, p_CurlMulti_Type);
- if (self) {
- PyObject_GC_Track(self);
- }
- else {
- return NULL;
- }
-
- /* Initialize object attributes */
- self->dict = NULL;
- self->state = NULL;
-
- /* Allocate libcurl multi handle */
- self->multi_handle = curl_multi_init();
- if (self->multi_handle == NULL) {
- Py_DECREF(self);
- PyErr_SetString(ErrorObject, "initializing curl-multi failed");
- return NULL;
- }
- return self;
-}
-
-
-static void
-util_multi_close(CurlMultiObject *self)
-{
- assert(self != NULL);
- self->state = NULL;
- if (self->multi_handle != NULL) {
- CURLM *multi_handle = self->multi_handle;
- self->multi_handle = NULL;
- curl_multi_cleanup(multi_handle);
- }
-}
-
-
-static void
-do_multi_dealloc(CurlMultiObject *self)
-{
- PyObject_GC_UnTrack(self);
- Py_TRASHCAN_SAFE_BEGIN(self)
-
- ZAP(self->dict);
- util_multi_close(self);
-
- PyObject_GC_Del(self);
- Py_TRASHCAN_SAFE_END(self)
-}
-
-
-static PyObject *
-do_multi_close(CurlMultiObject *self)
-{
- if (check_multi_state(self, 2, "close") != 0) {
- return NULL;
- }
- util_multi_close(self);
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-/* --------------- GC support --------------- */
-
-/* Drop references that may have created reference cycles. */
-static int
-do_multi_clear(CurlMultiObject *self)
-{
- ZAP(self->dict);
- return 0;
-}
-
-static int
-do_multi_traverse(CurlMultiObject *self, visitproc visit, void *arg)
-{
- int err;
-#undef VISIT
-#define VISIT(v) if ((v) != NULL && ((err = visit(v, arg)) != 0)) return err
-
- VISIT(self->dict);
-
- return 0;
-#undef VISIT
-}
-
-/* --------------- perform --------------- */
-
-
-static PyObject *
-do_multi_perform(CurlMultiObject *self)
-{
- CURLMcode res;
- int running = -1;
-
- if (check_multi_state(self, 1 | 2, "perform") != 0) {
- return NULL;
- }
-
- /* Release global lock and start */
- self->state = PyThreadState_Get();
- assert(self->state != NULL);
- Py_BEGIN_ALLOW_THREADS
- res = curl_multi_perform(self->multi_handle, &running);
- Py_END_ALLOW_THREADS
- self->state = NULL;
-
- /* We assume these errors are ok, otherwise throw exception */
- if (res != CURLM_OK && res != CURLM_CALL_MULTI_PERFORM) {
- CURLERROR_MSG("perform failed");
- }
-
- /* Return a tuple with the result and the number of running handles */
- return Py_BuildValue("(ii)", (int)res, running);
-}
-
-
-/* --------------- add_handle/remove_handle --------------- */
-
-/* static utility function */
-static int
-check_multi_add_remove(const CurlMultiObject *self, const CurlObject *obj)
-{
- /* check CurlMultiObject status */
- assert_multi_state(self);
- if (self->multi_handle == NULL) {
- PyErr_SetString(ErrorObject, "cannot add/remove handle - multi-stack is closed");
- return -1;
- }
- if (self->state != NULL) {
- PyErr_SetString(ErrorObject, "cannot add/remove handle - multi_perform() already running");
- return -1;
- }
- /* check CurlObject status */
- assert_curl_state(obj);
- if (obj->state != NULL) {
- PyErr_SetString(ErrorObject, "cannot add/remove handle - perform() of curl object already running");
- return -1;
- }
- if (obj->multi_stack != NULL && obj->multi_stack != self) {
- PyErr_SetString(ErrorObject, "cannot add/remove handle - curl object already on another multi-stack");
- return -1;
- }
- return 0;
-}
-
-
-static PyObject *
-do_multi_add_handle(CurlMultiObject *self, PyObject *args)
-{
- CurlObject *obj;
- CURLMcode res;
-
- if (!PyArg_ParseTuple(args, "O!:add_handle", p_Curl_Type, &obj)) {
- return NULL;
- }
- if (check_multi_add_remove(self, obj) != 0) {
- return NULL;
- }
- if (obj->handle == NULL) {
- PyErr_SetString(ErrorObject, "curl object already closed");
- return NULL;
- }
- if (obj->multi_stack == self) {
- PyErr_SetString(ErrorObject, "curl object already on this multi-stack");
- return NULL;
- }
- assert(obj->multi_stack == NULL);
- res = curl_multi_add_handle(self->multi_handle, obj->handle);
- if (res != CURLM_OK) {
- CURLERROR_MSG("curl_multi_add_handle() failed due to internal errors");
- }
- obj->multi_stack = self;
- Py_INCREF(self);
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-static PyObject *
-do_multi_remove_handle(CurlMultiObject *self, PyObject *args)
-{
- CurlObject *obj;
- CURLMcode res;
-
- if (!PyArg_ParseTuple(args, "O!:remove_handle", p_Curl_Type, &obj)) {
- return NULL;
- }
- if (check_multi_add_remove(self, obj) != 0) {
- return NULL;
- }
- if (obj->handle == NULL) {
- /* CurlObject handle already closed -- ignore */
- goto done;
- }
- if (obj->multi_stack != self) {
- PyErr_SetString(ErrorObject, "curl object not on this multi-stack");
- return NULL;
- }
- res = curl_multi_remove_handle(self->multi_handle, obj->handle);
- if (res != CURLM_OK) {
- CURLERROR_MSG("curl_multi_remove_handle() failed due to internal errors");
- }
- assert(obj->multi_stack == self);
- obj->multi_stack = NULL;
- Py_DECREF(self);
-done:
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-/* --------------- fdset ---------------------- */
-
-static PyObject *
-do_multi_fdset(CurlMultiObject *self)
-{
- CURLMcode res;
- int max_fd = -1, fd;
- PyObject *ret = NULL;
- PyObject *read_list = NULL, *write_list = NULL, *except_list = NULL;
- PyObject *py_fd = NULL;
-
- if (check_multi_state(self, 1 | 2, "fdset") != 0) {
- return NULL;
- }
-
- /* Clear file descriptor sets */
- FD_ZERO(&self->read_fd_set);
- FD_ZERO(&self->write_fd_set);
- FD_ZERO(&self->exc_fd_set);
-
- /* Don't bother releasing the gil as this is just a data structure operation */
- res = curl_multi_fdset(self->multi_handle, &self->read_fd_set,
- &self->write_fd_set, &self->exc_fd_set, &max_fd);
- if (res != CURLM_OK || max_fd < 0) {
- CURLERROR_MSG("curl_multi_fdset() failed due to internal errors");
- }
-
- /* Allocate lists. */
- if ((read_list = PyList_New(0)) == NULL) goto error;
- if ((write_list = PyList_New(0)) == NULL) goto error;
- if ((except_list = PyList_New(0)) == NULL) goto error;
-
- /* Populate lists */
- for (fd = 0; fd < max_fd + 1; fd++) {
- if (FD_ISSET(fd, &self->read_fd_set)) {
- if ((py_fd = PyInt_FromLong((long)fd)) == NULL) goto error;
- if (PyList_Append(read_list, py_fd) != 0) goto error;
- Py_DECREF(py_fd);
- py_fd = NULL;
- }
- if (FD_ISSET(fd, &self->write_fd_set)) {
- if ((py_fd = PyInt_FromLong((long)fd)) == NULL) goto error;
- if (PyList_Append(write_list, py_fd) != 0) goto error;
- Py_DECREF(py_fd);
- py_fd = NULL;
- }
- if (FD_ISSET(fd, &self->exc_fd_set)) {
- if ((py_fd = PyInt_FromLong((long)fd)) == NULL) goto error;
- if (PyList_Append(except_list, py_fd) != 0) goto error;
- Py_DECREF(py_fd);
- py_fd = NULL;
- }
- }
-
- /* Return a tuple with the 3 lists */
- ret = Py_BuildValue("(OOO)", read_list, write_list, except_list);
-error:
- Py_XDECREF(py_fd);
- Py_XDECREF(except_list);
- Py_XDECREF(write_list);
- Py_XDECREF(read_list);
- return ret;
-}
-
-
-/* --------------- info_read --------------- */
-
-static PyObject *
-do_multi_info_read(CurlMultiObject *self, PyObject *args)
-{
- PyObject *ret = NULL;
- PyObject *ok_list = NULL, *err_list = NULL;
- CURLMsg *msg;
- int in_queue = 0, num_results = INT_MAX;
-
- /* Sanity checks */
- if (!PyArg_ParseTuple(args, "|i:info_read", &num_results)) {
- return NULL;
- }
- if (num_results <= 0) {
- PyErr_SetString(ErrorObject, "argument to info_read must be greater than zero");
- return NULL;
- }
- if (check_multi_state(self, 1 | 2, "info_read") != 0) {
- return NULL;
- }
-
- if ((ok_list = PyList_New(0)) == NULL) goto error;
- if ((err_list = PyList_New(0)) == NULL) goto error;
-
- /* Loop through all messages */
- while ((msg = curl_multi_info_read(self->multi_handle, &in_queue)) != NULL) {
- CURLcode res;
- CurlObject *co = NULL;
-
- /* Check for termination as specified by the user */
- if (num_results-- <= 0) {
- break;
- }
-
- /* Fetch the curl object that corresponds to the curl handle in the message */
- res = curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &co);
- if (res != CURLE_OK || co == NULL) {
- Py_DECREF(err_list);
- Py_DECREF(ok_list);
- CURLERROR_MSG("Unable to fetch curl handle from curl object");
- }
- assert(co->ob_type == p_Curl_Type);
- if (msg->msg != CURLMSG_DONE) {
- /* FIXME: what does this mean ??? */
- }
- if (msg->data.result == CURLE_OK) {
- /* Append curl object to list of objects which succeeded */
- if (PyList_Append(ok_list, (PyObject *)co) != 0) {
- goto error;
- }
- }
- else {
- /* Create a result tuple that will get added to err_list. */
- PyObject *v = Py_BuildValue("(Ois)", (PyObject *)co, (int)msg->data.result, co->error);
- /* Append curl object to list of objects which failed */
- if (v == NULL || PyList_Append(err_list, v) != 0) {
- Py_XDECREF(v);
- goto error;
- }
- Py_DECREF(v);
- }
- }
- /* Return (number of queued messages, [ok_objects], [error_objects]) */
- ret = Py_BuildValue("(iOO)", in_queue, ok_list, err_list);
-error:
- Py_XDECREF(err_list);
- Py_XDECREF(ok_list);
- return ret;
-}
-
-
-/* --------------- select --------------- */
-
-static PyObject *
-do_multi_select(CurlMultiObject *self, PyObject *args)
-{
- int max_fd = -1, n;
- double timeout = -1.0;
- struct timeval tv, *tvp;
- CURLMcode res;
-
- if (!PyArg_ParseTuple(args, "|d:select", &timeout)) {
- return NULL;
- }
- if (check_multi_state(self, 1 | 2, "select") != 0) {
- return NULL;
- }
-
- if (timeout == -1.0) {
- /* no timeout given - wait forever */
- tvp = NULL;
- } else if (timeout < 0 || timeout >= 365 * 24 * 60 * 60) {
- PyErr_SetString(PyExc_OverflowError, "invalid timeout period");
- return NULL;
- } else {
- long seconds = (long)timeout;
- timeout = timeout - (double)seconds;
- assert(timeout >= 0.0); assert(timeout < 1.0);
- tv.tv_sec = seconds;
- tv.tv_usec = (long)(timeout*1000000.0);
- tvp = &tv;
- }
-
- FD_ZERO(&self->read_fd_set);
- FD_ZERO(&self->write_fd_set);
- FD_ZERO(&self->exc_fd_set);
-
- res = curl_multi_fdset(self->multi_handle, &self->read_fd_set,
- &self->write_fd_set, &self->exc_fd_set, &max_fd);
- if (res != CURLM_OK) {
- CURLERROR_MSG("multi_fdset failed");
- }
-
- if (max_fd < 0) {
- n = 0;
- }
- else {
- Py_BEGIN_ALLOW_THREADS
- n = select(max_fd + 1, &self->read_fd_set, &self->write_fd_set, &self->exc_fd_set, tvp);
- Py_END_ALLOW_THREADS
- /* info: like Python's socketmodule.c we do not raise an exception
- * if select() fails - we'll leave it to the actual libcurl
- * socket code to report any errors.
- */
- }
-
- return PyInt_FromLong(n);
-}
-
-
-/*************************************************************************
-// type definitions
-**************************************************************************/
-
-/* --------------- methods --------------- */
-
-static char co_close_doc [] = "close() -> None. Close handle and end curl session.\n";
-static char co_errstr_doc [] = "errstr() -> String. Return the internal libcurl error buffer string.\n";
-static char co_getinfo_doc [] = "getinfo(info) -> Res. Extract and return information from a curl session. Throws pycurl.error exception upon failure.\n";
-static char co_perform_doc [] = "perform() -> None. Perform a file transfer. Throws pycurl.error exception upon failure.\n";
-static char co_setopt_doc [] = "setopt(option, parameter) -> None. Set curl session option. Throws pycurl.error exception upon failure.\n";
-static char co_unsetopt_doc [] = "unsetopt(option) -> None. Reset curl session option to default value. Throws pycurl.error exception upon failure.\n";
-
-static char co_multi_fdset_doc [] = "fdset() -> Tuple. Returns a tuple of three lists that can be passed to the select.select() method .\n";
-static char co_multi_info_read_doc [] = "info_read([max_objects]) -> Tuple. Returns a tuple (number of queued handles, [curl objects]).\n";
-static char co_multi_select_doc [] = "select([timeout]) -> Int. Returns result from doing a select() on the curl multi file descriptor with the given timeout.\n";
-
-static PyMethodDef curlobject_methods[] = {
- {"close", (PyCFunction)do_curl_close, METH_NOARGS, co_close_doc},
- {"errstr", (PyCFunction)do_curl_errstr, METH_NOARGS, co_errstr_doc},
- {"getinfo", (PyCFunction)do_curl_getinfo, METH_VARARGS, co_getinfo_doc},
- {"perform", (PyCFunction)do_curl_perform, METH_NOARGS, co_perform_doc},
- {"setopt", (PyCFunction)do_curl_setopt, METH_VARARGS, co_setopt_doc},
- {"unsetopt", (PyCFunction)do_curl_unsetopt, METH_VARARGS, co_unsetopt_doc},
- {NULL, NULL, 0, NULL}
-};
-
-static PyMethodDef curlmultiobject_methods[] = {
- {"add_handle", (PyCFunction)do_multi_add_handle, METH_VARARGS, NULL},
- {"close", (PyCFunction)do_multi_close, METH_NOARGS, NULL},
- {"fdset", (PyCFunction)do_multi_fdset, METH_NOARGS, co_multi_fdset_doc},
- {"info_read", (PyCFunction)do_multi_info_read, METH_VARARGS, co_multi_info_read_doc},
- {"perform", (PyCFunction)do_multi_perform, METH_NOARGS, NULL},
- {"remove_handle", (PyCFunction)do_multi_remove_handle, METH_VARARGS, NULL},
- {"select", (PyCFunction)do_multi_select, METH_VARARGS, co_multi_select_doc},
- {NULL, NULL, 0, NULL}
-};
-
-
-/* --------------- setattr/getattr --------------- */
-
-static PyObject *curlobject_constants = NULL;
-static PyObject *curlmultiobject_constants = NULL;
-
-static int
-my_setattr(PyObject **dict, char *name, PyObject *v)
-{
- if (v == NULL) {
- int rv = -1;
- if (*dict != NULL)
- rv = PyDict_DelItemString(*dict, name);
- if (rv < 0)
- PyErr_SetString(PyExc_AttributeError, "delete non-existing attribute");
- return rv;
- }
- if (*dict == NULL) {
- *dict = PyDict_New();
- if (*dict == NULL)
- return -1;
- }
- return PyDict_SetItemString(*dict, name, v);
-}
-
-static PyObject *
-my_getattr(PyObject *co, char *name, PyObject *dict1, PyObject *dict2, PyMethodDef *m)
-{
- PyObject *v = NULL;
- if (v == NULL && dict1 != NULL)
- v = PyDict_GetItemString(dict1, name);
- if (v == NULL && dict2 != NULL)
- v = PyDict_GetItemString(dict2, name);
- if (v != NULL) {
- Py_INCREF(v);
- return v;
- }
- return Py_FindMethod(m, co, name);
-}
-
-static int
-do_curl_setattr(CurlObject *co, char *name, PyObject *v)
-{
- assert_curl_state(co);
- return my_setattr(&co->dict, name, v);
-}
-
-static int
-do_multi_setattr(CurlMultiObject *co, char *name, PyObject *v)
-{
- assert_multi_state(co);
- return my_setattr(&co->dict, name, v);
-}
-
-static PyObject *
-do_curl_getattr(CurlObject *co, char *name)
-{
- assert_curl_state(co);
- return my_getattr((PyObject *)co, name, co->dict,
- curlobject_constants, curlobject_methods);
-}
-
-static PyObject *
-do_multi_getattr(CurlMultiObject *co, char *name)
-{
- assert_multi_state(co);
- return my_getattr((PyObject *)co, name, co->dict,
- curlmultiobject_constants, curlmultiobject_methods);
-}
-
-
-/* --------------- actual type definitions --------------- */
-
-static PyTypeObject Curl_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
- "pycurl.Curl", /* tp_name */
- sizeof(CurlObject), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* Methods */
- (destructor)do_curl_dealloc, /* tp_dealloc */
- 0, /* tp_print */
- (getattrfunc)do_curl_getattr, /* tp_getattr */
- (setattrfunc)do_curl_setattr, /* tp_setattr */
- 0, /* tp_compare */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_HAVE_GC, /* tp_flags */
- 0, /* tp_doc */
- (traverseproc)do_curl_traverse, /* tp_traverse */
- (inquiry)do_curl_clear /* tp_clear */
- /* More fields follow here, depending on your Python version. You can
- * safely ignore any compiler warnings about missing initializers.
- */
-};
-
-static PyTypeObject CurlMulti_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
- "pycurl.CurlMulti", /* tp_name */
- sizeof(CurlMultiObject), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* Methods */
- (destructor)do_multi_dealloc, /* tp_dealloc */
- 0, /* tp_print */
- (getattrfunc)do_multi_getattr, /* tp_getattr */
- (setattrfunc)do_multi_setattr, /* tp_setattr */
- 0, /* tp_compare */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_HAVE_GC, /* tp_flags */
- 0, /* tp_doc */
- (traverseproc)do_multi_traverse, /* tp_traverse */
- (inquiry)do_multi_clear /* tp_clear */
- /* More fields follow here, depending on your Python version. You can
- * safely ignore any compiler warnings about missing initializers.
- */
-};
-
-
-/*************************************************************************
-// module level
-// Note that the object constructors (do_curl_new, do_multi_new)
-// are module-level functions as well.
-**************************************************************************/
-
-static PyObject *
-do_global_init(PyObject *dummy, PyObject *args)
-{
- int res, option;
-
- UNUSED(dummy);
- if (!PyArg_ParseTuple(args, "i:global_init", &option)) {
- return NULL;
- }
-
- if (!(option == CURL_GLOBAL_SSL ||
- option == CURL_GLOBAL_WIN32 ||
- option == CURL_GLOBAL_ALL ||
- option == CURL_GLOBAL_NOTHING)) {
- PyErr_SetString(PyExc_ValueError, "invalid option to global_init");
- return NULL;
- }
-
- res = curl_global_init(option);
- if (res != CURLE_OK) {
- PyErr_SetString(ErrorObject, "unable to set global option");
- return NULL;
- }
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-static PyObject *
-do_global_cleanup(PyObject *dummy)
-{
- UNUSED(dummy);
- curl_global_cleanup();
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-
-static PyObject *vi_str(const char *s)
-{
- if (s == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
- }
- while (*s == ' ' || *s == '\t')
- s++;
- return PyString_FromString(s);
-}
-
-static PyObject *
-do_version_info(PyObject *dummy, PyObject *args)
-{
- const curl_version_info_data *vi;
- PyObject *ret = NULL;
- PyObject *protocols = NULL;
- PyObject *tmp;
- int i;
- int stamp = CURLVERSION_NOW;
-
- UNUSED(dummy);
- if (!PyArg_ParseTuple(args, "|i:version_info", &stamp)) {
- return NULL;
- }
- vi = curl_version_info((CURLversion) stamp);
- if (vi == NULL) {
- PyErr_SetString(ErrorObject, "unable to get version info");
- return NULL;
- }
-
- /* Note: actually libcurl in lib/version.c does ignore
- * the "stamp" parm, and so do we */
-
- for (i = 0; vi->protocols[i] != NULL; )
- i++;
- protocols = PyTuple_New(i);
- if (protocols == NULL)
- goto error;
- for (i = 0; vi->protocols[i] != NULL; i++) {
- tmp = vi_str(vi->protocols[i]);
- if (tmp == NULL)
- goto error;
- PyTuple_SET_ITEM(protocols, i, tmp);
- }
- ret = PyTuple_New(12);
- if (ret == NULL)
- goto error;
-
-#define SET(i, v) \
- tmp = (v); if (tmp == NULL) goto error; PyTuple_SET_ITEM(ret, i, tmp)
- SET(0, PyInt_FromLong((long) vi->age));
- SET(1, vi_str(vi->version));
- SET(2, PyInt_FromLong(vi->version_num));
- SET(3, vi_str(vi->host));
- SET(4, PyInt_FromLong(vi->features));
- SET(5, vi_str(vi->ssl_version));
- SET(6, PyInt_FromLong(vi->ssl_version_num));
- SET(7, vi_str(vi->libz_version));
- SET(8, protocols);
- SET(9, vi_str(vi->ares));
- SET(10, PyInt_FromLong(vi->ares_num));
- SET(11, vi_str(vi->libidn));
-#undef SET
- return ret;
-
-error:
- Py_XDECREF(ret);
- Py_XDECREF(protocols);
- return NULL;
-}
-
-
-/* Per function docstrings */
-static char pycurl_global_init_doc [] =
-"global_init(option) -> None. Initialize curl environment.\n";
-
-static char pycurl_global_cleanup_doc [] =
-"global_cleanup() -> None. Cleanup curl environment.\n";
-
-static char pycurl_version_info_doc [] =
-"version_info() -> tuple. Returns a 12-tuple with the version info.\n";
-
-static char pycurl_curl_new_doc [] =
-"Curl() -> New curl object. Implicitly calls global_init() if not called.\n";
-
-static char pycurl_multi_new_doc [] =
-"CurlMulti() -> New curl multi-object.\n";
-
-
-/* List of functions defined in this module */
-static PyMethodDef curl_methods[] = {
- {"global_init", (PyCFunction)do_global_init, METH_VARARGS, pycurl_global_init_doc},
- {"global_cleanup", (PyCFunction)do_global_cleanup, METH_NOARGS, pycurl_global_cleanup_doc},
- {"version_info", (PyCFunction)do_version_info, METH_VARARGS, pycurl_version_info_doc},
- {"Curl", (PyCFunction)do_curl_new, METH_NOARGS, pycurl_curl_new_doc},
- {"CurlMulti", (PyCFunction)do_multi_new, METH_NOARGS, pycurl_multi_new_doc},
- {NULL, NULL, 0, NULL}
-};
-
-
-/* Module docstring */
-static char module_doc [] =
-"This module implements an interface to the cURL library.\n"
-"\n"
-"Types:\n"
-"\n"
-"Curl() -> New object. Create a new curl object.\n"
-"CurlMulti() -> New object. Create a new curl multi-object.\n"
-"\n"
-"Functions:\n"
-"\n"
-"global_init(option) -> None. Initialize curl environment.\n"
-"global_cleanup() -> None. Cleanup curl environment.\n"
-"version_info() -> tuple. Return version information.\n"
-;
-
-
-/* Helper functions for inserting constants into the module namespace */
-
-static void
-insobj2(PyObject *dict1, PyObject *dict2, char *name, PyObject *value)
-{
- /* Insert an object into one or two dicts. Eats a reference to value.
- * See also the implementation of PyDict_SetItemString(). */
- PyObject *key = NULL;
-
- if (dict1 == NULL && dict2 == NULL)
- goto error;
- if (value == NULL)
- goto error;
- key = PyString_FromString(name);
- if (key == NULL)
- goto error;
-#if 0
- PyString_InternInPlace(&key); /* XXX Should we really? */
-#endif
- if (dict1 != NULL) {
- assert(PyDict_GetItem(dict1, key) == NULL);
- if (PyDict_SetItem(dict1, key, value) != 0)
- goto error;
- }
- if (dict2 != NULL && dict2 != dict1) {
- assert(PyDict_GetItem(dict2, key) == NULL);
- if (PyDict_SetItem(dict2, key, value) != 0)
- goto error;
- }
- Py_DECREF(key);
- Py_DECREF(value);
- return;
-error:
- Py_FatalError("pycurl: FATAL: insobj2() failed");
- assert(0);
-}
-
-static void
-insstr(PyObject *d, char *name, char *value)
-{
- PyObject *v = PyString_FromString(value);
- insobj2(d, NULL, name, v);
-}
-
-static void
-insint(PyObject *d, char *name, long value)
-{
- PyObject *v = PyInt_FromLong(value);
- insobj2(d, NULL, name, v);
-}
-
-static void
-insint_c(PyObject *d, char *name, long value)
-{
- PyObject *v = PyInt_FromLong(value);
- insobj2(d, curlobject_constants, name, v);
-}
-
-static void
-insint_m(PyObject *d, char *name, long value)
-{
- PyObject *v = PyInt_FromLong(value);
- insobj2(d, curlmultiobject_constants, name, v);
-}
-
-
-/* Initialization function for the module */
-#if defined(PyMODINIT_FUNC)
-PyMODINIT_FUNC
-#else
-#if defined(__cplusplus)
-extern "C"
-#endif
-DL_EXPORT(void)
-#endif
-initpycurl(void)
-{
- PyObject *m, *d;
- const curl_version_info_data *vi;
-
- /* Initialize the type of the new type objects here; doing it here
- * is required for portability to Windows without requiring C++. */
- p_Curl_Type = &Curl_Type;
- p_CurlMulti_Type = &CurlMulti_Type;
- Curl_Type.ob_type = &PyType_Type;
- CurlMulti_Type.ob_type = &PyType_Type;
-
- /* Create the module and add the functions */
- m = Py_InitModule3("pycurl", curl_methods, module_doc);
- assert(m != NULL && PyModule_Check(m));
-
- /* Add error object to the module */
- d = PyModule_GetDict(m);
- assert(d != NULL);
- ErrorObject = PyErr_NewException("pycurl.error", NULL, NULL);
- assert(ErrorObject != NULL);
- PyDict_SetItemString(d, "error", ErrorObject);
-
- curlobject_constants = PyDict_New();
- assert(curlobject_constants != NULL);
-
- /* Add version strings to the module */
- insstr(d, "version", curl_version());
- insstr(d, "COMPILE_DATE", __DATE__ " " __TIME__);
- insint(d, "COMPILE_PY_VERSION_HEX", PY_VERSION_HEX);
- insint(d, "COMPILE_LIBCURL_VERSION_NUM", LIBCURL_VERSION_NUM);
-
- /**
- ** the order of these constants mostly follows <curl/curl.h>
- **/
-
- /* Abort curl_read_callback(). */
- insint_c(d, "READFUNC_ABORT", CURL_READFUNC_ABORT);
-
- /* constants for ioctl callback return values */
- insint_c(d, "IOE_OK", CURLIOE_OK);
- insint_c(d, "IOE_UNKNOWNCMD", CURLIOE_UNKNOWNCMD);
- insint_c(d, "IOE_FAILRESTART", CURLIOE_FAILRESTART);
-
- /* curl_infotype: the kind of data that is passed to information_callback */
-/* XXX do we actually need curl_infotype in pycurl ??? */
- insint_c(d, "INFOTYPE_TEXT", CURLINFO_TEXT);
- insint_c(d, "INFOTYPE_HEADER_IN", CURLINFO_HEADER_IN);
- insint_c(d, "INFOTYPE_HEADER_OUT", CURLINFO_HEADER_OUT);
- insint_c(d, "INFOTYPE_DATA_IN", CURLINFO_DATA_IN);
- insint_c(d, "INFOTYPE_DATA_OUT", CURLINFO_DATA_OUT);
- insint_c(d, "INFOTYPE_SSL_DATA_IN", CURLINFO_SSL_DATA_IN);
- insint_c(d, "INFOTYPE_SSL_DATA_OUT", CURLINFO_SSL_DATA_OUT);
-
- /* CURLcode: error codes */
-/* FIXME: lots of error codes are missing */
- insint_c(d, "E_OK", CURLE_OK);
- insint_c(d, "E_UNSUPPORTED_PROTOCOL", CURLE_UNSUPPORTED_PROTOCOL);
-
- /* curl_proxytype: constants for setopt(PROXYTYPE, x) */
- insint_c(d, "PROXYTYPE_HTTP", CURLPROXY_HTTP);
- insint_c(d, "PROXYTYPE_SOCKS4", CURLPROXY_SOCKS4);
- insint_c(d, "PROXYTYPE_SOCKS5", CURLPROXY_SOCKS5);
-
- /* curl_httpauth: constants for setopt(HTTPAUTH, x) */
- insint_c(d, "HTTPAUTH_NONE", CURLAUTH_NONE);
- insint_c(d, "HTTPAUTH_BASIC", CURLAUTH_BASIC);
- insint_c(d, "HTTPAUTH_DIGEST", CURLAUTH_DIGEST);
- insint_c(d, "HTTPAUTH_GSSNEGOTIATE", CURLAUTH_GSSNEGOTIATE);
- insint_c(d, "HTTPAUTH_NTLM", CURLAUTH_NTLM);
- insint_c(d, "HTTPAUTH_ANY", CURLAUTH_ANY);
- insint_c(d, "HTTPAUTH_ANYSAFE", CURLAUTH_ANYSAFE);
-
- /* curl_ftpssl: constants for setopt(FTP_SSL, x) */
- insint_c(d, "FTPSSL_NONE", CURLFTPSSL_NONE);
- insint_c(d, "FTPSSL_TRY", CURLFTPSSL_TRY);
- insint_c(d, "FTPSSL_CONTROL", CURLFTPSSL_CONTROL);
- insint_c(d, "FTPSSL_ALL", CURLFTPSSL_ALL);
-
- /* curl_ftpauth: constants for setopt(FTPSSLAUTH, x) */
- insint_c(d, "FTPAUTH_DEFAULT", CURLFTPAUTH_DEFAULT);
- insint_c(d, "FTPAUTH_SSL", CURLFTPAUTH_SSL);
- insint_c(d, "FTPAUTH_TLS", CURLFTPAUTH_TLS);
-
- /* curl_ftpauth: constants for setopt(FTPSSLAUTH, x) */
- insint_c(d, "FORM_CONTENTS", CURLFORM_COPYCONTENTS);
- insint_c(d, "FORM_FILE", CURLFORM_FILE);
- insint_c(d, "FORM_CONTENTTYPE", CURLFORM_CONTENTTYPE);
-
- /* CURLoption: symbolic constants for setopt() */
-/* FIXME: reorder these to match <curl/curl.h> */
- insint_c(d, "FILE", CURLOPT_WRITEDATA);
- insint_c(d, "URL", CURLOPT_URL);
- insint_c(d, "PORT", CURLOPT_PORT);
- insint_c(d, "PROXY", CURLOPT_PROXY);
- insint_c(d, "USERPWD", CURLOPT_USERPWD);
- insint_c(d, "PROXYUSERPWD", CURLOPT_PROXYUSERPWD);
- insint_c(d, "RANGE", CURLOPT_RANGE);
- insint_c(d, "INFILE", CURLOPT_READDATA);
- /* ERRORBUFFER is not supported */
- insint_c(d, "WRITEFUNCTION", CURLOPT_WRITEFUNCTION);
- insint_c(d, "READFUNCTION", CURLOPT_READFUNCTION);
- insint_c(d, "TIMEOUT", CURLOPT_TIMEOUT);
- insint_c(d, "INFILESIZE", CURLOPT_INFILESIZE_LARGE); /* _LARGE ! */
- insint_c(d, "POSTFIELDS", CURLOPT_POSTFIELDS);
- insint_c(d, "REFERER", CURLOPT_REFERER);
- insint_c(d, "FTPPORT", CURLOPT_FTPPORT);
- insint_c(d, "USERAGENT", CURLOPT_USERAGENT);
- insint_c(d, "LOW_SPEED_LIMIT", CURLOPT_LOW_SPEED_LIMIT);
- insint_c(d, "LOW_SPEED_TIME", CURLOPT_LOW_SPEED_TIME);
- insint_c(d, "RESUME_FROM", CURLOPT_RESUME_FROM_LARGE); /* _LARGE ! */
- insint_c(d, "WRITEDATA", CURLOPT_WRITEDATA);
- insint_c(d, "READDATA", CURLOPT_READDATA);
- insint_c(d, "PROXYPORT", CURLOPT_PROXYPORT);
- insint_c(d, "HTTPPROXYTUNNEL", CURLOPT_HTTPPROXYTUNNEL);
- insint_c(d, "VERBOSE", CURLOPT_VERBOSE);
- insint_c(d, "HEADER", CURLOPT_HEADER);
- insint_c(d, "NOPROGRESS", CURLOPT_NOPROGRESS);
- insint_c(d, "NOBODY", CURLOPT_NOBODY);
- insint_c(d, "FAILONERROR", CURLOPT_FAILONERROR);
- insint_c(d, "UPLOAD", CURLOPT_UPLOAD);
- insint_c(d, "POST", CURLOPT_POST);
- insint_c(d, "FTPLISTONLY", CURLOPT_FTPLISTONLY);
- insint_c(d, "FTPAPPEND", CURLOPT_FTPAPPEND);
- insint_c(d, "NETRC", CURLOPT_NETRC);
- insint_c(d, "FOLLOWLOCATION", CURLOPT_FOLLOWLOCATION);
- insint_c(d, "TRANSFERTEXT", CURLOPT_TRANSFERTEXT);
- insint_c(d, "PUT", CURLOPT_PUT);
- insint_c(d, "POSTFIELDSIZE", CURLOPT_POSTFIELDSIZE_LARGE); /* _LARGE ! */
- insint_c(d, "COOKIE", CURLOPT_COOKIE);
- insint_c(d, "HTTPHEADER", CURLOPT_HTTPHEADER);
- insint_c(d, "HTTPPOST", CURLOPT_HTTPPOST);
- insint_c(d, "SSLCERT", CURLOPT_SSLCERT);
- insint_c(d, "SSLCERTPASSWD", CURLOPT_SSLCERTPASSWD);
- insint_c(d, "CRLF", CURLOPT_CRLF);
- insint_c(d, "QUOTE", CURLOPT_QUOTE);
- insint_c(d, "POSTQUOTE", CURLOPT_POSTQUOTE);
- insint_c(d, "PREQUOTE", CURLOPT_PREQUOTE);
- insint_c(d, "WRITEHEADER", CURLOPT_WRITEHEADER);
- insint_c(d, "HEADERFUNCTION", CURLOPT_HEADERFUNCTION);
- insint_c(d, "COOKIEFILE", CURLOPT_COOKIEFILE);
- insint_c(d, "SSLVERSION", CURLOPT_SSLVERSION);
- insint_c(d, "TIMECONDITION", CURLOPT_TIMECONDITION);
- insint_c(d, "TIMEVALUE", CURLOPT_TIMEVALUE);
- insint_c(d, "CUSTOMREQUEST", CURLOPT_CUSTOMREQUEST);
- insint_c(d, "STDERR", CURLOPT_STDERR);
- insint_c(d, "INTERFACE", CURLOPT_INTERFACE);
- insint_c(d, "KRB4LEVEL", CURLOPT_KRB4LEVEL);
- insint_c(d, "PROGRESSFUNCTION", CURLOPT_PROGRESSFUNCTION);
- insint_c(d, "SSL_VERIFYPEER", CURLOPT_SSL_VERIFYPEER);
- insint_c(d, "CAPATH", CURLOPT_CAPATH);
- insint_c(d, "CAINFO", CURLOPT_CAINFO);
- insint_c(d, "OPT_FILETIME", CURLOPT_FILETIME);
- insint_c(d, "MAXREDIRS", CURLOPT_MAXREDIRS);
- insint_c(d, "MAXCONNECTS", CURLOPT_MAXCONNECTS);
- insint_c(d, "CLOSEPOLICY", CURLOPT_CLOSEPOLICY);
- insint_c(d, "FRESH_CONNECT", CURLOPT_FRESH_CONNECT);
- insint_c(d, "FORBID_REUSE", CURLOPT_FORBID_REUSE);
- insint_c(d, "RANDOM_FILE", CURLOPT_RANDOM_FILE);
- insint_c(d, "EGDSOCKET", CURLOPT_EGDSOCKET);
- insint_c(d, "CONNECTTIMEOUT", CURLOPT_CONNECTTIMEOUT);
- insint_c(d, "HTTPGET", CURLOPT_HTTPGET);
- insint_c(d, "SSL_VERIFYHOST", CURLOPT_SSL_VERIFYHOST);
- insint_c(d, "COOKIEJAR", CURLOPT_COOKIEJAR);
- insint_c(d, "SSL_CIPHER_LIST", CURLOPT_SSL_CIPHER_LIST);
- insint_c(d, "HTTP_VERSION", CURLOPT_HTTP_VERSION);
- insint_c(d, "FTP_USE_EPSV", CURLOPT_FTP_USE_EPSV);
- insint_c(d, "SSLCERTTYPE", CURLOPT_SSLCERTTYPE);
- insint_c(d, "SSLKEY", CURLOPT_SSLKEY);
- insint_c(d, "SSLKEYTYPE", CURLOPT_SSLKEYTYPE);
- insint_c(d, "SSLKEYPASSWD", CURLOPT_SSLKEYPASSWD);
- insint_c(d, "SSLENGINE", CURLOPT_SSLENGINE);
- insint_c(d, "SSLENGINE_DEFAULT", CURLOPT_SSLENGINE_DEFAULT);
- insint_c(d, "DNS_CACHE_TIMEOUT", CURLOPT_DNS_CACHE_TIMEOUT);
- insint_c(d, "DNS_USE_GLOBAL_CACHE", CURLOPT_DNS_USE_GLOBAL_CACHE);
- insint_c(d, "DEBUGFUNCTION", CURLOPT_DEBUGFUNCTION);
- insint_c(d, "BUFFERSIZE", CURLOPT_BUFFERSIZE);
- insint_c(d, "NOSIGNAL", CURLOPT_NOSIGNAL);
- insint_c(d, "SHARE", CURLOPT_SHARE);
- insint_c(d, "PROXYTYPE", CURLOPT_PROXYTYPE);
- insint_c(d, "ENCODING", CURLOPT_ENCODING);
- insint_c(d, "HTTP200ALIASES", CURLOPT_HTTP200ALIASES);
- insint_c(d, "UNRESTRICTED_AUTH", CURLOPT_UNRESTRICTED_AUTH);
- insint_c(d, "FTP_USE_EPRT", CURLOPT_FTP_USE_EPRT);
- insint_c(d, "HTTPAUTH", CURLOPT_HTTPAUTH);
- insint_c(d, "FTP_CREATE_MISSING_DIRS", CURLOPT_FTP_CREATE_MISSING_DIRS);
- insint_c(d, "PROXYAUTH", CURLOPT_PROXYAUTH);
- insint_c(d, "FTP_RESPONSE_TIMEOUT", CURLOPT_FTP_RESPONSE_TIMEOUT);
- insint_c(d, "IPRESOLVE", CURLOPT_IPRESOLVE);
- insint_c(d, "MAXFILESIZE", CURLOPT_MAXFILESIZE_LARGE); /* _LARGE ! */
- insint_c(d, "INFILESIZE_LARGE", CURLOPT_INFILESIZE_LARGE);
- insint_c(d, "RESUME_FROM_LARGE", CURLOPT_RESUME_FROM_LARGE);
- insint_c(d, "MAXFILESIZE_LARGE", CURLOPT_MAXFILESIZE_LARGE);
- insint_c(d, "NETRC_FILE", CURLOPT_NETRC_FILE);
- insint_c(d, "FTP_SSL", CURLOPT_FTP_SSL);
- insint_c(d, "POSTFIELDSIZE_LARGE", CURLOPT_POSTFIELDSIZE_LARGE);
- insint_c(d, "TCP_NODELAY", CURLOPT_TCP_NODELAY);
- insint_c(d, "SOURCE_USERPWD", CURLOPT_SOURCE_USERPWD);
- insint_c(d, "SOURCE_PREQUOTE", CURLOPT_SOURCE_PREQUOTE);
- insint_c(d, "SOURCE_POSTQUOTE", CURLOPT_SOURCE_POSTQUOTE);
- insint_c(d, "FTPSSLAUTH", CURLOPT_FTPSSLAUTH);
- insint_c(d, "IOCTLFUNCTION", CURLOPT_IOCTLFUNCTION);
- insint_c(d, "IOCTLDATA", CURLOPT_IOCTLDATA);
- insint_c(d, "SOURCE_URL", CURLOPT_SOURCE_URL);
- insint_c(d, "SOURCE_QUOTE", CURLOPT_SOURCE_QUOTE);
- insint_c(d, "FTP_ACCOUNT", CURLOPT_FTP_ACCOUNT);
-
- /* constants for setopt(IPRESOLVE, x) */
- insint_c(d, "IPRESOLVE_WHATEVER", CURL_IPRESOLVE_WHATEVER);
- insint_c(d, "IPRESOLVE_V4", CURL_IPRESOLVE_V4);
- insint_c(d, "IPRESOLVE_V6", CURL_IPRESOLVE_V6);
-
- /* constants for setopt(HTTP_VERSION, x) */
- insint_c(d, "CURL_HTTP_VERSION_NONE", CURL_HTTP_VERSION_NONE);
- insint_c(d, "CURL_HTTP_VERSION_1_0", CURL_HTTP_VERSION_1_0);
- insint_c(d, "CURL_HTTP_VERSION_1_1", CURL_HTTP_VERSION_1_1);
- insint_c(d, "CURL_HTTP_VERSION_LAST", CURL_HTTP_VERSION_LAST);
-
- /* CURL_NETRC_OPTION: constants for setopt(NETRC, x) */
- insint_c(d, "NETRC_OPTIONAL", CURL_NETRC_OPTIONAL);
- insint_c(d, "NETRC_IGNORED", CURL_NETRC_IGNORED);
- insint_c(d, "NETRC_REQUIRED", CURL_NETRC_REQUIRED);
-
- /* constants for setopt(SSLVERSION, x) */
- insint_c(d, "SSLVERSION_DEFAULT", CURL_SSLVERSION_DEFAULT);
- insint_c(d, "SSLVERSION_TLSv1", CURL_SSLVERSION_TLSv1);
- insint_c(d, "SSLVERSION_SSLv2", CURL_SSLVERSION_SSLv2);
- insint_c(d, "SSLVERSION_SSLv3", CURL_SSLVERSION_SSLv3);
-
- /* curl_TimeCond: constants for setopt(TIMECONDITION, x) */
- insint_c(d, "TIMECONDITION_NONE", CURL_TIMECOND_NONE);
- insint_c(d, "TIMECONDITION_IFMODSINCE", CURL_TIMECOND_IFMODSINCE);
- insint_c(d, "TIMECONDITION_IFUNMODSINCE", CURL_TIMECOND_IFUNMODSINCE);
- insint_c(d, "TIMECONDITION_LASTMOD", CURL_TIMECOND_LASTMOD);
-
- /* CURLINFO: symbolic constants for getinfo(x) */
- insint_c(d, "EFFECTIVE_URL", CURLINFO_EFFECTIVE_URL);
- insint_c(d, "HTTP_CODE", CURLINFO_HTTP_CODE);
- insint_c(d, "RESPONSE_CODE", CURLINFO_HTTP_CODE);
- insint_c(d, "TOTAL_TIME", CURLINFO_TOTAL_TIME);
- insint_c(d, "NAMELOOKUP_TIME", CURLINFO_NAMELOOKUP_TIME);
- insint_c(d, "CONNECT_TIME", CURLINFO_CONNECT_TIME);
- insint_c(d, "PRETRANSFER_TIME", CURLINFO_PRETRANSFER_TIME);
- insint_c(d, "SIZE_UPLOAD", CURLINFO_SIZE_UPLOAD);
- insint_c(d, "SIZE_DOWNLOAD", CURLINFO_SIZE_DOWNLOAD);
- insint_c(d, "SPEED_DOWNLOAD", CURLINFO_SPEED_DOWNLOAD);
- insint_c(d, "SPEED_UPLOAD", CURLINFO_SPEED_UPLOAD);
- insint_c(d, "HEADER_SIZE", CURLINFO_HEADER_SIZE);
- insint_c(d, "REQUEST_SIZE", CURLINFO_REQUEST_SIZE);
- insint_c(d, "SSL_VERIFYRESULT", CURLINFO_SSL_VERIFYRESULT);
- insint_c(d, "INFO_FILETIME", CURLINFO_FILETIME);
- insint_c(d, "CONTENT_LENGTH_DOWNLOAD", CURLINFO_CONTENT_LENGTH_DOWNLOAD);
- insint_c(d, "CONTENT_LENGTH_UPLOAD", CURLINFO_CONTENT_LENGTH_UPLOAD);
- insint_c(d, "STARTTRANSFER_TIME", CURLINFO_STARTTRANSFER_TIME);
- insint_c(d, "CONTENT_TYPE", CURLINFO_CONTENT_TYPE);
- insint_c(d, "REDIRECT_TIME", CURLINFO_REDIRECT_TIME);
- insint_c(d, "REDIRECT_COUNT", CURLINFO_REDIRECT_COUNT);
- insint_c(d, "HTTP_CONNECTCODE", CURLINFO_HTTP_CONNECTCODE);
- insint_c(d, "HTTPAUTH_AVAIL", CURLINFO_HTTPAUTH_AVAIL);
- insint_c(d, "PROXYAUTH_AVAIL", CURLINFO_PROXYAUTH_AVAIL);
- insint_c(d, "OS_ERRNO", CURLINFO_OS_ERRNO);
- insint_c(d, "NUM_CONNECTS", CURLINFO_NUM_CONNECTS);
- insint_c(d, "SSL_ENGINES", CURLINFO_SSL_ENGINES);
-
- /* curl_closepolicy: constants for setopt(CLOSEPOLICY, x) */
- insint_c(d, "CLOSEPOLICY_OLDEST", CURLCLOSEPOLICY_OLDEST);
- insint_c(d, "CLOSEPOLICY_LEAST_RECENTLY_USED", CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
- insint_c(d, "CLOSEPOLICY_LEAST_TRAFFIC", CURLCLOSEPOLICY_LEAST_TRAFFIC);
- insint_c(d, "CLOSEPOLICY_SLOWEST", CURLCLOSEPOLICY_SLOWEST);
- insint_c(d, "CLOSEPOLICY_CALLBACK", CURLCLOSEPOLICY_CALLBACK);
-
- /* options for global_init() */
- insint(d, "GLOBAL_SSL", CURL_GLOBAL_SSL);
- insint(d, "GLOBAL_WIN32", CURL_GLOBAL_WIN32);
- insint(d, "GLOBAL_ALL", CURL_GLOBAL_ALL);
- insint(d, "GLOBAL_NOTHING", CURL_GLOBAL_NOTHING);
- insint(d, "GLOBAL_DEFAULT", CURL_GLOBAL_DEFAULT);
-
- /* curl_lock_data: XXX do we need this in pycurl ??? */
- /* curl_lock_access: XXX do we need this in pycurl ??? */
- /* CURLSHcode: XXX do we need this in pycurl ??? */
- /* CURLSHoption: XXX do we need this in pycurl ??? */
-
- /* CURLversion: constants for curl_version_info(x) */
-#if 0
- /* XXX - do we need these ?? */
- insint(d, "VERSION_FIRST", CURLVERSION_FIRST);
- insint(d, "VERSION_SECOND", CURLVERSION_SECOND);
- insint(d, "VERSION_THIRD", CURLVERSION_THIRD);
- insint(d, "VERSION_NOW", CURLVERSION_NOW);
-#endif
-
- /* version features - bitmasks for curl_version_info_data.features */
-#if 0
- /* XXX - do we need these ?? */
- /* XXX - should we really rename these ?? */
- insint(d, "VERSION_FEATURE_IPV6", CURL_VERSION_IPV6);
- insint(d, "VERSION_FEATURE_KERBEROS4", CURL_VERSION_KERBEROS4);
- insint(d, "VERSION_FEATURE_SSL", CURL_VERSION_SSL);
- insint(d, "VERSION_FEATURE_LIBZ", CURL_VERSION_LIBZ);
- insint(d, "VERSION_FEATURE_NTLM", CURL_VERSION_NTLM);
- insint(d, "VERSION_FEATURE_GSSNEGOTIATE", CURL_VERSION_GSSNEGOTIATE);
- insint(d, "VERSION_FEATURE_DEBUG", CURL_VERSION_DEBUG);
- insint(d, "VERSION_FEATURE_ASYNCHDNS", CURL_VERSION_ASYNCHDNS);
- insint(d, "VERSION_FEATURE_SPNEGO", CURL_VERSION_SPNEGO);
- insint(d, "VERSION_FEATURE_LARGEFILE", CURL_VERSION_LARGEFILE);
- insint(d, "VERSION_FEATURE_IDN", CURL_VERSION_IDN);
-#endif
-
- /**
- ** the order of these constants mostly follows <curl/multi.h>
- **/
-
- /* CURLMcode: multi error codes */
- insint_m(d, "E_CALL_MULTI_PERFORM", CURLM_CALL_MULTI_PERFORM);
- insint_m(d, "E_MULTI_OK", CURLM_OK);
- insint_m(d, "E_MULTI_BAD_HANDLE", CURLM_BAD_HANDLE);
- insint_m(d, "E_MULTI_BAD_EASY_HANDLE", CURLM_BAD_EASY_HANDLE);
- insint_m(d, "E_MULTI_OUT_OF_MEMORY", CURLM_OUT_OF_MEMORY);
- insint_m(d, "E_MULTI_INTERNAL_ERROR", CURLM_INTERNAL_ERROR);
-
- /* Check the version, as this has caused nasty problems in
- * some cases. */
- vi = curl_version_info(CURLVERSION_NOW);
- if (vi == NULL) {
- Py_FatalError("pycurl: FATAL: curl_version_info() failed");
- assert(0);
- }
- if (vi->version_num < LIBCURL_VERSION_NUM) {
- Py_FatalError("pycurl: FATAL: libcurl link-time version is older than compile-time version");
- assert(0);
- }
-
- /* Finally initialize global interpreter lock */
- PyEval_InitThreads();
-}
-
-/* vi:ts=4:et:nowrap
- */
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import sys, threading, time
-import pycurl
-
-# We should ignore SIGPIPE when using pycurl.NOSIGNAL - see
-# the libcurl tutorial for more info.
-try:
- import signal
- from signal import SIGPIPE, SIG_IGN
- signal.signal(signal.SIGPIPE, signal.SIG_IGN)
-except ImportError:
- pass
-
-
-class Test(threading.Thread):
- def __init__(self, url, ofile):
- threading.Thread.__init__(self)
- self.curl = pycurl.Curl()
- self.curl.setopt(pycurl.URL, url)
- self.curl.setopt(pycurl.WRITEDATA, ofile)
- self.curl.setopt(pycurl.FOLLOWLOCATION, 1)
- self.curl.setopt(pycurl.MAXREDIRS, 5)
- self.curl.setopt(pycurl.NOSIGNAL, 1)
-
- def run(self):
- self.curl.perform()
- self.curl.close()
- sys.stdout.write(".")
- sys.stdout.flush()
-
-
-# Read list of URIs from file specified on commandline
-try:
- urls = open(sys.argv[1]).readlines()
-except IndexError:
- # No file was specified, show usage string
- print "Usage: %s <file with uris to fetch>" % sys.argv[0]
- raise SystemExit
-
-# Initialize thread array and the file number
-threads = []
-fileno = 0
-
-# Start one thread per URI in parallel
-t1 = time.time()
-for url in urls:
- f = open(str(fileno), "wb")
- t = Test(url, f)
- t.start()
- threads.append((t, f))
- fileno = fileno + 1
-# Wait for all threads to finish
-for thread, file in threads:
- thread.join()
- file.close()
-t2 = time.time()
-print "\n** Multithreading, %d seconds elapsed for %d uris" % (int(t2-t1), len(urls))
-
-# Start one thread per URI in sequence
-fileno = 0
-t1 = time.time()
-for url in urls:
- f = open(str(fileno), "wb")
- t = Test(url, f)
- t.start()
- fileno = fileno + 1
- t.join()
- f.close()
-t2 = time.time()
-print "\n** Singlethreading, %d seconds elapsed for %d uris" % (int(t2-t1), len(urls))
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import sys
-import pycurl
-
-## Callback function invoked when body data is ready
-def body(buf):
- # Print body data to stdout
- sys.stdout.write(buf)
-
-## Callback function invoked when header data is ready
-def header(buf):
- # Print header data to stderr
- sys.stderr.write(buf)
-
-c = pycurl.Curl()
-c.setopt(pycurl.URL, 'http://www.python.org/')
-c.setopt(pycurl.WRITEFUNCTION, body)
-c.setopt(pycurl.HEADERFUNCTION, header)
-c.setopt(pycurl.FOLLOWLOCATION, 1)
-c.setopt(pycurl.MAXREDIRS, 5)
-c.perform()
-c.setopt(pycurl.URL, 'http://curl.haxx.se/')
-c.perform()
-c.close()
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import pycurl
-
-def test(t, b):
- print "debug(%d): %s" % (t, b)
-
-c = pycurl.Curl()
-c.setopt(pycurl.URL, 'http://curl.haxx.se/')
-c.setopt(pycurl.VERBOSE, 1)
-c.setopt(pycurl.DEBUGFUNCTION, test)
-c.perform()
-c.close()
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import time
-import pycurl
-
-
-## Callback function invoked when progress information is updated
-def progress(download_t, download_d, upload_t, upload_d):
- print "Total to download %d bytes, have %d bytes so far" % \
- (download_t, download_d)
-
-url = "http://www.cnn.com"
-
-print "Starting downloading", url
-print
-f = open("body", "wb")
-h = open("header", "wb")
-c = pycurl.Curl()
-c.setopt(c.URL, url)
-c.setopt(c.WRITEDATA, f)
-c.setopt(c.NOPROGRESS, 0)
-c.setopt(c.PROGRESSFUNCTION, progress)
-c.setopt(c.FOLLOWLOCATION, 1)
-c.setopt(c.MAXREDIRS, 5)
-c.setopt(c.WRITEHEADER, h)
-c.setopt(c.OPT_FILETIME, 1)
-c.perform()
-
-print
-print "HTTP-code:", c.getinfo(c.HTTP_CODE)
-print "Total-time:", c.getinfo(c.TOTAL_TIME)
-print "Download speed: %.2f bytes/second" % c.getinfo(c.SPEED_DOWNLOAD)
-print "Document size: %d bytes" % c.getinfo(c.SIZE_DOWNLOAD)
-print "Effective URL:", c.getinfo(c.EFFECTIVE_URL)
-print "Content-type:", c.getinfo(c.CONTENT_TYPE)
-print "Namelookup-time:", c.getinfo(c.NAMELOOKUP_TIME)
-print "Redirect-time:", c.getinfo(c.REDIRECT_TIME)
-print "Redirect-count:", c.getinfo(c.REDIRECT_COUNT)
-epoch = c.getinfo(c.INFO_FILETIME)
-print "Filetime: %d (%s)" % (epoch, time.ctime(epoch))
-print
-print "Header is in file 'header', body is in file 'body'"
-
-c.close()
-f.close()
-h.close()
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import sys, threading
-from gtk import *
-import pycurl
-
-# We should ignore SIGPIPE when using pycurl.NOSIGNAL - see
-# the libcurl tutorial for more info.
-try:
- import signal
- from signal import SIGPIPE, SIG_IGN
- signal.signal(signal.SIGPIPE, signal.SIG_IGN)
-except ImportError:
- pass
-
-
-class ProgressBar:
- def __init__(self, uri):
- self.round = 0.0
- win = GtkDialog()
- win.set_title("PycURL progress")
- win.show()
- vbox = GtkVBox(spacing=5)
- vbox.set_border_width(10)
- win.vbox.pack_start(vbox)
- win.set_default_size(200, 20)
- vbox.show()
- label = GtkLabel("Downloading %s" % uri)
- label.set_alignment(0, 0.5)
- vbox.pack_start(label, expand=FALSE)
- label.show()
- pbar = GtkProgressBar()
- pbar.show()
- self.pbar = pbar
- vbox.pack_start(pbar)
- win.connect("destroy", self.close_app)
- win.connect("delete_event", self.close_app)
-
- def progress(self, download_t, download_d, upload_t, upload_d):
- threads_enter()
- if download_t == 0:
- self.round = self.round + 0.1
- if self.round >= 1.0: self.round = 0.0
- else:
- self.round = float(download_d) / float(download_t)
- self.pbar.update(self.round)
- threads_leave()
-
- def mainloop(self):
- threads_enter()
- mainloop()
- threads_leave()
-
- def close_app(self, *args):
- args[0].destroy()
- mainquit()
-
-
-class Test(threading.Thread):
- def __init__(self, url, target_file, progress):
- threading.Thread.__init__(self)
- self.target_file = target_file
- self.progress = progress
- self.curl = pycurl.Curl()
- self.curl.setopt(pycurl.URL, url)
- self.curl.setopt(pycurl.WRITEDATA, self.target_file)
- self.curl.setopt(pycurl.FOLLOWLOCATION, 1)
- self.curl.setopt(pycurl.NOPROGRESS, 0)
- self.curl.setopt(pycurl.PROGRESSFUNCTION, self.progress)
- self.curl.setopt(pycurl.MAXREDIRS, 5)
- self.curl.setopt(pycurl.NOSIGNAL, 1)
-
- def run(self):
- self.curl.perform()
- self.curl.close()
- self.target_file.close()
- self.progress(1.0, 1.0, 0, 0)
-
-
-# Check command line args
-if len(sys.argv) < 3:
- print "Usage: %s <URL> <filename>" % sys.argv[0]
- raise SystemExit
-
-# Make a progress bar window
-p = ProgressBar(sys.argv[1])
-# Start thread for fetching url
-Test(sys.argv[1], open(sys.argv[2], 'wb'), p.progress).start()
-# Enter the GTK mainloop
-p.mainloop()
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-#
-# a simple self-test
-#
-
-try:
- # need Python 2.2 or better for garbage collection
- from gc import get_objects
- import gc
- del get_objects
- gc.enable()
-except ImportError:
- gc = None
-import copy, os, sys
-from StringIO import StringIO
-try:
- import cPickle
-except ImportError:
- cPickle = None
-try:
- import pickle
-except ImportError:
- pickle = None
-
-# update sys.path when running in the build directory
-from util import get_sys_path
-sys.path = get_sys_path()
-
-import pycurl
-from pycurl import Curl, CurlMulti
-
-
-class opts:
- verbose = 1
-
-if "-q" in sys.argv:
- opts.verbose = opts.verbose - 1
-
-
-print "Python", sys.version
-print "PycURL %s (compiled against 0x%x)" % (pycurl.version, pycurl.COMPILE_LIBCURL_VERSION_NUM)
-print "PycURL version info", pycurl.version_info()
-print " %s, compiled %s" % (pycurl.__file__, pycurl.COMPILE_DATE)
-
-
-# /***********************************************************************
-# // test misc
-# ************************************************************************/
-
-if 1:
- c = Curl()
- assert c.URL is pycurl.URL
- del c
-
-
-# /***********************************************************************
-# // test handles
-# ************************************************************************/
-
-# remove an invalid handle: this should fail
-if 1:
- m = CurlMulti()
- c = Curl()
- try:
- m.remove_handle(c)
- except pycurl.error:
- pass
- else:
- assert 0, "internal error"
- del m, c
-
-
-# remove an invalid but closed handle
-if 1:
- m = CurlMulti()
- c = Curl()
- c.close()
- m.remove_handle(c)
- del m, c
-
-
-# add a closed handle: this should fail
-if 1:
- m = CurlMulti()
- c = Curl()
- c.close()
- try:
- m.add_handle(c)
- except pycurl.error:
- pass
- else:
- assert 0, "internal error"
- m.close()
- del m, c
-
-
-# add a handle twice: this should fail
-if 1:
- m = CurlMulti()
- c = Curl()
- m.add_handle(c)
- try:
- m.add_handle(c)
- except pycurl.error:
- pass
- else:
- assert 0, "internal error"
- del m, c
-
-
-# add a handle on multiple stacks: this should fail
-if 1:
- m1 = CurlMulti()
- m2 = CurlMulti()
- c = Curl()
- m1.add_handle(c)
- try:
- m2.add_handle(c)
- except pycurl.error:
- pass
- else:
- assert 0, "internal error"
- del m1, m2, c
-
-
-# move a handle
-if 1:
- m1 = CurlMulti()
- m2 = CurlMulti()
- c = Curl()
- m1.add_handle(c)
- m1.remove_handle(c)
- m2.add_handle(c)
- del m1, m2, c
-
-
-# /***********************************************************************
-# // test copying and pickling - copying and pickling of
-# // instances of Curl and CurlMulti is not allowed
-# ************************************************************************/
-
-if 1 and copy:
- c = Curl()
- m = CurlMulti()
- try:
- copy.copy(c)
- except copy.Error:
- pass
- else:
- assert 0, "internal error - copying should fail"
- try:
- copy.copy(m)
- except copy.Error:
- pass
- else:
- assert 0, "internal error - copying should fail"
-
-if 1 and pickle:
- c = Curl()
- m = CurlMulti()
- fp = StringIO()
- p = pickle.Pickler(fp, 1)
- try:
- p.dump(c)
- except pickle.PicklingError:
- pass
- else:
- assert 0, "internal error - pickling should fail"
- try:
- p.dump(m)
- except pickle.PicklingError:
- pass
- else:
- assert 0, "internal error - pickling should fail"
- del c, m, fp, p
-
-if 1 and cPickle:
- c = Curl()
- m = CurlMulti()
- fp = StringIO()
- p = cPickle.Pickler(fp, 1)
- try:
- p.dump(c)
- except cPickle.PicklingError:
- pass
- else:
- assert 0, "internal error - pickling should fail"
- try:
- p.dump(m)
- except cPickle.PicklingError:
- pass
- else:
- assert 0, "internal error - pickling should fail"
- del c, m, fp, p
-
-
-# /***********************************************************************
-# // test refcounts
-# ************************************************************************/
-
-# basic check of reference counting (use a memory checker like valgrind)
-if 1:
- c = Curl()
- m = CurlMulti()
- m.add_handle(c)
- del m
- m = CurlMulti()
- c.close()
- del m, c
-
-# basic check of cyclic garbage collection
-if 1 and gc:
- gc.collect()
- c = Curl()
- c.m = CurlMulti()
- c.m.add_handle(c)
- # create some nasty cyclic references
- c.c = c
- c.c.c1 = c
- c.c.c2 = c
- c.c.c3 = c.c
- c.c.c4 = c.m
- c.m.c = c
- c.m.m = c.m
- c.m.c = c
- # delete
- gc.collect()
- flags = gc.DEBUG_COLLECTABLE | gc.DEBUG_UNCOLLECTABLE | gc.DEBUG_OBJECTS
- if opts.verbose >= 1:
- flags = flags | gc.DEBUG_STATS
- gc.set_debug(flags)
- gc.collect()
- ##print gc.get_referrers(c)
- ##print gc.get_objects()
- if opts.verbose >= 1:
- print "Tracked objects:", len(gc.get_objects())
- # The `del' below should delete these 4 objects:
- # Curl + internal dict, CurlMulti + internal dict
- del c
- gc.collect()
- if opts.verbose >= 1:
- print "Tracked objects:", len(gc.get_objects())
-
-
-# /***********************************************************************
-# // done
-# ************************************************************************/
-
-print "All tests passed."
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-#
-# just a simple self-test
-# need Python 2.2 or better for garbage collection
-#
-
-import gc, pycurl, sys
-gc.enable()
-
-
-print "Python", sys.version
-print "PycURL %s (compiled against 0x%x)" % (pycurl.version, pycurl.COMPILE_LIBCURL_VERSION_NUM)
-##print "PycURL version info", pycurl.version_info()
-print " %s, compiled %s" % (pycurl.__file__, pycurl.COMPILE_DATE)
-
-
-gc.collect()
-flags = gc.DEBUG_COLLECTABLE | gc.DEBUG_UNCOLLECTABLE | gc.DEBUG_OBJECTS
-if 1:
- flags = flags | gc.DEBUG_STATS
-gc.set_debug(flags)
-gc.collect()
-
-print "Tracked objects:", len(gc.get_objects())
-
-multi = pycurl.CurlMulti()
-t = []
-for a in range(100):
- curl = pycurl.Curl()
- multi.add_handle(curl)
- t.append(curl)
-
-print "Tracked objects:", len(gc.get_objects())
-
-for curl in t:
- curl.close()
- multi.remove_handle(curl)
-
-print "Tracked objects:", len(gc.get_objects())
-
-del curl
-del t
-del multi
-
-print "Tracked objects:", len(gc.get_objects())
-gc.collect()
-print "Tracked objects:", len(gc.get_objects())
-
-
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import pycurl
-
-m = pycurl.CurlMulti()
-m.handles = []
-c1 = pycurl.Curl()
-c2 = pycurl.Curl()
-c1.setopt(c1.URL, 'http://curl.haxx.se')
-c2.setopt(c2.URL, 'http://cnn.com')
-c2.setopt(c2.FOLLOWLOCATION, 1)
-m.add_handle(c1)
-m.add_handle(c2)
-m.handles.append(c1)
-m.handles.append(c2)
-
-num_handles = len(m.handles)
-while num_handles:
- while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM:
- break
- m.select()
-
-m.remove_handle(c2)
-m.remove_handle(c1)
-del m.handles
-m.close()
-c1.close()
-c2.close()
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import os, sys
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
-import pycurl
-
-
-urls = (
- "http://curl.haxx.se",
- "http://www.python.org",
- "http://pycurl.sourceforge.net",
- "http://pycurl.sourceforge.net/tests/403_FORBIDDEN", # that actually exists ;-)
- "http://pycurl.sourceforge.net/tests/404_NOT_FOUND",
-)
-
-# Read list of URIs from file specified on commandline
-try:
- urls = open(sys.argv[1], "rb").readlines()
-except IndexError:
- # No file was specified
- pass
-
-# init
-m = pycurl.CurlMulti()
-m.handles = []
-for url in urls:
- c = pycurl.Curl()
- # save info in standard Python attributes
- c.url = url
- c.body = StringIO()
- c.http_code = -1
- m.handles.append(c)
- # pycurl API calls
- c.setopt(c.URL, c.url)
- c.setopt(c.WRITEFUNCTION, c.body.write)
- m.add_handle(c)
-
-# get data
-num_handles = len(m.handles)
-while num_handles:
- while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM:
- break
- # currently no more I/O is pending, could do something in the meantime
- # (display a progress bar, etc.)
- m.select()
-
-# close handles
-for c in m.handles:
- # save info in standard Python attributes
- c.http_code = c.getinfo(c.HTTP_CODE)
- # pycurl API calls
- m.remove_handle(c)
- c.close()
-m.close()
-
-# print result
-for c in m.handles:
- data = c.body.getvalue()
- if 0:
- print "**********", c.url, "**********"
- print data
- else:
- print "%-53s http_code %3d, %6d bytes" % (c.url, c.http_code, len(data))
-
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-# same as test_multi2.py, but enforce some debugging and strange API-calls
-
-import os, sys
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
-import pycurl
-
-
-urls = (
- "http://curl.haxx.se",
- "http://www.python.org",
- "http://pycurl.sourceforge.net",
- "http://pycurl.sourceforge.net/THIS_HANDLE_IS_CLOSED",
-)
-
-# init
-m = pycurl.CurlMulti()
-m.handles = []
-for url in urls:
- c = pycurl.Curl()
- # save info in standard Python attributes
- c.url = url
- c.body = StringIO()
- c.http_code = -1
- c.debug = 0
- m.handles.append(c)
- # pycurl API calls
- c.setopt(c.URL, c.url)
- c.setopt(c.WRITEFUNCTION, c.body.write)
- m.add_handle(c)
-
-# debug - close a handle
-if 1:
- c = m.handles[3]
- c.debug = 1
- c.close()
-
-# get data
-num_handles = len(m.handles)
-while num_handles:
- while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM:
- break
- # currently no more I/O is pending, could do something in the meantime
- # (display a progress bar, etc.)
- m.select()
-
-# close handles
-for c in m.handles:
- # save info in standard Python attributes
- try:
- c.http_code = c.getinfo(c.HTTP_CODE)
- except pycurl.error:
- # handle already closed - see debug above
- assert c.debug
- c.http_code = -1
- # pycurl API calls
- if 0:
- m.remove_handle(c)
- c.close()
- elif 0:
- # in the C API this is the wrong calling order, but pycurl
- # handles this automatically
- c.close()
- m.remove_handle(c)
- else:
- # actually, remove_handle is called automatically on close
- c.close()
-m.close()
-
-# print result
-for c in m.handles:
- data = c.body.getvalue()
- if 0:
- print "**********", c.url, "**********"
- print data
- else:
- print "%-53s http_code %3d, %6d bytes" % (c.url, c.http_code, len(data))
-
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import sys, select, time
-import pycurl
-
-c1 = pycurl.Curl()
-c2 = pycurl.Curl()
-c3 = pycurl.Curl()
-c1.setopt(c1.URL, "http://www.python.org")
-c2.setopt(c2.URL, "http://curl.haxx.se")
-c3.setopt(c3.URL, "http://slashdot.org")
-c1.body = open("doc1", "wb")
-c2.body = open("doc2", "wb")
-c3.body = open("doc3", "wb")
-c1.setopt(c1.WRITEFUNCTION, c1.body.write)
-c2.setopt(c2.WRITEFUNCTION, c2.body.write)
-c3.setopt(c3.WRITEFUNCTION, c3.body.write)
-
-m = pycurl.CurlMulti()
-m.add_handle(c1)
-m.add_handle(c2)
-m.add_handle(c3)
-
-# Number of seconds to wait for a timeout to happen
-SELECT_TIMEOUT = 10
-
-# Stir the state machine into action
-while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM:
- break
-
-# Keep going until all the connections have terminated
-while num_handles:
- apply(select.select, m.fdset() + (SELECT_TIMEOUT,))
- while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM:
- break
-
-# Cleanup
-m.remove_handle(c3)
-m.remove_handle(c2)
-m.remove_handle(c1)
-m.close()
-c1.body.close()
-c2.body.close()
-c3.body.close()
-c1.close()
-c2.close()
-c3.close()
-print "http://www.python.org is in file doc1"
-print "http://curl.haxx.se is in file doc2"
-print "http://slashdot.org is in file doc3"
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import sys, select, time
-import pycurl
-
-c1 = pycurl.Curl()
-c2 = pycurl.Curl()
-c3 = pycurl.Curl()
-c1.setopt(c1.URL, "http://www.python.org")
-c2.setopt(c2.URL, "http://curl.haxx.se")
-c3.setopt(c3.URL, "http://slashdot.org")
-c1.body = open("doc1", "wb")
-c2.body = open("doc2", "wb")
-c3.body = open("doc3", "wb")
-c1.setopt(c1.WRITEFUNCTION, c1.body.write)
-c2.setopt(c2.WRITEFUNCTION, c2.body.write)
-c3.setopt(c3.WRITEFUNCTION, c3.body.write)
-
-m = pycurl.CurlMulti()
-m.add_handle(c1)
-m.add_handle(c2)
-m.add_handle(c3)
-
-# Number of seconds to wait for a timeout to happen
-SELECT_TIMEOUT = 10
-
-# Stir the state machine into action
-while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM:
- break
-
-# Keep going until all the connections have terminated
-while num_handles:
- # The select method uses fdset internally to determine which file descriptors
- # to check.
- m.select(SELECT_TIMEOUT)
- while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM:
- break
-
-# Cleanup
-m.remove_handle(c3)
-m.remove_handle(c2)
-m.remove_handle(c1)
-m.close()
-c1.body.close()
-c2.body.close()
-c3.body.close()
-c1.close()
-c2.close()
-c3.close()
-print "http://www.python.org is in file doc1"
-print "http://curl.haxx.se is in file doc2"
-print "http://slashdot.org is in file doc3"
-
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import sys, select, time
-import pycurl
-
-c1 = pycurl.Curl()
-c2 = pycurl.Curl()
-c3 = pycurl.Curl()
-c1.setopt(c1.URL, "http://www.python.org")
-c2.setopt(c2.URL, "http://curl.haxx.se")
-c3.setopt(c3.URL, "http://slashdot.org")
-c1.body = open("doc1", "wb")
-c2.body = open("doc2", "wb")
-c3.body = open("doc3", "wb")
-c1.setopt(c1.WRITEFUNCTION, c1.body.write)
-c2.setopt(c2.WRITEFUNCTION, c2.body.write)
-c3.setopt(c3.WRITEFUNCTION, c3.body.write)
-
-m = pycurl.CurlMulti()
-m.add_handle(c1)
-m.add_handle(c2)
-m.add_handle(c3)
-
-# Number of seconds to wait for a timeout to happen
-SELECT_TIMEOUT = 10
-
-# Stir the state machine into action
-while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM:
- break
-
-# Keep going until all the connections have terminated
-while num_handles:
- # The select method uses fdset internally to determine which file descriptors
- # to check.
- m.select(SELECT_TIMEOUT)
- while 1:
- ret, num_handles = m.perform()
- # Print the message, if any
- print m.info_read(1)
- if ret != pycurl.E_CALL_MULTI_PERFORM:
- break
-
-# Cleanup
-m.remove_handle(c3)
-m.remove_handle(c2)
-m.remove_handle(c1)
-m.close()
-c1.body.close()
-c2.body.close()
-c3.body.close()
-c1.close()
-c2.close()
-c3.close()
-print "http://www.python.org is in file doc1"
-print "http://curl.haxx.se is in file doc2"
-print "http://slashdot.org is in file doc3"
-
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import os, sys, time
-from threading import Thread, RLock
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
-import pycurl
-
-# We should ignore SIGPIPE when using pycurl.NOSIGNAL - see
-# the libcurl tutorial for more info.
-try:
- import signal
- from signal import SIGPIPE, SIG_IGN
- signal.signal(signal.SIGPIPE, signal.SIG_IGN)
-except ImportError:
- pass
-
-# The conclusion is: the multi interface is fastest!
-
-NUM_PAGES = 30
-NUM_THREADS = 10
-assert NUM_PAGES % NUM_THREADS == 0
-
-##URL = "http://pycurl.sourceforge.net/tests/testgetvars.php?%d"
-URL = "http://pycurl.sourceforge.net/tests/teststaticpage.html?%d"
-
-
-#
-# util
-#
-
-class Curl:
- def __init__(self, url):
- self.url = url
- self.body = StringIO()
- self.http_code = -1
- # pycurl API calls
- self._curl = pycurl.Curl()
- self._curl.setopt(pycurl.URL, self.url)
- self._curl.setopt(pycurl.WRITEFUNCTION, self.body.write)
- self._curl.setopt(pycurl.NOSIGNAL, 1)
-
- def perform(self):
- self._curl.perform()
-
- def close(self):
- self.http_code = self._curl.getinfo(pycurl.HTTP_CODE)
- self._curl.close()
-
-
-def print_result(items):
- return # DO NOTHING
- #
- for c in items:
- data = c.body.getvalue()
- if 0:
- print "**********", c.url, "**********"
- print data
- elif 1:
- print "%-60s %3d %6d" % (c.url, c.http_code, len(data))
-
-
-###
-### 1) multi
-###
-
-def test_multi():
- clock1 = time.time()
-
- # init
- handles = []
- m = pycurl.CurlMulti()
- for i in range(NUM_PAGES):
- c = Curl(URL %i)
- m.add_handle(c._curl)
- handles.append(c)
-
- clock2 = time.time()
-
- # stir state machine into action
- while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM:
- break
-
- # get data
- while num_handles:
- m.select()
- while 1:
- ret, num_handles = m.perform()
- if ret != pycurl.E_CALL_MULTI_PERFORM:
- break
-
- clock3 = time.time()
-
- # close handles
- for c in handles:
- c.close()
- m.close()
-
- clock4 = time.time()
- print "multi interface: %d pages: perform %5.2f secs, total %5.2f secs" % (NUM_PAGES, clock3 - clock2, clock4 - clock1)
-
- # print result
- print_result(handles)
-
-
-
-###
-### 2) thread
-###
-
-class Test(Thread):
- def __init__(self, lock=None):
- Thread.__init__(self)
- self.lock = lock
- self.items = []
-
- def run(self):
- if self.lock:
- self.lock.acquire()
- self.lock.release()
- for c in self.items:
- c.perform()
-
-
-def test_threads(lock=None):
- clock1 = time.time()
-
- # create and start threads, but block them
- if lock:
- lock.acquire()
-
- # init (FIXME - this is ugly)
- threads = []
- handles = []
- t = None
- for i in range(NUM_PAGES):
- if i % (NUM_PAGES / NUM_THREADS) == 0:
- t = Test(lock)
- if lock:
- t.start()
- threads.append(t)
- c = Curl(URL % i)
- t.items.append(c)
- handles.append(c)
- assert len(handles) == NUM_PAGES
- assert len(threads) == NUM_THREADS
-
- clock2 = time.time()
-
- #
- if lock:
- # release lock to let the blocked threads run
- lock.release()
- else:
- # start threads
- for t in threads:
- t.start()
- # wait for threads to finish
- for t in threads:
- t.join()
-
- clock3 = time.time()
-
- # close handles
- for c in handles:
- c.close()
-
- clock4 = time.time()
- if lock:
- print "thread interface [lock]: %d pages: perform %5.2f secs, total %5.2f secs" % (NUM_PAGES, clock3 - clock2, clock4 - clock1)
- else:
- print "thread interface: %d pages: perform %5.2f secs, total %5.2f secs" % (NUM_PAGES, clock3 - clock2, clock4 - clock1)
-
- # print result
- print_result(handles)
-
-
-
-###
-### 3) thread - threads grab curl objects on demand from a shared pool
-###
-
-class TestPool(Thread):
- def __init__(self, lock, pool):
- Thread.__init__(self)
- self.lock = lock
- self.pool = pool
-
- def run(self):
- while 1:
- self.lock.acquire()
- c = None
- if self.pool:
- c = self.pool.pop()
- self.lock.release()
- if c is None:
- break
- c.perform()
-
-
-def test_thread_pool(lock):
- clock1 = time.time()
-
- # init
- handles = []
- for i in range(NUM_PAGES):
- c = Curl(URL %i)
- handles.append(c)
-
- # create and start threads, but block them
- lock.acquire()
- threads = []
- pool = handles[:] # shallow copy of the list, shared for pop()
- for i in range(NUM_THREADS):
- t = TestPool(lock, pool)
- t.start()
- threads.append(t)
- assert len(pool) == NUM_PAGES
- assert len(threads) == NUM_THREADS
-
- clock2 = time.time()
-
- # release lock to let the blocked threads run
- lock.release()
-
- # wait for threads to finish
- for t in threads:
- t.join()
-
- clock3 = time.time()
-
- # close handles
- for c in handles:
- c.close()
-
- clock4 = time.time()
- print "thread interface [pool]: %d pages: perform %5.2f secs, total %5.2f secs" % (NUM_PAGES, clock3 - clock2, clock4 - clock1)
-
- # print result
- print_result(handles)
-
-
-
-lock = RLock()
-if 1:
- test_multi()
- test_threads()
- test_threads(lock)
- test_thread_pool(lock)
-else:
- test_thread_pool(lock)
- test_threads(lock)
- test_threads()
- test_multi()
-
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import urllib
-import pycurl
-
-# simple
-pf = {'field1': 'value1'}
-
-# multiple fields
-pf = {'field1':'value1', 'field2':'value2 with blanks', 'field3':'value3'}
-
-# multiple fields with & in field
-pf = {'field1':'value1', 'field2':'value2 with blanks and & chars',
- 'field3':'value3'}
-
-c = pycurl.Curl()
-c.setopt(c.URL, 'http://pycurl.sourceforge.net/tests/testpostvars.php')
-c.setopt(c.POSTFIELDS, urllib.urlencode(pf))
-c.setopt(c.VERBOSE, 1)
-c.perform()
-c.close()
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import pycurl
-
-pf = [('field1', 'this is a test using httppost & stuff'),
- ('field2', (pycurl.FORM_FILE, 'test_post.py', pycurl.FORM_FILE, 'test_post2.py')),
- ('field3', (pycurl.FORM_CONTENTS, 'this is wei\000rd, but null-bytes are okay'))
- ]
-
-c = pycurl.Curl()
-c.setopt(c.URL, 'http://www.contactor.se/~dast/postit.cgi')
-c.setopt(c.HTTPPOST, pf)
-c.setopt(c.VERBOSE, 1)
-c.perform()
-c.close()
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import urllib
-POSTSTRING = urllib.urlencode({'field1':'value1', 'field2':'value2 with blanks', 'field3':'value3'})
-
-class test:
-
- def __init__(self):
- self.finished = False
-
- def read_cb(self, size):
- assert len(POSTSTRING) <= size
- if not self.finished:
- self.finished = True
- return POSTSTRING
- else:
- # Nothing more to read
- return ""
-
-import pycurl
-c = pycurl.Curl()
-t = test()
-c.setopt(c.URL, 'http://pycurl.sourceforge.net/tests/testpostvars.php')
-c.setopt(c.POST, 1)
-c.setopt(c.POSTFIELDSIZE, len(POSTSTRING))
-c.setopt(c.READFUNCTION, t.read_cb)
-c.setopt(c.VERBOSE, 1)
-c.perform()
-c.close()
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import sys
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
-import pycurl
-
-url = "http://curl.haxx.se/dev/"
-
-print "Testing", pycurl.version
-
-body = StringIO()
-c = pycurl.Curl()
-c.setopt(c.URL, url)
-c.setopt(c.WRITEFUNCTION, body.write)
-c.perform()
-c.close()
-
-contents = body.getvalue()
-print contents
+++ /dev/null
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-## XML-RPC lib included in python2.2
-import xmlrpclib
-import pycurl
-
-# Header fields passed in request
-xmlrpc_header = [
- "User-Agent: PycURL XML-RPC Test", "Content-Type: text/xml"
- ]
-
-# XML-RPC request template
-xmlrpc_template = """
-<?xml version='1.0'?><methodCall><methodName>%s</methodName>%s</methodCall>
-"""
-
-# Engage
-c = pycurl.Curl()
-c.setopt(c.URL, 'http://betty.userland.com/RPC2')
-c.setopt(c.POST, 1)
-c.setopt(c.HTTPHEADER, xmlrpc_header)
-c.setopt(c.POSTFIELDS, xmlrpc_template % ("examples.getStateName", xmlrpclib.dumps((5,))))
-
-print 'Response from http://betty.userland.com/'
-c.perform()
-c.close()
+++ /dev/null
-# -*- coding: iso-8859-1 -*-
-# vi:ts=4:et
-# $Id$
-
-import os, sys
-
-#
-# prepare sys.path in case we are still in the build directory
-# see also: distutils/command/build.py (build_platlib)
-#
-
-def get_sys_path(p=None):
- if p is None: p = sys.path
- p = p[:]
- try:
- from distutils.util import get_platform
- except ImportError:
- return p
- p0 = ""
- if p: p0 = p[0]
- #
- plat = get_platform()
- plat_specifier = "%s-%s" % (plat, sys.version[:3])
- ##print plat, plat_specifier
- #
- for prefix in (p0, os.curdir, os.pardir,):
- if not prefix:
- continue
- d = os.path.join(prefix, "build")
- for subdir in ("lib", "lib." + plat_specifier, "lib." + plat):
- dir = os.path.normpath(os.path.join(d, subdir))
- if os.path.isdir(dir):
- if dir not in p:
- p.insert(1, dir)
- #
- return p
-
-
+++ /dev/null
-#!/usr/bin/env plcsh
-# $Id$
-
-import sys,os,time
-
-def Run (peername):
- timestring=time.strftime("%Y-%m-%d-%H-%M-%S")
- print 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',peername
- print 'RefreshPeer on %s - starting on %s'%(peername,timestring)
- print 'xxxxxxxxxx'
- sys.stdout.flush()
- start=time.time()
- result=RefreshPeer(peername)
- finish=time.time()
-
- print 'Total duration',finish-start
- print 'xxxxxxxxxx timers:'
- keys=result.keys()
- keys.sort()
- for key in keys:
- print key,result[key]
- sys.stdout.flush()
- sys.stderr.flush()
-
-def RunInLog (peername):
- monthstring=time.strftime("%Y-%m")
- logname="/var/log/refresh-peer-%s-%s.log"%(peername,monthstring)
- sys.stdout=open(logname,'a')
- sys.stderr=sys.stdout
- Run(peername)
- sys.stderr.close()
- sys.stdout.close()
-
-if __name__ == "__main__":
-
- for peername in sys.argv[1:]:
- RunInLog (peername)
-
-
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from distutils.core import setup
from glob import glob
setup(py_modules = ['ModPython'],
- packages = ['PLC', 'PLC/Methods', 'PLC/Methods/system'],
+ packages = ['PLC', 'PLC/Methods', 'PLC/Methods/system', 'PLC/Accessors', 'PLC/Legacy'],
scripts = ['plcsh', 'Server.py'],
- data_files = [('', ['planetlab4.sql']),
- ('php', ['php/plc_api.php']),
- ('migrations', ['migrations/README.txt'] + glob('migrations/[0-9][0-9][0-9]*')),
- ])
+ data_files = [
+ ('', ['planetlab5.sql']),
+ ('php', ['php/plc_api.php']),
+ ('migrations',
+ ['migrations/README.txt',
+ 'migrations/extract-views.py']
+ + glob('migrations/[0-9][0-9][0-9]*')),
+ ('migrations/v42-to-v43',
+ ['migrations/v42-to-v43/migrate.sh',
+ 'migrations/v42-to-v43/migrate.sed',
+ 'migrations/v42-to-v43/migrate.sql',
+ 'migrations/v42-to-v43/parse-site-nodegroups.py',
+ 'migrations/v42-to-v43/site-nodegroups.def'
+ ]),
+ ])
# do not delete from primary tables
if foreign_key_parts[0] in ['addresses', 'boot_states', 'conf_files', \
- 'keys', 'messages', 'nodegroups', 'nodenetworks', 'nodes', 'pcus', 'peers' \
+ 'keys', 'messages', 'nodegroups', 'interfaces', 'nodes', 'pcus', 'peers' \
'persons', 'roles', 'sessions', 'sites', 'slices']:
#print "skipping table %s" % foreign_key_parts[0]
continue
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
import re
'nm_net_max_rate': 'net_max_rate',
'nm_net_exempt_min_rate': 'net_i2_min_rate',
'nm_net_exempt_max_rate': 'net_i2_max_rate'}
-for slice_attribute in GetSliceAttributes({'name': rename.keys()}):
+for slice_attribute in GetSliceTags({'name': rename.keys()}):
id = slice_attribute['slice_attribute_id']
name = slice_attribute['name']
slice_id = slice_attribute['slice_id']
# Add the new attribute
if GetSlices([slice_id]):
- AddSliceAttribute(slice_id, rename[name], str(kbps))
+ AddSliceTag(slice_id, rename[name], str(kbps))
# Delete the old attribute
- DeleteSliceAttribute(id)
+ DeleteSliceTag(id)
# Convert nm_net_{exempt_,}avg_rate to
# net_{i2_,}max_kbyte and net_{i2_,}thresh_kbyte
'thresh': 'net_thresh_kbyte'},
'nm_net_exempt_avg_rate': {'max': 'net_i2_max_kbyte',
'thresh': 'net_i2_thresh_kbyte'}}
-for slice_attribute in GetSliceAttributes({'name': rename.keys()}):
+for slice_attribute in GetSliceTags({'name': rename.keys()}):
id = slice_attribute['slice_attribute_id']
name = slice_attribute['name']
slice_id = slice_attribute['slice_id']
# Add the new attribute
if GetSlices([slice_id]):
- AddSliceAttribute(slice_id, rename[name]['max'], str(max_kbyte))
- AddSliceAttribute(slice_id, rename[name]['thresh'], str(thresh_kbyte))
+ AddSliceTag(slice_id, rename[name]['max'], str(max_kbyte))
+ AddSliceTag(slice_id, rename[name]['thresh'], str(thresh_kbyte))
# Delete the old attribute
- DeleteSliceAttribute(id)
+ DeleteSliceTag(id)
# Convert plc_slice_state
-for slice_attribute in GetSliceAttributes({'name': 'plc_slice_state'}):
+for slice_attribute in GetSliceTags({'name': 'plc_slice_state'}):
id = slice_attribute['slice_attribute_id']
name = slice_attribute['name']
slice_id = slice_attribute['slice_id']
# Add the new attribute
if GetSlices([slice_id]):
if slice_attribute['value'] == "suspended":
- AddSliceAttribute(slice_id, 'enabled', "0")
+ AddSliceTag(slice_id, 'enabled', "0")
else:
- AddSliceAttribute(slice_id, 'enabled', "1")
+ AddSliceTag(slice_id, 'enabled', "1")
# Delete the old attribute
- DeleteSliceAttribute(id)
+ DeleteSliceTag(id)
# Straight renames
rename = {'nm_cpu_share': 'cpu_share',
'nm_net_max_thresh_byte': 'net_thresh_kbyte',
'nm_net_max_exempt_byte': 'net_i2_max_kbyte',
'nm_net_max_thresh_exempt_byte': 'net_i2_thresh_kbyte'}
-for slice_attribute in GetSliceAttributes({'name': rename.keys()}):
+for slice_attribute in GetSliceTags({'name': rename.keys()}):
id = slice_attribute['slice_attribute_id']
name = slice_attribute['name']
slice_id = slice_attribute['slice_id']
# Add the new attribute
if GetSlices([slice_id]):
- AddSliceAttribute(slice_id, rename[name], value)
+ AddSliceTag(slice_id, rename[name], value)
# Delete the old attribute
- DeleteSliceAttribute(id)
+ DeleteSliceTag(id)
# Update plc_ticket_pubkey attribute
-for slice_attribute in GetSliceAttributes({'name': "plc_ticket_pubkey"}):
+for slice_attribute in GetSliceTags({'name': "plc_ticket_pubkey"}):
id = slice_attribute['slice_attribute_id']
- UpdateSliceAttribute(id, """
+ UpdateSliceTag(id, """
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDKXa72MEKDAnVyzEpKOB1ot2eW
xG/TG2aa7q/2oy1xf5XMmU9H9uKwO+GoUeinp1BSxgkVRF0VhEGGaqKR9kYQzX0k
ht4+P2hAr+UyU4cp0NxV4xfmyAbrNKuHVjawMUCu5BH0IkBUC/89ckxk71oROnak
""".lstrip())
# Delete _deleted and deprecated slice attributes and types
-for attribute_type in GetSliceAttributeTypes():
+for attribute_type in GetSliceTagTypes():
id = attribute_type['attribute_type_id']
name = attribute_type['name']
if name == 'general_prop_share' or \
re.match('nm_', name) or \
re.search('_deleted$', name):
- DeleteSliceAttributeType(id)
+ DeleteSliceTagType(id)
# N.B. Automatically deletes all slice attributes of this type
# Add Proper ops
for slice, op in proper_ops:
try:
- AddSliceAttribute(slice, 'proper_op', op)
+ AddSliceTag(slice, 'proper_op', op)
except Exception, err:
print "Warning: %s:" % slice, err
initscripts = dict([(initscript['initscript_id'], initscript) for initscript in [{'initscript_id': 8, 'script': 'IyEgL2Jpbi9zaA0KDQojIDxQcm9ncmFtIE5hbWU+DQojICAgIGJpbmRzY3JpcHQNCiMNCiMgPEF1dGhvcj4NCiMgICAgSmVmZnJ5IEpvaG5zdG9uIGFuZCBKZXJlbXkgUGxpY2h0YQ0KIw0KIyA8UHVycG9zZT4NCiMgICAgRG93bmxvYWRzIGFuZCBpbnN0YWxscyBzdG9yayBvbiBhIG5vZGUuDQoNCiMgc2F2ZSBvcmlnaW5hbCBQV0QNCk9MRFBXRD0kUFdEDQoNCiMgZXJyb3IgcmVwb3J0aW5nIGZ1bmN0aW9uDQplcnJvcigpDQp7DQogICBlY2hvDQogICBlY2hvICJQbGVhc2UgRS1tYWlsIHN0b3JrLXN1cHBvcnRAY3MuYXJpem9uYS5lZHUgaWYgeW91IGJlbGlldmUgeW91IGhhdmUiIA0KICAgZWNobyAicmVjZWl2ZWQgdGhpcyBtZXNzYWdlIGluIGVycm9yLiINCg0KICAgIyBnZXQgcmlkIG9mIENFUlQgZmlsZQ0KICAgaWYgWyAtZiAkQ0VSVCBdDQogICB0aGVuDQogICAgICBybSAtZiAkQ0VSVCA+IC9kZXYvbnVsbA0KICAgZmkNCg0KICAgIyByZXN0b3JlIG9yaWdpbmFsIFBXRA0KICAgY2QgJE9MRFBXRA0KICAgZXhpdCAxDQp9DQoNCkNFUlQ9YHB3ZGAvdGVtcGNydGZpbGUNCg0KI2Z1bmN0aW9ucw0KDQojIyMNCiMjIyBjcmVhdGVDZXJ0aWZpY2F0ZSgpDQojIyMgICAgcHJpbnRzIG91dCB0aGUgZXF1aWZheCBjZXJ0aWZpY2F0ZSB0byB1c2UgYW5kIHN0b3Jlcw0KIyMjICAgIHRoZSBmaWxlIG5hbWUgaW4gJENFUlQNCiMjIw0KZnVuY3Rpb24gY3JlYXRlQ2VydGlmaWNhdGUoKXsNCmNhdCA+ICRDRVJUIDw8RVFVSUZBWA0KLS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tDQpNSUlDa0RDQ0FmbWdBd0lCQWdJQkFUQU5CZ2txaGtpRzl3MEJBUVFGQURCYU1Rc3dDUVlEVlFRR0V3SlYNClV6RWNNQm9HQTFVRUNoTVRSWEYxYVdaaGVDQlRaV04xY21VZ1NXNWpMakV0TUNzR0ExVUVBeE1rUlhGMQ0KYVdaaGVDQlRaV04xY21VZ1IyeHZZbUZzSUdWQ2RYTnBibVZ6Y3lCRFFTMHhNQjRYRFRrNU1EWXlNVEEwDQpNREF3TUZvWERUSXdNRFl5TVRBME1EQXdNRm93V2pFTE1Ba0dBMVVFQmhNQ1ZWTXhIREFhQmdOVkJBb1QNCkUwVnhkV2xtWVhnZ1UyVmpkWEpsSUVsdVl5NHhMVEFyQmdOVkJBTVRKRVZ4ZFdsbVlYZ2dVMlZqZFhKbA0KSUVkc2IySmhiQ0JsUW5WemFXNWxjM01nUTBFdE1UQ0JuekFOQmdrcWhraUc5dzBCQVFFRkFBT0JqUUF3DQpnWWtDZ1lFQXV1Y1hrQUpsc1RSVlBFbkNVZFhmcDlFM2o5SG5nWE5CVW1DYm5hRVhKbml0eDdIb0pwUXkNCnRkNHpqVG92Mi9LYWVscHptS05jNmZ1S2N4dGM1OE8vZ0d6TnFmVFdLOEQzK1ptcVk2S3hSd0lQMU9SUg0KT2hJOGJJcGFWSVJ3MjhIRmtNOXlSY3VvV2NETk01MC9vNWJyaFRNaEhENGVQbUJ1ZHB4bmhjWEl3MkVDDQpBd0VBQWFObU1HUXdFUVlKWUlaSUFZYjRRZ0VCQkFRREFnQUhNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHcNCkh3WURWUjBqQkJnd0ZvQVV2cWlnZEhKUWEwUzN5U1BZKzZqL3MxZHJhR3d3SFFZRFZSME9CQllFRkw2bw0Kb0hSeVVHdEV0OGtqMlB1by83TlhhMmhzTUEwR0NTcUdTSWIzRFFFQkJBVUFBNEdCQUREaUFWR3F4K3BmDQoycm5RWlE4dzFqN2FEUlJKYnBHVEp4UXg3OFQzTFVYNDdNZS9va0VOSTdTUytSa0FaNzBCcjgzZ2NmeGENCnoyVEU0SmFZMEtOQTRnR0s3eWNIOFdVQmlrUXRCbVYxVXNDR0VDQWhYMnhyRDJ5dUNSeXY4cUlZTk1SMQ0KcEhNYzhZM2M3NjM1czNhMGtyL2NsUkFldnN2SU8xcUVZQmxXbEtsVg0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLSANCkVRVUlGQVgNCn0NCg0KIyMjDQojIyMgb3ZlcldyaXRlQ29uZigpDQojIyMJb3ZlcndyaXRlIHRoZSBkZWZhdWx0IHN0b3JrLmNvbmYgZmlsZQ0KIyMjICAgICB0aGF0IHdhcyBpbnN0YWxsZWQgYnkgdGhlIHJwbSBwYWNrYWdlLg0KIyMjICAgICB0aGlzIGlzIGEgdGVtcG9yYXJ5IGhhY2sgYmVjYXVzZSBJIG5lZWQNCiMjIyAgICAgdG8gY2hhbmdlIHRoZSBuZXN0cG9ydCBhbmQgSSBkb250IGtub3cNCiMjIyAgICAgZW5vdWdoIHRvIHJlcGFja2FnZSB0aGUgcnBtIHdpdGggdGhlDQojIyMgICAgIGNvcnJlY3Qgc2V0dGluZ3MNCmZ1bmN0aW9uIG92ZXJXcml0ZUNvbmYoKXsNCmNhdCA+IC91c3IvbG9jYWwvc3RvcmsvZXRjL3N0b3JrLmNvbmYgPDxFTkRPRkZJTEUNCnBhY21hbj0vdXNyL2xvY2FsL3N0b3JrL2Jpbi9wYWNtYW4NCmR0ZC1wYWNrYWdlcz0vdXNyL2xvY2FsL3N0b3JrL2Jpbi9wYWNrYWdlcy5kdGQNCmR0ZC1ncm91cHM9L3Vzci9sb2NhbC9zdG9yay9iaW4vZ3JvdXBzLmR0ZA0Kc3RvcmtuZXN0dXBkYXRlbGlzdGVuZXJwb3J0PTY0OQ0KDQojYml0dG9ycmVudHRyYWNrZXJob3N0PXF1YWRydXMuY3MuYXJpem9uYS5lZHUNCmJpdHRvcnJlbnR0cmFja2VyaG9zdD1ucjA2LmNzLmFyaXpvbmEuZWR1DQoNCmJpdHRvcnJlbnR0cmFja2VycG9ydD02ODgwDQpiaXR0b3JyZW50dXBsb2FkcmF0ZT0wDQpiaXR0b3JyZW50c2VlZGxvb2t1cHRpbWVvdXQ9MzANCg0KI3BhY2thZ2VyZXBvc2l0b3J5ID0gcXVhZHJ1cy5jcy5hcml6b25hLmVkdS9QbGFuZXRMYWIvVjN8ZGlzdCwgc3RhYmxlDQpwYWNrYWdlcmVwb3NpdG9yeSA9IG5yMDYuY3MuYXJpem9uYS5lZHUvUGxhbmV0TGFiL1YzfGRpc3QsIHN0YWJsZQ0KI3BhY2thZ2VpbmZvcmVwb3NpdG9yeSA9IHF1YWRydXMuY3MuYXJpem9uYS5lZHUvUGxhbmV0TGFiL1YzL3N0b3JrLmluZm8NCnBhY2thZ2VpbmZvcmVwb3NpdG9yeSA9IG5yMDYuY3MuYXJpem9uYS5lZHUvUGxhbmV0TGFiL1YzL3N0b3JrLmluZm8NCg0KdXNlcm5hbWUgPSBQbGFuZXRMYWINCnB1YmxpY2tleWZpbGUgPSAvdXNyL2xvY2FsL3N0b3JrL3Zhci9rZXlzL1BsYW5ldExhYi5wdWJsaWNrZXkNCnBhY2thZ2VtYW5hZ2VycyA9IG5lc3RycG0sIHJwbSwgdGFyZ3oNCnRyYW5zZmVybWV0aG9kPSBuZXN0LGJpdHRvcnJlbnQsY29ibGl0eixjb3JhbCxodHRwLGZ0cA0KbmVzdHBvcnQ9NjAwMA0KdGFycGFja2luZm9wYXRoPS91c3IvbG9jYWwvc3RvcmsvdmFyL3RhcmluZm8NCkVORE9GRklMRQ0KfSANCg0KDQojIyMNCiMjIyBkb3dubG9hZE5SMDYoKQ0KIyMjICAgIGRvd25sb2FkIGEgZmlsZSBmcm9tIG5yMDYgdXNpbmcgY3VybA0KIyMjDQojIyMgYXJnczogDQojIyMgICAgICAgLSB0aGUgcGF0aCBvZiB0aGUgZmlsZSB5b3Ugd2lzaCB0byBkb3dubG9hZA0KIyMjICAgICAgICAgcmVsYXRpdmUgZnJvbSBodHRwczovL25yMDYuY3MuYXJpem9uYS5lZHUNCiMjIyAgICAgICAtIHRoZSBmaWxlIHRvIHNhdmUgaXQgdG8NCiMjIyAgICAgICAtIHJldHVybmVkIHZhbHVlIGFzIHNwZWNpZmllZCBpbiB2ZXJpZnlEb3dubG9hZA0KZnVuY3Rpb24gZG93bmxvYWROUjA2KCl7DQogICAgY3VybCAtLWNhY2VydCAkQ0VSVCBodHRwczovL25yMDYuY3MuYXJpem9uYS5lZHUvJDEgLW8gJDIgMj4vZGV2L251bGwNCiAgICB2ZXJpZnlEb3dubG9hZCAkMiAkMw0KfQ0KDQojIyMNCiMjIyB2ZXJpZnlEb3dubG9hZCgpDQojIyMgICAgIHZlcmlmeSB0aGF0IGEgZmlsZSB0aGF0IHdhcyBqdXN0IGRvd25sb2FkIHdpdGggZG93bmxvYWROUjA2DQojIyMgICAgIHdhcyBkb3dubG9hZCBjb3JyZWN0bHkuIFNpbmNlIHdlIGFyZSBnZXR0aW5nIHN0dWZmIGZyb20gYQ0KIyMjICAgICBodHRwIHNlcnZlciB3ZSBhcmUgYXNzdW1pbmcgdGhhdCBpZiB3ZSBnZXQgYSA0MDQgcmVzcG9uc2UNCiMjIyAgICAgdGhhdCB0aGUgcGFnZSB3ZSB3YW50IGRvZXMgbm90IGV4aXN0LiBBbHNvLCBpZiB0aGUgb3V0cHV0IGZpbGUNCiMjIyAgICAgZG9lcyBub3QgZXhpc3QgdGhhdCBtZWFucyB0aGF0IG9ubHkgaGVhZGVycyB3ZXJlIHJldHVybmVkDQojIyMgICAgIHdpdGhvdXQgYW55IGNvbnRlbnQuIHRoaXMgdG9vIGlzIGEgaW52YWxpZCBmaWxlIGRvd25sb2FkDQojIyMNCiMjIyBhcmdzOg0KIyMjICAgICAgIC0gdGhlIGZpbGUgdG8gdmVyaWZ5DQojIyMgICAgICAgLSByZXR1cm4gdmFyaWFibGUsIHdpbGwgaGF2ZSAxIGlmIGZhaWwgMCBpZiBnb29kDQojIyMNCmZ1bmN0aW9uIHZlcmlmeURvd25sb2FkKCl7DQogICAgZXZhbCAiJDI9MCINCiAgICBpZiBbICEgLWYgJDEgXTsNCiAgICB0aGVuDQogICAgICAgIGV2YWwgIiQyPTEiDQogICAgZWxpZiBncmVwICc0MDQgTm90IEZvdW5kJyAkMSA+IC9kZXYvbnVsbA0KICAgIHRoZW4NCglybSAtZiAkMQ0KICAgICAgICBldmFsICIkMj0xIg0KICAgIGVsc2UNCiAgICAgICAgZXZhbCAiJDI9MCINCiAgICBmaQ0KfQ0KDQoNCiMgY2hlY2sgZm9yIHJvb3QgdXNlcg0KaWYgWyAkVUlEIC1uZSAiMCIgXQ0KdGhlbg0KICAgZWNobyAiWW91IG11c3QgcnVuIHRoaXMgcHJvZ3JhbSB3aXRoIHJvb3QgcGVybWlzc2lvbnMuLi4iDQogICBlcnJvcg0KZmkgICANCiANCiMgY2xlYW4gdXAgaW4gY2FzZSB0aGlzIHNjcmlwdCB3YXMgcnVuIGJlZm9yZSBhbmQgZmFpbGVkDQpybSAtcmYgL3RtcC9zdG9yayAmPiAvZGV2L251bGwNCg0KIyBjcmVhdGUgL3RtcC9zdG9yayBkaXJlY3RvcnkNCm1rZGlyIC90bXAvc3RvcmsgDQppZiBbICQ/IC1uZSAiMCIgXQ0KdGhlbg0KICAgZWNobw0KICAgZWNobyAiQ291bGQgbm90IGNyZWF0ZSB0aGUgL3RtcC9zdG9yayBkaXJlY3RvcnkuLi4iDQogICBlcnJvcg0KZmkNCg0KIyBleHBvcnQgb3VyIHJvb3QgZGlyZWN0b3J5IHRvIFN0b3JrDQplY2hvICJhcml6b25hX3N0b3JrMiIgPiAvLmV4cG9ydGRpcg0KaWYgWyAkPyAtbmUgIjAiIF0NCnRoZW4NCiAgIGVjaG8NCiAgIGVjaG8gIkNvdWxkIG5vdCBjcmVhdGUgdGhlIC8uZXhwb3J0ZGlyIGZpbGUuLi4iDQogICBlcnJvcg0KZmkNCiANCiMgdGVsbCBzdG9yayB0aGF0IHdlIHdhbnQgdG8gYmUgc2VydmVkDQppZiBbIC1mIC9ldGMvc2xpY2VuYW1lIF0NCnRoZW4NCiAgIFNMSUNFTkFNRT1gY2F0IC9ldGMvc2xpY2VuYW1lYA0KZWxzZSANCiAgIFNMSUNFTkFNRT0kVVNFUg0KZmkNCndnZXQgLU8gL3RtcC9zdG9yay8kU0xJQ0VOQU1FICJodHRwOi8vbG9jYWxob3N0OjY0OC8kU0xJQ0VOQU1FXCRiaW5kc2NyaXB0Ig0KDQojIHZlcmlmeSB0aGF0IHRoZSBkb3dubG9hZCB3YXMgc3VjY2Vzc2Z1bA0KaWYgWyAhIC1mIC90bXAvc3RvcmsvJFNMSUNFTkFNRSAtbyAkPyAtbmUgMCBdDQp0aGVuDQogICBlY2hvDQogICBlY2hvICJTdG9yayBkb2Vzbid0IHNlZW0gdG8gYmUgcnVubmluZyBvbiB0aGlzIG5vZGUuLi4iDQogICBlcnJvcg0KZmkNCg0KIyB3YWl0IGZvciBzdG9yayBzbGljZSANCmVjaG8gIldhaXRpbmcgZm9yIFN0b3JrIHRvIGFjY2VwdCBvdXIgYmluZGluZy4uLiINCndoaWxlIFsgISAtZiAvdG1wL3N0b3JrL3N0b3JrX3NheXNfZ28gXQ0KZG8NCiAgIHNsZWVwIDENCmRvbmUNCg0KIyBjaGFuZ2UgUFdEIHRvIHRoZSAvdG1wL3N0b3JrIGRpcmVjdG9yeSANCmNkIC90bXAvc3RvcmsNCmlmIFsgJD8gLW5lICIwIiBdDQp0aGVuDQogICBlY2hvDQogICBlY2hvICJDb3VsZCBub3QgYWNjZXNzIHRoZSAvdG1wL3N0b3JrIGRpcmVjdG9yeS4uLiINCiAgIGVycm9yDQpmaQ0KDQojIGNvbmZpcm0gdGhhdCBwYWNrYWdlcyB0byBiZSBpbnN0YWxsZWQgYWN0dWFsbHkgZXhpc3QNCmlmIGVjaG8gKi5ycG0gfCBncmVwICcqJyA+IC9kZXYvbnVsbA0KdGhlbg0KICAgZWNobw0KICAgZWNobyAiRXJyb3I6IFN0b3JrIHBhY2thZ2UgZG93bmxvYWQgZmFpbGVkLi4uIg0KICAgZXJyb3INCmZpDQoNCiMgcmVtb3ZlIFN0b3JrIHBhY2thZ2VzIGFuZCBmaWxlcw0KZWNobw0KZWNobyAiUmVtb3ZpbmcgU3RvcmsgZmlsZXMuLi4iDQoNCiMgYnVpbGQgYSBsaXN0IG9mIHBhY2thZ2VzIHRvIHJlbW92ZQ0KcGFja2FnZXM9IiINCmZvciBmaWxlbmFtZSBpbiAqLnJwbQ0KZG8NCiAgIyBjb252ZXJ0IGZpbGVuYW1lIHRvIGEgcGFja2FnZSBuYW1lDQogIHBhY2s9YHJwbSAtcXAgLS1xZiAiJXtOQU1FfVxuIiAkZmlsZW5hbWVgDQogIGlmIFsgJD8gLWVxICIwIiBdDQogIHRoZW4NCiAgICBwYWNrYWdlcz0iJHBhY2thZ2VzICRwYWNrIg0KICBmaQ0KZG9uZSAgIA0KDQojIHJlbW92ZSBvbGQgU3RvcmsgcGFja2FnZXMNCnJwbSAtZSAkcGFja2FnZXMgJj4gL2Rldi9udWxsDQoNCiMgcmVtb3ZlIGFueXRoaW5nIGxlZnQgaW4gL3Vzci9sb2NhbC9zdG9yay9iaW4NCnJtIC1yZiAvdXNyL2xvY2FsL3N0b3JrL2Jpbi8qICY+IC9kZXYvbnVsbCANCg0KIyBpbnN0YWxsIFN0b3JrIHBhY2thZ2VzDQplY2hvDQplY2hvICJJbnN0YWxsaW5nIHBhY2thZ2VzLi4uIiANCg0KIyBidWlsZCBhIGxpc3Qgb2YgcGFja2FnZXMgdG8gaW5zdGFsbA0KcGFja2FnZXM9IiINCmZvciBmaWxlbmFtZSBpbiAqLnJwbQ0KZG8NCiAgcGFja2FnZXM9IiRwYWNrYWdlcyAkZmlsZW5hbWUiDQpkb25lICAgDQoNCiMgaW5zdGFsbCB0aGUgbmV3IHN0b3JrIHBhY2thZ2VzDQpycG0gLWkgJHBhY2thZ2VzDQoNCiMgcmVwb3J0IHBhY2thZ2UgaW5zdGFsbGF0aW9uIGVycm9ycw0KaWYgWyAkPyAtbmUgIjAiIF0NCnRoZW4NCiAgZWNobyAiV2FybmluZzogUG9zc2libGUgZXJyb3IgaW5zdGFsbGluZyBTdG9yayBwYWNrYWdlcy4uLiINCmZpDQoNCiMgcmVzdG9yZSBvcmlnaW5hbCBQV0QNCmNkICRPTERQV0QNCg0KIyBjbGVhbiB1cCB0ZW1wb3JhcnkgZmlsZXMNCnJtIC1yZiAvdG1wL3N0b3JrICY+IC9kZXYvbnVsbA0KDQojIFNFRSBUTy1ETyAxDQojY3JlYXRlIHRoZSBlcXVpZmF4IGNlcnRpZmljYXRlIHRvIHVzZSBmb3IgY3VybA0KI2NyZWF0ZUNlcnRpZmljYXRlDQoNCiMgVE8tRE8gMQ0KIyBpbXBsZW1lbnQgdGhlIGJlbG93IGluIHRoZSBiZWdnaW5pbmcgb2Ygc3RvcmsucHkNCiNhdHRlbXB0IHRvIGRvd25sb2FkIHRoZSB1c2VycyBwdWJsaWMga2V5IGZyb20gdGhlIHJlcG9zaXRvcnkNCiNkb3dubG9hZE5SMDYgInVzZXItdXBsb2FkL3B1YmtleXMvJFNMSUNFTkFNRS5wdWJsaWNrZXkiICIvdXNyL2xvY2FsL3N0b3JrL3Zhci8kU0xJQ0VOQU1FLnB1YmxpY2tleSIgUkVUDQoNCiNpZiBbICRSRVQgLW5lIDAgXTsNCiN0aGVuDQojICAgZWNobw0KIyAgIGVjaG8gIkNvdWxkIG5vdCBmZXRjaCB5b3VyIHB1YmxpYyBrZXkgZnJvbSB0aGUgcmVwb3NpdG9yeS4iDQojICAgZWNobyAiSWYgeW91IHdhbnQgdG8gdXBsb2FkIG9uZSBmb3IgdGhlIG5leHQgdGltZSB5b3UgcnVuIg0KIyAgIGVjaG8gInRoZSBpbml0c2NyaXB0IHBsZWFzZSB2aXNpdCINCiMgICBlY2hvICJodHRwOi8vbnIwNi5jcy5hcml6b25hLmVkdS90ZXN0cGhwL3VwbG9hZC5waHAiDQojICAgZWNobw0KI2ZpDQoNCiNhdHRlbXB0IHRvIGRvd25sb2FkIHRoZSB1c2VycyBzdG9yay5jb25mIGZpbGUgZnJvbSB0aGUgcmVwb3NpdG9yeQ0KI2Rvd25sb2FkTlIwNiAidXNlci11cGxvYWQvY29uZi8kU0xJQ0VOQU1FLnN0b3JrLmNvbmYiICIvdXNyL2xvY2FsL3N0b3JrL2V0Yy9zdG9yay5jb25mLnVzZXJzIiBSRVQNCg0KI2lmIFsgJFJFVCAtbmUgMCBdOw0KI3RoZW4NCiMgICBlY2hvDQojICAgZWNobyAiQ291bGQgbm90IGZldGNoIHlvdXIgc3RvcmsuY29uZiBmaWxlIGZyb20gdGhlIHJlcG9zaXRvcnkuIg0KIyAgIGVjaG8gIklmIHlvdSB3YW50IHRvIHVwbG9hZCBvbmUgZm9yIHRoZSBuZXh0IHRpbWUgeW91IHJ1biINCiMgICBlY2hvICJ0aGUgaW5pdHNjcmlwdCBwbGVhc2UgdmlzaXQiDQojICAgZWNobyAiaHR0cDovL25yMDYuY3MuYXJpem9uYS5lZHUvdGVzdHBocC91cGxvYWQucGhwIg0KIyAgIGVjaG8gIlN0b3JrIHdpbGwgd29yayB3aXRob3V0IGEgY29uZmlndXJhdGlvbiBmaWxlIGJ1dCB0byBtYWtlIG9uZSINCiMgICBlY2hvICJwbGVhc2UgcGxhY2UgYSBmaWxlIG5hbWVkIHN0b3JrLmNvbmYgaW4gL3Vzci9sb2NhbC9zdG9yay9ldGMiDQojICAgZWNobyAicmVmZXIgdG8gdGhlIG1hbnVhbCBmb3IgbW9yZSBkaXJlY3Rpb25zIG9yIGVtYWlsOiINCiMgICBlY2hvICJzdG9yay1zdXBwb3J0QGNzLmFyaXpvbmEuZWR1IGZvciBhZGRpdGlvbmFsIGFzc2lzdGFuY2UuIg0KIyAgIGVjaG8NCiNmaQ0KDQojZG9udCBuZWVkIHRvIG92ZXJ3cml0ZSB0aGUgZGVmYXVsdCBjb25mIGZpbGUNCiNiZWNhdXNlIGl0IHNob3VsZCBiZSBmaXhlZCBpbiB0aGUgbmV3IHJwbXMNCiNvdmVyV3JpdGVDb25mDQoNCiMgcnVuIHN0b3JrIHRvIHVwZGF0ZSBrZXlmaWxlcyBhbmQgZG93bmxvYWQgcGFja2FnZSBsaXN0cw0KZWNobw0KZWNobyAiQXR0ZW1wdGluZyB0byBjb21tdW5pY2F0ZSB3aXRoIHN0b3JrLi4uIg0KaWYgc3RvcmsgDQp0aGVuDQogICBlY2hvDQogICBlY2hvICJDb25ncmF0dWxhdGlvbnMsIHlvdSBoYXZlIHN1Y2Nlc3NmdWxseSBib3VuZCB0byBzdG9yayEiDQogICBlY2hvDQogICBlY2hvICJGb3IgaGVscCwgeW91IG1heSB0eXBlIHN0b3JrIC0taGVscCINCiAgIGVjaG8NCiAgICNlY2hvICJUaGVyZSBpcyBhbHNvIGEgc3RvcmtxdWVyeSBjb21tYW5kIHRoYXQgd2lsbCBwcm92aWRlIGluZm9ybWF0aW9uIg0KICAgI2VjaG8gImFib3V0IHBhY2thZ2VzIGluIHRoZSByZXBvc2l0b3J5LiINCiAgIGVjaG8NCiAgIGVjaG8gIkZvciBtb3JlIGhlbHAsIHZpc2l0IHRoZSBzdG9yayBwcm9qZWN0IG9ubGluZSBhdCINCiAgIGVjaG8gImh0dHA6Ly93d3cuY3MuYXJpem9uYS5lZHUvc3RvcmsvLiAgUGxlYXNlIGNvbnRhY3QiDQogICBlY2hvICJzdG9yay1zdXBwb3J0QGNzLmFyaXpvbmEuZWR1IGZvciBhZGRpdGlvbmFsIGFzc2lzdGFuY2UuIiANCiAgICNybSAtZiAkQ0VSVCA+IC9kZXYvbnVsbA0KZWxzZQ0KICAgZWNobw0KICAgZWNobyAiQW4gZXJyb3Igb2NjdXJyZWQgZHVyaW5nIGluc3RhbGwgZmluYWxpemF0aW9uLi4uICBQbGVhc2UgY29udGFjdCINCiAgIGVjaG8gInN0b3JrLXN1cHBvcnRAY3MuYXJpem9uYS5lZHUgZm9yIGFzc2lzdGFuY2UuIg0KICAgI3JtIC1mICRDRVJUID4gL2Rldi9udWxsDQogICBleGl0IDENCmZpDQoNCiMgZG9uZQ0KZXhpdCAwDQo=', 'name': 'arizona_stork_2', 'encoding': 'base64'}, {'initscript_id': 9, 'script': 'IyEvYmluL2Jhc2gNCmNkIC8NCnJtIC1mIHN0YXJ0X3B1cnBsZQ0Kd2dldCBodHRwOi8vd3d3LmNzLnByaW5jZXRvbi5lZHUvfmRlaXNlbnN0L3B1cnBsZS9zdGFydF9wdXJwbGUNCmNobW9kIDc1NSBzdGFydF9wdXJwbGUNCnN1IHByaW5jZXRvbl9wdXJwbGUgLWMgJy4vc3RhcnRfcHVycGxlJw0K', 'name': 'princeton_purple', 'encoding': 'base64'}, {'initscript_id': 6, 'script': 'IyEgL2Jpbi9zaA0KDQojIHNhdmUgb3JpZ2luYWwgUFdEDQpPTERQV0Q9JFBXRA0KDQojIGVycm9yIHJlcG9ydGluZyBmdW5jdGlvbg0KZXJyb3IoKQ0Kew0KICAgZWNobw0KICAgZWNobyAiUGxlYXNlIEUtbWFpbCBzdG9yay1zdXBwb3J0QGNzLmFyaXpvbmEuZWR1IGlmIHlvdSBiZWxpZXZlIHlvdSBoYXZlIiANCiAgIGVjaG8gInJlY2VpdmVkIHRoaXMgbWVzc2FnZSBpbiBlcnJvci4iDQoNCiAgICMgcmVzdG9yZSBvcmlnaW5hbCBQV0QNCiAgIGNkICRPTERQV0QNCiAgIGV4aXQgMQ0KfQ0KDQojIGNoZWNrIGZvciByb290IHVzZXINCmlmIFsgJFVJRCAtbmUgIjAiIF0NCnRoZW4NCiAgIGVjaG8gJ1lvdSBtdXN0IGJlIHJvb3QgdG8gcnVuIHRoaXMgcHJvZ3JhbS4uLicNCiAgIGVycm9yDQpmaSAgIA0KIA0KIyBDbGVhbiB1cCBpbiBjYXNlIEkgcmFuIHRoaXMgYmVmb3JlDQpybSAtZiAvdG1wL3N0b3JrKiA+IC9kZXYvbnVsbCAyPiYxDQoNCiMgRmlyc3Qgb2YgYWxsIGV4cG9ydCBvdXIgcm9vdCBkaXJlY3RvcnkgdG8gU3RvcmsNCmVjaG8gImFyaXpvbmFfc3RvcmsiID4gLy5leHBvcnRkaXINCiANCiMgTm93IHRlbGwgc3RvcmsgdGhhdCB3ZSB3YW50IHRvIGJlIHNlcnZlZA0KaWYgWyAtZiAvZXRjL3NsaWNlbmFtZSBdDQp0aGVuDQogICBTTElDRU5BTUU9YGNhdCAvZXRjL3NsaWNlbmFtZWANCmVsc2UgDQogICBTTElDRU5BTUU9JFVTRVINCmZpDQoNCndnZXQgaHR0cDovL2xvY2FsaG9zdDo2NDAvJFNMSUNFTkFNRQ0KDQojIGNoZWNrIHRvIG1ha2Ugc3VyZSB0aGUgZG93bmxvYWQgd2FzIHN1Y2Nlc3NmdWwNCmlmIFsgISAtZiAkU0xJQ0VOQU1FIC1vICQ/IC1uZSAwIF0NCnRoZW4NCiAgIGVjaG8NCiAgIGVjaG8gIlN0b3JrIGRvZXNuJ3Qgc2VlbSB0byBiZSBydW5uaW5nIG9uIHRoaXMgbm9kZS4uLiINCiAgIGVycm9yDQpmaQ0KDQojIHdhaXQgZm9yIHN0b3JrIHNsaWNlIA0KZWNobyAiV2FpdGluZyBmb3IgU3RvcmsgdG8gYWNjZXB0IG91ciBiaW5kaW5nLi4uIg0Kd2hpbGUgWyAhIC1mIC90bXAvc3Rvcmtfc2F5c19nbyBdDQpkbw0KICAgc2xlZXAgMQ0KZG9uZQ0KDQojIGNoYW5nZSBQV0QgdG8gdGhlIC90bXAgZGlyZWN0b3J5IA0KY2QgL3RtcA0KaWYgWyAkPyAtbmUgIjAiIF0NCnRoZW4NCiAgIGVjaG8NCiAgIGVjaG8gIkNvdWxkIG5vdCBhY2Nlc3MgdGhlIC90bXAgZGlyZWN0b3J5Li4uIg0KICAgZXJyb3INCmZpDQoNCiMgY29uZmlybSB0aGF0IHBhY2thZ2VzIHRvIGJlIGluc3RhbGxlZCBhY3R1YWxseSBleGlzdA0KaWYgZWNobyAqLnJwbSB8IGdyZXAgJyonID4gL2Rldi9udWxsDQp0aGVuDQogICBlY2hvDQogICBlY2hvICJFcnJvcjogU3RvcmsgcGFja2FnZSBkb3dubG9hZCBmYWlsZWQuLi4iDQogICBlcnJvcg0KZmkNCg0KIyBpbnN0YWxsIFN0b3JrIHBhY2thZ2VzDQplY2hvICJJbnN0YWxsaW5nIHBhY2thZ2VzLi4uIiANCmZvciBwYWNrIGluICoucnBtDQpkbw0KICAgIyByZW1vdmUgdGhlIG9sZCBzdG9yayBwYWNrYWdlLCBpZiBhbnkNCiAgIHJwbSAtZSBgcnBtIC1xcCAtLXFmICIle05BTUV9XG4iICRwYWNrYCA+IC9kZXYvbnVsbCAyPiYxDQoNCiAgICMgcmVtb3ZlIGFueXRoaW5nIGxlZnQgaW4gL3Vzci9sb2NhbC9zdG9yay9iaW4NCiAgIHJtIC1yZiAvdXNyL2xvY2FsL3N0b3JrL2Jpbi8qID4gL2Rldi9udWxsIDI+JjENCg0KICAgIyBpbnN0YWxsIHRoZSBuZXcgc3RvcmsgcGFja2FnZQ0KICAgcnBtIC1pICRwYWNrDQoNCiAgICMgcmVwb3J0IHBhY2thZ2UgaW5zdGFsbGF0aW9uIGVycm9ycw0KICAgaWYgWyAkPyAtbmUgIjAiIF0NCiAgIHRoZW4NCiAgICAgZWNobyAiV2FybmluZzogUG9zc2libGUgZXJyb3IgaW5zdGFsbGluZyBTdG9yayBwYWNrYWdlOiAkcGFjay4uLiINCiAgIGZpDQpkb25lDQoNCiMgcmVzdG9yZSBvcmlnaW5hbCBQV0QNCmNkICRPTERQV0QNCg0KIyBjbGVhbiB1cCB0ZW1wb3JhcnkgZmlsZXMNCnJtIC1mIC90bXAvc3RvcmsqID4gL2Rldi9udWxsIDI+JjENCnJtICRTTElDRU5BTUUqIA0KDQojIHJ1biBzdG9yayB0byB1cGRhdGUga2V5ZmlsZXMgYW5kIGRvd25sb2FkIHBhY2thZ2UgbGlzdHMNCmVjaG8gIkF0dGVtcHRpbmcgdG8gY29tbXVuaWNhdGUgd2l0aCBzdG9yay4uLiINCmlmIHN0b3JrIA0KdGhlbg0KICAgZWNobw0KICAgZWNobyAiQ29uZ3JhdHVsYXRpb25zLCB5b3UgaGF2ZSBzdWNjZXNzZnVsbHkgYm91bmQgdG8gc3RvcmshIg0KICAgZWNobw0KICAgZWNobyAiRm9yIGhlbHAsIHlvdSBtYXkgdHlwZSBzdG9yayAtLWhlbHAgIg0KICAgZWNobw0KICAgZWNobyAiVGhlcmUgaXMgYWxzbyBhIHN0b3JrcXVlcnkgY29tbWFuZCB0aGF0IHdpbGwgcHJvdmlkZSBpbmZvcm1hdGlvbiINCiAgIGVjaG8gImFib3V0IHBhY2thZ2VzIGluIHRoZSByZXBvc2l0b3J5LiINCiAgIGVjaG8NCiAgIGVjaG8gIkZvciBtb3JlIGhlbHAsIHZpc2l0IHRoZSBzdG9yayBwcm9qZWN0IG9ubGluZSBhdCINCiAgIGVjaG8gImh0dHA6Ly93d3cuY3MuYXJpem9uYS5lZHUvc3RvcmsvLiAgUGxlYXNlIGNvbnRhY3QiDQogICBlY2hvICJzdG9yay1zdXBwb3J0QGNzLmFyaXpvbmEuZWR1IGZvciBhZGRpdGlvbmFsIGFzc2lzdGFuY2UuIiANCmVsc2UNCiAgIGVjaG8NCiAgIGVjaG8gIkFuIGVycm9yIG9jY3VycmVkIGR1cmluZyBpbnN0YWxsIGZpbmFsaXphdGlvbi4uLiAgUGxlYXNlIGNvbnRhY3QiDQogICBlY2hvICJzdG9yay1zdXBwb3J0QGNzLmFyaXpvbmEuZWR1IGZvciBhc3Npc3RhbmNlLiINCiAgIGV4aXQgMQ0KZmkNCg0KIw0KIyBIZWxsbyBXb3JsZCBkZW1vIGNvZGUNCiMNCg0KIyBQdWJsaWMga2V5IGZvciB0aGlzIGRlbW8NCmNhdCA+L3Vzci9sb2NhbC9zdG9yay92YXIva2V5cy9oZWxsby5wdWJsaWNrZXkgPDwiRU9GIg0KLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0NCk1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQU1XcVE3K2VxQVljNlRPSUJPbkJyRnZqYjlnRVViaWgNCkkxd0Nyeld4a09aa01BcXFmY1RuMW9tcCtLMGd0cUtBK3VaNEIzRGlQRXI0Q0V0Myt5MmJlMGtDQXdFQUFRPT0NCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ0KRU9GDQpzZWQgLWkgLWUgJ3MvXnVzZXJuYW1lLiovdXNlcm5hbWUgPSBoZWxsby8nIC91c3IvbG9jYWwvc3RvcmsvZXRjL3N0b3JrLmNvbmYNCg0KIyBJbnN0YWxsIFJQTQ0Kc3RvcmsgdXBncmFkZSBoZWxsbw0KDQojIGVuZA0KZXhpdCAwDQo=', 'name': 'princeton_hello_stork', 'encoding': 'base64'}, {'initscript_id': 10, 'script': 'IyEvYmluL2Jhc2gNCg0KIyBJbml0IHNjcmlwdCBmb3IgdGhlIFBsYW5ldExhYiAiSGVsbG8gV29ybGQiIGRlbW8gdXNpbmcgR29vZ2xlIEVhcnRoLg0KIyBJbnN0YWxscyBhIGNyb250YWIgZW50cnkgb24gdGhlIG5vZGUgdGhhdCBwaG9uZXMgaG9tZSB0byB0aGUgc2VydmVyDQojIGV2ZXJ5IHRocmVlIG1pbnV0ZXMuDQoNClNFUlZFUj0xMjguMTEyLjEzOS43Mzo4MDQyCQkjIHBsYW5ldGxhYi0zLmNzLnByaW5jZXRvbi5lZHUNCg0KL3Vzci9iaW4vY3VybCAtcyBodHRwOi8vJFNFUlZFUi8NCmVjaG8gIiovNSAqICogKiAqIC91c3IvYmluL2N1cmwgLXMgaHR0cDovLyRTRVJWRVIvIiB8IGNyb250YWIgLQ0KL3NiaW4vY2hrY29uZmlnIGNyb25kIG9uDQo=', 'name': 'princeton_hello', 'encoding': 'base64'}]])
# Convert plc_initscript.initscript_id to raw initscript attribute
-for slice_attribute in GetSliceAttributes({'name': 'plc_initscript'}):
+for slice_attribute in GetSliceTags({'name': 'plc_initscript'}):
id = slice_attribute['slice_attribute_id']
slice_id = slice_attribute['slice_id']
initscript_id = int(slice_attribute['value'])
# Delete old attribute
- DeleteSliceAttribute(id)
+ DeleteSliceTag(id)
if initscript_id not in initscripts:
print "Warning: Missing initscript %d" % initscript_id
initscript = base64.b64decode(initscripts[initscript_id]['script'])
# Add as initscript attribute
- AddSliceAttribute(slice_id, 'initscript', initscript)
+ AddSliceTag(slice_id, 'initscript', initscript)
# Add our custom yum.conf entries
conf_file_id = AddConfFile({
def fix_row(row, table_name, table_fields):
- if table_name in ['nodenetworks']:
+ if table_name in ['interfaces']:
# convert str bwlimit to bps int
bwlimit_index = table_fields.index('bwlimit')
if isinstance(row[bwlimit_index], int):
--- /dev/null
+# Build a WSDL spec of the API
+
+all: plcapi.wsdl
+
+plcapi.wsdl:
+ PYTHONPATH=../ python api2wsdl.py > $@
+
+clean:
+ rm -f plcapi.wsdl
+
+.PHONY: all clean
--- /dev/null
+#!/usr/bin/python
+#
+# Sapan Bhatia <sapanb@cs.princeton.edu>
+#
+# Generates a WSDL for plcapi
+# Current limitations:
+# - Invalid for the following reasons
+# - The types are python types, not WSDL types
+# - I'm not sure of what to do with the auth structure
+
+import os, sys
+import time
+import pdb
+import xml.dom.minidom
+import xml.dom.ext
+import inspect
+import globals
+
+from PLC.API import PLCAPI
+from PLC.Method import *
+from PLC.Auth import Auth
+from PLC.Parameter import Parameter, Mixed, python_type, xmlrpc_type
+
+
+api = PLCAPI(None)
+
+try:
+ set
+except NameError:
+ from sets import Set
+ set = Set
+
+# Class functions
+
+def param_type(param):
+ if isinstance(param, Mixed) and len(param):
+ subtypes = [param_type(subparam) for subparam in param]
+ return " or ".join(subtypes)
+ elif isinstance(param, (list, tuple, set)) and len(param):
+ return "array of " + " or ".join([param_type(subparam) for subparam in param])
+ else:
+ return xmlrpc_type(python_type(param))
+
+
+def add_wsdl_ports_and_bindings (wsdl):
+ api.all_methods.sort()
+ for method in api.all_methods:
+ # Skip system. methods
+ if "system." in method:
+ continue
+
+ function = api.callable(method)
+
+ # Commented documentation
+ #lines = ["// " + line.strip() for line in function.__doc__.strip().split("\n")]
+ #print "\n".join(lines)
+ #print
+
+
+ in_el = wsdl.firstChild.appendChild(wsdl.createElement("wsdl:message"))
+ in_el.setAttribute("name", function.name + "_in")
+
+ # Arguments
+
+ if (function.accepts):
+ (min_args, max_args, defaults) = function.args()
+ for (argname,argtype) in zip(max_args,function.accepts):
+ arg_part = in_el.appendChild(wsdl.createElement("wsdl:part"))
+ arg_part.setAttribute("name", argname)
+ arg_part.setAttribute("type", param_type(argtype))
+
+ # Return type
+ return_type = function.returns
+ out_el = wsdl.firstChild.appendChild(wsdl.createElement("wsdl:message"))
+ out_el.setAttribute("name", function.name + "_out")
+ ret_part = out_el.appendChild(wsdl.createElement("wsdl:part"))
+ ret_part.setAttribute("name", "returnvalue")
+ ret_part.setAttribute("type", param_type(return_type))
+
+ # Port connecting arguments with return type
+
+ port_el = wsdl.firstChild.appendChild(wsdl.createElement("wsdl:portType"))
+ port_el.setAttribute("name", function.name + "_port")
+
+ op_el = port_el.appendChild(wsdl.createElement("wsdl:operation"))
+ op_el.setAttribute("name", function.name)
+ op_el.appendChild(wsdl.createElement("wsdl:input")).setAttribute("message","tns:" + function.name + "_in")
+ op_el.appendChild(wsdl.createElement("wsdl:output")).setAttribute("message","tns:" + function.name + "_out")
+
+ # Bindings
+
+ bind_el = wsdl.firstChild.appendChild(wsdl.createElement("wsdl:binding"))
+ bind_el.setAttribute("name", function.name + "_binding")
+ bind_el.setAttribute("type", "tns:" + function.name + "_port")
+
+ soap_bind = bind_el.appendChild(wsdl.createElement("soap:binding"))
+ soap_bind.setAttribute("style", "rpc")
+ soap_bind.setAttribute("transport","http://schemas.xmlsoap.org/soap/http")
+
+
+ wsdl_op = bind_el.appendChild(wsdl.createElement("wsdl:operation"))
+ wsdl_op.setAttribute("name", function.name)
+ wsdl_op.appendChild(wsdl.createElement("soap:operation")).setAttribute("soapAction",
+ "urn:" + function.name)
+
+
+ wsdl_input = wsdl_op.appendChild(wsdl.createElement("wsdl:input"))
+ input_soap_body = wsdl_input.appendChild(wsdl.createElement("soap:body"))
+ input_soap_body.setAttribute("use", "encoded")
+ input_soap_body.setAttribute("namespace", "urn:" + function.name)
+ input_soap_body.setAttribute("encodingStyle","http://schemas.xmlsoap.org/soap/encoding/")
+
+
+ wsdl_output = wsdl_op.appendChild(wsdl.createElement("wsdl:output"))
+ output_soap_body = wsdl_output.appendChild(wsdl.createElement("soap:body"))
+ output_soap_body.setAttribute("use", "encoded")
+ output_soap_body.setAttribute("namespace", "urn:" + function.name)
+ output_soap_body.setAttribute("encodingStyle","http://schemas.xmlsoap.org/soap/encoding/")
+
+
+def add_wsdl_service(wsdl):
+ service_el = wsdl.firstChild.appendChild(wsdl.createElement("wsdl:service"))
+ service_el.setAttribute("name", "plc_api_service")
+
+ for method in api.all_methods:
+ name=api.callable(method).name
+ servport_el = service_el.appendChild(wsdl.createElement("wsdl:port"))
+ servport_el.setAttribute("name", name + "_port")
+ servport_el.setAttribute("binding", "tns:" + name + "_binding")
+
+ soapaddress = servport_el.appendChild(wsdl.createElement("soap:address"))
+ soapaddress.setAttribute("location", "%s" % globals.plc_ns)
+
+
+def get_wsdl_definitions():
+ wsdl_text_header = """
+ <wsdl:definitions
+ name="auto_generated"
+ targetNamespace="%s"
+ xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
+ xmlns:tns="xmlns:%s"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>""" % (globals.plc_ns,globals.plc_ns)
+
+ wsdl = xml.dom.minidom.parseString(wsdl_text_header)
+
+ return wsdl
+
+
+wsdl = get_wsdl_definitions()
+add_wsdl_ports_and_bindings(wsdl)
+add_wsdl_service(wsdl)
+
+
+xml.dom.ext.PrettyPrint(wsdl)
+
--- /dev/null
+#!/usr/bin/python
+
+plc_ns="http://www.planet-lab.org/plcapi.wsdl"