r5092 - in branches/lucidity/sage/python/sage: . aviary
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-10-25 16:43:40 +0000 (Tue, 25 Oct 2011)
New Revision: 5092
Added:
branches/lucidity/sage/python/sage/exceptions.py
branches/lucidity/sage/python/sage/https_full.py
Modified:
branches/lucidity/sage/python/sage/aviary/aviaryoperations.py
branches/lucidity/sage/python/sage/https.py
branches/lucidity/sage/python/sage/verifiedhttps.py
branches/lucidity/sage/python/sage/verifiedhttps_m2crypto.py
Log:
Add license statements, split files for clarity.
svn merge -c 5091 svn+ssh://svn.fedorahosted.org/svn/cumin/trunk .
Modified: branches/lucidity/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- branches/lucidity/sage/python/sage/aviary/aviaryoperations.py 2011-10-25 13:46:51 UTC (rev 5091)
+++ branches/lucidity/sage/python/sage/aviary/aviaryoperations.py 2011-10-25 16:43:40 UTC (rev 5092)
@@ -8,12 +8,18 @@
import time
import sage
+from datetime import datetime
from suds import *
from suds.client import Client
from suds.transport.https import HttpAuthenticated
from sage.util import CallSync, CallThread, ObjectPool, host_list
from sage.https import *
-from datetime import datetime
+try:
+ from sage.https_full import HTTPSFullCertTransport
+ has_full_cert = True
+ technology = sage.https_full.technology
+except:
+ has_full_cert = False
log = logging.getLogger("sage.aviary")
@@ -511,8 +517,7 @@
self.cert = cert
self.root_cert = root_cert
self.domain_verify = domain_verify
- self.server_validation_possible = hasattr(sage.https,
- "HTTPSFullCertTransport")
+ self.server_validation_possible = has_full_cert
if self.root_cert == "":
log.info("AviaryOperations: no root certificate file specified, "\
"using client validation only for ssl connections.")
@@ -524,7 +529,7 @@
else:
log.info("AviaryOperations: using client and server "\
"certificate validation for ssl connections, "\
- "solution is %s" % sage.https.technology)
+ "solution is %s" % technology)
log.info("AviaryOperations: verify server domain against "\
"certificate during validation (%s)" % self.domain_verify)
Copied: branches/lucidity/sage/python/sage/exceptions.py (from rev 5091, trunk/sage/python/sage/exceptions.py)
===================================================================
--- branches/lucidity/sage/python/sage/exceptions.py (rev 0)
+++ branches/lucidity/sage/python/sage/exceptions.py 2011-10-25 16:43:40 UTC (rev 5092)
@@ -0,0 +1,3 @@
+# Provide common exception classes here
+class SSLVerificationError(Exception):
+ pass
Modified: branches/lucidity/sage/python/sage/https.py
===================================================================
--- branches/lucidity/sage/python/sage/https.py 2011-10-25 13:46:51 UTC (rev 5091)
+++ branches/lucidity/sage/python/sage/https.py 2011-10-25 16:43:40 UTC (rev 5092)
@@ -1,8 +1,5 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+# Copyright 2011 David Norton, Jr.
#
-# Copyright 2009-2011 Red Hat, Inc.
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -15,20 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# http://davidnortonjr.com/
+# Copyright 2011 Red Hat, Inc.
+#
+# Modifications: inclusion of doc strings, method and class name changes,
+# provide _get_auth_handler method which can be overloaded
+# in derived classes.
+
# uses Suds - https://fedorahosted.org/suds/
import urllib2 as u2
-from suds.transport.http import HttpTransport, Reply, TransportError
+from suds.transport.http import HttpTransport
import httplib
-import socket
-technology = "urllib2"
-
-# Provide an exception here that implementation classes
-# can use in common to raise exceptions and return messages
-class SSLVerificationError(Exception):
- pass
-
class HTTPSClientAuthHandler(u2.HTTPSHandler):
def __init__(self, key, cert):
"""
@@ -68,100 +64,9 @@
HttpTransport.__init__(self, *args, **kwargs)
self.key = key
self.cert = cert
+ self.urlopener = u2.build_opener(self._get_auth_handler())
- def u2open(self, u2request):
- """
- Open an ssl connection with client certificate validation.
-
- @param u2request: A urllib2 request.
- @type u2request: urllib2.Request.
- @return: The opened file-like urllib2 object.
- @rtype: fp
- """
- tm = self.options.timeout
- url = u2.build_opener(self._get_auth_handler())
- if self.u2ver() < 2.6:
- socket.setdefaulttimeout(tm)
- return url.open(u2request)
- else:
- return url.open(u2request, timeout=tm)
-
def _get_auth_handler(self):
return HTTPSClientAuthHandler(self.key, self.cert)
-try:
- # If verifiedhttps dependencies can be satisfied,
- # this import will succeed and the following two classes will
- # be available to provide server certificate validation.
- # A module can check for the presence of these two classes
- # after import thusly (with "whatever" enclosing module
- # if necessary):
- # import https
- # if hasattr(<whatever.>https, "HTTPSFullAuthHandler"):
- # ...
- # if hasattr(<whatever.>https, "HTTPSFullCertTransport"):
- # ...
- try:
- # Try a solution that uses the Python ssl module first
- from sage.verifiedhttps import VerifiedHTTPSConnection
- technology = "Python ssl"
- except:
- # Didn't work, try a solution based on m2crypto
- from sage.verifiedhttps_m2crypto import VerifiedHTTPSConnection
- technology = "M2Crypto"
-
- class HTTPSFullAuthHandler(HTTPSClientAuthHandler):
- """
- Add server certificate validation to HTTPSClientAuthHandler
- via a different connection type (VerifiedHTTPSConnection).
- """
- def __init__(self, my_key, my_cert, root_cert, domain_verify):
- """
- @param my_key: full path for the client's private key file
- @param my_cert: full path for the client's PEM certificate file
- @param root_cert: full path for root certificates file used to
- verify server certificates on connection
- @param domain_verify: check server host against the 'commonName'
- field in the server certificate
- """
- HTTPSClientAuthHandler.__init__(self, my_key, my_cert)
- self.root_cert = root_cert
- self.domain_verify = domain_verify
-
- def _get_connection(self, host, timeout=300):
- """
- @return: A connection object derived from httplib types with
- with client and server certificate validation support
- @rtype: VerifiedHTTPSConnection
- """
- return VerifiedHTTPSConnection(host,
- key_file=self.key,
- cert_file=self.cert,
- root_cert=self.root_cert,
- domain_verify=self.domain_verify)
-
- class HTTPSFullCertTransport(HTTPSClientCertTransport):
- """
- Add server certificate validation to HTTPSClientCertTransport
- via a different handler type (HTTPSFullAuthHandler)
- """
- def __init__(self, key, cert, root_cert, domain_verify=True,
- *args, **kwargs):
- """
- @param key: full path for the client's private key file
- @param cert: full path for the client's PEM certificate file
- @param root_cert: full path for root certificates file used to
- verify server certificates on connection
- @param domain_verify: check server host against the 'commonName'
- field in the server certificate
- """
- HTTPSClientCertTransport.__init__(self, key, cert, *args, **kwargs)
- self.root_cert = root_cert
- self.domain_verify = domain_verify
-
- def _get_auth_handler(self):
- return HTTPSFullAuthHandler(self.key, self.cert, self.root_cert,
- self.domain_verify)
-except:
- pass
Copied: branches/lucidity/sage/python/sage/https_full.py (from rev 5091, trunk/sage/python/sage/https_full.py)
===================================================================
--- branches/lucidity/sage/python/sage/https_full.py (rev 0)
+++ branches/lucidity/sage/python/sage/https_full.py 2011-10-25 16:43:40 UTC (rev 5092)
@@ -0,0 +1,66 @@
+from https import HTTPSClientAuthHandler, HTTPSClientCertTransport
+
+# If verifiedhttps dependencies can be satisfied,
+# this import will succeed and the following two classes will
+# be available to provide server certificate validation.
+try:
+ # Try a solution that uses the Python ssl module first
+ from sage.verifiedhttps import VerifiedHTTPSConnection
+ technology = "Python ssl"
+except:
+ # Didn't work, try a solution based on m2crypto
+ from sage.verifiedhttps_m2crypto import VerifiedHTTPSConnection
+ technology = "M2Crypto"
+
+class HTTPSFullAuthHandler(HTTPSClientAuthHandler):
+ """
+ Add server certificate validation to HTTPSClientAuthHandler
+ via a different connection type (VerifiedHTTPSConnection).
+ """
+ def __init__(self, my_key, my_cert, root_cert, domain_verify):
+ """
+ @param my_key: full path for the client's private key file
+ @param my_cert: full path for the client's PEM certificate file
+ @param root_cert: full path for root certificates file used to
+ verify server certificates on connection
+ @param domain_verify: check server host against the 'commonName'
+ field in the server certificate
+ """
+ self.root_cert = root_cert
+ self.domain_verify = domain_verify
+ HTTPSClientAuthHandler.__init__(self, my_key, my_cert)
+
+ def _get_connection(self, host, timeout=300):
+ """
+ @return: A connection object derived from httplib types with
+ with client and server certificate validation support
+ @rtype: VerifiedHTTPSConnection
+ """
+ return VerifiedHTTPSConnection(host,
+ key_file=self.key,
+ cert_file=self.cert,
+ root_cert=self.root_cert,
+ domain_verify=self.domain_verify)
+
+class HTTPSFullCertTransport(HTTPSClientCertTransport):
+ """
+ Add server certificate validation to HTTPSClientCertTransport
+ via a different handler type (HTTPSFullAuthHandler)
+ """
+ def __init__(self, key, cert, root_cert, domain_verify=True,
+ *args, **kwargs):
+ """
+ @param key: full path for the client's private key file
+ @param cert: full path for the client's PEM certificate file
+ @param root_cert: full path for root certificates file used to
+ verify server certificates on connection
+ @param domain_verify: check server host against the 'commonName'
+ field in the server certificate
+ """
+ self.root_cert = root_cert
+ self.domain_verify = domain_verify
+ HTTPSClientCertTransport.__init__(self, key, cert, *args, **kwargs)
+
+ def _get_auth_handler(self):
+ return HTTPSFullAuthHandler(self.key, self.cert, self.root_cert,
+ self.domain_verify)
Modified: branches/lucidity/sage/python/sage/verifiedhttps.py
===================================================================
--- branches/lucidity/sage/python/sage/verifiedhttps.py 2011-10-25 13:46:51 UTC (rev 5091)
+++ branches/lucidity/sage/python/sage/verifiedhttps.py 2011-10-25 16:43:40 UTC (rev 5092)
@@ -1,7 +1,29 @@
+# Copyright 2011 Joseph Turner
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Copyright 2011 Red Hat, Inc.
+#
+# Modifications: addition of __init__ routine and
+# member variables timeout, root_cert, server_verify,
+# and domain_verify for per instance control
+
+
import httplib
import socket
import ssl
-from https import SSLVerificationError
+from exceptions import SSLVerificationError
# Note: much thanks to Joseph Turner for showing the world
# how to extend httplib using the ssl module to implement
Modified: branches/lucidity/sage/python/sage/verifiedhttps_m2crypto.py
===================================================================
--- branches/lucidity/sage/python/sage/verifiedhttps_m2crypto.py 2011-10-25 13:46:51 UTC (rev 5091)
+++ branches/lucidity/sage/python/sage/verifiedhttps_m2crypto.py 2011-10-25 16:43:40 UTC (rev 5092)
@@ -1,5 +1,20 @@
+# Copyright 2011 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
from M2Crypto import httpslib, SSL
-from https import SSLVerificationError
+from exceptions import SSLVerificationError
# wrap the creation of a SSL.Context, etc in a class
class VerifiedHTTPSConnection(httpslib.HTTPSConnection):
@@ -51,7 +66,7 @@
# This is mostly for testing with self-signed certificates
# and to provide the same interface as verifiedhttps.py
# In order to squash the report of the mismatched hostnames,
- # we replace the message -- could be considered a leak of
+ # we replace the message -- could be considered as a leak of
# domain and certificate information I suppose.
if self.server_verify and self.domain_verify:
raise SSLVerificationError("Server certificate doesn't match domain;"\
12 years, 7 months
r5091 - in trunk/sage/python/sage: . aviary
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-10-25 13:46:51 +0000 (Tue, 25 Oct 2011)
New Revision: 5091
Added:
trunk/sage/python/sage/exceptions.py
trunk/sage/python/sage/https_full.py
Modified:
trunk/sage/python/sage/aviary/aviaryoperations.py
trunk/sage/python/sage/https.py
trunk/sage/python/sage/verifiedhttps.py
trunk/sage/python/sage/verifiedhttps_m2crypto.py
Log:
Add license and copyright notices to htpps.py, verifiedhttps.py,
and verifiedhttps_m2crypto.py. Moved derived classes from
https.py to https_full.py, create exceptions.py for common exceptions.
Modified: trunk/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- trunk/sage/python/sage/aviary/aviaryoperations.py 2011-10-24 19:52:45 UTC (rev 5090)
+++ trunk/sage/python/sage/aviary/aviaryoperations.py 2011-10-25 13:46:51 UTC (rev 5091)
@@ -8,12 +8,18 @@
import time
import sage
+from datetime import datetime
from suds import *
from suds.client import Client
from suds.transport.https import HttpAuthenticated
from sage.util import CallSync, CallThread, ObjectPool, host_list
from sage.https import *
-from datetime import datetime
+try:
+ from sage.https_full import HTTPSFullCertTransport
+ has_full_cert = True
+ technology = sage.https_full.technology
+except:
+ has_full_cert = False
log = logging.getLogger("sage.aviary")
@@ -511,8 +517,7 @@
self.cert = cert
self.root_cert = root_cert
self.domain_verify = domain_verify
- self.server_validation_possible = hasattr(sage.https,
- "HTTPSFullCertTransport")
+ self.server_validation_possible = has_full_cert
if self.root_cert == "":
log.info("AviaryOperations: no root certificate file specified, "\
"using client validation only for ssl connections.")
@@ -524,7 +529,7 @@
else:
log.info("AviaryOperations: using client and server "\
"certificate validation for ssl connections, "\
- "solution is %s" % sage.https.technology)
+ "solution is %s" % technology)
log.info("AviaryOperations: verify server domain against "\
"certificate during validation (%s)" % self.domain_verify)
Added: trunk/sage/python/sage/exceptions.py
===================================================================
--- trunk/sage/python/sage/exceptions.py (rev 0)
+++ trunk/sage/python/sage/exceptions.py 2011-10-25 13:46:51 UTC (rev 5091)
@@ -0,0 +1,3 @@
+# Provide common exception classes here
+class SSLVerificationError(Exception):
+ pass
Modified: trunk/sage/python/sage/https.py
===================================================================
--- trunk/sage/python/sage/https.py 2011-10-24 19:52:45 UTC (rev 5090)
+++ trunk/sage/python/sage/https.py 2011-10-25 13:46:51 UTC (rev 5091)
@@ -1,8 +1,5 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+# Copyright 2011 David Norton, Jr.
#
-# Copyright 2009-2011 Red Hat, Inc.
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -15,20 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# http://davidnortonjr.com/
+# Copyright 2011 Red Hat, Inc.
+#
+# Modifications: inclusion of doc strings, method and class name changes,
+# provide _get_auth_handler method which can be overloaded
+# in derived classes.
+
# uses Suds - https://fedorahosted.org/suds/
import urllib2 as u2
-from suds.transport.http import HttpTransport, Reply, TransportError
+from suds.transport.http import HttpTransport
import httplib
-import socket
-technology = "urllib2"
-
-# Provide an exception here that implementation classes
-# can use in common to raise exceptions and return messages
-class SSLVerificationError(Exception):
- pass
-
class HTTPSClientAuthHandler(u2.HTTPSHandler):
def __init__(self, key, cert):
"""
@@ -68,100 +64,9 @@
HttpTransport.__init__(self, *args, **kwargs)
self.key = key
self.cert = cert
+ self.urlopener = u2.build_opener(self._get_auth_handler())
- def u2open(self, u2request):
- """
- Open an ssl connection with client certificate validation.
-
- @param u2request: A urllib2 request.
- @type u2request: urllib2.Request.
- @return: The opened file-like urllib2 object.
- @rtype: fp
- """
- tm = self.options.timeout
- url = u2.build_opener(self._get_auth_handler())
- if self.u2ver() < 2.6:
- socket.setdefaulttimeout(tm)
- return url.open(u2request)
- else:
- return url.open(u2request, timeout=tm)
-
def _get_auth_handler(self):
return HTTPSClientAuthHandler(self.key, self.cert)
-try:
- # If verifiedhttps dependencies can be satisfied,
- # this import will succeed and the following two classes will
- # be available to provide server certificate validation.
- # A module can check for the presence of these two classes
- # after import thusly (with "whatever" enclosing module
- # if necessary):
- # import https
- # if hasattr(<whatever.>https, "HTTPSFullAuthHandler"):
- # ...
- # if hasattr(<whatever.>https, "HTTPSFullCertTransport"):
- # ...
- try:
- # Try a solution that uses the Python ssl module first
- from sage.verifiedhttps import VerifiedHTTPSConnection
- technology = "Python ssl"
- except:
- # Didn't work, try a solution based on m2crypto
- from sage.verifiedhttps_m2crypto import VerifiedHTTPSConnection
- technology = "M2Crypto"
-
- class HTTPSFullAuthHandler(HTTPSClientAuthHandler):
- """
- Add server certificate validation to HTTPSClientAuthHandler
- via a different connection type (VerifiedHTTPSConnection).
- """
- def __init__(self, my_key, my_cert, root_cert, domain_verify):
- """
- @param my_key: full path for the client's private key file
- @param my_cert: full path for the client's PEM certificate file
- @param root_cert: full path for root certificates file used to
- verify server certificates on connection
- @param domain_verify: check server host against the 'commonName'
- field in the server certificate
- """
- HTTPSClientAuthHandler.__init__(self, my_key, my_cert)
- self.root_cert = root_cert
- self.domain_verify = domain_verify
-
- def _get_connection(self, host, timeout=300):
- """
- @return: A connection object derived from httplib types with
- with client and server certificate validation support
- @rtype: VerifiedHTTPSConnection
- """
- return VerifiedHTTPSConnection(host,
- key_file=self.key,
- cert_file=self.cert,
- root_cert=self.root_cert,
- domain_verify=self.domain_verify)
-
- class HTTPSFullCertTransport(HTTPSClientCertTransport):
- """
- Add server certificate validation to HTTPSClientCertTransport
- via a different handler type (HTTPSFullAuthHandler)
- """
- def __init__(self, key, cert, root_cert, domain_verify=True,
- *args, **kwargs):
- """
- @param key: full path for the client's private key file
- @param cert: full path for the client's PEM certificate file
- @param root_cert: full path for root certificates file used to
- verify server certificates on connection
- @param domain_verify: check server host against the 'commonName'
- field in the server certificate
- """
- HTTPSClientCertTransport.__init__(self, key, cert, *args, **kwargs)
- self.root_cert = root_cert
- self.domain_verify = domain_verify
-
- def _get_auth_handler(self):
- return HTTPSFullAuthHandler(self.key, self.cert, self.root_cert,
- self.domain_verify)
-except:
- pass
Added: trunk/sage/python/sage/https_full.py
===================================================================
--- trunk/sage/python/sage/https_full.py (rev 0)
+++ trunk/sage/python/sage/https_full.py 2011-10-25 13:46:51 UTC (rev 5091)
@@ -0,0 +1,66 @@
+from https import HTTPSClientAuthHandler, HTTPSClientCertTransport
+
+# If verifiedhttps dependencies can be satisfied,
+# this import will succeed and the following two classes will
+# be available to provide server certificate validation.
+try:
+ # Try a solution that uses the Python ssl module first
+ from sage.verifiedhttps import VerifiedHTTPSConnection
+ technology = "Python ssl"
+except:
+ # Didn't work, try a solution based on m2crypto
+ from sage.verifiedhttps_m2crypto import VerifiedHTTPSConnection
+ technology = "M2Crypto"
+
+class HTTPSFullAuthHandler(HTTPSClientAuthHandler):
+ """
+ Add server certificate validation to HTTPSClientAuthHandler
+ via a different connection type (VerifiedHTTPSConnection).
+ """
+ def __init__(self, my_key, my_cert, root_cert, domain_verify):
+ """
+ @param my_key: full path for the client's private key file
+ @param my_cert: full path for the client's PEM certificate file
+ @param root_cert: full path for root certificates file used to
+ verify server certificates on connection
+ @param domain_verify: check server host against the 'commonName'
+ field in the server certificate
+ """
+ self.root_cert = root_cert
+ self.domain_verify = domain_verify
+ HTTPSClientAuthHandler.__init__(self, my_key, my_cert)
+
+ def _get_connection(self, host, timeout=300):
+ """
+ @return: A connection object derived from httplib types with
+ with client and server certificate validation support
+ @rtype: VerifiedHTTPSConnection
+ """
+ return VerifiedHTTPSConnection(host,
+ key_file=self.key,
+ cert_file=self.cert,
+ root_cert=self.root_cert,
+ domain_verify=self.domain_verify)
+
+class HTTPSFullCertTransport(HTTPSClientCertTransport):
+ """
+ Add server certificate validation to HTTPSClientCertTransport
+ via a different handler type (HTTPSFullAuthHandler)
+ """
+ def __init__(self, key, cert, root_cert, domain_verify=True,
+ *args, **kwargs):
+ """
+ @param key: full path for the client's private key file
+ @param cert: full path for the client's PEM certificate file
+ @param root_cert: full path for root certificates file used to
+ verify server certificates on connection
+ @param domain_verify: check server host against the 'commonName'
+ field in the server certificate
+ """
+ self.root_cert = root_cert
+ self.domain_verify = domain_verify
+ HTTPSClientCertTransport.__init__(self, key, cert, *args, **kwargs)
+
+ def _get_auth_handler(self):
+ return HTTPSFullAuthHandler(self.key, self.cert, self.root_cert,
+ self.domain_verify)
Modified: trunk/sage/python/sage/verifiedhttps.py
===================================================================
--- trunk/sage/python/sage/verifiedhttps.py 2011-10-24 19:52:45 UTC (rev 5090)
+++ trunk/sage/python/sage/verifiedhttps.py 2011-10-25 13:46:51 UTC (rev 5091)
@@ -1,7 +1,29 @@
+# Copyright 2011 Joseph Turner
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Copyright 2011 Red Hat, Inc.
+#
+# Modifications: addition of __init__ routine and
+# member variables timeout, root_cert, server_verify,
+# and domain_verify for per instance control
+
+
import httplib
import socket
import ssl
-from https import SSLVerificationError
+from exceptions import SSLVerificationError
# Note: much thanks to Joseph Turner for showing the world
# how to extend httplib using the ssl module to implement
Modified: trunk/sage/python/sage/verifiedhttps_m2crypto.py
===================================================================
--- trunk/sage/python/sage/verifiedhttps_m2crypto.py 2011-10-24 19:52:45 UTC (rev 5090)
+++ trunk/sage/python/sage/verifiedhttps_m2crypto.py 2011-10-25 13:46:51 UTC (rev 5091)
@@ -1,5 +1,20 @@
+# Copyright 2011 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
from M2Crypto import httpslib, SSL
-from https import SSLVerificationError
+from exceptions import SSLVerificationError
# wrap the creation of a SSL.Context, etc in a class
class VerifiedHTTPSConnection(httpslib.HTTPSConnection):
@@ -51,7 +66,7 @@
# This is mostly for testing with self-signed certificates
# and to provide the same interface as verifiedhttps.py
# In order to squash the report of the mismatched hostnames,
- # we replace the message -- could be considered a leak of
+ # we replace the message -- could be considered as a leak of
# domain and certificate information I suppose.
if self.server_verify and self.domain_verify:
raise SSLVerificationError("Server certificate doesn't match domain;"\
12 years, 7 months
r5090 - in trunk: cumin/python/cumin wooly/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-24 19:52:45 +0000 (Mon, 24 Oct 2011)
New Revision: 5090
Modified:
trunk/cumin/python/cumin/widgets.strings
trunk/wooly/resources/mootools.js
Log:
Addressing BZ 748497 by setting up a domready event to set the focus to the desired element for the wallaby tag editing filtered select widget.
Modified: trunk/cumin/python/cumin/widgets.strings
===================================================================
--- trunk/cumin/python/cumin/widgets.strings 2011-10-24 17:34:03 UTC (rev 5089)
+++ trunk/cumin/python/cumin/widgets.strings 2011-10-24 19:52:45 UTC (rev 5090)
@@ -934,6 +934,10 @@
'setview':'total',
'listcontainer_height':'{listcontainer_height}'});
});
+ var focusElements = $$('.focusfirst');
+ if(focusElements != null) {
+ focusElements[0].focus();
+ }
});
//]]>
Modified: trunk/wooly/resources/mootools.js
===================================================================
--- trunk/wooly/resources/mootools.js 2011-10-24 17:34:03 UTC (rev 5089)
+++ trunk/wooly/resources/mootools.js 2011-10-24 19:52:45 UTC (rev 5090)
@@ -1771,6 +1771,7 @@
// that filters based on what's been entered in the textfield
filterbox_container = new Element('div', {'class': 'mtms_filterbox'});
this.filterbox = new Element('input', {
+ 'class':'focusfirst',
'id':'filterbox',
'events': {
'keyup': function(evt){
12 years, 7 months
r5089 - in trunk: cumin/resources wooly/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-24 17:34:03 +0000 (Mon, 24 Oct 2011)
New Revision: 5089
Modified:
trunk/cumin/resources/app.css
trunk/wooly/resources/mootools.js
Log:
Addressing BZ 748497 by refactoring the filtered select widget javascript code and updating the CSS to reflect the new positioning.
Modified: trunk/cumin/resources/app.css
===================================================================
--- trunk/cumin/resources/app.css 2011-10-24 17:14:59 UTC (rev 5088)
+++ trunk/cumin/resources/app.css 2011-10-24 17:34:03 UTC (rev 5089)
@@ -665,7 +665,7 @@
}
.mtmultiselect {
- width:400px;
+ width:450px;
background:#E7E7F7;
font:12px verdana;
}
@@ -707,13 +707,11 @@
}
.mtms_filterbox input {
- background:#FFF;
- border:1px solid #141212;
}
.mtms_filtercontrols {
color:#000;
- padding:7px 0;
+ padding:40px 0px 0px 0px;
}
.mtms_filtercontrols a,.mtms_paginator a {
Modified: trunk/wooly/resources/mootools.js
===================================================================
--- trunk/wooly/resources/mootools.js 2011-10-24 17:14:59 UTC (rev 5088)
+++ trunk/wooly/resources/mootools.js 2011-10-24 17:34:03 UTC (rev 5089)
@@ -1725,7 +1725,7 @@
'selected': 'Selected:',
'unselected': 'Unselected:',
'selectall': 'Select all',
- 'selectedfiltered':'Select filtered',
+ 'selectedfiltered':'Select all',
'selectnone': 'Clear',
'filter': 'Filter',
'in': 'in',
@@ -1757,25 +1757,15 @@
this.showselected,
this.numselected);
ul.grab(this.selectedbtn);
-
- this.unselectedbtn = this.makebtn(this.options.labels.unselected,
- this.showunselected,
- this.options.datasrc.getChildren().length - this.numselected);
- ul.grab(this.unselectedbtn);
-
- var br = new Element('br');
- ul.grab(br);
-
- this.selectFilteredBtn = this.makebtn(this.options.labels.selectedfiltered,
+
+ this.selectFilteredBtn = this.makeformbtn(this.options.labels.selectedfiltered,
this.selectFiltered,
'');
- ul.grab(this.selectFilteredBtn);
- this.selectNoneBtn = this.makebtn(this.options.labels.selectnone,
- this.selectNone,
- '');
- ul.grab(this.selectNoneBtn);
-
+ this.selectNoneBtn = this.makeformbtn(this.options.labels.selectnone,
+ this.selectNone,
+ '');
+
// Make text field for filter
// On keyup, the displaylist.filter is called with a function
// that filters based on what's been entered in the textfield
@@ -1795,7 +1785,9 @@
});
this.filterbox_label = new Element('span', {'html':'Filter list: ', 'class':'mtms_filterlabel'});
filterbox_container.grab(this.filterbox_label);
- filterbox_container.grab(this.filterbox);
+ filterbox_container.grab(this.filterbox);
+ filterbox_container.grab(this.selectNoneBtn);
+ filterbox_container.grab(this.selectFilteredBtn);
this.options.view.grab(filterbox_container, this.options.inputpos);
},
@@ -1806,8 +1798,9 @@
counts here.)
*/
- makebtn: function(label, func, prefix){
- var li = new Element('li');
+ makebtn: function(label, func, prefix, element_type){
+ element_type = typeof(element_type) != 'undefined' ? element_type : 'li';
+ var li = new Element(element_type);
var btn = new Element('a', {'html': label,
'href': '',
'events': {
@@ -1822,6 +1815,17 @@
}
return li;
},
+
+ makeformbtn: function(label, func, prefix){
+ var btn = new Element('input', {type: "submit",
+ value: label,
+ 'events': {
+ // You might have to bind this differently
+ 'click': func.bind(this)
+ }
+ });
+ return btn;
+ },
showtotal: function(){
// return true for every item in the datasrc
@@ -1842,15 +1846,6 @@
);
return false;
},
- showunselected:function(){
- this.filter(this.options.datasrc.getChildren(),
- function(item){
- return (item.selected !== true);
- },
- this.RESETINPUT
- );
- return false;
- },
selectAll:function(){
this.options.datasrc.getChildren().each(
function(item){
@@ -1921,8 +1916,7 @@
this.numselected = numselected;
var total = this.options.datasrc.getChildren().length;
this.totalbtn.getElement('span').set('text', total);
- this.selectedbtn.getElement('span').set('text', numselected);
- this.unselectedbtn.getElement('span').set('text', total - numselected);
+ this.selectedbtn.getElement('span').set('text', numselected);
}
});
12 years, 7 months
r5088 - trunk/cumin/python/cumin/grid
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-10-24 17:14:59 +0000 (Mon, 24 Oct 2011)
New Revision: 5088
Modified:
trunk/cumin/python/cumin/grid/negotiator.py
Log:
Make quota editing asynchronous
BZ739658
Modified: trunk/cumin/python/cumin/grid/negotiator.py
===================================================================
--- trunk/cumin/python/cumin/grid/negotiator.py 2011-10-20 20:48:13 UTC (rev 5087)
+++ trunk/cumin/python/cumin/grid/negotiator.py 2011-10-24 17:14:59 UTC (rev 5088)
@@ -1,7 +1,7 @@
from wooly.util import StringCatalog, Writer
import logging
from cumin.objectframe import ObjectFrame, ObjectFrameTask,\
- ObjectFrameTaskFeedbackForm
+ ObjectFrameTaskForm
from cumin.objectselector import ObjectSelector, ObjectLinkColumn,\
MonitorSelfStatColumn, ObjectTable, MonitorSelfAgeColumn
from wooly import Widget, Attribute, Parameter
@@ -10,6 +10,7 @@
from wooly.parameters import ListParameter
from wooly.template import WidgetTemplate
from cumin.stat import StatFlashChart
+from sage.util import call_async
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.grid.negotiator")
@@ -205,7 +206,7 @@
val = min(1.0, val)
return val
-class GroupForm(ObjectFrameTaskFeedbackForm):
+class GroupForm(ObjectFrameTaskForm):
def __init__(self, app, name, task):
super(GroupForm, self).__init__(app, name, task)
@@ -308,7 +309,7 @@
def render_chart_id(self, session):
return self.chart.render_id(session)
- def process_submit(self, session):
+ def _invoke_tasks(self, session):
negotiator = self.negotiator.get(session)
quotas = self.quotas.get(session)
group_names = self.group_names.get(session)
@@ -330,6 +331,8 @@
self.task.reconfig(negotiator)
self.app.model.update_negotiator_config_value(negotiator)
+ def process_submit(self, session):
+ call_async(None, self._invoke_tasks, session)
self.task.exit_with_redirect(session)
def check_quota(self, quota, original):
@@ -400,17 +403,16 @@
self.app.main_page.main.grid.view.show(session)
def do_invoke(self, invoc, negotiator, group, value):
+ try:
+ short_group = group.split("_")[-1]
+ except:
+ short_group = group
+ invoc.description = "Set %s to %s" % (short_group, value)
result = self.app.remote.set_raw_config(negotiator, group, value)
if result.error:
raise result.error
invoc.status_code = result.status
- try:
- group = group.split("_")[-1]
- invoc.description = "Set %s to %s" % (group, value)
- except:
- pass
-
invoc.end()
def reconfig(self, negotiator):
12 years, 7 months
r5087 - branches/noflash/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-20 20:48:13 +0000 (Thu, 20 Oct 2011)
New Revision: 5087
Modified:
branches/noflash/cumin/resources/app.js
Log:
Fixing the x-axis tick values when zooming. Also clearing out ofc-related code.
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-10-20 18:27:12 UTC (rev 5086)
+++ branches/noflash/cumin/resources/app.js 2011-10-20 20:48:13 UTC (rev 5087)
@@ -370,57 +370,6 @@
return chart;
}
-cumin.updateFlashChart = function (id) {
- var chart = cumin.getFlashChart(id);
- if (chart == null)
- return false;
- if (typeof chart.get_ymax != "undefined")
- chart.get_ymax(id)
- else
- wooly.log("get_ymax not definded for " + id);
-}
-
-/* called from .swf in response to chart.get_ymax() */
-function got_ymax(id, href, axis_max, vals_max, low, high) {
- var chart = cumin.getFlashChart(id);
- if (chart == null)
- return false;
-
- var branch = wooly.session.branch(href);
-
- var now = new Date().getTime();
- var then = now - 10 * 1000;
- if (typeof chart.last_time != "undefined") {
- then = chart.last_time;
- }
- chart.last_time = now;
- var elapsed = now - then;
- branch['elapsed'] = elapsed; // milliseconds since last update
-
- // hack: do a full update every minute
- if (typeof chart.last_full_time == "undefined") {
- chart.last_full_time = now;
- }
- var last_full_time = chart.last_full_time;
- if (now - last_full_time > 60 * 1000) {
- if (low != "-1") {
- branch['low'] = low;
- branch['high'] = high;
- delete branch.elapsed;
- }
- chart.last_full_time = now;
- }
-
- branch['amax'] = axis_max;
- branch['vmax'] = vals_max;
-
- href = branch.marshal();
- if (typeof chart.reload != "undefined")
- chart.reload(href, false);
- else
- wooly.log("reload not definded for " + id);
-}
-
function incrementChartSequence(chart) {
var src = chart.src;
var branch = wooly.session.branch(src);
@@ -433,101 +382,6 @@
}
-/*
-function ofc_ready(id) {
- if (typeof id != "undefined") {
- var key = id;
- var hash = wooly.session.hash();
- if (typeof hash[key] != "undefined") {
- var oChartHtml = $(key);
- if (oChartHtml) {
- var links = oChartHtml.getElements('a');
- var state = hash[key];
-
- $each(links, function (item) {
- if (item.get('state') == state) {
- changeDuration(state, item, key);
- }
- });
- }
- }
- }
-}
-
-window.addEvent('domready',function () {
- var hash = wooly.session.hash();
- for (var key in hash) {
- if (!(hash[key] instanceof Function)) {
- var oImg = document.images[key];
- if (oImg) {
- var oChart = $(key);
- if (oChart) {
- var links = oChart.getElements('a');
- var state = hash[key];
-
- $each(links, function (item) {
- if (item.get('state') == state) {
- changeDuration(state, item, key);
- }
- });
- }
- }
- }
- }
-});
-*/
-
-function ofc_range(id, href, low, high) {
- var chart = cumin.getFlashChart(id);
- if (chart) {
- var now = new Date().getTime();
- chart.last_full_time = now;
-
- var branch = wooly.session.branch(href);
-
- // don't allow high < low
- var iLow = parseFloat(low, 10);
- var iHigh = parseFloat(high, 10);
- if (iHigh < iLow) {
- low = high;
- high = iLow + "";
- }
-
- branch['low'] = low;
- branch['high'] = high;
- if (branch.elapsed)
- delete branch.elapsed;
-
- href = branch.marshal();
- if (typeof chart.reload != "undefined")
- chart.reload(href, true);
- else
- wooly.log("reload not definded for " + id);
- }
-}
-
-function ofc_change_priority(index, text) {
- var fields = text.split("|");
- //var percent = fields[0].substring(0, fields[0].length - 1);
- //var value = fields[1];
- var label = fields[2];
- //var id = fields[3];
-
- var selinput = null;
- $$(".slider").each( function (el, i) {
- var input = el.getParent("tr").getElement("input");
- if (el.id == label) {
- selinput = input;
- } else {
- input.selectRange(0, 0);
- }
- });
- if (selinput) {
- selinput.focus();
- selinput.selectRange(0, selinput.value.length);
- }
-}
-
function addJavascript(jsname, pos) {
var th = document.getElementsByTagName(pos)[0];
var s = document.createElement('script');
@@ -706,7 +560,7 @@
min:dataopts['xmin'] / dataContainer['x_axis_normalizer'],
max:dataopts['xmax'] / dataContainer['x_axis_normalizer'],
//ticks:[[-3600, "60 min"], [-2700, "45 min"], [-1800, "30 min"], [-900, "15 min"], [0, "0"]]
- tickOptions:{formatString:'%d ' + dataContainer['x_axis_unit_label']},
+ tickOptions:{formatString:'%g ' + dataContainer['x_axis_unit_label']},
}
},
series: getSeries(dataContainer),
@@ -735,7 +589,8 @@
cursor:{show:true,
zoom:true,
looseZoom:true,
- showCursorLegend:false}
+ showCursorLegend:false
+ },
}
var divName = $(holder).get('id');
12 years, 7 months
r5086 - in branches/noflash: cumin/resources wooly/python/wooly wooly/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-20 18:27:12 +0000 (Thu, 20 Oct 2011)
New Revision: 5086
Modified:
branches/noflash/cumin/resources/app.js
branches/noflash/wooly/python/wooly/pages.py
branches/noflash/wooly/python/wooly/pages.strings
branches/noflash/wooly/resources/jquery.jqplot.js
Log:
Cleaning-up rendering of axis labels. No longer showing negative times on x-axis. The x-axis now zooms correctly.
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-10-20 15:39:04 UTC (rev 5085)
+++ branches/noflash/cumin/resources/app.js 2011-10-20 18:27:12 UTC (rev 5086)
@@ -602,6 +602,22 @@
dataContainer['end_secs'] = json.end_secs;
dataContainer['tnow'] = json.tnow;
dataContainer['x_axis_values'] = [];
+
+ switch(json['duration']) {
+ case 600:
+ dataContainer['x_axis_normalizer'] = 60;
+ dataContainer['x_axis_unit_label'] = "min";
+ break;
+ case 3600:
+ dataContainer['x_axis_normalizer'] = 60;
+ dataContainer['x_axis_unit_label'] = "min";
+ break;
+ case 86400:
+ dataContainer['x_axis_normalizer'] = 3600;
+ dataContainer['x_axis_unit_label'] = "hr";
+ break;
+ }
+
for ( var i = 0; i < json.x_axis.labels.labels.length; i++) {
dataContainer['x_axis_values'] = dataContainer['x_axis_values']
.append([ json.x_axis.labels.labels[i].text ]);
@@ -612,7 +628,7 @@
dataContainer['x_coordinate_values'][i] = new Array();
for ( var j = 0; j < json.elements[i].values.length; j++) {
dataContainer['x_coordinate_values'][i]
- .append([ json.elements[i].values[j].dt ]);
+ .append([ json.elements[i].values[j].dt / dataContainer['x_axis_normalizer'] ]);
}
}
@@ -621,7 +637,7 @@
dataContainer['y_coordinate_values'][i] = new Array();
for ( var j = 0; j < json.elements[i].values.length; j++) {
dataContainer['y_coordinate_values'][i].append([ [
- json.elements[i].values[j].dt - dataContainer['tnow'],
+ (json.elements[i].values[j].dt - dataContainer['tnow']) / dataContainer['x_axis_normalizer'],
json.elements[i].values[j].y ] ]);
}
}
@@ -635,6 +651,8 @@
dataContainer['x_axis_values'] = dataContainer['x_axis_values']
.append([ json.x_axis.labels.labels[i].text ]);
}
+
+
// console.log("end_secs: " + dataContainer['end_secs'] + " tnow: "
// + dataContainer['tnow']);
@@ -660,7 +678,7 @@
text: '',
show: false,
},
- gridPadding: {top:25, right:20, bottom:20, left:20},
+ gridPadding: {top:35, right:20, bottom:20, left:20},
grid: { background: '#444444' },
legend: {
show:true,
@@ -676,8 +694,20 @@
}
},
axes: {
- y2axis: {autoscale: true, min:0},
- xaxis: {autoscale: false, pad:0, min:dataopts['xmin'], max:dataopts['xmax']}
+ y2axis: {
+ autoscale: true,
+ min:0,
+ tickOptions:{formatString:'%d'},
+ numberTicks:4,
+ },
+ xaxis: {
+ autoscale: true,
+ pad:0,
+ min:dataopts['xmin'] / dataContainer['x_axis_normalizer'],
+ max:dataopts['xmax'] / dataContainer['x_axis_normalizer'],
+ //ticks:[[-3600, "60 min"], [-2700, "45 min"], [-1800, "30 min"], [-900, "15 min"], [0, "0"]]
+ tickOptions:{formatString:'%d ' + dataContainer['x_axis_unit_label']},
+ }
},
series: getSeries(dataContainer),
seriesColors: ['#00cc00','#cc0000','#0000cc'],
Modified: branches/noflash/wooly/python/wooly/pages.py
===================================================================
--- branches/noflash/wooly/python/wooly/pages.py 2011-10-20 15:39:04 UTC (rev 5085)
+++ branches/noflash/wooly/python/wooly/pages.py 2011-10-20 18:27:12 UTC (rev 5086)
@@ -109,7 +109,7 @@
def get_content_type(self, session):
value = session.request_environment.get("HTTP_USER_AGENT")
- if value and value.find("MSIE 6") != -1:
+ if (value and value.find("MSIE 6") != -1) or (value and value.find("MSIE 9") != -1):
content_type = self.html_content_type
else:
content_type = self.xhtml_content_type
Modified: branches/noflash/wooly/python/wooly/pages.strings
===================================================================
--- branches/noflash/wooly/python/wooly/pages.strings 2011-10-20 15:39:04 UTC (rev 5085)
+++ branches/noflash/wooly/python/wooly/pages.strings 2011-10-20 18:27:12 UTC (rev 5086)
@@ -24,6 +24,7 @@
<script type="text/javascript" src="resource?name=jquery.jqplot.js"></script>
<script type="text/javascript" src="resource?name=jqplot.pieRenderer.min.js"></script>
<script type="text/javascript" src="resource?name=jqplot.donutRenderer.min.js"></script>
+ <script type="text/javascript" src="resource?name=jqplot.categoryAxisRenderer.js"></script>
<script type="text/javascript" src="resource?name=jqplot.enhancedLegendRenderer.js"></script>
<script type="text/javascript" src="resource?name=jqplot.highlighter.min.js"></script>
<script type="text/javascript" src="resource?name=jqplot.cursor.js"></script>
Modified: branches/noflash/wooly/resources/jquery.jqplot.js
===================================================================
--- branches/noflash/wooly/resources/jquery.jqplot.js 2011-10-20 15:39:04 UTC (rev 5085)
+++ branches/noflash/wooly/resources/jquery.jqplot.js 2011-10-20 18:27:12 UTC (rev 5086)
@@ -3811,12 +3811,13 @@
if (!format) {
format = $.jqplot.config.defaultTickFormatString;
}
- return $.jqplot.sprintf(format, val);
+ return ($.jqplot.sprintf(format, val)).replace(/-/,""); // hack to prevent negative axis labels, which we don't have
}
else {
return String(val);
}
};
+
$.jqplot.AxisTickRenderer.prototype.pack = function() {
};
12 years, 7 months
r5085 - branches/noflash/wooly/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-20 15:39:04 +0000 (Thu, 20 Oct 2011)
New Revision: 5085
Modified:
branches/noflash/wooly/resources/jquery.jqplot.css
Log:
Using !important on override of inline style for jqplot-table-legend.
Modified: branches/noflash/wooly/resources/jquery.jqplot.css
===================================================================
--- branches/noflash/wooly/resources/jquery.jqplot.css 2011-10-19 20:38:13 UTC (rev 5084)
+++ branches/noflash/wooly/resources/jquery.jqplot.css 2011-10-20 15:39:04 UTC (rev 5085)
@@ -184,6 +184,11 @@
border-right-style: solid;
}
+/* This gives us a left justified 'n' position for our legend */
+.jqplot-table-legend {
+ left:0px !important;
+}
+
.jqplot-title {
top: 0px;
left: 0px;
12 years, 7 months
r5084 - in branches/noflash: cumin/resources wooly/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-19 20:38:13 +0000 (Wed, 19 Oct 2011)
New Revision: 5084
Modified:
branches/noflash/cumin/resources/app.js
branches/noflash/wooly/resources/jquery.jqplot.css
Log:
Adding tooltips to the new charts, also css modification to up the z-index of the tooltips.
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-10-19 19:47:45 UTC (rev 5083)
+++ branches/noflash/cumin/resources/app.js 2011-10-19 20:38:13 UTC (rev 5084)
@@ -685,7 +685,7 @@
lineWidth:1,
fill:true,
fillAndStroke:true,
- fillAlpha: 0.4,
+ fillAlpha: 0.1,
rendererOptions: {
highlightMouseOver: false,
highlightMouseDown: false,
@@ -697,6 +697,11 @@
style:'filledCircle',
size:4},
},
+ highlighter: {
+ tooltipaxes:'xy',
+ show: true,
+ formatString:'<table class="jqplot-highlighter"><tr><td>Time:</td><td>%s</td></tr><tr><td>Value:</td><td>%s</td></tr></table>'
+ },
cursor:{show:true,
zoom:true,
looseZoom:true,
Modified: branches/noflash/wooly/resources/jquery.jqplot.css
===================================================================
--- branches/noflash/wooly/resources/jquery.jqplot.css 2011-10-19 19:47:45 UTC (rev 5083)
+++ branches/noflash/wooly/resources/jquery.jqplot.css 2011-10-19 20:38:13 UTC (rev 5084)
@@ -201,16 +201,18 @@
border: 1px solid #cccccc;
font-size: 0.75em;
white-space: nowrap;
- background: rgba(208,208,208,0.5);
+ background: rgba(255,255,255,0.9);
padding: 1px;
+ z-index:10;
}
.jqplot-highlighter-tooltip, .jqplot-canvasOverlay-tooltip {
border: 1px solid #cccccc;
font-size: 0.75em;
white-space: nowrap;
- background: rgba(208,208,208,0.5);
+ background: rgba(255,255,255,0.9);
padding: 1px;
+ z-index:10;
}
.jqplot-point-label {
12 years, 7 months
r5083 - branches/noflash/wooly/python/wooly
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-19 19:47:45 +0000 (Wed, 19 Oct 2011)
New Revision: 5083
Modified:
branches/noflash/wooly/python/wooly/pages.strings
Log:
replacing horizontalLegendRenderer with the enhancedLegendRenderer
Modified: branches/noflash/wooly/python/wooly/pages.strings
===================================================================
--- branches/noflash/wooly/python/wooly/pages.strings 2011-10-19 19:32:25 UTC (rev 5082)
+++ branches/noflash/wooly/python/wooly/pages.strings 2011-10-19 19:47:45 UTC (rev 5083)
@@ -24,7 +24,7 @@
<script type="text/javascript" src="resource?name=jquery.jqplot.js"></script>
<script type="text/javascript" src="resource?name=jqplot.pieRenderer.min.js"></script>
<script type="text/javascript" src="resource?name=jqplot.donutRenderer.min.js"></script>
- <script type="text/javascript" src="resource?name=jqplot.horizontalLegendRenderer.js"></script>
+ <script type="text/javascript" src="resource?name=jqplot.enhancedLegendRenderer.js"></script>
<script type="text/javascript" src="resource?name=jqplot.highlighter.min.js"></script>
<script type="text/javascript" src="resource?name=jqplot.cursor.js"></script>
<script type="text/javascript" src="resource?name=jqplot.dateAxisRenderer.js"></script>
12 years, 7 months