Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ddgr for openSUSE:Factory checked in 
at 2022-09-25 15:35:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ddgr (Old)
 and      /work/SRC/openSUSE:Factory/.ddgr.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ddgr"

Sun Sep 25 15:35:31 2022 rev:6 rq:1005752 version:2.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/ddgr/ddgr.changes        2020-09-03 
01:19:40.640592414 +0200
+++ /work/SRC/openSUSE:Factory/.ddgr.new.2275/ddgr.changes      2022-09-25 
15:35:57.243717006 +0200
@@ -1,0 +2,7 @@
+Sat Sep 24 09:00:05 UTC 2022 - Dirk M??ller <[email protected]>
+
+- update to 2.0:
+  - Display results in reversed order (`--rev`, `--reverse`)
+  - Support Python v3.10 (dropped v3.6)
+
+-------------------------------------------------------------------

Old:
----
  ddgr-1.9.tar.gz

New:
----
  ddgr-2.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ddgr.spec ++++++
--- /var/tmp/diff_new_pack.XiAtbV/_old  2022-09-25 15:35:57.627717931 +0200
+++ /var/tmp/diff_new_pack.XiAtbV/_new  2022-09-25 15:35:57.631717941 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ddgr
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           ddgr
-Version:        1.9
+Version:        2.0
 Release:        0
 Summary:        DuckDuckGo from the terminal
 License:        GPL-3.0-only

++++++ ddgr-1.9.tar.gz -> ddgr-2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ddgr-1.9/.circleci/config.yml 
new/ddgr-2.0/.circleci/config.yml
--- old/ddgr-1.9/.circleci/config.yml   2020-07-25 20:42:25.000000000 +0200
+++ new/ddgr-2.0/.circleci/config.yml   2022-03-05 01:23:13.000000000 +0100
@@ -17,53 +17,53 @@
           make test
 
 jobs:
-  py35:
+  py37:
     docker:
-      - image: python:3.5-slim
+      - image: python:3.7-slim
     <<: *test-template
 
-  py36:
+  py38:
     docker:
-      - image: python:3.6-slim
+      - image: python:3.8-slim
     <<: *test-template
 
-  py37:
+  py39:
     docker:
-      - image: python:3.7-slim
+      - image: python:3.9-slim
     <<: *test-template
 
-  py38:
+  py310:
     docker:
-      - image: python:3.8-slim
+      - image: python:3.10-slim
     <<: *test-template
 
-  package-and-publish:
-    machine: true
-    working_directory: ~/ddgr
-    steps:
-      - checkout
-      - run:
-          name: "package with packagecore"
-          command: |
-            # Use latest installed python3 from pyenv
-            export PYENV_VERSION="$(pyenv versions | grep -Po '\b3\.\d+\.\d+' 
| tail -1)"
-            pip install packagecore
-            packagecore -o ./dist/ ${CIRCLE_TAG#v}
-      - run:
-          name: "publish to GitHub"
-          command: |
-            go get github.com/tcnksm/ghr
-            ghr -t ${GITHUB_API_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r 
${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -replace ${CIRCLE_TAG} ./dist/
+#  package-and-publish:
+#    machine: true
+#    working_directory: ~/ddgr
+#    steps:
+#      - checkout
+#      - run:
+#          name: "package with packagecore"
+#          command: |
+#            # Use latest installed python3 from pyenv
+#            export PYENV_VERSION="$(pyenv versions | grep -Po '\b3\.\d+\.\d+' 
| tail -1)"
+#            pip install packagecore
+#            packagecore -o ./dist/ ${CIRCLE_TAG#v}
+#      - run:
+#          name: "publish to GitHub"
+#          command: |
+#            go get github.com/tcnksm/ghr
+#            ghr -t ${GITHUB_API_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r 
${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -replace ${CIRCLE_TAG} ./dist/
 
 workflows:
   version: 2
 
   test:
     jobs: &all-tests
-      - py35
-      - py36
       - py37
       - py38
+      - py39
+      - py310
 
   nightly:
     triggers:
@@ -75,11 +75,11 @@
                 - master
     jobs: *all-tests
 
-  publish-github-release:
-    jobs:
-      - package-and-publish:
-          filters:
-            tags:
-              only: /^v.*/
-            branches:
-              ignore: /.*/
+#  publish-github-release:
+#    jobs:
+#      - package-and-publish:
+#          filters:
+#            tags:
+#              only: /^v.*/
+#            branches:
+#              ignore: /.*/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ddgr-1.9/.pylintrc new/ddgr-2.0/.pylintrc
--- old/ddgr-1.9/.pylintrc      2020-07-25 20:42:25.000000000 +0200
+++ new/ddgr-2.0/.pylintrc      2022-03-05 01:23:13.000000000 +0100
@@ -1,6 +1,8 @@
 [MESSAGES CONTROL]
 disable=
   broad-except,
+  consider-using-f-string,
+  consider-using-with,
   import-outside-toplevel,
   invalid-name,
   missing-docstring,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ddgr-1.9/CHANGELOG new/ddgr-2.0/CHANGELOG
--- old/ddgr-1.9/CHANGELOG      2020-07-25 20:42:25.000000000 +0200
+++ new/ddgr-2.0/CHANGELOG      2022-03-05 01:23:13.000000000 +0100
@@ -1,3 +1,11 @@
+ddgr v2.0
+2022-03-05
+
+- Display results in reversed order (`--rev`, `--reverse`)
+- Support Python v3.10 (dropped v3.6)
+
+-------------------------------------------------------------------------------
+
 ddgr v1.9
 2020-07-26
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ddgr-1.9/README.md new/ddgr-2.0/README.md
--- old/ddgr-1.9/README.md      2020-07-25 20:42:25.000000000 +0200
+++ new/ddgr-2.0/README.md      2022-03-05 01:23:13.000000000 +0100
@@ -10,10 +10,10 @@
 </p>
 
 <p align="center">
-<a href="https://asciinema.org/a/212198";><img 
src="https://asciinema.org/a/212198.png"; alt="Asciicast" width="734"/></a>
+<a href="https://asciinema.org/a/212198";><img 
src="https://asciinema.org/a/212198.svg"; alt="Asciicast" width="734"/></a>
 </p>
 
-`ddgr` is a cmdline utility to search DuckDuckGo from the terminal. While 
[googler](https://github.com/jarun/googler) is extremely popular among cmdline 
users, in many forums the need of a similar utility for privacy-aware 
DuckDuckGo came up. [DuckDuckGo Bangs](https://duckduckgo.com/bang) are 
super-cool too! So here's `ddgr` for you!
+`ddgr` is a cmdline utility to search DuckDuckGo ([html 
version](https://html.duckduckgo.com/html/)) from the terminal. While 
[googler](https://github.com/jarun/googler) is extremely popular among cmdline 
users, in many forums the need of a similar utility for privacy-aware 
DuckDuckGo came up. [DuckDuckGo Bangs](https://duckduckgo.com/bang) are 
super-cool too! So here's `ddgr` for you!
 
 Unlike the web interface, you can specify the number of search results you 
would like to see per page. It's more convenient than skimming through 30-odd 
search results per page. The default interface is carefully designed to use 
minimum space without sacrificing readability.
 
@@ -21,10 +21,8 @@
 
 `ddgr` isn't affiliated to DuckDuckGo in any way.
 
-*Love smart and efficient utilities? Explore [my 
repositories](https://github.com/jarun?tab=repositories). Buy me a cup of 
coffee if they help you.*
-
 <p align="center">
-<a 
href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RMLTQ76JSXJ4Q";><img
 src="https://img.shields.io/badge/PayPal-donate-1eb0fc.svg"; alt="Donate via 
PayPal!" /></a>
+<a 
href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RMLTQ76JSXJ4Q";><img
 src="https://img.shields.io/badge/[email protected]"; alt="Donate via 
PayPal!" /></a>
 </p>
 
 ### Table of contents
@@ -33,7 +31,6 @@
 - [Installation](#installation)
   - [Dependencies](#dependencies)
   - [From a package manager](#from-a-package-manager)
-  - [Release packages](#release-packages)
   - [From source](#from-source)
   - [Running standalone](#running-standalone)
   - [Shell completion](#shell-completion)
@@ -71,7 +68,7 @@
 
 #### Dependencies
 
-`ddgr` requires Python 3.5 or later. Only the latest patch release of each 
minor version is supported.
+`ddgr` requires Python 3.6 or later. Only the latest patch release of each 
minor version is supported.
 
 To copy url to clipboard at the omniprompt, `ddgr` looks for `xsel` or `xclip` 
or `termux-clipboard-set` (in the same order) on Linux, `pbcopy` (default 
installed) on OS X, `clip` (default installed) on Windows and `clipboard` 
(default installed) on Haiku. It also supports GNU Screen and tmux copy-paste 
buffers in the absence of X11.
 
@@ -89,6 +86,7 @@
 Unlisted packagers:
 <p>
 <br>
+??? <a href="https://github.com/shinokada/awesome";>Awesome</a> (<code>awesome 
-install jarun/ddgr</code>)<br>
 ??? <a href="https://pypi.org/project/ddgr/";>PyPI</a> (<code>pip3 install 
ddgr</code>)<br>
 ??? <a href="https://snapcraft.io/ddgr/";>Snap Store</a> (<code>snap install 
ddgr</code>)<br>
 ??? <a href="http://codex.sourcemage.org/test/utils/ddgr/";>Source Mage</a> 
(<code>cast ddgr</code>)<br>
@@ -96,10 +94,6 @@
 </p>
 </details>
 
-#### Release packages
-
-Packages for Arch Linux, CentOS, Debian, Fedora, OpenSUSE Leap, Solus, and 
Ubuntu are available with the [latest stable 
release](https://github.com/jarun/ddgr/releases/latest).
-
 #### From source
 
 If you have git installed, clone this repository. Otherwise download the 
[latest stable release](https://github.com/jarun/ddgr/releases/latest) or 
[development version](https://github.com/jarun/ddgr/archive/master.zip).
@@ -164,6 +158,7 @@
   --json                output in JSON format; implies --np
   --gb, --gui-browser   open a bang directly in gui browser
   --np, --noprompt      perform search and exit, do not prompt
+  --rev, --reverse      list entries in reversed order
   --url-handler UTIL    custom script or cli utility to open results
   --show-browser-logs   do not suppress browser output (stdout and stderr)
   -v, --version         show program's version number and exit
@@ -267,7 +262,7 @@
 - [SZ Lin](https://github.com/szlin)
 - [Alex Gontar](https://github.com/mosegontar)
 
-Copyright ?? 2016-2020 [Arun Prakash Jana](mailto:[email protected])
+Copyright ?? 2016-2022 [Arun Prakash Jana](mailto:[email protected])
 
 ### In the Press
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ddgr-1.9/auto-completion/bash/ddgr-completion.bash 
new/ddgr-2.0/auto-completion/bash/ddgr-completion.bash
--- old/ddgr-1.9/auto-completion/bash/ddgr-completion.bash      2020-07-25 
20:42:25.000000000 +0200
+++ new/ddgr-2.0/auto-completion/bash/ddgr-completion.bash      2022-03-05 
01:23:13.000000000 +0100
@@ -26,6 +26,7 @@
         --json
         --gb --gui-browser
         --np --noprompt
+        --rev --reverse
         --url-handler
         --show-browser-logs
         -v --version
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ddgr-1.9/auto-completion/fish/ddgr.fish 
new/ddgr-2.0/auto-completion/fish/ddgr.fish
--- old/ddgr-1.9/auto-completion/fish/ddgr.fish 2020-07-25 20:42:25.000000000 
+0200
+++ new/ddgr-2.0/auto-completion/fish/ddgr.fish 2022-03-05 01:23:13.000000000 
+0100
@@ -28,6 +28,7 @@
 complete -c ddgr -l json                 --description 'output in JSON format; 
implies --np]'
 complete -c ddgr -l gb -l gui-browser    --description 'open a bang directly 
in gui browser'
 complete -c ddgr -l np -l noprompt       --description 'perform search and 
exit'
+complete -c ddgr -l rev -l reverse       --description 'list entries in 
reversed order'
 complete -c ddgr -l url-handler -r       --description 'cli script or utility'
 complete -c ddgr -l show-browser-logs    --description 'do not suppress 
browser output'
 complete -c ddgr -s v -l version         --description 'show version number 
and exit'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ddgr-1.9/auto-completion/zsh/_ddgr 
new/ddgr-2.0/auto-completion/zsh/_ddgr
--- old/ddgr-1.9/auto-completion/zsh/_ddgr      2020-07-25 20:42:25.000000000 
+0200
+++ new/ddgr-2.0/auto-completion/zsh/_ddgr      2022-03-05 01:23:13.000000000 
+0100
@@ -49,6 +49,7 @@
     '(--json)--json[output in JSON format; implies --np]'
     '(--gb --gui-browser)'{--gb,--gui-browser}'[open a bang directly in gui 
browser]'
     '(--np --noprompt)'{--np,--noprompt}'[perform search and exit]'
+    '(--rev --reverse)'{--rev,--reverse}'[list entries in reversed order]'
     '(--url-handler)--url-handler[cli script or utility]:url opener'
     '(--show-browser-logs)--show-browser-logs[do not suppress browser output]'
     '(- : *)'{-v,--version}'[show version number and exit]'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ddgr-1.9/ddgr new/ddgr-2.0/ddgr
--- old/ddgr-1.9/ddgr   2020-07-25 20:42:25.000000000 +0200
+++ new/ddgr-2.0/ddgr   2022-03-05 01:23:13.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 
-# Copyright (C) 2016-2020 Arun Prakash Jana <[email protected]>
+# Copyright (C) 2016-2022 Arun Prakash Jana <[email protected]>
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -71,7 +71,7 @@
 
 # Constants
 
-_VERSION_ = '1.9'
+_VERSION_ = '2.0'
 
 COLORMAP = {k: '\x1b[%sm' % v for k, v in {
     'a': '30', 'b': '31', 'c': '32', 'd': '33',
@@ -117,8 +117,8 @@
 
     # Custom URL handler gets max priority
     if hasattr(open_url, 'url_handler'):
-        pipe = Popen([open_url.url_handler, url], stdin=PIPE)
-        pipe.communicate()
+        with Popen([open_url.url_handler, url], stdin=PIPE) as pipe:
+            pipe.communicate()
         return
 
     browser = webbrowser.get()
@@ -296,8 +296,7 @@
     psl_textwrap_wrap = textwrap.wrap
 
     def textwrap_wrap(text, width=70, **kwargs):
-        if width <= 2:
-            width = 2
+        width = max(width, 2)
         # We first add a U+0000 after each East Asian Fullwidth or East
         # Asian Wide character, then fill to width - 1 (so that if a NUL
         # character ends up on a new line, we still have one last column
@@ -1354,6 +1353,7 @@
     Methods
     -------
     fetch()
+    display_instant_answer(json_output=False)
     display_results(prelude='\n', json_output=False)
     fetch_and_display(prelude='\n', json_output=False)
     read_next_command()
@@ -1373,6 +1373,7 @@
         self._conn = DdgConnection(proxy=proxy, ua=ua)
 
         self.results = []
+        self.instant_answer = ''
         self._urltable = {}
 
         colors = self.colors
@@ -1391,15 +1392,11 @@
         return self._ddg_url.keywords
 
     @require_keywords
-    def fetch(self, json_output=False):
+    def fetch(self):
         """Fetch a page and parse for results.
 
         Results are stored in ``self.results``.
-
-        Parameters
-        ----------
-        json_output : bool, optional
-            Whether to dump results in JSON format. Default is False.
+        Instant answer is stored in ``self.instant_answer``.
 
         Raises
         ------
@@ -1444,8 +1441,28 @@
         self._ddg_url.np_next = parser.np_next_button
         self._ddg_url.vqd = parser.vqd
 
-        # Show instant answer
-        if self.index == 0 and parser.click_result and not json_output:
+        if parser.click_result:
+            self.instant_answer = parser.click_result.strip()
+        else:
+            self.instant_answer = ''
+
+        self._ddg_url.update_num(len(parser.results))
+
+    @require_keywords
+    def display_instant_answer(self, json_output=False):
+        """Display instant answer stored in ``self.instant_answer``.
+
+        Parameters
+        ----------
+        json_output : bool, optional
+            Whether to dump results in JSON format. Default is False.
+
+        See Also
+        --------
+        fetch_and_display
+
+        """
+        if self.index == 0 and self.instant_answer and not json_output:
             if self.colors:
                 print(self.colors.abstract)
 
@@ -1455,16 +1472,14 @@
                 columns = 0
 
             fillwidth = columns - INDENT
-            for line in textwrap.wrap(parser.click_result.strip(), 
width=fillwidth):
+            for line in textwrap.wrap(self.instant_answer, width=fillwidth):
                 print('%s%s' % (' ' * INDENT, line))
 
             if self.colors:
                 print(self.colors.reset, end='')
-        LOGDBG('Prev nextParams: %s', self._ddg_url.np_prev)
-        LOGDBG('Next nextParams: %s', self._ddg_url.np_next)
-        LOGDBG('VQD: %s', self._ddg_url.vqd)
 
-        self._ddg_url.update_num(len(parser.results))
+            if self._opts.reverse:
+                print('')
 
     @require_keywords
     def display_results(self, prelude='\n', json_output=False):
@@ -1481,20 +1496,27 @@
         else:
             results = self.results
 
+        if self._opts.reverse:
+            results.reverse()
+
         if json_output:
             # JSON output
             results_object = [r.jsonizable_object() for r in results]
             print(json.dumps(results_object, indent=2, sort_keys=True, 
ensure_ascii=False))
         elif not results:
             print('No results.', file=sys.stderr)
-        elif self._opts.num:  # Paginated output
-            sys.stderr.write(prelude)
-            for i, r in enumerate(results):
-                r.print_paginated(str(i + 1))
-        else:  # Regular output
+        else:
             sys.stderr.write(prelude)
-            for r in results:
-                r.print()
+
+            if self._opts.num:  # Paginated output
+                for i, r in enumerate(results):
+                    if self._opts.reverse:
+                        r.print_paginated(str(len(results) - i))
+                    else:
+                        r.print_paginated(str(i + 1))
+            else:  # Regular output
+                for r in results:
+                    r.print()
 
     @require_keywords
     def fetch_and_display(self, prelude='\n', json_output=False):
@@ -1517,11 +1539,17 @@
         See Also
         --------
         fetch
+        display_instant_answer
         display_results
 
         """
         self.fetch()
-        self.display_results(prelude=prelude, json_output=json_output)
+        if not self._opts.reverse:
+            self.display_instant_answer()
+            self.display_results(prelude=prelude, json_output=json_output)
+        else:
+            self.display_results(prelude=prelude, json_output=json_output)
+            self.display_instant_answer()
 
     def read_next_command(self):
         """Show omniprompt and read user command line.
@@ -1734,8 +1762,8 @@
                 return
 
             printerr('failed to locate suitable clipboard utility')
-        except Exception:
-            raise NoKeywordsException
+        except Exception as e:
+            raise NoKeywordsException from e
 
     def cmdloop(self):
         """Run REPL."""
@@ -1828,7 +1856,7 @@
         file = sys.stderr if file is None else file
         file.write(textwrap.dedent("""
         Version %s
-        Copyright ?? 2016-2020 Arun Prakash Jana <[email protected]>
+        Copyright ?? 2016-2022 Arun Prakash Jana <[email protected]>
         License: GPLv3
         Webpage: https://github.com/jarun/ddgr
         """ % _VERSION_))
@@ -1853,8 +1881,8 @@
             n = int(arg)
             assert n > 0
             return n
-        except (ValueError, AssertionError):
-            raise argparse.ArgumentTypeError('%s is not a positive integer' % 
arg)
+        except (ValueError, AssertionError) as e:
+            raise argparse.ArgumentTypeError('%s is not a positive integer' % 
arg) from e
 
     @staticmethod
     def nonnegative_int(arg):
@@ -1864,8 +1892,8 @@
             assert n >= 0
             assert n <= 25
             return n
-        except (ValueError, AssertionError):
-            raise argparse.ArgumentTypeError('%s is not a non-negative integer 
<= 25' % arg)
+        except (ValueError, AssertionError) as e:
+            raise argparse.ArgumentTypeError('%s is not a non-negative integer 
<= 25' % arg) from e
 
     @staticmethod
     def is_duration(arg):
@@ -1878,8 +1906,8 @@
         try:
             if arg[0] not in ('h', 'd', 'w', 'm', 'y') or int(arg[1:]) < 0:
                 raise ValueError
-        except (TypeError, IndexError, ValueError):
-            raise argparse.ArgumentTypeError('%s is not a valid duration' % 
arg)
+        except (TypeError, IndexError, ValueError) as e:
+            raise argparse.ArgumentTypeError('%s is not a valid duration' % 
arg) from e
         return arg
 
     @staticmethod
@@ -1889,8 +1917,8 @@
             assert len(arg) == 6
             for c in arg:
                 assert c in COLORMAP
-        except AssertionError:
-            raise argparse.ArgumentTypeError('%s is not a valid color string' 
% arg)
+        except AssertionError as e:
+            raise argparse.ArgumentTypeError('%s is not a valid color string' 
% arg) from e
         return arg
 
 
@@ -1927,7 +1955,7 @@
                 old_mode = wintypes.DWORD()
                 if not kernel32.GetConsoleMode(handle, byref(old_mode)):
                     raise RuntimeError('GetConsoleMode failed')
-                new_mode = old_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING
+                new_mode = bin(old_mode.value) | 
ENABLE_VIRTUAL_TERMINAL_PROCESSING
                 if not kernel32.SetConsoleMode(handle, new_mode):
                     raise RuntimeError('SetConsoleMode failed')
             # Note: No need to restore at exit. SetConsoleMode seems to
@@ -1950,10 +1978,9 @@
     api_url = ('https://duckduckgo.com/ac/?q=%s&kl=wt-wt' %
                urllib.parse.quote(prefix, safe=''))
     # A timeout of 3 seconds seems to be overly generous already.
-    resp = urllib.request.urlopen(api_url, timeout=3)
-    respobj = json.loads(resp.read().decode('utf-8'))
-
-    return [entry['phrase'] for entry in respobj]
+    with urllib.request.urlopen(api_url, timeout=3) as resp:
+        with json.loads(resp.read().decode('utf-8')) as respobj:
+            return [entry['phrase'] for entry in respobj]
 
 
 def completer_run(prefix):
@@ -2008,6 +2035,7 @@
     addarg('--json', action='store_true', help='output in JSON format; implies 
--np')
     addarg('--gb', '--gui-browser', dest='gui_browser', action='store_true', 
help='open a bang directly in gui browser')
     addarg('--np', '--noprompt', dest='noninteractive', action='store_true', 
help='perform search and exit, do not prompt')
+    addarg('--rev', '--reverse', dest='reverse', action='store_true', 
help='list entries in reversed order')
     addarg('--url-handler', metavar='UTIL', help='custom script or cli utility 
to open results')
     addarg('--show-browser-logs', action='store_true', help='do not suppress 
browser output (stdout and stderr)')
     addarg('-v', '--version', action='version', version=_VERSION_)
@@ -2075,14 +2103,19 @@
                 # Handle bangs
                 open_url(repl._ddg_url.full())
             else:
-                repl.fetch(opts.json)
+                repl.fetch()
                 if opts.ducky:
                     if repl.results:
                         open_url(repl.results[0].url)
                     else:
                         print('No results.', file=sys.stderr)
                 else:
-                    repl.display_results(prelude='', json_output=opts.json)
+                    if not opts.reverse:
+                        repl.display_instant_answer(json_output=opts.json)
+                        repl.display_results(prelude='', json_output=opts.json)
+                    else:
+                        repl.display_results(prelude='', json_output=opts.json)
+                        repl.display_instant_answer(json_output=opts.json)
 
             sys.exit(0)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ddgr-1.9/ddgr.1 new/ddgr-2.0/ddgr.1
--- old/ddgr-1.9/ddgr.1 2020-07-25 20:42:25.000000000 +0200
+++ new/ddgr-2.0/ddgr.1 2022-03-05 01:23:13.000000000 +0100
@@ -1,11 +1,11 @@
-.TH "DDGR" "1" "21 Jul 2020" "Version 1.9" "User Commands"
+.TH "DDGR" "1" "05 Mar 2022" "Version 2.0" "User Commands"
 .SH NAME
 ddgr \- DuckDuckGo from the terminal
 .SH SYNOPSIS
 .B ddgr [OPTIONS] [KEYWORD [KEYWORD ...]]
 .SH DESCRIPTION
 .B ddgr
-is a command-line tool to search DuckDuckGo. \fBddgr\fR shows the title, URL 
and text context for each result. Results are fetched in pages. Keyboard 
shortcuts are available for page navigation. Results are indexed and a result 
URL can be opened in a browser using the index number. There is no 
configuration file as aliases serve the same purpose for this utility. Supports 
sequential searches in a single instance.
+is a command-line tool to search DuckDuckGo (html version). \fBddgr\fR shows 
the title, URL and text context for each result. Results are fetched in pages. 
Keyboard shortcuts are available for page navigation. Results are indexed and a 
result URL can be opened in a browser using the index number. There is no 
configuration file as aliases serve the same purpose for this utility. Supports 
sequential searches in a single instance.
 .PP
 .B Features
 .PP
@@ -72,6 +72,9 @@
 .BI "--np, --noprompt"
 Perform search and exit; do not prompt for further interactions.
 .TP
+.BI "--rev, --reverse"
+List the entries in reversed order.
+.TP
 .BI "--url-handler=" UTIL
 Custom script or command-line utility to open urls with.
 .TP
@@ -334,7 +337,7 @@
 .SH REPORTING BUGS
 .I https://github.com/jarun/ddgr/issues
 .SH LICENSE
-Copyright \(co 2016-2020 Arun Prakash Jana <[email protected]>
+Copyright \(co 2016-2022 Arun Prakash Jana <[email protected]>
 .PP
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
 .br
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ddgr-1.9/setup.py new/ddgr-2.0/setup.py
--- old/ddgr-1.9/setup.py       2020-07-25 20:42:25.000000000 +0200
+++ new/ddgr-2.0/setup.py       2022-03-05 01:23:13.000000000 +0100
@@ -25,7 +25,7 @@
     description='DuckDuckGo from the terminal',
     long_description=long_description,
     long_description_content_type='text/markdown',
-    python_requires='>=3.5',
+    python_requires='>=3.6',
     platforms=['any'],
     py_modules=['ddgr'],
     entry_points={
@@ -43,10 +43,11 @@
         'Programming Language :: Python',
         'Programming Language :: Python :: 3',
         'Programming Language :: Python :: 3 :: Only',
-        'Programming Language :: Python :: 3.5',
         'Programming Language :: Python :: 3.6',
         'Programming Language :: Python :: 3.7',
         'Programming Language :: Python :: 3.8',
+        'Programming Language :: Python :: 3.9',
+        'Programming Language :: Python :: 3.10',
         'Topic :: Internet :: WWW/HTTP :: Indexing/Search',
         'Topic :: Utilities',
     ],

Reply via email to