Hello community,

here is the log from the commit of package azure-cli-find for openSUSE:Factory 
checked in at 2018-02-14 09:30:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/azure-cli-find (Old)
 and      /work/SRC/openSUSE:Factory/.azure-cli-find.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "azure-cli-find"

Wed Feb 14 09:30:57 2018 rev:2 rq:574813 version:0.2.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/azure-cli-find/azure-cli-find.changes    
2017-11-10 14:53:54.151662327 +0100
+++ /work/SRC/openSUSE:Factory/.azure-cli-find.new/azure-cli-find.changes       
2018-02-14 09:30:58.396890446 +0100
@@ -1,0 +2,9 @@
+Thu Feb  8 12:05:14 UTC 2018 - adrian.glaub...@suse.com
+
+- New upstream release
+  + Version 0.2.8
+  + For detailed information about changes see the
+    HISTORY.rst file provided with this package
+- Install HISTORY.rst into doc directory
+
+-------------------------------------------------------------------

Old:
----
  azure-cli-find-0.2.7.tar.gz

New:
----
  azure-cli-find-0.2.8.tar.gz

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

Other differences:
------------------
++++++ azure-cli-find.spec ++++++
--- /var/tmp/diff_new_pack.bXArS7/_old  2018-02-14 09:30:59.616846240 +0100
+++ /var/tmp/diff_new_pack.bXArS7/_new  2018-02-14 09:30:59.616846240 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package azure-cli-find
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -15,8 +15,9 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
+
 Name:           azure-cli-find
-Version:        0.2.7
+Version:        0.2.8
 Release:        0
 Summary:        Microsoft Azure CLI 'find' Command Module
 License:        MIT
@@ -24,16 +25,16 @@
 Url:            https://github.com/Azure/azure-cli
 Source:         
https://files.pythonhosted.org/packages/source/a/azure-cli-find/azure-cli-find-%{version}.tar.gz
 Source1:        LICENSE.txt
-BuildRequires:  python3-devel
-BuildRequires:  python3-setuptools
-BuildRequires:  unzip
 BuildRequires:  azure-cli-command-modules-nspkg
 BuildRequires:  azure-cli-nspkg
 BuildRequires:  python3-azure-nspkg
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+BuildRequires:  unzip
 Requires:       azure-cli-command-modules-nspkg
+Requires:       azure-cli-core
 Requires:       azure-cli-nspkg
 Requires:       python3-azure-nspkg
-Requires:       azure-cli-core
 Conflicts:      azure-cli < 2.0.0
 
 BuildArch:      noarch
@@ -62,7 +63,8 @@
 
 %files
 %defattr(-,root,root,-)
-%doc LICENSE.txt README.rst
+%doc HISTORY.rst LICENSE.txt README.rst
 %{python3_sitelib}/azure/cli/command_modules/find
 %{python3_sitelib}/azure_cli_find-*.egg-info
+
 %changelog

++++++ azure-cli-find-0.2.7.tar.gz -> azure-cli-find-0.2.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-find-0.2.7/HISTORY.rst 
new/azure-cli-find-0.2.8/HISTORY.rst
--- old/azure-cli-find-0.2.7/HISTORY.rst        2017-09-23 01:47:00.000000000 
+0200
+++ new/azure-cli-find-0.2.8/HISTORY.rst        2018-01-05 22:11:35.000000000 
+0100
@@ -2,8 +2,13 @@
 
 Release History
 ===============
-0.2.7 (2017-09-22)
-++++++++++++++++++
+
+0.2.8
+++++++
+* Update for CLI core changes.
+
+0.2.7
++++++
 * minor fixes
 
 0.2.6 (2017-07-07)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-find-0.2.7/PKG-INFO 
new/azure-cli-find-0.2.8/PKG-INFO
--- old/azure-cli-find-0.2.7/PKG-INFO   2017-09-23 01:49:48.000000000 +0200
+++ new/azure-cli-find-0.2.8/PKG-INFO   2018-01-05 22:12:40.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: azure-cli-find
-Version: 0.2.7
+Version: 0.2.8
 Summary: Microsoft Azure Command-Line Tools Find Command Module
 Home-page: https://github.com/Azure/azure-cli
 Author: Microsoft Corporation
@@ -17,8 +17,13 @@
         
         Release History
         ===============
-        0.2.7 (2017-09-22)
-        ++++++++++++++++++
+        
+        0.2.8
+        ++++++
+        * Update for CLI core changes.
+        
+        0.2.7
+        +++++
         * minor fixes
         
         0.2.6 (2017-07-07)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-find-0.2.7/azure/cli/command_modules/find/__init__.py 
new/azure-cli-find-0.2.8/azure/cli/command_modules/find/__init__.py
--- old/azure-cli-find-0.2.7/azure/cli/command_modules/find/__init__.py 
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-find-0.2.8/azure/cli/command_modules/find/__init__.py 
2018-01-05 22:11:35.000000000 +0100
@@ -3,12 +3,26 @@
 # Licensed under the MIT License. See License.txt in the project root for 
license information.
 # 
--------------------------------------------------------------------------------------------
 
+from azure.cli.core import AzCommandsLoader
 import azure.cli.command_modules.find._help  # pylint: disable=unused-import
 
 
-def load_params(_):
-    import azure.cli.command_modules.find._params  # pylint: 
disable=redefined-outer-name, unused-variable
+class FindCommandsLoader(AzCommandsLoader):
 
+    def __init__(self, cli_ctx=None):
+        from azure.cli.core.commands import CliCommandType
+        find_custom = 
CliCommandType(operations_tmpl='azure.cli.command_modules.find.custom#{}')
+        super(FindCommandsLoader, self).__init__(cli_ctx=cli_ctx, 
custom_command_type=find_custom)
+        self.module_name = __name__
 
-def load_commands():
-    import azure.cli.command_modules.find.commands  # pylint: 
disable=redefined-outer-name, unused-variable
+    def load_command_table(self, args):
+        from azure.cli.command_modules.find.commands import load_command_table
+        load_command_table(self, args)
+        return self.command_table
+
+    def load_arguments(self, command):
+        from azure.cli.command_modules.find._params import load_arguments
+        load_arguments(self, command)
+
+
+COMMAND_LOADER_CLS = FindCommandsLoader
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-find-0.2.7/azure/cli/command_modules/find/_gather_commands.py 
new/azure-cli-find-0.2.8/azure/cli/command_modules/find/_gather_commands.py
--- old/azure-cli-find-0.2.7/azure/cli/command_modules/find/_gather_commands.py 
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-find-0.2.8/azure/cli/command_modules/find/_gather_commands.py 
2018-01-05 22:11:35.000000000 +0100
@@ -5,36 +5,34 @@
 
 import yaml
 
-from azure.cli.core.commands import _update_command_definitions
-from azure.cli.core.help_files import helps
+from knack.help_files import helps
 
 
-def build_command_table():
-    import azure.cli.core.commands as commands
-    cmd_table = commands.get_command_table()
-    for cmd in cmd_table:
-        cmd_table[cmd].load_arguments()
-    _update_command_definitions(cmd_table)
+def build_command_table(cli_ctx):
+    from azure.cli.core import MainCommandsLoader
+    cmd_table = MainCommandsLoader(cli_ctx).load_command_table(None)
+    for command in cmd_table:
+        cmd_table[command].load_arguments()
 
     data = {}
-    for cmd in cmd_table:
+    for command in cmd_table:
         com_descip = {}
         param_descrip = {}
-        com_descip['short-summary'] = cmd_table[cmd].description() \
-            if callable(cmd_table[cmd].description) \
-            else cmd_table[cmd].description or ''
+        com_descip['short-summary'] = cmd_table[command].description() \
+            if callable(cmd_table[command].description) \
+            else cmd_table[command].description or ''
         com_descip['examples'] = ''
 
-        for key in cmd_table[cmd].arguments:
+        for key in cmd_table[command].arguments:
             required = ''
             help_desc = ''
-            if cmd_table[cmd].arguments[key].type.settings.get('required'):
+            if cmd_table[command].arguments[key].type.settings.get('required'):
                 required = '[REQUIRED]'
-            if cmd_table[cmd].arguments[key].type.settings.get('help'):
-                help_desc = 
cmd_table[cmd].arguments[key].type.settings.get('help')
+            if cmd_table[command].arguments[key].type.settings.get('help'):
+                help_desc = 
cmd_table[command].arguments[key].type.settings.get('help')
 
             name_options = []
-            for name in cmd_table[cmd].arguments[key].options_list:
+            for name in cmd_table[command].arguments[key].options_list:
                 name_options.append(name)
 
             options = {
@@ -42,44 +40,44 @@
                 'required': required,
                 'help': help_desc
             }
-            param_descrip[cmd_table[cmd].arguments[key].options_list[0]] = 
options
+            param_descrip[cmd_table[command].arguments[key].options_list[0]] = 
options
 
         com_descip['parameters'] = param_descrip
-        data[cmd] = com_descip
+        data[command] = com_descip
 
-    for cmd in helps:
-        diction_help = yaml.load(helps[cmd])
-        if cmd not in data:
-            data[cmd] = {
+    for command in helps:
+        diction_help = yaml.load(helps[command])
+        if command not in data:
+            data[command] = {
                 'short-summary': diction_help.get(
                     'short-summary', ''),
                 'long-summary': diction_help.get('long-summary', ''),
                 'parameters': {}
             }
         else:
-            data[cmd]['short-summary'] = diction_help.get('short-summary',
-                                                          
data[cmd].get('short-summary', ''))
-            data[cmd]['long-summary'] = diction_help.get("long-summary", '')
-            data[cmd]['parameters'] = {}
+            data[command]['short-summary'] = diction_help.get('short-summary',
+                                                              
data[command].get('short-summary', ''))
+            data[command]['long-summary'] = diction_help.get("long-summary", 
'')
+            data[command]['parameters'] = {}
 
         if 'parameters' in diction_help:
             for param in diction_help["parameters"]:
-                if param['name'].split()[0] not in data[cmd]['parameters']:
+                if param['name'].split()[0] not in data[command]['parameters']:
                     options = {
                         'name': name_options,
                         'required': required,
                         'help': help_desc
                     }
-                    data[cmd]['parameters'] = {
+                    data[command]['parameters'] = {
                         param["name"].split()[0]: options
                     }
                 if 'short-summary' in param:
-                    data[cmd]['parameters'][param['name'].split()[0]]['help'] \
+                    
data[command]['parameters'][param['name'].split()[0]]['help'] \
                         = param['short-summary']
         if 'examples' in diction_help:
             string_example = ''
             for example in diction_help['examples']:
                 string_example += example.get('name', '') + '\n' + 
example.get('text', '') + '\n'
-            data[cmd]['examples'] = string_example
+            data[command]['examples'] = string_example
 
     return data
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-find-0.2.7/azure/cli/command_modules/find/_help.py 
new/azure-cli-find-0.2.8/azure/cli/command_modules/find/_help.py
--- old/azure-cli-find-0.2.7/azure/cli/command_modules/find/_help.py    
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-find-0.2.8/azure/cli/command_modules/find/_help.py    
2018-01-05 22:11:35.000000000 +0100
@@ -3,7 +3,7 @@
 # Licensed under the MIT License. See License.txt in the project root for 
license information.
 # 
--------------------------------------------------------------------------------------------
 
-from azure.cli.core.help_files import helps
+from knack.help_files import helps
 
 helps['find'] = """
     type: command
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-find-0.2.7/azure/cli/command_modules/find/_params.py 
new/azure-cli-find-0.2.8/azure/cli/command_modules/find/_params.py
--- old/azure-cli-find-0.2.7/azure/cli/command_modules/find/_params.py  
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-find-0.2.8/azure/cli/command_modules/find/_params.py  
2018-01-05 22:11:35.000000000 +0100
@@ -3,13 +3,8 @@
 # Licensed under the MIT License. See License.txt in the project root for 
license information.
 # 
--------------------------------------------------------------------------------------------
 
-from azure.cli.core.commands import CliArgumentType, register_cli_argument
 
-
-query = CliArgumentType(
-    options_list=('--search-query', '-q'),
-    help='Query text to find.',
-    nargs='+'
-)
-
-register_cli_argument('find', 'criteria', query)
+def load_arguments(self, _):
+    with self.argument_context('find') as c:
+        c.argument('criteria', options_list=['--search-query', '-q'], 
help='Query text to find.', nargs='+')
+        c.argument('reindex', help='Clear the current index and reindex the 
command modules.')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-find-0.2.7/azure/cli/command_modules/find/commands.py 
new/azure-cli-find-0.2.8/azure/cli/command_modules/find/commands.py
--- old/azure-cli-find-0.2.7/azure/cli/command_modules/find/commands.py 
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-find-0.2.8/azure/cli/command_modules/find/commands.py 
2018-01-05 22:11:35.000000000 +0100
@@ -3,6 +3,7 @@
 # Licensed under the MIT License. See License.txt in the project root for 
license information.
 # 
--------------------------------------------------------------------------------------------
 
-from azure.cli.core.commands import cli_command
 
-cli_command(__name__, 'find', 'azure.cli.command_modules.find.custom#find')
+def load_command_table(self, _):
+    with self.command_group('') as g:
+        g.custom_command('find', 'find')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-find-0.2.7/azure/cli/command_modules/find/custom.py 
new/azure-cli-find-0.2.8/azure/cli/command_modules/find/custom.py
--- old/azure-cli-find-0.2.7/azure/cli/command_modules/find/custom.py   
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-find-0.2.8/azure/cli/command_modules/find/custom.py   
2018-01-05 22:11:35.000000000 +0100
@@ -13,11 +13,8 @@
 import six
 
 from azure.cli.command_modules.find._gather_commands import build_command_table
-import azure.cli.core.azlogging as azlogging
 from azure.cli.core._environment import get_config_dir
 
-logger = azlogging.get_az_logger(__name__)
-
 INDEX_DIR_PREFIX = 'search_index'
 INDEX_VERSION = 'v1'
 INDEX_PATH = os.path.join(get_config_dir(), '{}_{}'.format(INDEX_DIR_PREFIX, 
INDEX_VERSION))
@@ -34,17 +31,24 @@
         examples=TEXT(stored=True, analyzer=stem_ana))
 
 
-def _cli_index_corpus():
-    return build_command_table()
+def _purge():
+    for f in os.listdir(get_config_dir()):
+        if re.search("^{}_*".format(INDEX_DIR_PREFIX), f):
+            shutil.rmtree(os.path.join(get_config_dir(), f))
 
 
-def _index_help():
+def _create_index(cli_ctx):
     from whoosh import index
+    _purge()
+    os.mkdir(INDEX_PATH)
+    index.create_in(INDEX_PATH, _get_schema())
+
+    # index help
     ix = index.open_dir(INDEX_PATH)
     writer = ix.writer()
-    for cmd, document in list(_cli_index_corpus().items()):
+    for command, document in build_command_table(cli_ctx).items():
         writer.add_document(
-            cmd_name=six.u(cmd),
+            cmd_name=six.u(command),
             short_summary=six.u(document.get('short-summary', '')),
             long_summary=six.u(document.get('long-summary', '')),
             examples=six.u(document.get('examples', ''))
@@ -52,28 +56,12 @@
     writer.commit()
 
 
-def _purge():
-    for f in os.listdir(get_config_dir()):
-        if re.search("^{}_*".format(INDEX_DIR_PREFIX), f):
-            shutil.rmtree(os.path.join(get_config_dir(), f))
-
-
-def _create_index():
+def _get_index(cli_ctx):
     from whoosh import index
-    _purge()
-    os.mkdir(INDEX_PATH)
-    index.create_in(INDEX_PATH, _get_schema())
-    _index_help()
-
 
-def _ensure_index():
+    # create index if it does not exist already
     if not os.path.exists(INDEX_PATH):
-        _create_index()
-
-
-def _get_index():
-    from whoosh import index
-    _ensure_index()
+        _create_index(cli_ctx)
     return index.open_dir(INDEX_PATH)
 
 
@@ -93,25 +81,18 @@
     print('')
 
 
-def find(criteria, reindex=False):
-    """
-    Search for Azure CLI commands
-    :param str criteria: Query text to search for.
-    :param bool reindex: Clear the current index and reindex the command 
modules.
-    :return:
-    :rtype: None
-    """
+def find(cmd, criteria, reindex=False):
     from whoosh.qparser import MultifieldParser
     if reindex:
-        _create_index()
+        _create_index(cmd.cli_ctx)
 
     try:
-        ix = _get_index()
+        ix = _get_index(cmd.cli_ctx)
     except ValueError:
         # got a pickle error because the index was written by a different 
python version
         # recreate the index and proceed
-        _create_index()
-        ix = _get_index()
+        _create_index(cmd.cli_ctx)
+        ix = _get_index(cmd.cli_ctx)
 
     qp = MultifieldParser(
         ['cmd_name', 'short_summary', 'long_summary', 'examples'],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-find-0.2.7/azure_cli_find.egg-info/PKG-INFO 
new/azure-cli-find-0.2.8/azure_cli_find.egg-info/PKG-INFO
--- old/azure-cli-find-0.2.7/azure_cli_find.egg-info/PKG-INFO   2017-09-23 
01:49:48.000000000 +0200
+++ new/azure-cli-find-0.2.8/azure_cli_find.egg-info/PKG-INFO   2018-01-05 
22:12:40.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: azure-cli-find
-Version: 0.2.7
+Version: 0.2.8
 Summary: Microsoft Azure Command-Line Tools Find Command Module
 Home-page: https://github.com/Azure/azure-cli
 Author: Microsoft Corporation
@@ -17,8 +17,13 @@
         
         Release History
         ===============
-        0.2.7 (2017-09-22)
-        ++++++++++++++++++
+        
+        0.2.8
+        ++++++
+        * Update for CLI core changes.
+        
+        0.2.7
+        +++++
         * minor fixes
         
         0.2.6 (2017-07-07)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-find-0.2.7/azure_cli_find.egg-info/requires.txt 
new/azure-cli-find-0.2.8/azure_cli_find.egg-info/requires.txt
--- old/azure-cli-find-0.2.7/azure_cli_find.egg-info/requires.txt       
2017-09-23 01:49:48.000000000 +0200
+++ new/azure-cli-find-0.2.8/azure_cli_find.egg-info/requires.txt       
2018-01-05 22:12:40.000000000 +0100
@@ -1,3 +1,2 @@
 azure-cli-core
 whoosh
-azure-cli-command-modules-nspkg>=2.0.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-find-0.2.7/setup.py 
new/azure-cli-find-0.2.8/setup.py
--- old/azure-cli-find-0.2.7/setup.py   2017-09-23 01:49:48.000000000 +0200
+++ new/azure-cli-find-0.2.8/setup.py   2018-01-05 22:11:35.000000000 +0100
@@ -15,7 +15,7 @@
     cmdclass = {}
 
 
-VERSION = "0.2.7"
+VERSION = "0.2.8"
 CLASSIFIERS = [
     'Development Status :: 4 - Beta',
     'Intended Audience :: Developers',


Reply via email to