401
401
<dl class="function">
402
402
<dt id="lib.system.shell">
403
<tt class="descclassname">lib.system.</tt><tt class="descname">shell</tt><big>(</big><em>*args</em><big>)</big><a class="headerlink" href="#lib.system.shell" title="Permalink to this definition">¶</a></dt>
403
<tt class="descclassname">lib.system.</tt><tt class="descname">shell</tt><big>(</big><em>*args</em>, <em>**options</em><big>)</big><a class="headerlink" href="#lib.system.shell" title="Permalink to this definition">¶</a></dt>
404
404
<dd><p>Runs a shell command and captures the output.</p>
405
405
<table class="docutils field-list" frame="void" rules="none">
406
406
<col class="field-name" />
417
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">shell</span><span class="p">(</span><span class="s">'echo world'</span><span class="p">)</span>
417
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">shell</span><span class="p">(</span><span class="s">'echo world'</span><span class="p">,</span> <span class="n">shell</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
418
<span class="go">('world\n', '')</span>
423
<dl class="function">
424
<dt id="lib.system.shell_cache">
425
<tt class="descclassname">lib.system.</tt><tt class="descname">shell_cache</tt><big>(</big><em>args</em>, <em>cache=''</em>, <em>key=None</em>, <em>validate=None</em>, <em>**options</em><big>)</big><a class="headerlink" href="#lib.system.shell_cache" title="Permalink to this definition">¶</a></dt>
426
<dd><p>Runs a shell command and captures the output. It uses a caching system
427
so that cached results don’t need to run a subprocess anymore. The results
428
are cached by sys.platform</p>
429
<table class="docutils field-list" frame="void" rules="none">
430
<col class="field-name" />
431
<col class="field-body" />
433
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
434
<li><em>args</em> (tuple of strings) – the command to be executed in the shell</li>
435
<li><em>cache</em> (string) – the filename of the cache file</li>
436
<li><em>validate</em> – a validate (eg mtime) to validate the cache result</li>
440
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">stdout and stdout</p>
443
<tr class="field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">typle of strings</p>
448
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">shell</span><span class="p">(</span><span class="s">'echo world'</span><span class="p">,</span> <span class="n">shell</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
418
449
<span class="go">('world\n', '')</span>
423
454
<dl class="function">
424
455
<dt id="lib.system.shell_returncode">
425
<tt class="descclassname">lib.system.</tt><tt class="descname">shell_returncode</tt><big>(</big><em>*args</em><big>)</big><a class="headerlink" href="#lib.system.shell_returncode" title="Permalink to this definition">¶</a></dt>
456
<tt class="descclassname">lib.system.</tt><tt class="descname">shell_returncode</tt><big>(</big><em>*args</em>, <em>**options</em><big>)</big><a class="headerlink" href="#lib.system.shell_returncode" title="Permalink to this definition">¶</a></dt>
426
457
<dd><p>Runs a shell command and returns it’s exit code.</p>
427
458
<table class="docutils field-list" frame="void" rules="none">
428
459
<col class="field-name" />