[web] Slight tweak on jQueryUI's colors on links (related to #4564046)
Follow up to commit 16f550b48d57 which was somewhat brutal. This change
only overrides jQueryUI's CSS rules inside tab panes and leaves actual
tab buttons alone.
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr## This file is part of CubicWeb.## CubicWeb 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.## CubicWeb 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 CubicWeb. If not, see <http://www.gnu.org/licenses/>."""data source related entities"""__docformat__="restructuredtext en"importrefromsocketimportgethostnameimportloggingfromlogilab.common.textutilsimporttext_to_dictfromlogilab.common.configurationimportOptionErrorfromlogilab.mtconverterimportxml_escapefromcubicweb.entitiesimportAnyEntity,fetch_configclass_CWSourceCfgMixIn(object):@propertydefdictconfig(self):returnself.configandtext_to_dict(self.config)or{}defupdate_config(self,skip_unknown=False,**config):fromcubicweb.serverimportSOURCE_TYPESfromcubicweb.server.serverconfigimport(SourceConfiguration,generate_source_config)cfg=self.dictconfigcfg.update(config)options=SOURCE_TYPES[self.type].optionssconfig=SourceConfiguration(self._cw.vreg.config,options=options)foropt,valincfg.iteritems():try:sconfig.set_option(opt,val)exceptOptionError:ifskip_unknown:continueraisecfgstr=unicode(generate_source_config(sconfig),self._cw.encoding)self.cw_set(config=cfgstr)classCWSource(_CWSourceCfgMixIn,AnyEntity):__regid__='CWSource'fetch_attrs,cw_fetch_order=fetch_config(['name','type'])@propertydefhost_config(self):dictconfig=self.dictconfighost=gethostname()forhostcfginself.host_configs:ifhostcfg.match(host):self.info('matching host config %s for source %s',hostcfg.match_host,self.name)dictconfig.update(hostcfg.dictconfig)returndictconfig@propertydefhost_configs(self):returnself.reverse_cw_host_config_ofdefinit_mapping(self,mapping):forkey,optionsinmapping:ifisinstance(key,tuple):# relation definitionassertlen(key)==3restrictions=['X relation_type RT, RT name %(rt)s']kwargs={'rt':key[1]}ifkey[0]!='*':restrictions.append('X from_entity FT, FT name %(ft)s')kwargs['ft']=key[0]ifkey[2]!='*':restrictions.append('X to_entity TT, TT name %(tt)s')kwargs['tt']=key[2]rql='Any X WHERE %s'%','.join(restrictions)schemarset=self._cw.execute(rql,kwargs)elifkey[0].isupper():# entity typeschemarset=self._cw.execute('CWEType X WHERE X name %(et)s',{'et':key})else:# relation typeschemarset=self._cw.execute('CWRType X WHERE X name %(rt)s',{'rt':key})forschemaentityinschemarset.entities():self._cw.create_entity('CWSourceSchemaConfig',cw_for_source=self,cw_schema=schemaentity,options=options)@propertydefrepo_source(self):"""repository only property, not available from the web side (eg self._cw is expected to be a server session) """returnself._cw.repo.sources_by_eid[self.eid]classCWSourceHostConfig(_CWSourceCfgMixIn,AnyEntity):__regid__='CWSourceHostConfig'fetch_attrs,cw_fetch_order=fetch_config(['match_host','config'])@propertydefcwsource(self):returnself.cw_host_config_of[0]defmatch(self,hostname):returnre.match(self.match_host,hostname)classCWSourceSchemaConfig(AnyEntity):__regid__='CWSourceSchemaConfig'fetch_attrs,cw_fetch_order=fetch_config(['cw_for_source','cw_schema','options'])defdc_title(self):returnself._cw._(self.cw_etype)+' #%s'%self.eid@propertydefschema(self):returnself.cw_schema[0]@propertydefcwsource(self):returnself.cw_for_source[0]classCWDataImport(AnyEntity):__regid__='CWDataImport'repo_source=_logs=None# please pylintdefinit(self):self._logs=[]self.repo_source=self.cwsource.repo_sourcedefdc_title(self):return'%s [%s]'%(self.printable_value('start_timestamp'),self.printable_value('status'))@propertydefcwsource(self):returnself.cw_import_of[0]defrecord_debug(self,msg,path=None,line=None):self._log(logging.DEBUG,msg,path,line)self.repo_source.debug(msg)defrecord_info(self,msg,path=None,line=None):self._log(logging.INFO,msg,path,line)self.repo_source.info(msg)defrecord_warning(self,msg,path=None,line=None):self._log(logging.WARNING,msg,path,line)self.repo_source.warning(msg)defrecord_error(self,msg,path=None,line=None):self._status=u'failed'self._log(logging.ERROR,msg,path,line)self.repo_source.error(msg)defrecord_fatal(self,msg,path=None,line=None):self._status=u'failed'self._log(logging.FATAL,msg,path,line)self.repo_source.fatal(msg)def_log(self,severity,msg,path=None,line=None):encodedmsg=u'%s\t%s\t%s\t%s<br/>'%(severity,pathoru'',lineoru'',xml_escape(msg))self._logs.append(encodedmsg)defwrite_log(self,session,**kwargs):if'status'notinkwargs:kwargs['status']=getattr(self,'_status',u'success')self.cw_set(log=u'<br/>'.join(self._logs),**kwargs)self._logs=[]