Beispiel #1
0
 def __init__(self):
     """
     Creates a new instance of this class.
     """
     UrlFetcherBase.__init__(self,
         "urlfetcher",
         _("displays url contents with typing animation"))
Beispiel #2
0
 def __init__(self):
     """
     Creates a new instance of this class.
     """
     UrlFetcherBase.__init__(
         self, "urlfetcher",
         _("displays url contents with typing animation"))
Beispiel #3
0
    def __init__(self, name, description, url=None, tags=None, print_format=None, delay=None, cli_opts=None):
        """
       Creates a new instance of this class.

        This constructor has two additional arguments, compared with its base
        class:

            * tags: defines the list of string tags of the RSS that you are
              interest in. Accepted values are:
                   * pubDate
                   * title
                   * link
                   * description

            * print_format: defines the formating to be printed out, based on
              the tags available (use python string format with dictionary. eg.
              '%(title)s (%(pubDate)s)\n\n')
        """
        UrlFetcherBase.__init__(self, name, description, url, delay, cli_opts)

        XMLReaderHelperBase.__init__(self, "item", tags)

        self.print_format = print_format

        # build deafults
        if not cli_opts:
            self.cli_opts = {"opts": "hrd:u:f:", "long_opts": ["raw", "help", "delay=", "url=", "format="]}

        if not print_format:
            self.print_format = "%(title)s (%(pubDate)s)\n\n"
Beispiel #4
0
    def __init__(self,
                 name,
                 description,
                 url=None,
                 tags=None,
                 print_format=None,
                 delay=None,
                 cli_opts=None):
        """
       Creates a new instance of this class.

        This constructor has two additional arguments, compared with its base
        class:

            * tags: defines the list of string tags of the RSS that you are
              interest in. Accepted values are:
                   * pubDate
                   * title
                   * link
                   * description

            * print_format: defines the formating to be printed out, based on
              the tags available (use python string format with dictionary. eg.
              '%(title)s (%(pubDate)s)\n\n')
        """
        UrlFetcherBase.__init__(self, name, description, url, delay, cli_opts)

        XMLReaderHelperBase.__init__(self, "item", tags)

        self.print_format = print_format

        # build deafults
        if not cli_opts:
            self.cli_opts = {
                'opts': 'hrd:u:f:',
                'long_opts': ['raw', 'help', 'delay=', 'url=', 'format=']
            }

        if not print_format:
            self.print_format = '%(title)s (%(pubDate)s)\n\n'