From: Mark Huang Date: Thu, 4 Jan 2007 16:01:28 +0000 (+0000) Subject: minimal hacks so that the PHP bindings can be built under FC2 X-Git-Tag: pycurl-7_13_1~176 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=17a90e3c5373b78b5aea38e011a96455c0024eae;p=plcapi.git minimal hacks so that the PHP bindings can be built under FC2 --- diff --git a/PLC/Auth.py b/PLC/Auth.py index be54b126..ca8a72e6 100644 --- a/PLC/Auth.py +++ b/PLC/Auth.py @@ -4,7 +4,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: Auth.py,v 1.8 2006/11/09 19:43:55 mlhuang Exp $ +# $Id: Auth.py,v 1.9 2006/12/15 18:35:38 mlhuang Exp $ # import crypt @@ -18,7 +18,6 @@ from PLC.Persons import Persons from PLC.Nodes import Node, Nodes from PLC.Sessions import Session, Sessions from PLC.Peers import Peer, Peers -from PLC.GPG import gpg_verify class Auth(Parameter): """ @@ -72,6 +71,7 @@ class GPGAuth(Auth): for key in keys: try: + from PLC.GPG import gpg_verify gpg_verify(method.name, args, auth['signature'], key) return except PLCAuthenticationFailure, fault: diff --git a/PLC/Filter.py b/PLC/Filter.py index 458e14ce..9f5fb42b 100644 --- a/PLC/Filter.py +++ b/PLC/Filter.py @@ -1,4 +1,9 @@ from types import StringTypes +try: + set +except NameError: + from sets import Set + set = Set from PLC.Faults import * from PLC.Parameter import Parameter, Mixed, python_type diff --git a/PLC/Peers.py b/PLC/Peers.py index 393be627..866b41bb 100644 --- a/PLC/Peers.py +++ b/PLC/Peers.py @@ -20,10 +20,6 @@ from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes from PLC.SliceAttributes import SliceAttribute, SliceAttributes from PLC.Slices import Slice, Slices -import xmlrpclib -from PLC.PyCurl import PyCurlTransport -from PLC.GPG import gpg_sign - class Peer(Row): """ Stores the list of peering PLCs in the peers table. @@ -87,6 +83,8 @@ class Peer(Row): Connect to this peer via XML-RPC. """ + import xmlrpclib + from PLC.PyCurl import PyCurlTransport self.server = xmlrpclib.ServerProxy(self['peer_url'], PyCurlTransport(self['peer_url'], self['cacert']), allow_none = 1, **kwds) @@ -98,6 +96,7 @@ class Peer(Row): """ def wrapper(*args, **kwds): + from PLC.GPG import gpg_sign signature = gpg_sign(methodname, args, self.api.config.PLC_ROOT_GPG_KEY, self.api.config.PLC_ROOT_GPG_KEY_PUB) diff --git a/php/methods.py b/php/methods.py index 27761a05..b41b1baa 100755 --- a/php/methods.py +++ b/php/methods.py @@ -5,7 +5,7 @@ # Mark Huang # Copyright (C) 2005 The Trustess of Princeton University # -# $Id: methods.py,v 1.3 2006/11/21 20:00:53 mlhuang Exp $ +# $Id: methods.py,v 1.4 2006/11/29 19:43:17 mlhuang Exp $ # import os, sys @@ -15,6 +15,12 @@ from PLC.API import PLCAPI from PLC.Method import * from PLC.Auth import Auth +try: + set +except NameError: + from sets import Set + set = Set + def php_cast(value): """ Casts Python values to PHP values.