-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
gummy.cli.html
243 lines (217 loc) · 14.6 KB
/
gummy.cli.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content="gummy.cli module" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://iwasakishuto.github.io/Translation-Gummy/gummy.cli.html" />
<meta property="og:description" content="CLI(Command Line Interface) tools Since the following two programs are frequently used, I created this file to be called from command line. Translate your journals and generate a PDF., Translation." />
<meta property="og:image" content="https://iwasakishuto.github.io/images/FacebookImage/Translation-Gummy.png" />
<meta property="og:site_name" content="Translation-Gummy" />
<meta name="twitter:site" content="@cabernet_rock" />
<meta name="twitter:card" content="summary">
<meta name="twitter:image:src" content="https://iwasakishuto.github.io/images/FacebookImage/Translation-Gummy.png">
<title>gummy.cli module — Translation-Gummy documentation</title>
<link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/custom.css" />
<link rel="stylesheet" type="text/css" href="_static/font-awesome/css/solid.css" />
<link rel="stylesheet" type="text/css" href="_static/font-awesome/css/brands.css" />
<link rel="stylesheet" type="text/css" href="_static/font-awesome/css/fontawesome.css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script src="_static/custom.js"></script>
<link rel="shortcut icon" href="_static/favicon.png"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="gummy.gateways module" href="gummy.gateways.html" />
<link rel="prev" title="gummy.utils.templates module" href="gummy.utils.templates.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<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 class="right" >
<a href="gummy.gateways.html" title="gummy.gateways module"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="gummy.utils.templates.html" title="gummy.utils.templates module"
accesskey="P">previous</a> |</li>
<li><i class="fas fa-home"></i><a href="https://iwasakishuto.github.io/">Portfolio Top</a> »</li>
<li class="nav-item nav-item-0"><a href="index.html">Translation-Gummy documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="gummy.html" accesskey="U">gummy package</a> »</li>
<li class="nav-item nav-item-this"><a href="">gummy.cli module</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-gummy.cli">
<span id="gummy-cli-module"></span><h1>gummy.cli module<a class="headerlink" href="#module-gummy.cli" title="Permalink to this headline">¶</a></h1>
<p>CLI(Command Line Interface) tools</p>
<p>Since the following two programs are frequently used, I created this file to be called from command line.</p>
<ul class="simple">
<li><p>Translate your journals and generate a PDF.</p></li>
<li><p>Translation</p></li>
</ul>
<dl class="py function">
<dt id="gummy.cli.translate_journal">
<code class="sig-prename descclassname">gummy.cli.</code><code class="sig-name descname">translate_journal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">argv</span><span class="o">=</span><span class="default_value">['-M', 'html', '.', '_build']</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/gummy/cli.html#translate_journal"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gummy.cli.translate_journal" title="Permalink to this definition">¶</a></dt>
<dd><p>Translate journals.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – URL of a paper or <code class="docutils literal notranslate"><span class="pre">path/to/local.pdf</span></code>. (required)</p></li>
<li><p><strong>-G/--gateway</strong> (<em>str</em>) – Gateway identifier, string name of a gateway. (default= <code class="docutils literal notranslate"><span class="pre">"useless"</span></code> )</p></li>
<li><p><strong>-T/--translator</strong> (<em>str</em>) – Translator identifier, string name of a translator. (default= <code class="docutils literal notranslate"><span class="pre">"deepl"</span></code> )</p></li>
<li><p><strong>-J/--journal</strong> (<em>str</em>) – Journal identifier, string name of a journal. (default= <code class="docutils literal notranslate"><span class="pre">None</span></code> )</p></li>
<li><p><strong>--crawl-type</strong> (<em>str</em>) – Crawling type, if you not specify, use recommended crawling type. (default= <code class="docutils literal notranslate"><span class="pre">None</span></code> )</p></li>
<li><p><strong>-O/--out-dir</strong> (<em>str</em>) – Where you want to save a created PDF. (default= <code class="docutils literal notranslate"><span class="pre">GUMMY_DIR</span></code> )</p></li>
<li><p><strong>--browser</strong> (<em>bool</em>) – Whether you want to run Chrome with GUI browser. (default= <code class="docutils literal notranslate"><span class="pre">False</span></code> )</p></li>
<li><p><strong>-pdf/--pdf-path</strong> (<em>str</em>) – Path to output pdf file path. (default= <code class="docutils literal notranslate"><span class="pre">None</span></code> )</p></li>
<li><p><strong>-tpl/--tpl-path</strong> (<em>str</em>) – Path to template path. (default= <code class="docutils literal notranslate"><span class="pre">None</span></code> )</p></li>
<li><p><strong>--save-html</strong> (<em>bool</em>) – Whether you want to save an intermediate html file. (default= <code class="docutils literal notranslate"><span class="pre">False</span></code> )</p></li>
<li><p><strong>--quiet</strong> (<em>bool</em>) – Whether you want to be quiet or not. (default= <code class="docutils literal notranslate"><span class="pre">False</span></code> )</p></li>
<li><p><strong>--translator-verbose</strong> (<em>bool</em>) – Whether you want to print translator’s output or not. (default= <code class="docutils literal notranslate"><span class="pre">False</span></code> )</p></li>
<li><p><strong>-GP/--gateway-params</strong> (<em>dict</em>) – Specify the value required to pass through the gateway. You can specify by <code class="docutils literal notranslate"><span class="pre">-GP</span> <span class="pre">username=USERNAME</span> <span class="pre">-GP</span> <span class="pre">password=PASSWORD</span></code> (default= <code class="docutils literal notranslate"><span class="pre">{}</span></code> )</p></li>
<li><p><strong>--highlight</strong> (<em>bool</em>) – Whetehr you want to highlight the PDF or not. (default=False)”)</p></li>
<li><p><strong>--ignore_length</strong> (<em>int</em>) – If the number of English characters is smaller than <code class="docutils literal notranslate"><span class="pre">ignore_length</span></code> , do not highlight.</p></li>
<li><p><strong>--highlight_color</strong> (<em>list</em>) – The highlight color.</p></li>
</ul>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>When you run from the command line, execute as follows:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ gummy-journal "https://www.nature.com/articles/ncb0800_500"
</pre></div>
</div>
</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span>>>> $ gummy-journal "https://www.nature.com/articles/ncb0800_500"
</pre></div>
</div>
</dd></dl>
<dl class="py function">
<dt id="gummy.cli.translate_text">
<code class="sig-prename descclassname">gummy.cli.</code><code class="sig-name descname">translate_text</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">argv</span><span class="o">=</span><span class="default_value">['-M', 'html', '.', '_build']</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/gummy/cli.html#translate_text"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gummy.cli.translate_text" title="Permalink to this definition">¶</a></dt>
<dd><p>Translate from Japanese to English.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>query</strong> (<em>str</em>) – English to be translated. (required)</p></li>
<li><p><strong>-T/--translator</strong> (<em>str</em>) – Translator identifier, string name of a translator. (default= <code class="docutils literal notranslate"><span class="pre">"deepl"</span></code> )</p></li>
<li><p><strong>--browser</strong> (<em>bool</em>) – Whether you want to run Chrome with GUI browser. (default= <code class="docutils literal notranslate"><span class="pre">False</span></code> )</p></li>
<li><p><strong>--quiet</strong> (<em>bool</em>) – Whether you want to be quiet or not. (default= <code class="docutils literal notranslate"><span class="pre">False</span></code> )</p></li>
<li><p><strong>--translator-verbose</strong> (<em>bool</em>) – Whether you want to print translator’s output or not. (default= <code class="docutils literal notranslate"><span class="pre">False</span></code> )</p></li>
</ul>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>When you run from the command line, execute as follows:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ gummy-translate "This is a pen."
</pre></div>
</div>
</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span>>>> $ gummy-translate "This is a pen."
</pre></div>
</div>
</dd></dl>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Other contents</h4>
<ul class="social">
<li><a href="https://iwasakishuto.github.io/Blog/index.html"><img src="https://iwasakishuto.github.io/images/apple-touch-icon/Blog.png"></a></li>
<li><a href="https://iwasakishuto.github.io/University/index.html"><img src="https://iwasakishuto.github.io/images/apple-touch-icon/University.png"></a></li>
<li><a href="https://iwasakishuto.github.io/Front-End/index.html"><img src="https://iwasakishuto.github.io/images/apple-touch-icon/Front-End.png"></a></li>
<li><a href="https://iwasakishuto.github.io/Kerasy/index.html"><img src="https://iwasakishuto.github.io/images/apple-touch-icon/Kerasy.png"></a></li>
<li><a href="https://iwasakishuto.github.io/Python-Charmers/index.html"><img src="https://iwasakishuto.github.io/images/apple-touch-icon/Python-Charmers.png"></a></li>
</ul>
<h4>Social link</h4>
<ul class="social">
<li><a class="sc-twitter" href="https://twitter.com/cabernet_rock">
<i class="fab fa-twitter" aria-hidden="true"></i>
</a></li>
<li><a class="sc-github" href="https://github.com/iwasakishuto">
<i class="fab fa-github" aria-hidden="true"></i>
</a></li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="gummy.utils.templates.html"
title="previous chapter">gummy.utils.templates module</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="gummy.gateways.html"
title="next chapter">gummy.gateways module</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/gummy.cli.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<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 class="right" >
<a href="gummy.gateways.html" title="gummy.gateways module"
>next</a> |</li>
<li class="right" >
<a href="gummy.utils.templates.html" title="gummy.utils.templates module"
>previous</a> |</li>
<li><i class="fas fa-home"></i><a href="https://iwasakishuto.github.io/">Portfolio Top</a> »</li>
<li class="nav-item nav-item-0"><a href="index.html">Translation-Gummy documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="gummy.html" >gummy package</a> »</li>
<li class="nav-item nav-item-this"><a href="">gummy.cli module</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2021, iwasakishuto.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-164333757-6"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-164333757-6');
</script>
</body>
</html>