From 8ccf48564a5d237a369976d33b5729d2b9809825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Sun, 9 Nov 2014 00:24:46 +0100 Subject: [PATCH] Fixing admin table colors & some PEPify --- .../static/adm/css/dataTables.bootstrap.css | 6 +-- server/src/uds/transports/__init__.py | 46 ++++++++++--------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/server/src/uds/static/adm/css/dataTables.bootstrap.css b/server/src/uds/static/adm/css/dataTables.bootstrap.css index b22d05de..1fd386e9 100644 --- a/server/src/uds/static/adm/css/dataTables.bootstrap.css +++ b/server/src/uds/static/adm/css/dataTables.bootstrap.css @@ -105,10 +105,10 @@ div.dataTables_scrollFoot table { color: white; } -.table-striped > tbody > tr:nth-child(2n+1) > td { background-color: #d9edf7; } -.table-striped > tbody > tr:nth-child(2n) > td { background-color: white; } +.table-striped > tbody > tr:nth-child(2n+1) > td { background-color: #606060; color: #F0F0F0; } +.table-striped > tbody > tr:nth-child(2n) > td { background-color: white; color: #000000;} -.table-striped > tbody > tr:nth-child(2n+1) > td.sorting_1 { background-color: #b3dbef; } +.table-striped > tbody > tr:nth-child(2n+1) > td.sorting_1 { background-color: #505050; color: #FFFFFF; } .table-striped > tbody > tr:nth-child(2n) > td.sorting_1 { background-color: #F5F5F5; } diff --git a/server/src/uds/transports/__init__.py b/server/src/uds/transports/__init__.py index 131bb8e9..50b7c6f9 100644 --- a/server/src/uds/transports/__init__.py +++ b/server/src/uds/transports/__init__.py @@ -4,27 +4,27 @@ # Copyright (c) 2012 Virtual Cable S.L. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without modification, +# Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # -# * Redistributions of source code must retain the above copyright notice, +# * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. -# * Neither the name of Virtual Cable S.L. nor the names of its contributors -# may be used to endorse or promote products derived from this software +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software # without specific prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' @@ -32,32 +32,34 @@ Transport modules for UDS are contained inside this package. To create a new transport module, you will need to follow this steps: 1.- Create the transport module, probably based on an existing one 2.- Insert the module package as child of this package - 3.- Import the class of your transport module at __init__. For example:: - from Transport import SimpleTransport + 3.- Import the class of your transport module at __init__. For example:: + from Transport import SimpleTransport 4.- Done. At Server restart, the module will be recognized, loaded and treated - + The registration of modules is done locating subclases of :py:class:`uds.core.auths.Authentication` .. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com ''' + def __init__(): ''' This imports all packages that are descendant of this package, and, after that, - it register all subclases of service provider as + it register all subclases of service provider as ''' - import os.path, pkgutil + import os.path + import pkgutil import sys from uds.core import transports - + # Dinamycally import children of this package. The __init__.py files must import classes pkgpath = os.path.dirname(sys.modules[__name__].__file__) for _, name, _ in pkgutil.iter_modules([pkgpath]): __import__(name, globals(), locals(), [], -1) - + p = transports.Transport # This is marked as error in IDE, but it's not (__subclasses__) for cls in p.__subclasses__(): transports.factory().insert(cls) - + __init__()