示例#1
0
 def urlActions(self, symbol):
     settings = Settings()
     settings.beginGroup(settings.keys.urls)
     urls = settings.value(settings.keys.tickerurls, defaults.tickerUrls())
     settings.endGroup()
     urls = [str(s) for s in defaults.tickerUrls()]
     actions = []
     for url in urls: #urls.toStringList():
         try:
             name, url = str(url).split(':', 1)
             url = Template(url).substitute(symbol=symbol)
         except (KeyError, ValueError, ):
             continue
         action = makeUrlAction(name, url, toolTip='%s %s' % (symbol, name))
         actions.append(action)
     return actions
示例#2
0
 def urlActions(self, symbol):
     settings = Settings()
     settings.beginGroup(settings.keys.urls)
     urls = settings.value(settings.keys.tickerurls, defaults.tickerUrls())
     settings.endGroup()
     urls = [str(s) for s in defaults.tickerUrls()]
     actions = []
     for url in urls:  #urls.toStringList():
         try:
             name, url = str(url).split(':', 1)
             url = Template(url).substitute(symbol=symbol)
         except (
                 KeyError,
                 ValueError,
         ):
             continue
         action = makeUrlAction(name, url, toolTip='%s %s' % (symbol, name))
         actions.append(action)
     return actions
示例#3
0
    def urlActions(self, symbol):
        """ Returns a list of actions for the given symbol.

        """
        actions = []
        settings = self.settings
        settings.beginGroup(self.settings.keys.urls)
        urls = settings.value(settings.keys.tickerurls, defaults.tickerUrls())
        settings.endGroup()
        urls = [str(s) for s in defaults.tickerUrls()]
        for url in urls:
            try:
                name, url = str(url).split(':', 1)
                url = Template(url).substitute(symbol=symbol)
            except (KeyError, ValueError, ):
                continue
            act = makeUrlAction(name, url, toolTip='%s %s' % (symbol, name))
            request = partial(self.requestUrl, action=act)
            self.connect(act, Signals.triggered, request)
            actions.append(act)
        return actions
示例#4
0
    def urlActions(self, symbol):
        """ Returns a list of actions for the given symbol.

        """
        actions = []
        settings = self.settings
        settings.beginGroup(self.settings.keys.urls)
        urls = settings.value(settings.keys.tickerurls, defaults.tickerUrls())
        settings.endGroup()
        urls = [str(s) for s in defaults.tickerUrls()]
        for url in urls:
            try:
                name, url = str(url).split(':', 1)
                url = Template(url).substitute(symbol=symbol)
            except (
                    KeyError,
                    ValueError,
            ):
                continue
            act = makeUrlAction(name, url, toolTip='%s %s' % (symbol, name))
            request = partial(self.requestUrl, action=act)
            self.connect(act, Signals.triggered, request)
            actions.append(act)
        return actions