コード例 #1
0
ファイル: urlfetcher.py プロジェクト: AkBKukU/termsaver
 def __init__(self):
     """
     Creates a new instance of this class.
     """
     UrlFetcherBase.__init__(self,
         "urlfetcher",
         _("displays url contents with typing animation"))
コード例 #2
0
ファイル: urlfetcher.py プロジェクト: kran0/dotfiles
 def __init__(self):
     """
     Creates a new instance of this class.
     """
     UrlFetcherBase.__init__(
         self, "urlfetcher",
         _("displays url contents with typing animation"))
コード例 #3
0
ファイル: rssfeed.py プロジェクト: NMLOR10N/termsaver
    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"
コード例 #4
0
ファイル: rssfeed.py プロジェクト: kran0/dotfiles
    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'