613 lines
76 KiB
HTML
613 lines
76 KiB
HTML
|
|
||
|
|
||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
|
||
|
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
|
||
|
<title>composer.cli.recipes — Lorax 19.7.11 documentation</title>
|
||
|
|
||
|
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||
|
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
var DOCUMENTATION_OPTIONS = {
|
||
|
URL_ROOT: '../../../',
|
||
|
VERSION: '19.7.11',
|
||
|
COLLAPSE_INDEX: false,
|
||
|
FILE_SUFFIX: '.html',
|
||
|
HAS_SOURCE: true
|
||
|
};
|
||
|
</script>
|
||
|
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||
|
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||
|
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||
|
<link rel="top" title="Lorax 19.7.11 documentation" href="../../../index.html" />
|
||
|
<link rel="up" title="composer.cli" href="../cli.html" />
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="related">
|
||
|
<h3>Navigation</h3>
|
||
|
<ul>
|
||
|
<li class="right" style="margin-right: 10px">
|
||
|
<a href="../../../genindex.html" title="General Index"
|
||
|
accesskey="I">index</a></li>
|
||
|
<li class="right" >
|
||
|
<a href="../../../py-modindex.html" title="Python Module Index"
|
||
|
>modules</a> |</li>
|
||
|
<li><a href="../../../index.html">Lorax 19.7.11 documentation</a> »</li>
|
||
|
<li><a href="../../index.html" >Module code</a> »</li>
|
||
|
<li><a href="../cli.html" accesskey="U">composer.cli</a> »</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
|
||
|
<div class="document">
|
||
|
<div class="documentwrapper">
|
||
|
<div class="bodywrapper">
|
||
|
<div class="body">
|
||
|
|
||
|
<h1>Source code for composer.cli.recipes</h1><div class="highlight"><pre>
|
||
|
<span class="c">#</span>
|
||
|
<span class="c"># Copyright (C) 2018 Red Hat, Inc.</span>
|
||
|
<span class="c">#</span>
|
||
|
<span class="c"># This program is free software; you can redistribute it and/or modify</span>
|
||
|
<span class="c"># it under the terms of the GNU General Public License as published by</span>
|
||
|
<span class="c"># the Free Software Foundation; either version 2 of the License, or</span>
|
||
|
<span class="c"># (at your option) any later version.</span>
|
||
|
<span class="c">#</span>
|
||
|
<span class="c"># This program is distributed in the hope that it will be useful,</span>
|
||
|
<span class="c"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
||
|
<span class="c"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
||
|
<span class="c"># GNU General Public License for more details.</span>
|
||
|
<span class="c">#</span>
|
||
|
<span class="c"># You should have received a copy of the GNU General Public License</span>
|
||
|
<span class="c"># along with this program. If not, see <http://www.gnu.org/licenses/>.</span>
|
||
|
<span class="c">#</span>
|
||
|
<span class="kn">import</span> <span class="nn">logging</span>
|
||
|
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s">"composer-cli"</span><span class="p">)</span>
|
||
|
|
||
|
<span class="kn">import</span> <span class="nn">os</span>
|
||
|
<span class="kn">import</span> <span class="nn">json</span>
|
||
|
|
||
|
<span class="kn">from</span> <span class="nn">composer</span> <span class="kn">import</span> <span class="n">http_client</span> <span class="k">as</span> <span class="n">client</span>
|
||
|
<span class="kn">from</span> <span class="nn">composer.cli.utilities</span> <span class="kn">import</span> <span class="n">argify</span><span class="p">,</span> <span class="n">frozen_toml_filename</span><span class="p">,</span> <span class="n">toml_filename</span><span class="p">,</span> <span class="n">handle_api_result</span>
|
||
|
<span class="kn">from</span> <span class="nn">composer.cli.utilities</span> <span class="kn">import</span> <span class="n">packageNEVRA</span>
|
||
|
|
||
|
<div class="viewcode-block" id="recipes_cmd"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_cmd">[docs]</a><span class="k">def</span> <span class="nf">recipes_cmd</span><span class="p">(</span><span class="n">opts</span><span class="p">):</span>
|
||
|
<span class="sd">"""Process recipes commands</span>
|
||
|
|
||
|
<span class="sd"> :param opts: Cmdline arguments</span>
|
||
|
<span class="sd"> :type opts: argparse.Namespace</span>
|
||
|
<span class="sd"> :returns: Value to return from sys.exit()</span>
|
||
|
<span class="sd"> :rtype: int</span>
|
||
|
|
||
|
<span class="sd"> This dispatches the recipes commands to a function</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="n">cmd_map</span> <span class="o">=</span> <span class="p">{</span>
|
||
|
<span class="s">"list"</span><span class="p">:</span> <span class="n">recipes_list</span><span class="p">,</span>
|
||
|
<span class="s">"show"</span><span class="p">:</span> <span class="n">recipes_show</span><span class="p">,</span>
|
||
|
<span class="s">"changes"</span><span class="p">:</span> <span class="n">recipes_changes</span><span class="p">,</span>
|
||
|
<span class="s">"diff"</span><span class="p">:</span> <span class="n">recipes_diff</span><span class="p">,</span>
|
||
|
<span class="s">"save"</span><span class="p">:</span> <span class="n">recipes_save</span><span class="p">,</span>
|
||
|
<span class="s">"delete"</span><span class="p">:</span> <span class="n">recipes_delete</span><span class="p">,</span>
|
||
|
<span class="s">"depsolve"</span><span class="p">:</span> <span class="n">recipes_depsolve</span><span class="p">,</span>
|
||
|
<span class="s">"push"</span><span class="p">:</span> <span class="n">recipes_push</span><span class="p">,</span>
|
||
|
<span class="s">"freeze"</span><span class="p">:</span> <span class="n">recipes_freeze</span><span class="p">,</span>
|
||
|
<span class="s">"tag"</span><span class="p">:</span> <span class="n">recipes_tag</span><span class="p">,</span>
|
||
|
<span class="s">"undo"</span><span class="p">:</span> <span class="n">recipes_undo</span><span class="p">,</span>
|
||
|
<span class="s">"workspace"</span><span class="p">:</span> <span class="n">recipes_workspace</span>
|
||
|
<span class="p">}</span>
|
||
|
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">cmd_map</span><span class="p">:</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"Unknown recipes command: </span><span class="si">%s</span><span class="s">"</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
|
||
|
<span class="k">return</span> <span class="mi">1</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="n">cmd_map</span><span class="p">[</span><span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]](</span><span class="n">opts</span><span class="o">.</span><span class="n">socket</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">api_version</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">2</span><span class="p">:],</span> <span class="n">opts</span><span class="o">.</span><span class="n">json</span><span class="p">)</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_list"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_list">[docs]</a><span class="k">def</span> <span class="nf">recipes_list</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Output the list of available recipes</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> recipes list</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/list"</span><span class="p">)</span>
|
||
|
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||
|
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
|
||
|
<span class="k">print</span><span class="p">(</span><span class="s">"Recipes: "</span> <span class="o">+</span> <span class="s">", "</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s">"recipes"</span><span class="p">]]))</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_show"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_show">[docs]</a><span class="k">def</span> <span class="nf">recipes_show</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Show the recipes, in TOML format</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> recipes show <recipe,...> Display the recipe in TOML format.</span>
|
||
|
|
||
|
<span class="sd"> Multiple recipes will be separated by \n\n</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="k">for</span> <span class="n">recipe</span> <span class="ow">in</span> <span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">):</span>
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/info/</span><span class="si">%s</span><span class="s">?format=toml"</span> <span class="o">%</span> <span class="n">recipe</span><span class="p">)</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">get_url_raw</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span> <span class="o">+</span> <span class="s">"</span><span class="se">\n\n</span><span class="s">"</span><span class="p">)</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_changes"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_changes">[docs]</a><span class="k">def</span> <span class="nf">recipes_changes</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Display the changes for each of the recipes</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> recipes changes <recipe,...> Display the changes for each recipe.</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/changes/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="s">","</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">))))</span>
|
||
|
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||
|
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
|
||
|
<span class="k">for</span> <span class="n">recipe</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s">"recipes"</span><span class="p">]:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s">"name"</span><span class="p">])</span>
|
||
|
<span class="k">for</span> <span class="n">change</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">"changes"</span><span class="p">]:</span>
|
||
|
<span class="n">prettyCommitDetails</span><span class="p">(</span><span class="n">change</span><span class="p">)</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="prettyCommitDetails"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.prettyCommitDetails">[docs]</a><span class="k">def</span> <span class="nf">prettyCommitDetails</span><span class="p">(</span><span class="n">change</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">):</span>
|
||
|
<span class="sd">"""Print the recipe's change in a nice way</span>
|
||
|
|
||
|
<span class="sd"> :param change: The individual recipe change dict</span>
|
||
|
<span class="sd"> :type change: dict</span>
|
||
|
<span class="sd"> :param indent: Number of spaces to indent</span>
|
||
|
<span class="sd"> :type indent: int</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="k">def</span> <span class="nf">revision</span><span class="p">():</span>
|
||
|
<span class="k">if</span> <span class="n">change</span><span class="p">[</span><span class="s">"revision"</span><span class="p">]:</span>
|
||
|
<span class="k">return</span> <span class="s">" revision </span><span class="si">%d</span><span class="s">"</span> <span class="o">%</span> <span class="n">change</span><span class="p">[</span><span class="s">"revision"</span><span class="p">]</span>
|
||
|
<span class="k">else</span><span class="p">:</span>
|
||
|
<span class="k">return</span> <span class="s">""</span>
|
||
|
|
||
|
<span class="k">print</span> <span class="s">" "</span> <span class="o">*</span> <span class="n">indent</span> <span class="o">+</span> <span class="n">change</span><span class="p">[</span><span class="s">"timestamp"</span><span class="p">]</span> <span class="o">+</span> <span class="s">" "</span> <span class="o">+</span> <span class="n">change</span><span class="p">[</span><span class="s">"commit"</span><span class="p">]</span> <span class="o">+</span> <span class="n">revision</span><span class="p">()</span>
|
||
|
<span class="k">print</span> <span class="s">" "</span> <span class="o">*</span> <span class="n">indent</span> <span class="o">+</span> <span class="n">change</span><span class="p">[</span><span class="s">"message"</span><span class="p">]</span> <span class="o">+</span> <span class="s">"</span><span class="se">\n</span><span class="s">"</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_diff"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_diff">[docs]</a><span class="k">def</span> <span class="nf">recipes_diff</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Display the differences between 2 versions of a recipe</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> recipes diff <recipe-name> Display the differences between 2 versions of a recipe.</span>
|
||
|
<span class="sd"> <from-commit> Commit hash or NEWEST</span>
|
||
|
<span class="sd"> <to-commit> Commit hash, NEWEST, or WORKSPACE</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"recipes diff is missing the recipe name, from commit, and to commit"</span><span class="p">)</span>
|
||
|
<span class="k">return</span> <span class="mi">1</span>
|
||
|
<span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"recipes diff is missing the from commit, and the to commit"</span><span class="p">)</span>
|
||
|
<span class="k">return</span> <span class="mi">1</span>
|
||
|
<span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"recipes diff is missing the to commit"</span><span class="p">)</span>
|
||
|
<span class="k">return</span> <span class="mi">1</span>
|
||
|
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/diff/</span><span class="si">%s</span><span class="s">/</span><span class="si">%s</span><span class="s">/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">args</span><span class="p">[</span><span class="mi">2</span><span class="p">]))</span>
|
||
|
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||
|
|
||
|
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
|
||
|
<span class="k">if</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"error"</span><span class="p">,</span> <span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">result</span><span class="p">[</span><span class="s">"error"</span><span class="p">][</span><span class="s">"msg"</span><span class="p">])</span>
|
||
|
<span class="k">return</span> <span class="mi">1</span>
|
||
|
|
||
|
<span class="k">for</span> <span class="n">diff</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s">"diff"</span><span class="p">]:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="n">prettyDiffEntry</span><span class="p">(</span><span class="n">diff</span><span class="p">))</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="prettyDiffEntry"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.prettyDiffEntry">[docs]</a><span class="k">def</span> <span class="nf">prettyDiffEntry</span><span class="p">(</span><span class="n">diff</span><span class="p">):</span>
|
||
|
<span class="sd">"""Generate nice diff entry string.</span>
|
||
|
|
||
|
<span class="sd"> :param diff: Difference entry dict</span>
|
||
|
<span class="sd"> :type diff: dict</span>
|
||
|
<span class="sd"> :returns: Nice string</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="k">def</span> <span class="nf">change</span><span class="p">(</span><span class="n">diff</span><span class="p">):</span>
|
||
|
<span class="k">if</span> <span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">]</span> <span class="ow">and</span> <span class="n">diff</span><span class="p">[</span><span class="s">"new"</span><span class="p">]:</span>
|
||
|
<span class="k">return</span> <span class="s">"Changed"</span>
|
||
|
<span class="k">elif</span> <span class="n">diff</span><span class="p">[</span><span class="s">"new"</span><span class="p">]</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">]:</span>
|
||
|
<span class="k">return</span> <span class="s">"Added"</span>
|
||
|
<span class="k">elif</span> <span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">]</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">diff</span><span class="p">[</span><span class="s">"new"</span><span class="p">]:</span>
|
||
|
<span class="k">return</span> <span class="s">"Removed"</span>
|
||
|
<span class="k">else</span><span class="p">:</span>
|
||
|
<span class="k">return</span> <span class="s">"Unknown"</span>
|
||
|
|
||
|
<span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="n">diff</span><span class="p">):</span>
|
||
|
<span class="k">if</span> <span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">]:</span>
|
||
|
<span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
|
||
|
<span class="k">elif</span> <span class="n">diff</span><span class="p">[</span><span class="s">"new"</span><span class="p">]:</span>
|
||
|
<span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s">"new"</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
|
||
|
<span class="k">else</span><span class="p">:</span>
|
||
|
<span class="k">return</span> <span class="s">"Unknown"</span>
|
||
|
|
||
|
<span class="k">def</span> <span class="nf">details</span><span class="p">(</span><span class="n">diff</span><span class="p">):</span>
|
||
|
<span class="k">if</span> <span class="n">change</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">==</span> <span class="s">"Changed"</span><span class="p">:</span>
|
||
|
<span class="k">if</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">==</span> <span class="s">"Description"</span><span class="p">:</span>
|
||
|
<span class="k">return</span> <span class="s">'"</span><span class="si">%s</span><span class="s">" -> "</span><span class="si">%s</span><span class="s">"'</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)],</span> <span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)])</span>
|
||
|
<span class="k">elif</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">==</span> <span class="s">"Version"</span><span class="p">:</span>
|
||
|
<span class="k">return</span> <span class="s">"</span><span class="si">%s</span><span class="s"> -> </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)],</span> <span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)])</span>
|
||
|
<span class="k">elif</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="s">"Module"</span><span class="p">,</span> <span class="s">"Package"</span><span class="p">]:</span>
|
||
|
<span class="k">return</span> <span class="s">"</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s"> -> </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">"name"</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">"version"</span><span class="p">],</span>
|
||
|
<span class="n">diff</span><span class="p">[</span><span class="s">"new"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">"version"</span><span class="p">])</span>
|
||
|
<span class="k">else</span><span class="p">:</span>
|
||
|
<span class="k">return</span> <span class="s">"Unknown"</span>
|
||
|
<span class="k">elif</span> <span class="n">change</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">==</span> <span class="s">"Added"</span><span class="p">:</span>
|
||
|
<span class="k">if</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="s">"Module"</span><span class="p">,</span> <span class="s">"Package"</span><span class="p">]:</span>
|
||
|
<span class="k">return</span> <span class="s">"</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">"new"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">"name"</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">"new"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">"version"</span><span class="p">])</span>
|
||
|
<span class="k">else</span><span class="p">:</span>
|
||
|
<span class="k">return</span> <span class="s">" "</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">diff</span><span class="p">[</span><span class="s">"new"</span><span class="p">][</span><span class="n">k</span><span class="p">]</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">diff</span><span class="p">[</span><span class="s">"new"</span><span class="p">]])</span>
|
||
|
<span class="k">elif</span> <span class="n">change</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">==</span> <span class="s">"Removed"</span><span class="p">:</span>
|
||
|
<span class="k">if</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="s">"Module"</span><span class="p">,</span> <span class="s">"Package"</span><span class="p">]:</span>
|
||
|
<span class="k">return</span> <span class="s">"</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">"name"</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">"version"</span><span class="p">])</span>
|
||
|
<span class="k">else</span><span class="p">:</span>
|
||
|
<span class="k">return</span> <span class="s">" "</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">][</span><span class="n">k</span><span class="p">]</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">diff</span><span class="p">[</span><span class="s">"old"</span><span class="p">]])</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="n">change</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">+</span> <span class="s">" "</span> <span class="o">+</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">+</span> <span class="s">" "</span> <span class="o">+</span> <span class="n">details</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_save"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_save">[docs]</a><span class="k">def</span> <span class="nf">recipes_save</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Save the recipe to a TOML file</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> recipes save <recipe,...> Save the recipe to a file, <recipe-name>.toml</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="k">for</span> <span class="n">recipe</span> <span class="ow">in</span> <span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">):</span>
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/info/</span><span class="si">%s</span><span class="s">?format=toml"</span> <span class="o">%</span> <span class="n">recipe</span><span class="p">)</span>
|
||
|
<span class="n">recipe_toml</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_raw</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||
|
<span class="nb">open</span><span class="p">(</span><span class="n">toml_filename</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span> <span class="s">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">recipe_toml</span><span class="p">)</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_delete"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_delete">[docs]</a><span class="k">def</span> <span class="nf">recipes_delete</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Delete a recipe from the server</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> delete <recipe> Delete a recipe from the server</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/delete/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||
|
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">delete_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_depsolve"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_depsolve">[docs]</a><span class="k">def</span> <span class="nf">recipes_depsolve</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Display the packages needed to install the recipe</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> recipes depsolve <recipe,...> Display the packages needed to install the recipe.</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/depsolve/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="s">","</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">))))</span>
|
||
|
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||
|
|
||
|
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
|
||
|
<span class="k">for</span> <span class="n">recipe</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s">"recipes"</span><span class="p">]:</span>
|
||
|
<span class="k">if</span> <span class="n">recipe</span><span class="p">[</span><span class="s">"recipe"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"version"</span><span class="p">,</span> <span class="s">""</span><span class="p">):</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="s">"Recipe: </span><span class="si">%s</span><span class="s"> v</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s">"recipe"</span><span class="p">][</span><span class="s">"name"</span><span class="p">],</span> <span class="n">recipe</span><span class="p">[</span><span class="s">"recipe"</span><span class="p">][</span><span class="s">"version"</span><span class="p">]))</span>
|
||
|
<span class="k">else</span><span class="p">:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="s">"Recipe: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s">"recipe"</span><span class="p">][</span><span class="s">"name"</span><span class="p">]))</span>
|
||
|
<span class="k">for</span> <span class="n">dep</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">"dependencies"</span><span class="p">]:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="s">" "</span> <span class="o">+</span> <span class="n">packageNEVRA</span><span class="p">(</span><span class="n">dep</span><span class="p">))</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_push"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_push">[docs]</a><span class="k">def</span> <span class="nf">recipes_push</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Push a recipe TOML file to the server, updating the recipe</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> push <recipe> Push a recipe TOML file to the server.</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/new"</span><span class="p">)</span>
|
||
|
<span class="n">rval</span> <span class="o">=</span> <span class="mi">0</span>
|
||
|
<span class="k">for</span> <span class="n">recipe</span> <span class="ow">in</span> <span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">):</span>
|
||
|
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"Missing recipe file: </span><span class="si">%s</span><span class="s">"</span><span class="p">,</span> <span class="n">recipe</span><span class="p">)</span>
|
||
|
<span class="k">continue</span>
|
||
|
<span class="n">recipe_toml</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">recipe</span><span class="p">,</span> <span class="s">"r"</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
|
||
|
|
||
|
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">post_url_toml</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">recipe_toml</span><span class="p">)</span>
|
||
|
<span class="k">if</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">):</span>
|
||
|
<span class="n">rval</span> <span class="o">=</span> <span class="mi">1</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="n">rval</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_freeze"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_freeze">[docs]</a><span class="k">def</span> <span class="nf">recipes_freeze</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Handle the recipes freeze commands</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> recipes freeze <recipe,...> Display the frozen recipe's modules and packages.</span>
|
||
|
<span class="sd"> recipes freeze show <recipe,...> Display the frozen recipe in TOML format.</span>
|
||
|
<span class="sd"> recipes freeze save <recipe,...> Save the frozen recipe to a file, <recipe-name>.frozen.toml.</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="k">if</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s">"show"</span><span class="p">:</span>
|
||
|
<span class="k">return</span> <span class="n">recipes_freeze_show</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">:],</span> <span class="n">show_json</span><span class="p">)</span>
|
||
|
<span class="k">elif</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s">"save"</span><span class="p">:</span>
|
||
|
<span class="k">return</span> <span class="n">recipes_freeze_save</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">:],</span> <span class="n">show_json</span><span class="p">)</span>
|
||
|
|
||
|
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"freeze is missing the recipe name"</span><span class="p">)</span>
|
||
|
<span class="k">return</span> <span class="mi">1</span>
|
||
|
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/freeze/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="s">","</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">))))</span>
|
||
|
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||
|
|
||
|
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||
|
<span class="k">else</span><span class="p">:</span>
|
||
|
<span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s">"recipes"</span><span class="p">]:</span>
|
||
|
<span class="n">recipe</span> <span class="o">=</span> <span class="n">entry</span><span class="p">[</span><span class="s">"recipe"</span><span class="p">]</span>
|
||
|
<span class="k">if</span> <span class="n">recipe</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"version"</span><span class="p">,</span> <span class="s">""</span><span class="p">):</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="s">"Recipe: </span><span class="si">%s</span><span class="s"> v</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="n">recipe</span><span class="p">[</span><span class="s">"version"</span><span class="p">]))</span>
|
||
|
<span class="k">else</span><span class="p">:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="s">"Recipe: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s">"name"</span><span class="p">]))</span>
|
||
|
|
||
|
<span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">"modules"</span><span class="p">]:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="s">" </span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">m</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="n">m</span><span class="p">[</span><span class="s">"version"</span><span class="p">]))</span>
|
||
|
|
||
|
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">"packages"</span><span class="p">]:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="s">" </span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">p</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="n">p</span><span class="p">[</span><span class="s">"version"</span><span class="p">]))</span>
|
||
|
|
||
|
<span class="c"># Print any errors</span>
|
||
|
<span class="k">for</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"</span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">"</span><span class="p">,</span> <span class="n">err</span><span class="p">[</span><span class="s">"recipe"</span><span class="p">],</span> <span class="n">err</span><span class="p">[</span><span class="s">"msg"</span><span class="p">])</span>
|
||
|
|
||
|
<span class="c"># Return a 1 if there are any errors</span>
|
||
|
<span class="k">if</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||
|
<span class="k">return</span> <span class="mi">1</span>
|
||
|
<span class="k">else</span><span class="p">:</span>
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_freeze_show"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_freeze_show">[docs]</a><span class="k">def</span> <span class="nf">recipes_freeze_show</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Show the frozen recipe in TOML format</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> recipes freeze show <recipe,...> Display the frozen recipe in TOML format.</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"freeze show is missing the recipe name"</span><span class="p">)</span>
|
||
|
<span class="k">return</span> <span class="mi">1</span>
|
||
|
|
||
|
<span class="k">for</span> <span class="n">recipe</span> <span class="ow">in</span> <span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">):</span>
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/freeze/</span><span class="si">%s</span><span class="s">?format=toml"</span> <span class="o">%</span> <span class="n">recipe</span><span class="p">)</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">get_url_raw</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">))</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_freeze_save"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_freeze_save">[docs]</a><span class="k">def</span> <span class="nf">recipes_freeze_save</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Save the frozen recipe to a TOML file</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> recipes freeze save <recipe,...> Save the frozen recipe to a file, <recipe-name>.frozen.toml.</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"freeze save is missing the recipe name"</span><span class="p">)</span>
|
||
|
<span class="k">return</span> <span class="mi">1</span>
|
||
|
|
||
|
<span class="k">for</span> <span class="n">recipe</span> <span class="ow">in</span> <span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">):</span>
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/freeze/</span><span class="si">%s</span><span class="s">?format=toml"</span> <span class="o">%</span> <span class="n">recipe</span><span class="p">)</span>
|
||
|
<span class="n">recipe_toml</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_raw</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||
|
<span class="nb">open</span><span class="p">(</span><span class="n">frozen_toml_filename</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span> <span class="s">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">recipe_toml</span><span class="p">)</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="mi">0</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_tag"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_tag">[docs]</a><span class="k">def</span> <span class="nf">recipes_tag</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Tag the most recent recipe commit as a release</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> recipes tag <recipe> Tag the most recent recipe commit as a release.</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/tag/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||
|
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">post_url</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="s">""</span><span class="p">)</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_undo"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_undo">[docs]</a><span class="k">def</span> <span class="nf">recipes_undo</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Undo changes to a recipe</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> recipes undo <recipe> <commit> Undo changes to a recipe by reverting to the selected commit.</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"undo is missing the recipe name and commit hash"</span><span class="p">)</span>
|
||
|
<span class="k">return</span> <span class="mi">1</span>
|
||
|
<span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"undo is missing commit hash"</span><span class="p">)</span>
|
||
|
<span class="k">return</span> <span class="mi">1</span>
|
||
|
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/undo/</span><span class="si">%s</span><span class="s">/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>
|
||
|
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">post_url</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="s">""</span><span class="p">)</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||
|
</div>
|
||
|
<div class="viewcode-block" id="recipes_workspace"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.recipes.recipes_workspace">[docs]</a><span class="k">def</span> <span class="nf">recipes_workspace</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="sd">"""Push the recipe TOML to the temporary workspace storage</span>
|
||
|
|
||
|
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||
|
<span class="sd"> :type socket_path: str</span>
|
||
|
<span class="sd"> :param api_version: Version of the API to talk to. eg. "0"</span>
|
||
|
<span class="sd"> :type api_version: str</span>
|
||
|
<span class="sd"> :param args: List of remaining arguments from the cmdline</span>
|
||
|
<span class="sd"> :type args: list of str</span>
|
||
|
<span class="sd"> :param show_json: Set to True to show the JSON output instead of the human readable output</span>
|
||
|
<span class="sd"> :type show_json: bool</span>
|
||
|
|
||
|
<span class="sd"> recipes workspace <recipe> Push the recipe TOML to the temporary workspace storage.</span>
|
||
|
<span class="sd"> """</span>
|
||
|
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/recipes/workspace"</span><span class="p">)</span>
|
||
|
<span class="n">rval</span> <span class="o">=</span> <span class="mi">0</span>
|
||
|
<span class="k">for</span> <span class="n">recipe</span> <span class="ow">in</span> <span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">):</span>
|
||
|
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"Missing recipe file: </span><span class="si">%s</span><span class="s">"</span><span class="p">,</span> <span class="n">recipe</span><span class="p">)</span>
|
||
|
<span class="k">continue</span>
|
||
|
<span class="n">recipe_toml</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">recipe</span><span class="p">,</span> <span class="s">"r"</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
|
||
|
|
||
|
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">post_url_toml</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">recipe_toml</span><span class="p">)</span>
|
||
|
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||
|
<span class="k">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||
|
<span class="k">elif</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"error"</span><span class="p">,</span> <span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">result</span><span class="p">[</span><span class="s">"error"</span><span class="p">][</span><span class="s">"msg"</span><span class="p">])</span>
|
||
|
|
||
|
<span class="c"># Any errors results in returning a 1, but we continue with the rest first</span>
|
||
|
<span class="k">if</span> <span class="ow">not</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"status"</span><span class="p">,</span> <span class="bp">False</span><span class="p">):</span>
|
||
|
<span class="n">rval</span> <span class="o">=</span> <span class="mi">1</span>
|
||
|
|
||
|
<span class="k">return</span> <span class="n">rval</span></div>
|
||
|
</pre></div>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="sphinxsidebar">
|
||
|
<div class="sphinxsidebarwrapper">
|
||
|
<div id="searchbox" style="display: none">
|
||
|
<h3>Quick search</h3>
|
||
|
<form class="search" action="../../../search.html" method="get">
|
||
|
<input type="text" name="q" />
|
||
|
<input type="submit" value="Go" />
|
||
|
<input type="hidden" name="check_keywords" value="yes" />
|
||
|
<input type="hidden" name="area" value="default" />
|
||
|
</form>
|
||
|
<p class="searchtip" style="font-size: 90%">
|
||
|
Enter search terms or a module, class or function name.
|
||
|
</p>
|
||
|
</div>
|
||
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="clearer"></div>
|
||
|
</div>
|
||
|
<div class="related">
|
||
|
<h3>Navigation</h3>
|
||
|
<ul>
|
||
|
<li class="right" style="margin-right: 10px">
|
||
|
<a href="../../../genindex.html" title="General Index"
|
||
|
>index</a></li>
|
||
|
<li class="right" >
|
||
|
<a href="../../../py-modindex.html" title="Python Module Index"
|
||
|
>modules</a> |</li>
|
||
|
<li><a href="../../../index.html">Lorax 19.7.11 documentation</a> »</li>
|
||
|
<li><a href="../../index.html" >Module code</a> »</li>
|
||
|
<li><a href="../cli.html" >composer.cli</a> »</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="footer">
|
||
|
© Copyright 2018, Red Hat, Inc..
|
||
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|