-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
13,575 additions
and
1,347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 48e3095bf711b5dc6e90d1b99d7913b6 | ||
config: 6463dd90ee08595f02f68d122dfe6099 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
|
||
<!DOCTYPE html> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>polibeepsync.cmdlineparser — PoliBeePsync 0.4.4 documentation</title> | ||
<title>polibeepsync.cmdlineparser — PoliBeePsync 0.7.0 documentation</title> | ||
<link rel="stylesheet" href="../../_static/alabaster.css" type="text/css" /> | ||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> | ||
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></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> | ||
<script type="text/javascript" src="../../_static/language_data.js"></script> | ||
<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> | ||
<link rel="index" title="Index" href="../../genindex.html" /> | ||
<link rel="search" title="Search" href="../../search.html" /> | ||
|
||
|
@@ -31,7 +31,39 @@ | |
<div class="body" role="main"> | ||
|
||
<h1>Source code for polibeepsync.cmdlineparser</h1><div class="highlight"><pre> | ||
<span></span><span class="kn">import</span> <span class="nn">argparse</span> | ||
<span></span><span class="n">__copyright__</span> <span class="o">=</span> <span class="s2">"""Copyright 2020 Davide Olianas ([email protected]), Di</span> | ||
<span class="s2">Campli Raffaele ([email protected])."""</span> | ||
|
||
<span class="n">__license__</span> <span class="o">=</span> <span class="s2">"""This f is part of poliBeePsync.</span> | ||
<span class="s2">poliBeePsync is free software: you can redistribute it and/or modify</span> | ||
<span class="s2">it under the terms of the GNU General Public License as published by</span> | ||
<span class="s2">the Free Software Foundation, either version 3 of the License, or</span> | ||
<span class="s2">any later version.</span> | ||
|
||
<span class="s2">poliBeePsync is distributed in the hope that it will be useful,</span> | ||
<span class="s2">but WITHOUT ANY WARRANTY; without even the implied warranty of</span> | ||
<span class="s2">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> | ||
<span class="s2">GNU General Public License for more details.</span> | ||
|
||
<span class="s2">You should have received a copy of the GNU General Public License</span> | ||
<span class="s2">along with poliBeePsync. If not, see <http://www.gnu.org/licenses/>.</span> | ||
<span class="s2">"""</span> | ||
|
||
<span class="kn">import</span> <span class="nn">argparse</span> | ||
|
||
<span class="sd">"""</span> | ||
<span class="sd">Thanks</span> | ||
<span class="sd">https://stackoverflow.com/questions/14117415/in-python-using-argparse-allow</span> | ||
<span class="sd">-only-positive-integers</span> | ||
<span class="sd">"""</span> | ||
|
||
|
||
<div class="viewcode-block" id="check_positive"><a class="viewcode-back" href="../../polibeepsync.html#polibeepsync.cmdlineparser.check_positive">[docs]</a><span class="k">def</span> <span class="nf">check_positive</span><span class="p">(</span><span class="n">value</span><span class="p">):</span> | ||
<span class="n">ivalue</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> | ||
<span class="k">if</span> <span class="n">ivalue</span> <span class="o"><=</span> <span class="mi">0</span><span class="p">:</span> | ||
<span class="k">raise</span> <span class="n">argparse</span><span class="o">.</span><span class="n">ArgumentTypeError</span><span class="p">(</span> | ||
<span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">value</span><span class="si">}</span><span class="s2">: 0 and negative numbers are not allowed"</span><span class="p">)</span> | ||
<span class="k">return</span> <span class="n">ivalue</span></div> | ||
|
||
|
||
<div class="viewcode-block" id="create_parser"><a class="viewcode-back" href="../../polibeepsync.html#polibeepsync.cmdlineparser.create_parser">[docs]</a><span class="k">def</span> <span class="nf">create_parser</span><span class="p">():</span> | ||
|
@@ -41,22 +73,25 @@ <h1>Source code for polibeepsync.cmdlineparser</h1><div class="highlight"><pre> | |
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--hidden'</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s1">'store_true'</span><span class="p">,</span> | ||
<span class="n">help</span><span class="o">=</span><span class="s2">"Don't show the main window, just the icon"</span> | ||
<span class="s2">" in the system tray"</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--debug'</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s1">'store'</span><span class="p">,</span> <span class="n">choices</span><span class="o">=</span><span class="n">debug_levels</span><span class="p">,</span> | ||
<span class="n">help</span><span class="o">=</span><span class="s2">"Show debug information."</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--log-level'</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s1">'store'</span><span class="p">,</span> <span class="n">choices</span><span class="o">=</span><span class="n">debug_levels</span><span class="p">,</span> | ||
<span class="n">help</span><span class="o">=</span><span class="s1">'Choose logging report verbosity'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'-s'</span><span class="p">,</span> <span class="s1">'--use_theme'</span><span class="p">,</span> | ||
<span class="n">action</span><span class="o">=</span><span class="s1">'store_true'</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> | ||
<span class="n">help</span><span class="o">=</span><span class="s2">"Choose Qt theme over gtk"</span><span class="p">)</span> | ||
|
||
<span class="k">return</span> <span class="n">parser</span></div> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span> | ||
<span class="s1">'--sync-interval'</span><span class="p">,</span> | ||
<span class="nb">type</span><span class="o">=</span><span class="n">check_positive</span><span class="p">,</span> | ||
<span class="n">action</span><span class="o">=</span><span class="s1">'store'</span><span class="p">,</span> | ||
<span class="n">help</span><span class="o">=</span><span class="s1">'[Non persistent override] Choose how often (in minutes) the '</span> | ||
<span class="s1">'courses files should be synced'</span><span class="p">)</span> | ||
|
||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span> | ||
<span class="s1">'--sync-on-startup'</span><span class="p">,</span> | ||
<span class="n">action</span><span class="o">=</span><span class="s1">'store_true'</span><span class="p">,</span> | ||
<span class="n">help</span><span class="o">=</span><span class="s1">'[Non persistent override] Synces the courses files on startup'</span><span class="p">)</span> | ||
|
||
<div class="viewcode-block" id="main"><a class="viewcode-back" href="../../polibeepsync.html#polibeepsync.cmdlineparser.main">[docs]</a><span class="k">def</span> <span class="nf">main</span><span class="p">():</span> | ||
<span class="n">parser</span> <span class="o">=</span> <span class="n">create_parser</span><span class="p">()</span> | ||
<span class="n">args</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">parse_args</span><span class="p">()</span> | ||
<span class="nb">print</span><span class="p">(</span><span class="n">args</span><span class="p">)</span></div> | ||
|
||
<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">'__main__'</span><span class="p">:</span> | ||
<span class="n">main</span><span class="p">()</span> | ||
<span class="k">return</span> <span class="n">parser</span></div> | ||
</pre></div> | ||
|
||
</div> | ||
|
@@ -99,7 +134,7 @@ <h3 id="searchlabel">Quick search</h3> | |
</form> | ||
</div> | ||
</div> | ||
<script type="text/javascript">$('#searchbox').show(0);</script> | ||
<script>$('#searchbox').show(0);</script> | ||
|
||
|
||
|
||
|
@@ -114,10 +149,10 @@ <h3 id="searchlabel">Quick search</h3> | |
</div> | ||
|
||
<div class="footer"> | ||
©2019, Davide Olianas, Raffaele Di Campli. | ||
©2020, Davide Olianas, Raffaele Di Campli. | ||
|
||
| | ||
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.1.2</a> | ||
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.1</a> | ||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a> | ||
|
||
</div> | ||
|
Oops, something went wrong.