# Path: Canard_settings.py
# class TUSLCache:
#     def __init__(self):
#     def __del__(self):
#     def setProperty(self,uri,obj):
#     def getProperty(self,uri=None):
#     def setObjectClass(self,uri,obj):
#     def getObjectClass(self,uri=None):
#     def insertCache(self,uri,objType,obj):
#     def retrieveCache(self,uri,objType):
# def getPref(key,default=None):
# def setPref(key,value):


import sqblUI
import isoLangCodes
import logging
        import urllib2
    import os, sys
from PyQt4 import QtCore, QtGui
from SQBLmodel import _ns, _namespaces 
from lxml import etree
from Canard_settings import TUSLObjectCache as cache

    def createURL(self):
        repository = self.repositoryURLs.currentText()
        searchTerms = self.searchTerms.text()
        if self.objectType.isVisible():
            objectType = self.objectType.currentText()
        else:
            objectType = self.objectTypeValue
        return "%s/%s/?s=%s"%(repository,objectType,searchTerms)

    def updateDesc(self):
        self.selected = self.retrievedItems.currentRow()
        current = self.items[self.selected]
        self.currentURI = current.get('uri')
        name = current.xpath("t:TextComponent[@xml:lang='%s']/t:Name"%self.language,namespaces=_namespaces)[0].text
        desc = current.xpath("t:TextComponent[@xml:lang='%s']/t:Description"%self.language,namespaces=_namespaces)[0].text
        text = "<b><a href='{url}'>{name}</a></b><p>{desc}</p>".format(
                url = current.get('additionalInformation'),
                name = name,
                desc = desc
                )
        self.itemDetails.setText(text)

    def getValues(self):
        # Add Object to the cache
        repository = self.repositoryURLs.currentText()
        if self.objectType.isVisible():
            objectType = self.objectType.currentText()
        else:
            objectType = self.objectTypeValue

# Path: Canard_settings.py
# class TUSLCache:
#     def __init__(self):
#     def __del__(self):
#     def setProperty(self,uri,obj):
#     def getProperty(self,uri=None):
#     def setObjectClass(self,uri,obj):
#     def getObjectClass(self,uri=None):
#     def insertCache(self,uri,objType,obj):
#     def retrieveCache(self,uri,objType):
# def getPref(key,default=None):
# def setPref(key,value):


# Path: SQBLWidgets/repositoryDialog.py
import sqblUI
import isoLangCodes
import logging
        import urllib2
    import os, sys
from PyQt4 import QtCore, QtGui
from SQBLmodel import _ns, _namespaces 
from lxml import etree
from Canard_settings import TUSLObjectCache as cache


    def createURL(self):
        repository = self.repositoryURLs.currentText()
        searchTerms = self.searchTerms.text()
        if self.objectType.isVisible():
            objectType = self.objectType.currentText()
        else:
            objectType = self.objectTypeValue
        return "%s/%s/?s=%s"%(repository,objectType,searchTerms)

    def updateDesc(self):
        self.selected = self.retrievedItems.currentRow()
        current = self.items[self.selected]
        self.currentURI = current.get('uri')
        name = current.xpath("t:TextComponent[@xml:lang='%s']/t:Name"%self.language,namespaces=_namespaces)[0].text
        desc = current.xpath("t:TextComponent[@xml:lang='%s']/t:Description"%self.language,namespaces=_namespaces)[0].text
        text = "<b><a href='{url}'>{name}</a></b><p>{desc}</p>".format(
                url = current.get('additionalInformation'),
                name = name,
                desc = desc
                )
        self.itemDetails.setText(text)

    def getValues(self):
        # Add Object to the cache
        repository = self.repositoryURLs.currentText()
        if self.objectType.isVisible():
            objectType = self.objectType.currentText()
        else:
            objectType = self.objectTypeValue

        cache.insertCache(uri=self.currentURI,objType=objectType,obj=etree.tostring(self.items[self.selected]))