Diff
from v0.1.2 to v0.2.0
Diffstat
.coveragerc | 6
.gitignore | 3
.pylintrc | 575 +++++++++++++++++++++++++++++
.travis.yml | 44 ++
LICENSE | 83 ++++
Makefile | 95 ++++
Pipfile | 9
Pipfile.lock | 289 +++++++++++++-
README.md | 307 ---------------
README.rst | 132 ++++++
docs/Makefile | 20 +
docs/source/conf.py | 176 ++++++++
docs/source/configuration.rst | 725 +++++++++++++++++++++++++++++++++++++
docs/source/index.rst | 23 +
docs/source/usage.rst | 356 ++++++++++++++++++
nncli | 56 --
nncli/__init__.py | 4
nncli/__main__.py | 6
nnotes_cli/__init__.py | 17
| 3
| 28 -
| 37 -
| 42 -
| 32 -
| 4
| 5
| 31 -
| 5
| 5
| 4
| 5
pyproject.toml | 24 +
pytest.ini | 2
setup.cfg | 12
setup.py | 64 ---
tests/test_config.py | 30 -
tests/test_nncli.py | 187 ++++----
tests/test_version.py | 35 -
tox.ini | 29 +
.coveragerc (created)
|
1 |
+[run] |
|
2 |
+branch = True |
|
3 |
+omit = nncli/__main__.py |
|
4 |
+ |
|
5 |
+[report] |
|
6 |
+show_missing = True |
.gitignore
2 |
2 |
dist/ |
3 |
3 |
MANIFEST |
4 |
4 |
*.egg-info/ |
5 |
|
-nnotes_cli/version.py |
6 |
5 |
.coverage |
7 |
6 |
.pytest_cache/ |
|
7 |
+docs/build/ |
|
8 |
+.tox |
.pylintrc (created)
|
1 |
+[MASTER] |
|
2 |
+ |
|
3 |
+# A comma-separated list of package or module names from where C extensions may |
|
4 |
+# be loaded. Extensions are loading into the active Python interpreter and may |
|
5 |
+# run arbitrary code. |
|
6 |
+extension-pkg-whitelist= |
|
7 |
+ |
|
8 |
+# Add files or directories to the blacklist. They should be base names, not |
|
9 |
+# paths. |
|
10 |
+ignore=CVS .git |
|
11 |
+ |
|
12 |
+# Add files or directories matching the regex patterns to the blacklist. The |
|
13 |
+# regex matches against base names, not paths. |
|
14 |
+ignore-patterns= |
|
15 |
+ |
|
16 |
+# Python code to execute, usually for sys.path manipulation such as |
|
17 |
+# pygtk.require(). |
|
18 |
+#init-hook= |
|
19 |
+ |
|
20 |
+# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the |
|
21 |
+# number of processors available to use. |
|
22 |
+jobs=1 |
|
23 |
+ |
|
24 |
+# Control the amount of potential inferred values when inferring a single |
|
25 |
+# object. This can help the performance when dealing with large functions or |
|
26 |
+# complex, nested conditions. |
|
27 |
+limit-inference-results=100 |
|
28 |
+ |
|
29 |
+# List of plugins (as comma separated values of python modules names) to load, |
|
30 |
+# usually to register additional checkers. |
|
31 |
+load-plugins= |
|
32 |
+ |
|
33 |
+# Pickle collected data for later comparisons. |
|
34 |
+persistent=no |
|
35 |
+ |
|
36 |
+# Specify a configuration file. |
|
37 |
+#rcfile= |
|
38 |
+ |
|
39 |
+# When enabled, pylint would attempt to guess common misconfiguration and emit |
|
40 |
+# user-friendly hints instead of false-positive error messages. |
|
41 |
+suggestion-mode=yes |
|
42 |
+ |
|
43 |
+# Allow loading of arbitrary C extensions. Extensions are imported into the |
|
44 |
+# active Python interpreter and may run arbitrary code. |
|
45 |
+unsafe-load-any-extension=no |
|
46 |
+ |
|
47 |
+ |
|
48 |
+[MESSAGES CONTROL] |
|
49 |
+ |
|
50 |
+# Only show warnings with the listed confidence levels. Leave empty to show |
|
51 |
+# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED. |
|
52 |
+confidence= |
|
53 |
+ |
|
54 |
+# Disable the message, report, category or checker with the given id(s). You |
|
55 |
+# can either give multiple identifiers separated by comma (,) or put this |
|
56 |
+# option multiple times (only on the command line, not in the configuration |
|
57 |
+# file where it should appear only once). You can also use "--disable=all" to |
|
58 |
+# disable everything first and then reenable specific checks. For example, if |
|
59 |
+# you want to run only the similarities checker, you can use "--disable=all |
|
60 |
+# --enable=similarities". If you want to run only the classes checker, but have |
|
61 |
+# no Warning level messages displayed, use "--disable=all --enable=classes |
|
62 |
+# --disable=W". |
|
63 |
+disable=unsubscriptable-object, |
|
64 |
+ print-statement, |
|
65 |
+ parameter-unpacking, |
|
66 |
+ unpacking-in-except, |
|
67 |
+ old-raise-syntax, |
|
68 |
+ backtick, |
|
69 |
+ long-suffix, |
|
70 |
+ old-ne-operator, |
|
71 |
+ old-octal-literal, |
|
72 |
+ import-star-module-level, |
|
73 |
+ non-ascii-bytes-literal, |
|
74 |
+ raw-checker-failed, |
|
75 |
+ bad-inline-option, |
|
76 |
+ locally-disabled, |
|
77 |
+ locally-enabled, |
|
78 |
+ file-ignored, |
|
79 |
+ suppressed-message, |
|
80 |
+ useless-suppression, |
|
81 |
+ deprecated-pragma, |
|
82 |
+ use-symbolic-message-instead, |
|
83 |
+ apply-builtin, |
|
84 |
+ basestring-builtin, |
|
85 |
+ buffer-builtin, |
|
86 |
+ cmp-builtin, |
|
87 |
+ coerce-builtin, |
|
88 |
+ execfile-builtin, |
|
89 |
+ file-builtin, |
|
90 |
+ long-builtin, |
|
91 |
+ raw_input-builtin, |
|
92 |
+ reduce-builtin, |
|
93 |
+ standarderror-builtin, |
|
94 |
+ unicode-builtin, |
|
95 |
+ xrange-builtin, |
|
96 |
+ coerce-method, |
|
97 |
+ delslice-method, |
|
98 |
+ getslice-method, |
|
99 |
+ setslice-method, |
|
100 |
+ no-absolute-import, |
|
101 |
+ old-division, |
|
102 |
+ dict-iter-method, |
|
103 |
+ dict-view-method, |
|
104 |
+ next-method-called, |
|
105 |
+ metaclass-assignment, |
|
106 |
+ indexing-exception, |
|
107 |
+ raising-string, |
|
108 |
+ reload-builtin, |
|
109 |
+ oct-method, |
|
110 |
+ hex-method, |
|
111 |
+ nonzero-method, |
|
112 |
+ cmp-method, |
|
113 |
+ input-builtin, |
|
114 |
+ round-builtin, |
|
115 |
+ intern-builtin, |
|
116 |
+ unichr-builtin, |
|
117 |
+ map-builtin-not-iterating, |
|
118 |
+ zip-builtin-not-iterating, |
|
119 |
+ range-builtin-not-iterating, |
|
120 |
+ filter-builtin-not-iterating, |
|
121 |
+ using-cmp-argument, |
|
122 |
+ eq-without-hash, |
|
123 |
+ div-method, |
|
124 |
+ idiv-method, |
|
125 |
+ rdiv-method, |
|
126 |
+ exception-message-attribute, |
|
127 |
+ invalid-str-codec, |
|
128 |
+ sys-max-int, |
|
129 |
+ bad-python3-import, |
|
130 |
+ deprecated-string-function, |
|
131 |
+ deprecated-str-translate-call, |
|
132 |
+ deprecated-itertools-function, |
|
133 |
+ deprecated-types-field, |
|
134 |
+ next-method-defined, |
|
135 |
+ dict-items-not-iterating, |
|
136 |
+ dict-keys-not-iterating, |
|
137 |
+ dict-values-not-iterating, |
|
138 |
+ deprecated-operator-function, |
|
139 |
+ deprecated-urllib-function, |
|
140 |
+ xreadlines-attribute, |
|
141 |
+ deprecated-sys-function, |
|
142 |
+ exception-escape, |
|
143 |
+ comprehension-escape |
|
144 |
+ |
|
145 |
+# Enable the message, report, category or checker with the given id(s). You can |
|
146 |
+# either give multiple identifier separated by comma (,) or put this option |
|
147 |
+# multiple time (only on the command line, not in the configuration file where |
|
148 |
+# it should appear only once). See also the "--disable" option for examples. |
|
149 |
+enable=c-extension-no-member |
|
150 |
+ |
|
151 |
+ |
|
152 |
+[REPORTS] |
|
153 |
+ |
|
154 |
+# Python expression which should return a note less than 10 (10 is the highest |
|
155 |
+# note). You have access to the variables errors warning, statement which |
|
156 |
+# respectively contain the number of errors / warnings messages and the total |
|
157 |
+# number of statements analyzed. This is used by the global evaluation report |
|
158 |
+# (RP0004). |
|
159 |
+evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) |
|
160 |
+ |
|
161 |
+# Template used to display messages. This is a python new-style format string |
|
162 |
+# used to format the message information. See doc for all details. |
|
163 |
+#msg-template= |
|
164 |
+ |
|
165 |
+# Set the output format. Available formats are text, parseable, colorized, json |
|
166 |
+# and msvs (visual studio). You can also give a reporter class, e.g. |
|
167 |
+# mypackage.mymodule.MyReporterClass. |
|
168 |
+output-format=text |
|
169 |
+ |
|
170 |
+# Tells whether to display a full report or only the messages. |
|
171 |
+reports=yes |
|
172 |
+ |
|
173 |
+# Activate the evaluation score. |
|
174 |
+score=yes |
|
175 |
+ |
|
176 |
+ |
|
177 |
+[REFACTORING] |
|
178 |
+ |
|
179 |
+# Maximum number of nested blocks for function / method body |
|
180 |
+max-nested-blocks=5 |
|
181 |
+ |
|
182 |
+# Complete name of functions that never returns. When checking for |
|
183 |
+# inconsistent-return-statements if a never returning function is called then |
|
184 |
+# it will be considered as an explicit return statement and no message will be |
|
185 |
+# printed. |
|
186 |
+never-returning-functions=sys.exit |
|
187 |
+ |
|
188 |
+ |
|
189 |
+[VARIABLES] |
|
190 |
+ |
|
191 |
+# List of additional names supposed to be defined in builtins. Remember that |
|
192 |
+# you should avoid to define new builtins when possible. |
|
193 |
+additional-builtins= |
|
194 |
+ |
|
195 |
+# Tells whether unused global variables should be treated as a violation. |
|
196 |
+allow-global-unused-variables=yes |
|
197 |
+ |
|
198 |
+# List of strings which can identify a callback function by name. A callback |
|
199 |
+# name must start or end with one of those strings. |
|
200 |
+callbacks=cb_, |
|
201 |
+ _cb |
|
202 |
+ |
|
203 |
+# A regular expression matching the name of dummy variables (i.e. expected to |
|
204 |
+# not be used). |
|
205 |
+dummy-variables-rgx=_$|dummy |
|
206 |
+ |
|
207 |
+# Argument names that match this expression will be ignored. Default to name |
|
208 |
+# with leading underscore. |
|
209 |
+ignored-argument-names=mock.* |
|
210 |
+ |
|
211 |
+# Tells whether we should check for unused import in __init__ files. |
|
212 |
+init-import=no |
|
213 |
+ |
|
214 |
+# List of qualified module names which can have objects that can redefine |
|
215 |
+# builtins. |
|
216 |
+redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io |
|
217 |
+ |
|
218 |
+ |
|
219 |
+[LOGGING] |
|
220 |
+ |
|
221 |
+# Logging modules to check that the string format arguments are in logging |
|
222 |
+# function parameter format. |
|
223 |
+logging-modules=logging |
|
224 |
+ |
|
225 |
+ |
|
226 |
+[TYPECHECK] |
|
227 |
+ |
|
228 |
+# List of decorators that produce context managers, such as |
|
229 |
+# contextlib.contextmanager. Add to this list to register other decorators that |
|
230 |
+# produce valid context managers. |
|
231 |
+contextmanager-decorators=contextlib.contextmanager, pytest.fixture |
|
232 |
+ |
|
233 |
+# List of members which are set dynamically and missed by pylint inference |
|
234 |
+# system, and so shouldn't trigger E1101 when accessed. Python regular |
|
235 |
+# expressions are accepted. |
|
236 |
+generated-members=REQUEST, |
|
237 |
+ acl_users, |
|
238 |
+ aq_parent, |
|
239 |
+ assert_called_once_with, |
|
240 |
+ assert_called_once, |
|
241 |
+ call_count, |
|
242 |
+ print, |
|
243 |
+ call_args_list, |
|
244 |
+ assert_any_call, |
|
245 |
+ assert_not_called |
|
246 |
+ |
|
247 |
+# Tells whether missing members accessed in mixin class should be ignored. A |
|
248 |
+# mixin class is detected if its name ends with "mixin" (case insensitive). |
|
249 |
+ignore-mixin-members=yes |
|
250 |
+ |
|
251 |
+# Tells whether to warn about missing members when the owner of the attribute |
|
252 |
+# is inferred to be None. |
|
253 |
+ignore-none=yes |
|
254 |
+ |
|
255 |
+# This flag controls whether pylint should warn about no-member and similar |
|
256 |
+# checks whenever an opaque object is returned when inferring. The inference |
|
257 |
+# can return multiple potential results while evaluating a Python object, but |
|
258 |
+# some branches might not be evaluated, which results in partial inference. In |
|
259 |
+# that case, it might be useful to still emit no-member and other checks for |
|
260 |
+# the rest of the inferred objects. |
|
261 |
+ignore-on-opaque-inference=yes |
|
262 |
+ |
|
263 |
+# List of class names for which member attributes should not be checked (useful |
|
264 |
+# for classes with dynamically set attributes). This supports the use of |
|
265 |
+# qualified names. |
|
266 |
+ignored-classes=SQLObject, |
|
267 |
+ DateTimeField, |
|
268 |
+ CharField, |
|
269 |
+ ForecastioDataBlock |
|
270 |
+ |
|
271 |
+# List of module names for which member attributes should not be checked |
|
272 |
+# (useful for modules/projects where namespaces are manipulated during runtime |
|
273 |
+# and thus existing member attributes cannot be deduced by static analysis. It |
|
274 |
+# supports qualified module names, as well as Unix pattern matching. |
|
275 |
+ignored-modules= |
|
276 |
+ |
|
277 |
+# Show a hint with possible names when a member name was not found. The aspect |
|
278 |
+# of finding the hint is based on edit distance. |
|
279 |
+missing-member-hint=yes |
|
280 |
+ |
|
281 |
+# The minimum edit distance a name should have in order to be considered a |
|
282 |
+# similar match for a missing member name. |
|
283 |
+missing-member-hint-distance=1 |
|
284 |
+ |
|
285 |
+# The total number of similar names that should be taken in consideration when |
|
286 |
+# showing a hint for a missing member. |
|
287 |
+missing-member-max-choices=1 |
|
288 |
+ |
|
289 |
+ |
|
290 |
+[MISCELLANEOUS] |
|
291 |
+ |
|
292 |
+# List of note tags to take in consideration, separated by a comma. |
|
293 |
+notes=FIXME, |
|
294 |
+ XXX, |
|
295 |
+ TODO |
|
296 |
+ |
|
297 |
+ |
|
298 |
+[BASIC] |
|
299 |
+ |
|
300 |
+# Naming style matching correct argument names. |
|
301 |
+argument-naming-style=snake_case |
|
302 |
+ |
|
303 |
+# Regular expression matching correct argument names. Overrides argument- |
|
304 |
+# naming-style. |
|
305 |
+argument-rgx=[a-z_][a-z0-9_]{2,30}$ |
|
306 |
+ |
|
307 |
+# Naming style matching correct attribute names. |
|
308 |
+attr-naming-style=snake_case |
|
309 |
+ |
|
310 |
+# Regular expression matching correct attribute names. Overrides attr-naming- |
|
311 |
+# style. |
|
312 |
+attr-rgx=[a-z_][a-z0-9_]{2,30}$ |
|
313 |
+ |
|
314 |
+# Bad variable names which should always be refused, separated by a comma. |
|
315 |
+bad-names=foo, |
|
316 |
+ bar, |
|
317 |
+ baz, |
|
318 |
+ toto, |
|
319 |
+ tutu, |
|
320 |
+ tata |
|
321 |
+ |
|
322 |
+# Naming style matching correct class attribute names. |
|
323 |
+class-attribute-naming-style=any |
|
324 |
+ |
|
325 |
+# Regular expression matching correct class attribute names. Overrides class- |
|
326 |
+# attribute-naming-style. |
|
327 |
+class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ |
|
328 |
+ |
|
329 |
+# Naming style matching correct class names. |
|
330 |
+class-naming-style=PascalCase |
|
331 |
+ |
|
332 |
+# Regular expression matching correct class names. Overrides class-naming- |
|
333 |
+# style. |
|
334 |
+class-rgx=[A-Z_][a-zA-Z0-9]+$ |
|
335 |
+ |
|
336 |
+# Naming style matching correct constant names. |
|
337 |
+const-naming-style=UPPER_CASE |
|
338 |
+ |
|
339 |
+# Regular expression matching correct constant names. Overrides const-naming- |
|
340 |
+# style. |
|
341 |
+const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ |
|
342 |
+ |
|
343 |
+# Minimum line length for functions/classes that require docstrings, shorter |
|
344 |
+# ones are exempt. |
|
345 |
+docstring-min-length=-1 |
|
346 |
+ |
|
347 |
+# Naming style matching correct function names. |
|
348 |
+function-naming-style=snake_case |
|
349 |
+ |
|
350 |
+# Regular expression matching correct function names. Overrides function- |
|
351 |
+# naming-style. |
|
352 |
+function-rgx=[a-z_][a-z0-9_]{2,30}$ |
|
353 |
+ |
|
354 |
+# Good variable names which should always be accepted, separated by a comma. |
|
355 |
+good-names=i, |
|
356 |
+ j, |
|
357 |
+ k, |
|
358 |
+ ex, |
|
359 |
+ Run, |
|
360 |
+ main, |
|
361 |
+ _ |
|
362 |
+ |
|
363 |
+# Include a hint for the correct naming format with invalid-name. |
|
364 |
+include-naming-hint=no |
|
365 |
+ |
|
366 |
+# Naming style matching correct inline iteration names. |
|
367 |
+inlinevar-naming-style=any |
|
368 |
+ |
|
369 |
+# Regular expression matching correct inline iteration names. Overrides |
|
370 |
+# inlinevar-naming-style. |
|
371 |
+inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ |
|
372 |
+ |
|
373 |
+# Naming style matching correct method names. |
|
374 |
+method-naming-style=snake_case |
|
375 |
+ |
|
376 |
+# Regular expression matching correct method names. Overrides method-naming- |
|
377 |
+# style. |
|
378 |
+method-rgx=[a-z_][a-z0-9_]{2,30}$ |
|
379 |
+ |
|
380 |
+# Naming style matching correct module names. |
|
381 |
+module-naming-style=snake_case |
|
382 |
+ |
|
383 |
+# Regular expression matching correct module names. Overrides module-naming- |
|
384 |
+# style. |
|
385 |
+module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ |
|
386 |
+ |
|
387 |
+# Colon-delimited sets of names that determine each other's naming style when |
|
388 |
+# the name regexes allow several styles. |
|
389 |
+name-group= |
|
390 |
+ |
|
391 |
+# Regular expression which should only match function or class names that do |
|
392 |
+# not require a docstring. |
|
393 |
+no-docstring-rgx=__.*__ |
|
394 |
+ |
|
395 |
+# List of decorators that produce properties, such as abc.abstractproperty. Add |
|
396 |
+# to this list to register other decorators that produce valid properties. |
|
397 |
+# These decorators are taken in consideration only for invalid-name. |
|
398 |
+property-classes=abc.abstractproperty |
|
399 |
+ |
|
400 |
+# Naming style matching correct variable names. |
|
401 |
+variable-naming-style=snake_case |
|
402 |
+ |
|
403 |
+# Regular expression matching correct variable names. Overrides variable- |
|
404 |
+# naming-style. |
|
405 |
+variable-rgx=[a-z_][a-z0-9_]{2,30}$ |
|
406 |
+ |
|
407 |
+ |
|
408 |
+[FORMAT] |
|
409 |
+ |
|
410 |
+# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. |
|
411 |
+expected-line-ending-format= |
|
412 |
+ |
|
413 |
+# Regexp for a line that is allowed to be longer than the limit. |
|
414 |
+ignore-long-lines=^\s*(# )?<?https?://\S+>?$ |
|
415 |
+ |
|
416 |
+# Number of spaces of indent required inside a hanging or continued line. |
|
417 |
+indent-after-paren=8 |
|
418 |
+ |
|
419 |
+# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 |
|
420 |
+# tab). |
|
421 |
+indent-string=' ' |
|
422 |
+ |
|
423 |
+# Maximum number of characters on a single line. |
|
424 |
+max-line-length=80 |
|
425 |
+ |
|
426 |
+# Maximum number of lines in a module. |
|
427 |
+max-module-lines=1000 |
|
428 |
+ |
|
429 |
+# List of optional constructs for which whitespace checking is disabled. `dict- |
|
430 |
+# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. |
|
431 |
+# `trailing-comma` allows a space between comma and closing bracket: (a, ). |
|
432 |
+# `empty-line` allows space-only lines. |
|
433 |
+no-space-check=trailing-comma, |
|
434 |
+ dict-separator |
|
435 |
+ |
|
436 |
+# Allow the body of a class to be on the same line as the declaration if body |
|
437 |
+# contains single statement. |
|
438 |
+single-line-class-stmt=no |
|
439 |
+ |
|
440 |
+# Allow the body of an if to be on the same line as the test if there is no |
|
441 |
+# else. |
|
442 |
+single-line-if-stmt=no |
|
443 |
+ |
|
444 |
+ |
|
445 |
+[SPELLING] |
|
446 |
+ |
|
447 |
+# Limits count of emitted suggestions for spelling mistakes. |
|
448 |
+max-spelling-suggestions=4 |
|
449 |
+ |
|
450 |
+# Spelling dictionary name. Available dictionaries: none. To make it working |
|
451 |
+# install python-enchant package.. |
|
452 |
+spelling-dict= |
|
453 |
+ |
|
454 |
+# List of comma separated words that should not be checked. |
|
455 |
+spelling-ignore-words= |
|
456 |
+ |
|
457 |
+# A path to a file that contains private dictionary; one word per line. |
|
458 |
+spelling-private-dict-file= |
|
459 |
+ |
|
460 |
+# Tells whether to store unknown words to indicated private dictionary in |
|
461 |
+# --spelling-private-dict-file option instead of raising a message. |
|
462 |
+spelling-store-unknown-words=no |
|
463 |
+ |
|
464 |
+ |
|
465 |
+[SIMILARITIES] |
|
466 |
+ |
|
467 |
+# Ignore comments when computing similarities. |
|
468 |
+ignore-comments=yes |
|
469 |
+ |
|
470 |
+# Ignore docstrings when computing similarities. |
|
471 |
+ignore-docstrings=yes |
|
472 |
+ |
|
473 |
+# Ignore imports when computing similarities. |
|
474 |
+ignore-imports=no |
|
475 |
+ |
|
476 |
+# Minimum lines number of a similarity. |
|
477 |
+min-similarity-lines=4 |
|
478 |
+ |
|
479 |
+ |
|
480 |
+[DESIGN] |
|
481 |
+ |
|
482 |
+# Maximum number of arguments for function / method. |
|
483 |
+max-args=5 |
|
484 |
+ |
|
485 |
+# Maximum number of attributes for a class (see R0902). |
|
486 |
+max-attributes=7 |
|
487 |
+ |
|
488 |
+# Maximum number of boolean expressions in an if statement. |
|
489 |
+max-bool-expr=5 |
|
490 |
+ |
|
491 |
+# Maximum number of branch for function / method body. |
|
492 |
+max-branches=20 |
|
493 |
+ |
|
494 |
+# Maximum number of locals for function / method body. |
|
495 |
+max-locals=15 |
|
496 |
+ |
|
497 |
+# Maximum number of parents for a class (see R0901). |
|
498 |
+max-parents=7 |
|
499 |
+ |
|
500 |
+# Maximum number of public methods for a class (see R0904). |
|
501 |
+max-public-methods=20 |
|
502 |
+ |
|
503 |
+# Maximum number of return / yield for function / method body. |
|
504 |
+max-returns=6 |
|
505 |
+ |
|
506 |
+# Maximum number of statements in function / method body. |
|
507 |
+max-statements=50 |
|
508 |
+ |
|
509 |
+# Minimum number of public methods for a class (see R0903). |
|
510 |
+min-public-methods=2 |
|
511 |
+ |
|
512 |
+ |
|
513 |
+[CLASSES] |
|
514 |
+ |
|
515 |
+# List of method names used to declare (i.e. assign) instance attributes. |
|
516 |
+defining-attr-methods=__init__, |
|
517 |
+ __new__, |
|
518 |
+ setUp |
|
519 |
+ |
|
520 |
+# List of member names, which should be excluded from the protected access |
|
521 |
+# warning. |
|
522 |
+exclude-protected=_asdict, |
|
523 |
+ _fields, |
|
524 |
+ _replace, |
|
525 |
+ _source, |
|
526 |
+ _make |
|
527 |
+ |
|
528 |
+# List of valid names for the first argument in a class method. |
|
529 |
+valid-classmethod-first-arg=cls |
|
530 |
+ |
|
531 |
+# List of valid names for the first argument in a metaclass class method. |
|
532 |
+valid-metaclass-classmethod-first-arg=mcs |
|
533 |
+ |
|
534 |
+ |
|
535 |
+[IMPORTS] |
|
536 |
+ |
|
537 |
+# Allow wildcard imports from modules that define __all__. |
|
538 |
+allow-wildcard-with-all=no |
|
539 |
+ |
|
540 |
+# Analyse import fallback blocks. This can be used to support both Python 2 and |
|
541 |
+# 3 compatible code, which means that the block might have code that exists |
|
542 |
+# only in one or another interpreter, leading to false positives when analysed. |
|
543 |
+analyse-fallback-blocks=no |
|
544 |
+ |
|
545 |
+# Deprecated modules which should not be used, separated by a comma. |
|
546 |
+deprecated-modules=regsub, |
|
547 |
+ TERMIOS, |
|
548 |
+ Bastion, |
|
549 |
+ rexec |
|
550 |
+ |
|
551 |
+# Create a graph of external dependencies in the given file (report RP0402 must |
|
552 |
+# not be disabled). |
|
553 |
+ext-import-graph= |
|
554 |
+ |
|
555 |
+# Create a graph of every (i.e. internal and external) dependencies in the |
|
556 |
+# given file (report RP0402 must not be disabled). |
|
557 |
+import-graph= |
|
558 |
+ |
|
559 |
+# Create a graph of internal dependencies in the given file (report RP0402 must |
|
560 |
+# not be disabled). |
|
561 |
+int-import-graph= |
|
562 |
+ |
|
563 |
+# Force import order to recognize a module as part of the standard |
|
564 |
+# compatibility libraries. |
|
565 |
+known-standard-library= |
|
566 |
+ |
|
567 |
+# Force import order to recognize a module as part of a third party library. |
|
568 |
+known-third-party=enchant |
|
569 |
+ |
|
570 |
+ |
|
571 |
+[EXCEPTIONS] |
|
572 |
+ |
|
573 |
+# Exceptions that will emit a warning when being caught. Defaults to |
|
574 |
+# "Exception". |
|
575 |
+overgeneral-exceptions=Exception |
.travis.yml (created)
|
1 |
+# https://travis-ci.org/djmoch/nncli |
|
2 |
+language: python |
|
3 |
+ |
|
4 |
+matrix: |
|
5 |
+ fast_finish: true |
|
6 |
+ |
|
7 |
+.mixins: |
|
8 |
+- &xenial-mixin |
|
9 |
+ dist: xenial |
|
10 |
+ sudo: true |
|
11 |
+ addons: |
|
12 |
+ apt: |
|
13 |
+ packages: |
|
14 |
+ - libgnutls-dev |
|
15 |
+ |
|
16 |
+env: |
|
17 |
+ - PIPENV_HIDE_EMOJIS=1 PIPENV_NO_INHERIT=1 |
|
18 |
+ |
|
19 |
+install: |
|
20 |
+ - pip install -U pip pipenv python-coveralls |
|
21 |
+ - make test-install |
|
22 |
+ |
|
23 |
+jobs: |
|
24 |
+ include: |
|
25 |
+ - stage: test |
|
26 |
+ script: make test |
|
27 |
+ python: 3.4 |
|
28 |
+ - stage: test |
|
29 |
+ script: make test |
|
30 |
+ python: 3.5 |
|
31 |
+ - stage: test |
|
32 |
+ script: make test |
|
33 |
+ python: 3.6 |
|
34 |
+ - stage: test |
|
35 |
+ script: make test |
|
36 |
+ <<: *xenial-mixin |
|
37 |
+ python: 3.7 |
|
38 |
+ # - stage: lint |
|
39 |
+ # script: make lint |
|
40 |
+ # python: 3.6 |
|
41 |
+ - stage: coverage |
|
42 |
+ script: make coverage |
|
43 |
+ after_success: coveralls |
|
44 |
+ python: 3.5 |
LICENSE
21 |
21 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
22 |
22 |
SOFTWARE. |
23 |
23 |
|
|
24 |
+------------------------------------------------------------------------------- |
|
25 |
+ |
|
26 |
+Portions of this software are adapted from sncli by Eric Davis: |
|
27 |
+ |
|
28 |
+** The MIT License ** |
|
29 |
+ |
|
30 |
+Copyright (c) 2014 Eric Davis (edavis@insanum.com) |
|
31 |
+ |
|
32 |
+Permission is hereby granted, free of charge, to any person obtaining a copy |
|
33 |
+of this software and associated documentation files (the "Software"), to deal |
|
34 |
+in the Software without restriction, including without limitation the rights |
|
35 |
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
36 |
+copies of the Software, and to permit persons to whom the Software is |
|
37 |
+furnished to do so, subject to the following conditions: |
|
38 |
+ |
|
39 |
+The above copyright notice and this permission notice shall be included in all |
|
40 |
+copies or substantial portions of the Software. |
|
41 |
+ |
|
42 |
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
43 |
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
44 |
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
45 |
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
46 |
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
47 |
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|
48 |
+SOFTWARE. |
|
49 |
+ |
|
50 |
+Dude... just buy me a beer. :-) |
|
51 |
+ |
|
52 |
+------------------------------------------------------------------------------- |
|
53 |
+ |
|
54 |
+Portions of nextcloud_note.py are adapted from simplenote.py by Daniel |
|
55 |
+Schauenberg: |
|
56 |
+ |
|
57 |
+Copyright (c) 2011 Daniel Schauenberg |
|
58 |
+ |
|
59 |
+Permission is hereby granted, free of charge, to any person obtaining |
|
60 |
+a copy of this software and associated documentation files (the |
|
61 |
+"Software"), to deal in the Software without restriction, including |
|
62 |
+without limitation the rights to use, copy, modify, merge, publish, |
|
63 |
+distribute, sublicense, and/or sell copies of the Software, and to |
|
64 |
+permit persons to whom the Software is furnished to do so, subject to |
|
65 |
+the following conditions: |
|
66 |
+ |
|
67 |
+The above copyright notice and this permission notice shall be |
|
68 |
+included in all copies or substantial portions of the Software. |
|
69 |
+ |
|
70 |
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
71 |
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
72 |
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
73 |
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
|
74 |
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
|
75 |
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
76 |
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
77 |
+ |
|
78 |
+------------------------------------------------------------------------------- |
|
79 |
+ |
|
80 |
+Portions of notes_db and utils modules are adapted from the |
|
81 |
+corresponding module in nvpy by Charl P. Botha: |
|
82 |
+ |
|
83 |
+Copyright (c) 2012, Charl P. Botha |
|
84 |
+All rights reserved. |
|
85 |
+ |
|
86 |
+Redistribution and use in source and binary forms, with or without |
|
87 |
+modification, are permitted provided that the following conditions are met: |
|
88 |
+ * Redistributions of source code must retain the above copyright |
|
89 |
+ notice, this list of conditions and the following disclaimer. |
|
90 |
+ * Redistributions in binary form must reproduce the above copyright |
|
91 |
+ notice, this list of conditions and the following disclaimer in the |
|
92 |
+ documentation and/or other materials provided with the distribution. |
|
93 |
+ * Neither the name of the <organization> nor the |
|
94 |
+ names of its contributors may be used to endorse or promote products |
|
95 |
+ derived from this software without specific prior written permission. |
|
96 |
+ |
|
97 |
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
|
98 |
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
99 |
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
100 |
+DISCLAIMED. IN NO EVENT SHALL CHARL P. BOTHA BE LIABLE FOR ANY |
|
101 |
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
102 |
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
103 |
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
104 |
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
105 |
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
106 |
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Makefile (created)
|
1 |
+.PHONY: clean clean-test clean-pyc clean-build help lint coverage coverage-html release dist install run debug docs |
|
2 |
+.DEFAULT_GOAL := help |
|
3 |
+ |
|
4 |
+define BROWSER_PYSCRIPT |
|
5 |
+import os, webbrowser, sys |
|
6 |
+ |
|
7 |
+try: |
|
8 |
+ from urllib import pathname2url |
|
9 |
+except: |
|
10 |
+ from urllib.request import pathname2url |
|
11 |
+ |
|
12 |
+webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) |
|
13 |
+endef |
|
14 |
+export BROWSER_PYSCRIPT |
|
15 |
+ |
|
16 |
+define PRINT_HELP_PYSCRIPT |
|
17 |
+import re, sys |
|
18 |
+ |
|
19 |
+for line in sys.stdin: |
|
20 |
+ match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) |
|
21 |
+ if match: |
|
22 |
+ target, help = match.groups() |
|
23 |
+ print("%-20s %s" % (target, help)) |
|
24 |
+endef |
|
25 |
+export PRINT_HELP_PYSCRIPT |
|
26 |
+ |
|
27 |
+BROWSER := python -c "$$BROWSER_PYSCRIPT" |
|
28 |
+PIPENV := pipenv |
|
29 |
+PIPRUN := $(PIPENV) run |
|
30 |
+PIPINST := $(PIPENV) --bare install --dev |
|
31 |
+ |
|
32 |
+help: |
|
33 |
+ @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) |
|
34 |
+ |
|
35 |
+clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts |
|
36 |
+ make -C docs clean |
|
37 |
+ |
|
38 |
+clean-build: ## remove build artifacts |
|
39 |
+ rm -fr build/ |
|
40 |
+ rm -fr dist/ |
|
41 |
+ rm -fr .eggs/ |
|
42 |
+ find . -name '*.egg-info' -exec rm -fr {} + |
|
43 |
+ find . -name '*.egg' -exec rm -f {} + |
|
44 |
+ |
|
45 |
+clean-pyc: ## remove Python file artifacts |
|
46 |
+ find . -name '*.pyc' -exec rm -f {} + |
|
47 |
+ find . -name '*.pyo' -exec rm -f {} + |
|
48 |
+ find . -name '*~' -exec rm -f {} + |
|
49 |
+ find . -name '__pycache__' -exec rm -fr {} + |
|
50 |
+ $(PIPRUN) pip uninstall -y nncli |
|
51 |
+ |
|
52 |
+clean-test: ## remove test and coverage artifacts |
|
53 |
+ rm -f .coverage |
|
54 |
+ rm -fr htmlcov/ |
|
55 |
+ rm -fr .pytest_cache |
|
56 |
+ rm -fr .tox |
|
57 |
+ |
|
58 |
+lint: ## check style with pylint |
|
59 |
+ $(PIPRUN) pylint nncli tests --disable=parse-error |
|
60 |
+ |
|
61 |
+test: ## run tests quickly with the default Python |
|
62 |
+ $(PIPRUN) python -m pytest |
|
63 |
+ |
|
64 |
+test-all: ## run tests on every Python version with tox |
|
65 |
+ $(PIPRUN) tox |
|
66 |
+ |
|
67 |
+test-install: ## install dependenices from Pipfile (for tox / CI builds) |
|
68 |
+ $(PIPINST) |
|
69 |
+ |
|
70 |
+coverage: ## check code coverage quickly with the default Python |
|
71 |
+ $(PIPRUN) python -m pytest --cov=nncli |
|
72 |
+ |
|
73 |
+coverage-html: coverage ## generate an HTML report and open in browser |
|
74 |
+ $(PIPRUN) coverage html |
|
75 |
+ $(BROWSER) htmlcov/index.html |
|
76 |
+ |
|
77 |
+release: dist ## package and upload a release |
|
78 |
+ $(PIPRUN) flit publish |
|
79 |
+ |
|
80 |
+dist: ## builds source and wheel package |
|
81 |
+ $(PIPRUN) flit build |
|
82 |
+ ls -l dist |
|
83 |
+ |
|
84 |
+docs: ## builds the sphinx documentation and opens in the browser |
|
85 |
+ make -C docs html |
|
86 |
+ $(BROWSER) docs/build/html/index.html |
|
87 |
+ |
|
88 |
+install: ## install the package to the active Python's site-packages |
|
89 |
+ $(PIPRUN) flit install --deps=none |
|
90 |
+ |
|
91 |
+run: ## run the package from site-packages |
|
92 |
+ $(PIPRUN) python -m nncli $(cmd) |
|
93 |
+ |
|
94 |
+debug: install ## debug the package from site packages |
|
95 |
+ $(PIPRUN) pudb3 $$($(PIPRUN) which nncli) $(cmd) |
Pipfile
7 |
7 |
appdirs = "*" |
8 |
8 |
requests = "*" |
9 |
9 |
urwid = "*" |
10 |
|
-setuptools = "*" |
11 |
|
-setuptools-scm = "*" |
12 |
10 |
|
13 |
11 |
[dev-packages] |
14 |
12 |
pytest = "*" |
|
|
. . . |
17 |
15 |
pytest-runner = "*" |
18 |
16 |
pylint = "*" |
19 |
17 |
pudb = "*" |
|
18 |
+sphinx = "*" |
|
19 |
+flit = "*" |
|
20 |
+setuptools = "*" |
|
21 |
+mock = "*" |
|
22 |
+tox = "*" |
|
23 |
+pathlib2 = {version = "*", markers = "python_version < '3.5'"} |
|
24 |
+scandir = {version = "*", markers = "python_version < '3.5'"} |
Pipfile.lock
1 |
1 |
{ |
2 |
2 |
"_meta": { |
3 |
3 |
"hash": { |
4 |
|
- "sha256": "b4bc66838172733ffa35a5998d87982699b21d67eccdb8d913fffd8c7dcd101a" |
|
4 |
+ "sha256": "3dd4d429a27a82ab0f5daa11fb974392ab9f45ac6b20647762d79a1c4ab1bd55" |
5 |
5 |
}, |
6 |
6 |
"pipfile-spec": 6, |
7 |
7 |
"requires": {}, |
|
|
. . . |
51 |
51 |
"index": "pypi", |
52 |
52 |
"version": "==2.19.1" |
53 |
53 |
}, |
54 |
|
- "setuptools-scm": { |
55 |
|
- "hashes": [ |
56 |
|
- "sha256:1191f2a136b5e86f7ca8ab00a97ef7aef997131f1f6d4971be69a1ef387d8b40", |
57 |
|
- "sha256:cc6953d224a22f10e933fa2f55c95979317c55259016adcf93310ba2997febfa" |
58 |
|
- ], |
59 |
|
- "index": "pypi", |
60 |
|
- "version": "==3.1.0" |
61 |
|
- }, |
62 |
54 |
"urllib3": { |
63 |
55 |
"hashes": [ |
64 |
56 |
"sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf", |
65 |
57 |
"sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5" |
66 |
58 |
], |
67 |
|
- "markers": "python_version != '3.1.*' and python_version != '3.3.*' and python_version >= '2.6' and python_version != '3.0.*' and python_version != '3.2.*' and python_version < '4'", |
|
59 |
+ "markers": "python_version != '3.1.*' and python_version != '3.3.*' and python_version < '4' and python_version != '3.0.*' and python_version != '3.2.*' and python_version >= '2.6'", |
68 |
60 |
"version": "==1.23" |
69 |
61 |
}, |
70 |
62 |
"urwid": { |
|
|
. . . |
76 |
68 |
} |
77 |
69 |
}, |
78 |
70 |
"develop": { |
|
71 |
+ "alabaster": { |
|
72 |
+ "hashes": [ |
|
73 |
+ "sha256:674bb3bab080f598371f4443c5008cbfeb1a5e622dd312395d2d82af2c54c456", |
|
74 |
+ "sha256:b63b1f4dc77c074d386752ec4a8a7517600f6c0db8cd42980cae17ab7b3275d7" |
|
75 |
+ ], |
|
76 |
+ "version": "==0.7.11" |
|
77 |
+ }, |
79 |
78 |
"astroid": { |
80 |
79 |
"hashes": [ |
81 |
80 |
"sha256:292fa429e69d60e4161e7612cb7cc8fa3609e2e309f80c224d93a76d5e7b58be", |
|
|
. . . |
85 |
84 |
}, |
86 |
85 |
"atomicwrites": { |
87 |
86 |
"hashes": [ |
88 |
|
- "sha256:6b5282987b21cd79151f51caccead7a09d0a32e89c568bd9e3c4aaa7bbdf3f3a", |
89 |
|
- "sha256:e16334d50fe0f90919ef7339c24b9b62e6abaa78cd2d226f3d94eb067eb89043" |
|
87 |
+ "sha256:0312ad34fcad8fac3704d441f7b317e50af620823353ec657a53e981f92920c0", |
|
88 |
+ "sha256:ec9ae8adaae229e4f8446952d204a3e4b5fdd2d099f9be3aaf556120135fb3ee" |
90 |
89 |
], |
91 |
|
- "markers": "python_version != '3.2.*' and python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.3.*' and python_version != '3.0.*'", |
92 |
|
- "version": "==1.2.0" |
|
90 |
+ "markers": "python_version != '3.1.*' and python_version >= '2.7' and python_version != '3.0.*' and python_version != '3.2.*' and python_version != '3.3.*'", |
|
91 |
+ "version": "==1.2.1" |
93 |
92 |
}, |
94 |
93 |
"attrs": { |
95 |
94 |
"hashes": [ |
96 |
|
- "sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265", |
97 |
|
- "sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b" |
|
95 |
+ "sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69", |
|
96 |
+ "sha256:ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb" |
|
97 |
+ ], |
|
98 |
+ "version": "==18.2.0" |
|
99 |
+ }, |
|
100 |
+ "babel": { |
|
101 |
+ "hashes": [ |
|
102 |
+ "sha256:6778d85147d5d85345c14a26aada5e478ab04e39b078b0745ee6870c2b5cf669", |
|
103 |
+ "sha256:8cba50f48c529ca3fa18cf81fa9403be176d374ac4d60738b839122dfaaa3d23" |
|
104 |
+ ], |
|
105 |
+ "version": "==2.6.0" |
|
106 |
+ }, |
|
107 |
+ "certifi": { |
|
108 |
+ "hashes": [ |
|
109 |
+ "sha256:376690d6f16d32f9d1fe8932551d80b23e9d393a8578c5633a2ed39a64861638", |
|
110 |
+ "sha256:456048c7e371c089d0a77a5212fb37a2c2dce1e24146e3b7e0261736aaeaa22a" |
|
111 |
+ ], |
|
112 |
+ "version": "==2018.8.24" |
|
113 |
+ }, |
|
114 |
+ "chardet": { |
|
115 |
+ "hashes": [ |
|
116 |
+ "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", |
|
117 |
+ "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" |
98 |
118 |
], |
99 |
|
- "version": "==18.1.0" |
|
119 |
+ "version": "==3.0.4" |
100 |
120 |
}, |
101 |
121 |
"coverage": { |
102 |
122 |
"hashes": [ |
|
|
. . . |
132 |
152 |
"sha256:e05cb4d9aad6233d67e0541caa7e511fa4047ed7750ec2510d466e806e0255d6", |
133 |
153 |
"sha256:f3f501f345f24383c0000395b26b726e46758b71393267aeae0bd36f8b3ade80" |
134 |
154 |
], |
135 |
|
- "markers": "python_version < '4' and python_version != '3.2.*' and python_version != '3.0.*' and python_version != '3.1.*' and python_version >= '2.6'", |
|
155 |
+ "markers": "python_version >= '2.6' and python_version != '3.1.*' and python_version != '3.0.*' and python_version != '3.2.*' and python_version < '4'", |
136 |
156 |
"version": "==4.5.1" |
137 |
157 |
}, |
|
158 |
+ "docutils": { |
|
159 |
+ "hashes": [ |
|
160 |
+ "sha256:02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6", |
|
161 |
+ "sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274", |
|
162 |
+ "sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6" |
|
163 |
+ ], |
|
164 |
+ "version": "==0.14" |
|
165 |
+ }, |
|
166 |
+ "flit": { |
|
167 |
+ "hashes": [ |
|
168 |
+ "sha256:178e6865185b1802aa3b1944f4957d2c83fc56294dc8047d2c4722131f696e61", |
|
169 |
+ "sha256:da823d4acae9bda42dcc0c7ab1d9be475a8a47aae5fd6dde63841d9f430ccb2f" |
|
170 |
+ ], |
|
171 |
+ "index": "pypi", |
|
172 |
+ "version": "==1.1" |
|
173 |
+ }, |
|
174 |
+ "idna": { |
|
175 |
+ "hashes": [ |
|
176 |
+ "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e", |
|
177 |
+ "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16" |
|
178 |
+ ], |
|
179 |
+ "version": "==2.7" |
|
180 |
+ }, |
|
181 |
+ "imagesize": { |
|
182 |
+ "hashes": [ |
|
183 |
+ "sha256:3f349de3eb99145973fefb7dbe38554414e5c30abd0c8e4b970a7c9d09f3a1d8", |
|
184 |
+ "sha256:f3832918bc3c66617f92e35f5d70729187676313caa60c187eb0f28b8fe5e3b5" |
|
185 |
+ ], |
|
186 |
+ "markers": "python_version != '3.1.*' and python_version >= '2.7' and python_version != '3.0.*' and python_version != '3.2.*' and python_version != '3.3.*'", |
|
187 |
+ "version": "==1.1.0" |
|
188 |
+ }, |
138 |
189 |
"isort": { |
139 |
190 |
"hashes": [ |
140 |
191 |
"sha256:1153601da39a25b14ddc54955dbbacbb6b2d19135386699e2ad58517953b34af", |
141 |
192 |
"sha256:b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8", |
142 |
193 |
"sha256:ec9ef8f4a9bc6f71eec99e1806bfa2de401650d996c59330782b89a5555c1497" |
143 |
194 |
], |
144 |
|
- "markers": "python_version >= '2.7' and python_version != '3.3.*' and python_version != '3.2.*' and python_version != '3.0.*' and python_version != '3.1.*'", |
|
195 |
+ "markers": "python_version != '3.1.*' and python_version >= '2.7' and python_version != '3.0.*' and python_version != '3.2.*' and python_version != '3.3.*'", |
145 |
196 |
"version": "==4.3.4" |
146 |
197 |
}, |
|
198 |
+ "jinja2": { |
|
199 |
+ "hashes": [ |
|
200 |
+ "sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd", |
|
201 |
+ "sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4" |
|
202 |
+ ], |
|
203 |
+ "version": "==2.10" |
|
204 |
+ }, |
147 |
205 |
"lazy-object-proxy": { |
148 |
206 |
"hashes": [ |
149 |
207 |
"sha256:0ce34342b419bd8f018e6666bfef729aec3edf62345a53b537a4dcc115746a33", |
|
|
. . . |
178 |
236 |
], |
179 |
237 |
"version": "==1.3.1" |
180 |
238 |
}, |
|
239 |
+ "markupsafe": { |
|
240 |
+ "hashes": [ |
|
241 |
+ "sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665" |
|
242 |
+ ], |
|
243 |
+ "version": "==1.0" |
|
244 |
+ }, |
181 |
245 |
"mccabe": { |
182 |
246 |
"hashes": [ |
183 |
247 |
"sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", |
|
|
. . . |
185 |
249 |
], |
186 |
250 |
"version": "==0.6.1" |
187 |
251 |
}, |
|
252 |
+ "mock": { |
|
253 |
+ "hashes": [ |
|
254 |
+ "sha256:5ce3c71c5545b472da17b72268978914d0252980348636840bd34a00b5cc96c1", |
|
255 |
+ "sha256:b158b6df76edd239b8208d481dc46b6afd45a846b7812ff0ce58971cf5bc8bba" |
|
256 |
+ ], |
|
257 |
+ "index": "pypi", |
|
258 |
+ "version": "==2.0.0" |
|
259 |
+ }, |
188 |
260 |
"more-itertools": { |
189 |
261 |
"hashes": [ |
190 |
262 |
"sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092", |
|
|
. . . |
193 |
265 |
], |
194 |
266 |
"version": "==4.3.0" |
195 |
267 |
}, |
|
268 |
+ "packaging": { |
|
269 |
+ "hashes": [ |
|
270 |
+ "sha256:e9215d2d2535d3ae866c3d6efc77d5b24a0192cce0ff20e42896cc0664f889c0", |
|
271 |
+ "sha256:f019b770dd64e585a99714f1fd5e01c7a8f11b45635aa953fd41c689a657375b" |
|
272 |
+ ], |
|
273 |
+ "version": "==17.1" |
|
274 |
+ }, |
|
275 |
+ "pathlib2": { |
|
276 |
+ "hashes": [ |
|
277 |
+ "sha256:8eb170f8d0d61825e09a95b38be068299ddeda82f35e96c3301a8a5e7604cb83", |
|
278 |
+ "sha256:d1aa2a11ba7b8f7b21ab852b1fb5afb277e1bb99d5dfc663380b5015c0d80c5a" |
|
279 |
+ ], |
|
280 |
+ "index": "pypi", |
|
281 |
+ "markers": "python_version < '3.5'", |
|
282 |
+ "version": "==2.3.2" |
|
283 |
+ }, |
|
284 |
+ "pbr": { |
|
285 |
+ "hashes": [ |
|
286 |
+ "sha256:1b8be50d938c9bb75d0eaf7eda111eec1bf6dc88a62a6412e33bf077457e0f45", |
|
287 |
+ "sha256:b486975c0cafb6beeb50ca0e17ba047647f229087bd74e37f4a7e2cac17d2caa" |
|
288 |
+ ], |
|
289 |
+ "version": "==4.2.0" |
|
290 |
+ }, |
196 |
291 |
"pluggy": { |
197 |
292 |
"hashes": [ |
198 |
293 |
"sha256:6e3836e39f4d36ae72840833db137f7b7d35105079aee6ec4a62d9f80d594dd1", |
199 |
294 |
"sha256:95eb8364a4708392bae89035f45341871286a333f749c3141c20573d2b3876e1" |
200 |
295 |
], |
201 |
|
- "markers": "python_version != '3.0.*' and python_version != '3.2.*' and python_version != '3.1.*' and python_version != '3.3.*' and python_version >= '2.7'", |
|
296 |
+ "markers": "python_version != '3.1.*' and python_version >= '2.7' and python_version != '3.0.*' and python_version != '3.2.*' and python_version != '3.3.*'", |
202 |
297 |
"version": "==0.7.1" |
203 |
298 |
}, |
204 |
299 |
"pudb": { |
|
|
. . . |
213 |
308 |
"sha256:06a30435d058473046be836d3fc4f27167fd84c45b99704f2fb5509ef61f9af1", |
214 |
309 |
"sha256:50402e9d1c9005d759426988a492e0edaadb7f4e68bcddfea586bc7432d009c6" |
215 |
310 |
], |
216 |
|
- "markers": "python_version != '3.0.*' and python_version != '3.2.*' and python_version != '3.3.*' and python_version != '3.1.*' and python_version >= '2.7'", |
|
311 |
+ "markers": "python_version != '3.1.*' and python_version >= '2.7' and python_version != '3.0.*' and python_version != '3.2.*' and python_version != '3.3.*'", |
217 |
312 |
"version": "==1.6.0" |
218 |
313 |
}, |
219 |
314 |
"pygments": { |
|
|
. . . |
231 |
326 |
"index": "pypi", |
232 |
327 |
"version": "==2.1.1" |
233 |
328 |
}, |
|
329 |
+ "pyparsing": { |
|
330 |
+ "hashes": [ |
|
331 |
+ "sha256:0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04", |
|
332 |
+ "sha256:fee43f17a9c4087e7ed1605bd6df994c6173c1e977d7ade7b651292fab2bd010" |
|
333 |
+ ], |
|
334 |
+ "version": "==2.2.0" |
|
335 |
+ }, |
234 |
336 |
"pytest": { |
235 |
337 |
"hashes": [ |
236 |
|
- "sha256:2e7c330338b2732ddb992217962e3454aa7290434e75329b1a6739cea41bea6b", |
237 |
|
- "sha256:4abcd98faeea3eb95bd05aa6a7b121d5f89d72e4d36ddb0dcbbfd1ec9f3651d1" |
|
338 |
+ "sha256:2d7c49e931316cc7d1638a3e5f54f5d7b4e5225972b3c9838f3584788d27f349", |
|
339 |
+ "sha256:ad0c7db7b5d4081631e0155f5c61b80ad76ce148551aaafe3a718d65a7508b18" |
238 |
340 |
], |
239 |
341 |
"index": "pypi", |
240 |
|
- "version": "==3.7.3" |
|
342 |
+ "version": "==3.7.4" |
241 |
343 |
}, |
242 |
344 |
"pytest-cov": { |
243 |
345 |
"hashes": [ |
|
|
. . . |
263 |
365 |
"index": "pypi", |
264 |
366 |
"version": "==4.2" |
265 |
367 |
}, |
|
368 |
+ "pytoml": { |
|
369 |
+ "hashes": [ |
|
370 |
+ "sha256:dae3c4e31d09eb06a6076d671f2281ee5d2c43cbeae16599c3af20881bb818ac" |
|
371 |
+ ], |
|
372 |
+ "version": "==0.1.18" |
|
373 |
+ }, |
|
374 |
+ "pytz": { |
|
375 |
+ "hashes": [ |
|
376 |
+ "sha256:a061aa0a9e06881eb8b3b2b43f05b9439d6583c206d0a6c340ff72a7b6669053", |
|
377 |
+ "sha256:ffb9ef1de172603304d9d2819af6f5ece76f2e85ec10692a524dd876e72bf277" |
|
378 |
+ ], |
|
379 |
+ "version": "==2018.5" |
|
380 |
+ }, |
|
381 |
+ "requests": { |
|
382 |
+ "hashes": [ |
|
383 |
+ "sha256:63b52e3c866428a224f97cab011de738c36aec0185aa91cfacd418b5d58911d1", |
|
384 |
+ "sha256:ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a" |
|
385 |
+ ], |
|
386 |
+ "index": "pypi", |
|
387 |
+ "version": "==2.19.1" |
|
388 |
+ }, |
|
389 |
+ "requests-download": { |
|
390 |
+ "hashes": [ |
|
391 |
+ "sha256:92d895a6ca51ea51aa42bab864bddaee31b5601c7e7e1ade4c27b0eb6695d846", |
|
392 |
+ "sha256:994d9d332befae6616f562769bab163f08d6404dc7e28fb7bfed4a0a43a754ad" |
|
393 |
+ ], |
|
394 |
+ "version": "==0.1.2" |
|
395 |
+ }, |
|
396 |
+ "scandir": { |
|
397 |
+ "hashes": [ |
|
398 |
+ "sha256:04b8adb105f2ed313a7c2ef0f1cf7aff4871aa7a1883fa4d8c44b5551ab052d6", |
|
399 |
+ "sha256:1444134990356c81d12f30e4b311379acfbbcd03e0bab591de2696a3b126d58e", |
|
400 |
+ "sha256:1b5c314e39f596875e5a95dd81af03730b338c277c54a454226978d5ba95dbb6", |
|
401 |
+ "sha256:346619f72eb0ddc4cf355ceffd225fa52506c92a2ff05318cfabd02a144e7c4e", |
|
402 |
+ "sha256:44975e209c4827fc18a3486f257154d34ec6eaec0f90fef0cca1caa482db7064", |
|
403 |
+ "sha256:61859fd7e40b8c71e609c202db5b0c1dbec0d5c7f1449dec2245575bdc866792", |
|
404 |
+ "sha256:a5e232a0bf188362fa00123cc0bb842d363a292de7126126df5527b6a369586a", |
|
405 |
+ "sha256:c14701409f311e7a9b7ec8e337f0815baf7ac95776cc78b419a1e6d49889a383", |
|
406 |
+ "sha256:c7708f29d843fc2764310732e41f0ce27feadde453261859ec0fca7865dfc41b", |
|
407 |
+ "sha256:c9009c527929f6e25604aec39b0a43c3f831d2947d89d6caaab22f057b7055c8", |
|
408 |
+ "sha256:f5c71e29b4e2af7ccdc03a020c626ede51da471173b4a6ad1e904f2b2e04b4bd" |
|
409 |
+ ], |
|
410 |
+ "index": "pypi", |
|
411 |
+ "markers": "python_version < '3.5'", |
|
412 |
+ "version": "==1.9.0" |
|
413 |
+ }, |
266 |
414 |
"six": { |
267 |
415 |
"hashes": [ |
268 |
416 |
"sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", |
|
|
. . . |
270 |
418 |
], |
271 |
419 |
"version": "==1.11.0" |
272 |
420 |
}, |
|
421 |
+ "snowballstemmer": { |
|
422 |
+ "hashes": [ |
|
423 |
+ "sha256:919f26a68b2c17a7634da993d91339e288964f93c274f1343e3bbbe2096e1128", |
|
424 |
+ "sha256:9f3bcd3c401c3e862ec0ebe6d2c069ebc012ce142cce209c098ccb5b09136e89" |
|
425 |
+ ], |
|
426 |
+ "version": "==1.2.1" |
|
427 |
+ }, |
|
428 |
+ "sphinx": { |
|
429 |
+ "hashes": [ |
|
430 |
+ "sha256:a07050845cc9a2f4026a6035cc8ed795a5ce7be6528bbc82032385c10807dfe7", |
|
431 |
+ "sha256:d719de667218d763e8fd144b7fcfeefd8d434a6201f76bf9f0f0c1fa6f47fcdb" |
|
432 |
+ ], |
|
433 |
+ "index": "pypi", |
|
434 |
+ "version": "==1.7.8" |
|
435 |
+ }, |
|
436 |
+ "sphinxcontrib-websupport": { |
|
437 |
+ "hashes": [ |
|
438 |
+ "sha256:68ca7ff70785cbe1e7bccc71a48b5b6d965d79ca50629606c7861a21b206d9dd", |
|
439 |
+ "sha256:9de47f375baf1ea07cdb3436ff39d7a9c76042c10a769c52353ec46e4e8fc3b9" |
|
440 |
+ ], |
|
441 |
+ "markers": "python_version != '3.1.*' and python_version >= '2.7' and python_version != '3.0.*' and python_version != '3.2.*' and python_version != '3.3.*'", |
|
442 |
+ "version": "==1.1.0" |
|
443 |
+ }, |
|
444 |
+ "tox": { |
|
445 |
+ "hashes": [ |
|
446 |
+ "sha256:37cf240781b662fb790710c6998527e65ca6851eace84d1595ee71f7af4e85f7", |
|
447 |
+ "sha256:eb61aa5bcce65325538686f09848f04ef679b5cd9b83cc491272099b28739600" |
|
448 |
+ ], |
|
449 |
+ "index": "pypi", |
|
450 |
+ "version": "==3.2.1" |
|
451 |
+ }, |
|
452 |
+ "typed-ast": { |
|
453 |
+ "hashes": [ |
|
454 |
+ "sha256:0948004fa228ae071054f5208840a1e88747a357ec1101c17217bfe99b299d58", |
|
455 |
+ "sha256:10703d3cec8dcd9eef5a630a04056bbc898abc19bac5691612acba7d1325b66d", |
|
456 |
+ "sha256:1f6c4bd0bdc0f14246fd41262df7dfc018d65bb05f6e16390b7ea26ca454a291", |
|
457 |
+ "sha256:25d8feefe27eb0303b73545416b13d108c6067b846b543738a25ff304824ed9a", |
|
458 |
+ "sha256:29464a177d56e4e055b5f7b629935af7f49c196be47528cc94e0a7bf83fbc2b9", |
|
459 |
+ "sha256:2e214b72168ea0275efd6c884b114ab42e316de3ffa125b267e732ed2abda892", |
|
460 |
+ "sha256:3e0d5e48e3a23e9a4d1a9f698e32a542a4a288c871d33ed8df1b092a40f3a0f9", |
|
461 |
+ "sha256:519425deca5c2b2bdac49f77b2c5625781abbaf9a809d727d3a5596b30bb4ded", |
|
462 |
+ "sha256:57fe287f0cdd9ceaf69e7b71a2e94a24b5d268b35df251a88fef5cc241bf73aa", |
|
463 |
+ "sha256:668d0cec391d9aed1c6a388b0d5b97cd22e6073eaa5fbaa6d2946603b4871efe", |
|
464 |
+ "sha256:68ba70684990f59497680ff90d18e756a47bf4863c604098f10de9716b2c0bdd", |
|
465 |
+ "sha256:6de012d2b166fe7a4cdf505eee3aaa12192f7ba365beeefaca4ec10e31241a85", |
|
466 |
+ "sha256:79b91ebe5a28d349b6d0d323023350133e927b4de5b651a8aa2db69c761420c6", |
|
467 |
+ "sha256:8550177fa5d4c1f09b5e5f524411c44633c80ec69b24e0e98906dd761941ca46", |
|
468 |
+ "sha256:898f818399cafcdb93cbbe15fc83a33d05f18e29fb498ddc09b0214cdfc7cd51", |
|
469 |
+ "sha256:94b091dc0f19291adcb279a108f5d38de2430411068b219f41b343c03b28fb1f", |
|
470 |
+ "sha256:a26863198902cda15ab4503991e8cf1ca874219e0118cbf07c126bce7c4db129", |
|
471 |
+ "sha256:a8034021801bc0440f2e027c354b4eafd95891b573e12ff0418dec385c76785c", |
|
472 |
+ "sha256:bc978ac17468fe868ee589c795d06777f75496b1ed576d308002c8a5756fb9ea", |
|
473 |
+ "sha256:c05b41bc1deade9f90ddc5d988fe506208019ebba9f2578c622516fd201f5863", |
|
474 |
+ "sha256:c9b060bd1e5a26ab6e8267fd46fc9e02b54eb15fffb16d112d4c7b1c12987559", |
|
475 |
+ "sha256:edb04bdd45bfd76c8292c4d9654568efaedf76fe78eb246dde69bdb13b2dad87", |
|
476 |
+ "sha256:f19f2a4f547505fe9072e15f6f4ae714af51b5a681a97f187971f50c283193b6" |
|
477 |
+ ], |
|
478 |
+ "markers": "python_version < '3.7' and implementation_name == 'cpython'", |
|
479 |
+ "version": "==1.1.0" |
|
480 |
+ }, |
|
481 |
+ "typing": { |
|
482 |
+ "hashes": [ |
|
483 |
+ "sha256:4027c5f6127a6267a435201981ba156de91ad0d1d98e9ddc2aa173453453492d", |
|
484 |
+ "sha256:57dcf675a99b74d64dacf6fba08fb17cf7e3d5fdff53d4a30ea2a5e7e52543d4", |
|
485 |
+ "sha256:a4c8473ce11a65999c8f59cb093e70686b6c84c98df58c1dae9b3b196089858a" |
|
486 |
+ ], |
|
487 |
+ "markers": "python_version < '3.5'", |
|
488 |
+ "version": "==3.6.6" |
|
489 |
+ }, |
|
490 |
+ "urllib3": { |
|
491 |
+ "hashes": [ |
|
492 |
+ "sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf", |
|
493 |
+ "sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5" |
|
494 |
+ ], |
|
495 |
+ "markers": "python_version != '3.1.*' and python_version != '3.3.*' and python_version < '4' and python_version != '3.0.*' and python_version != '3.2.*' and python_version >= '2.6'", |
|
496 |
+ "version": "==1.23" |
|
497 |
+ }, |
273 |
498 |
"urwid": { |
274 |
499 |
"hashes": [ |
275 |
500 |
"sha256:644d3e3900867161a2fc9287a9762753d66bd194754679adb26aede559bcccbc" |
|
|
. . . |
277 |
502 |
"index": "pypi", |
278 |
503 |
"version": "==2.0.1" |
279 |
504 |
}, |
|
505 |
+ "virtualenv": { |
|
506 |
+ "hashes": [ |
|
507 |
+ "sha256:2ce32cd126117ce2c539f0134eb89de91a8413a29baac49cbab3eb50e2026669", |
|
508 |
+ "sha256:ca07b4c0b54e14a91af9f34d0919790b016923d157afda5efdde55c96718f752" |
|
509 |
+ ], |
|
510 |
+ "markers": "python_version >= '2.7' and python_version != '3.0.*' and python_version != '3.2.*' and python_version != '3.1.*'", |
|
511 |
+ "version": "==16.0.0" |
|
512 |
+ }, |
280 |
513 |
"wrapt": { |
281 |
514 |
"hashes": [ |
282 |
515 |
"sha256:d4d560d479f2c21e1b5443bbd15fe7ec4b37fe7e53d335d3b9b0a7b1226fe3c6" |
283 |
516 |
], |
284 |
517 |
"version": "==1.10.11" |
|
518 |
+ }, |
|
519 |
+ "zipfile36": { |
|
520 |
+ "hashes": [ |
|
521 |
+ "sha256:a78a8dddf4fa114f7fe73df76ffcce7538e23433b7a6a96c1c904023f122aead", |
|
522 |
+ "sha256:f7e48adf627f75cd74cdb50e7d850623b465f4cf5de913809196e8f3aa57dc4b" |
|
523 |
+ ], |
|
524 |
+ "markers": "python_version in '3.3 3.4 3.5'", |
|
525 |
+ "version": "==0.1.3" |
285 |
526 |
} |
286 |
527 |
} |
287 |
528 |
} |
README.md (deleted)
1 |
|
-nncli |
2 |
|
-===== |
3 |
|
- |
4 |
|
- |
5 |
|
-[](https://pypi.org/project/nncli/) |
6 |
|
- |
7 |
|
-NextCloud Notes Command Line Interface |
8 |
|
- |
9 |
|
-nncli is a Python application that gives you access to your NextCloud |
10 |
|
-Notes account via the command line. It's a "hard" fork of |
11 |
|
-[sncli](https://github.com/insanum/sncli). You can access your notes via |
12 |
|
-a customizable console GUI that implements vi-like keybinds or via a |
13 |
|
-simple command line interface that you can script. |
14 |
|
- |
15 |
|
-Notes can be viewed/created/edited in *both an* **online** *and* |
16 |
|
-**offline** *mode*. All changes are saved to a local cache on disk and |
17 |
|
-automatically sync'ed when nncli is brought online. |
18 |
|
- |
19 |
|
-**Pull requests are welcome!** |
20 |
|
- |
21 |
|
-Check your OS distribution for installation packages. |
22 |
|
- |
23 |
|
-### Requirements |
24 |
|
- |
25 |
|
-* [Python 3](http://python.org) |
26 |
|
-* [Urwid](http://urwid.org) Python 3 module |
27 |
|
-* [Requests](https://requests.readthedocs.org/en/master/) Python 3 |
28 |
|
- module |
29 |
|
-* A love for the command line! |
30 |
|
- |
31 |
|
-### Installation |
32 |
|
- |
33 |
|
-* Via pip (latest release): |
34 |
|
- - `pip3 install nncli` |
35 |
|
-* Manually: |
36 |
|
- - Clone this repository to your hard disk: `git clone |
37 |
|
- https://github.com/djmoch/nncli.git` |
38 |
|
- - Install _nncli_: `python3 setup.py install` |
39 |
|
-* Development: |
40 |
|
- - Clone the repo |
41 |
|
- - Install Pipenv: `pip install pipenv` |
42 |
|
- - Stand up development environment: `pipenv install --dev` |
43 |
|
- |
44 |
|
-### Features |
45 |
|
- |
46 |
|
-* Console GUI |
47 |
|
- - full two-way sync with NextCloud Notes performed dynamically in the |
48 |
|
- background |
49 |
|
- - all actions logged and easily reviewed |
50 |
|
- - list note titles (configurable format w/ title, date, flags, category, |
51 |
|
- keys, etc) |
52 |
|
- - sort notes by date, alpha by title, category, favorite on top |
53 |
|
- - search for notes using a Google style search pattern or Regular |
54 |
|
- Expression |
55 |
|
- - view note contents and meta data |
56 |
|
- - pipe note contents to external command |
57 |
|
- - create and edit notes (using your editor) |
58 |
|
- - edit note category |
59 |
|
- - delete notes |
60 |
|
- - favorite/unfavorite notes |
61 |
|
- - vi-like keybinds (fully configurable) |
62 |
|
- - Colors! (fully configurable) |
63 |
|
-* Command Line (scripting) |
64 |
|
- - force a full two-way sync with NextCloud Notes |
65 |
|
- - all actions logged and easily reviewed |
66 |
|
- - list note titles and keys |
67 |
|
- - search for notes using a Google style search pattern or Regular |
68 |
|
- Expression |
69 |
|
- - dump note contents |
70 |
|
- - create a new note (via stdin or editor) |
71 |
|
- - import a note with raw json data (stdin or editor) |
72 |
|
- - edit a note (via editor) |
73 |
|
- - delete a note |
74 |
|
- - favorite/unfavorite a note |
75 |
|
- - view and edit note category |
76 |
|
- |
77 |
|
-### HowTo |
78 |
|
- |
79 |
|
-``` |
80 |
|
-Usage: |
81 |
|
- nncli [OPTIONS] [COMMAND] [COMMAND_ARGS] |
82 |
|
- |
83 |
|
- OPTIONS: |
84 |
|
- -h, --help - usage help |
85 |
|
- -v, --verbose - verbose output |
86 |
|
- -n, --nosync - don't perform a server sync |
87 |
|
- -r, --regex - search string is a regular expression |
88 |
|
- -k <key>, --key=<key> - note key |
89 |
|
- -t <title>, --title=<title> - title of note for create (cli mode) |
90 |
|
- -c <file>, --config=<file> - config file to read from |
91 |
|
- --version - version information |
92 |
|
- |
93 |
|
- COMMANDS: |
94 |
|
- <none> - console gui mode when no command specified |
95 |
|
- sync - perform a full sync with the server |
96 |
|
- list [search_string] - list notes (refined with search string) |
97 |
|
- export [search_string] - export notes in JSON (refined with search string) |
98 |
|
- dump [search_string] - dump notes (refined with search string) |
99 |
|
- create [-] - create a note ('-' content from stdin) |
100 |
|
- import [-] - import a note in JSON format ('-' JSON from stdin) |
101 |
|
- export - export a note in JSON format (specified by <key>) |
102 |
|
- dump - dump a note (specified by <key>) |
103 |
|
- edit - edit a note (specified by <key>) |
104 |
|
- delete - delete a note (specified by <key>) |
105 |
|
- < favorite | unfavorite > - favorite/unfavorite a note (specified by <key>) |
106 |
|
- cat get - retrieve the category from a note (specified by <key>) |
107 |
|
- cat set <category> - set the category for a note (specified by <key>) |
108 |
|
- cat rm - remove category from a note (specified by <key>) |
109 |
|
-``` |
110 |
|
- |
111 |
|
-#### Configuration |
112 |
|
- |
113 |
|
-The current NextCloud Notes API does not support oauth authentication so |
114 |
|
-your NextCloud Notes account password must be stored someplace |
115 |
|
-accessible to nncli. Use of the `cfg_nn_password_eval` option is |
116 |
|
-recommended (see below). |
117 |
|
- |
118 |
|
-nncli pulls in configuration from the `config` file located in the |
119 |
|
-standard location for your platform. At the very least, the following |
120 |
|
-example `config` will get you going (using your account information): |
121 |
|
- |
122 |
|
-``` |
123 |
|
-[nncli] |
124 |
|
-cfg_nn_username = lebowski@thedude.com |
125 |
|
-cfg_nn_password = nihilist |
126 |
|
-cfg_nn_host = nextcloud.thedude.com |
127 |
|
-``` |
128 |
|
- |
129 |
|
-Start nncli with no arguments which starts the console GUI mode. nncli |
130 |
|
-will begin to sync your existing notes and you'll see log messages at |
131 |
|
-the bottom of the console. You can view these log messages at any time |
132 |
|
-by pressing the `l` key. |
133 |
|
- |
134 |
|
-View the help by pressing `h`. Here you'll see all the keybinds and |
135 |
|
-configuration items. The middle column shows the config name that can be |
136 |
|
-used in your `config` to override the default setting. |
137 |
|
- |
138 |
|
-See example configuration file below for more notes. |
139 |
|
- |
140 |
|
-``` |
141 |
|
-[nncli] |
142 |
|
-cfg_nn_username = lebowski@thedude.com |
143 |
|
-cfg_nn_password = nihilist |
144 |
|
-cfg_nn_host = nextcloud.thedude.com |
145 |
|
- |
146 |
|
-# as an alternate to cfg_nn_password you could use the following config item |
147 |
|
-# any shell command can be used; its stdout is used for the password |
148 |
|
-# trailing newlines are stripped for ease of use |
149 |
|
-# note: if both password config are given, cfg_nn_password will be used |
150 |
|
-cfg_nn_password_eval = gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.nncli-pass.gpg |
151 |
|
- |
152 |
|
-# see http://urwid.org/manual/userinput.html for examples of more key |
153 |
|
-# combinations |
154 |
|
-kb_edit_note = space |
155 |
|
-kb_page_down = ctrl f |
156 |
|
- |
157 |
|
-# note that values must not be quoted |
158 |
|
-clr_note_focus_bg = light blue |
159 |
|
- |
160 |
|
-# if this editor config value is not provided, the $EDITOR env var will be |
161 |
|
-# used instead |
162 |
|
-# warning: if neither $EDITOR or cfg_editor is set, it will be impossible to |
163 |
|
-# edit notes |
164 |
|
-cfg_editor = nvim |
165 |
|
- |
166 |
|
-# alternatively, {fname} and/or {line} are substituted with the filename and |
167 |
|
-# current line number in nncli's pager. |
168 |
|
-# If {fname} isn't supplied, the filename is simply appended. |
169 |
|
-# examples: |
170 |
|
-cfg_editor = nvim {fname} +{line} |
171 |
|
-cfg_editor = nano +{line} |
172 |
|
- |
173 |
|
-# this is also supported for the pager: |
174 |
|
-cfg_pager = less -c +{line} -N {fname} |
175 |
|
-``` |
176 |
|
- |
177 |
|
-#### Note Title Format |
178 |
|
- |
179 |
|
-The format of each line in the note list is driven by the |
180 |
|
-`cfg_format_note_title` config item. Various formatting tags are |
181 |
|
-supported for dynamically building the title string. Each of these |
182 |
|
-formatting tags supports a width specifier (decimal) and a left |
183 |
|
-justification (-) like that supported by printf: |
184 |
|
- |
185 |
|
-``` |
186 |
|
-%F - flags (fixed 5 char width) |
187 |
|
- X - needs sync |
188 |
|
- * - favorited |
189 |
|
-%T - category |
190 |
|
-%D - date |
191 |
|
-%N - title |
192 |
|
-``` |
193 |
|
- |
194 |
|
-The default note title format pushes the note category to the far right of |
195 |
|
-the terminal and left justifies the note title after the date and flags: |
196 |
|
- |
197 |
|
-``` cfg_format_note_title = '[%D] %F %-N %T' ``` |
198 |
|
- |
199 |
|
-Note that the `%D` date format is further defined by the strftime format |
200 |
|
-specified in `cfg_format_strftime`. |
201 |
|
- |
202 |
|
-#### Colors |
203 |
|
- |
204 |
|
-nncli utilizes the Python [Uwrid](http://urwid.org) module to implement |
205 |
|
-the console user interface. |
206 |
|
- |
207 |
|
-At this time, nncli does not yet support 256-color terminals and is |
208 |
|
-limited to just 16-colors. Color names that can be specified in the |
209 |
|
-`config` file are listed |
210 |
|
-[here](http://urwid.org/manual/displayattributes.html#standard-foreground-colors). |
211 |
|
- |
212 |
|
-### Searching |
213 |
|
- |
214 |
|
-nncli supports two styles of search strings. First is a Google style |
215 |
|
-search string and second is a Regular Expression. |
216 |
|
- |
217 |
|
-A Google style search string is a group of tokens (separated by spaces) |
218 |
|
-with an implied *AND* between each token. This style search is case |
219 |
|
-insensitive. For example: |
220 |
|
- |
221 |
|
-`/category:category1 category:category2 word1 "word2 word3" category:category3` |
222 |
|
- |
223 |
|
-Regular expression searching also supports the use of flags (currently |
224 |
|
-only case-insensitive) by adding a final forward slash followed by the |
225 |
|
-flags. The following example will do a case-insensitive search for |
226 |
|
-`something`: |
227 |
|
- |
228 |
|
-`(regex) /something/i` |
229 |
|
- |
230 |
|
-### Creating from command line |
231 |
|
- |
232 |
|
-``` |
233 |
|
-# create a new note and open in editor |
234 |
|
-nncli create |
235 |
|
- |
236 |
|
-# create a new note with contents of stdin |
237 |
|
-echo 'hi' | nncli create - |
238 |
|
-``` |
239 |
|
- |
240 |
|
-### Importing |
241 |
|
- |
242 |
|
-nncli can import notes from raw json data (via stdin or editor). For |
243 |
|
-example: |
244 |
|
- |
245 |
|
-`echo '{"category":"testing","content":"New note!"}' | nncli import - ` |
246 |
|
- |
247 |
|
-Allowed fields are `content`, `category`, `favorite`, and `modified` |
248 |
|
- |
249 |
|
-### Exporting |
250 |
|
- |
251 |
|
-nncli can export notes as json data to stdout. Example: |
252 |
|
- |
253 |
|
-``` |
254 |
|
-# export a single note by id |
255 |
|
-nncli -k somekeyid export |
256 |
|
- |
257 |
|
-# export all notes |
258 |
|
-nncli export |
259 |
|
- |
260 |
|
-# export notes matching search string |
261 |
|
-nncli [-r] export some search keywords or regex |
262 |
|
-``` |
263 |
|
- |
264 |
|
-Note that nncli still stores all the notes data in the directory |
265 |
|
-specified by `cfg_db_path`, so for easy backups, it may be |
266 |
|
-easier/quicker to simply backup this entire directory. |
267 |
|
- |
268 |
|
-### Category |
269 |
|
- |
270 |
|
-Note category can be modified directly from the command line. Example: |
271 |
|
- |
272 |
|
-``` |
273 |
|
-# Retrieve note category (e.g. "category1") |
274 |
|
-nncli -k somekeyid cat get |
275 |
|
-# Returns "category1" |
276 |
|
- |
277 |
|
-# Add a category to a note, overwriting any existing one |
278 |
|
-nncli -k somekeyid cat set "category3" |
279 |
|
-# Now tagged as "category3" |
280 |
|
- |
281 |
|
-# Remove a category from a note |
282 |
|
-nncli -k somekeyid cat rm |
283 |
|
-# Note now has no category |
284 |
|
-``` |
285 |
|
-### Tricks |
286 |
|
- |
287 |
|
-Advanced text editors usually tailor their behavior based on the file |
288 |
|
-type being edited. For such editors, notes opened through nncli should |
289 |
|
-be treated as Markdown by default. However, you can change this |
290 |
|
-on a per-note basis through the use of modelines. In Vim, for instance, |
291 |
|
-a modeline is a comment line conforming to the pattern below. |
292 |
|
- |
293 |
|
-``` ; vim:ft=votl ``` |
294 |
|
- |
295 |
|
-Now when I edit this note Vim will automatically load the votl plugin. |
296 |
|
-Lots of possibilities here... |
297 |
|
- |
298 |
|
-### Thanks |
299 |
|
- |
300 |
|
-nncli is a fork of [sncli](https://github.com/insanum/sncli) by |
301 |
|
-[insanum](https://github.com/insanum). This application further pulls in |
302 |
|
-and uses modified versions of the |
303 |
|
-[simplenote.py](https://github.com/mrtazz/simplenote.py) module by |
304 |
|
-[mrtazz](https://github.com/mrtazz) and the |
305 |
|
-[notes_db.py](https://github.com/cpbotha/nvpy/blob/master/nvpy/notes_db.py) |
306 |
|
-module from [nvpy](https://github.com/cpbotha/nvpy) by |
307 |
|
-[cpbotha](https://github.com/cpbotha). |
README.rst (created)
|
1 |
+.. image:: https://img.shields.io/pypi/l/nncli.svg |
|
2 |
+ :alt: PyPI - License |
|
3 |
+.. image:: https://img.shields.io/travis/com/djmoch/nncli.svg |
|
4 |
+ :alt: Travis (.com) |
|
5 |
+ :target: https://travis-ci.com/djmoch/nncli |
|
6 |
+.. image:: https://img.shields.io/pypi/v/nncli.svg |
|
7 |
+ :alt: PyPI |
|
8 |
+ :target: https://pypi.org/project/nncli |
|
9 |
+.. image:: https://img.shields.io/coveralls/github/djmoch/nncli.svg |
|
10 |
+ :alt: Coveralls github |
|
11 |
+ :target: https://coveralls.io/github/djmoch/nncli |
|
12 |
+.. image:: https://img.shields.io/readthedocs/nncli.svg |
|
13 |
+ :alt: Read the Docs |
|
14 |
+ :target: https://nncli.readthedocs.io |
|
15 |
+ |
|
16 |
+nncli is a Python application that gives you access to your NextCloud |
|
17 |
+Notes account via the command line. It's a "hard" fork of |
|
18 |
+sncli_. You can access your notes via |
|
19 |
+a customizable console GUI that implements vi-like keybinds or via a |
|
20 |
+simple command line interface that you can script. |
|
21 |
+ |
|
22 |
+Notes can be viewed/created/edited in *both an* **online** *and* |
|
23 |
+**offline** *mode*. All changes are saved to a local cache on disk and |
|
24 |
+automatically sync'ed when nncli is brought online. |
|
25 |
+ |
|
26 |
+More detailed documentation can be found in the docs. |
|
27 |
+ |
|
28 |
+Requirements |
|
29 |
+~~~~~~~~~~~~ |
|
30 |
+ |
|
31 |
+- `Python 3`_ |
|
32 |
+ |
|
33 |
+- Urwid_ Python 3 module |
|
34 |
+ |
|
35 |
+- Requests_ Python 3 module |
|
36 |
+ |
|
37 |
+- A love for the command line! |
|
38 |
+ |
|
39 |
+Installation |
|
40 |
+~~~~~~~~~~~~ |
|
41 |
+ |
|
42 |
+- Via pip (latest release): |
|
43 |
+ |
|
44 |
+ - ``pip3 install nncli`` |
|
45 |
+ |
|
46 |
+- Manually: |
|
47 |
+ |
|
48 |
+ - Clone this repository to your hard disk: ``git clone |
|
49 |
+ https://github.com/djmoch/nncli.git`` |
|
50 |
+ |
|
51 |
+ - Install nncli: ``python3 setup.py install`` |
|
52 |
+ |
|
53 |
+- Development: |
|
54 |
+ |
|
55 |
+ - Clone the repo |
|
56 |
+ |
|
57 |
+ - Install Pipenv: ``pip install pipenv`` |
|
58 |
+ |
|
59 |
+ - Stand up development environment: ``pipenv install --dev`` |
|
60 |
+ |
|
61 |
+Features |
|
62 |
+~~~~~~~~ |
|
63 |
+ |
|
64 |
+- Console GUI |
|
65 |
+ |
|
66 |
+ - full two-way sync with NextCloud Notes performed dynamically in the |
|
67 |
+ background |
|
68 |
+ |
|
69 |
+ - all actions logged and easily reviewed |
|
70 |
+ |
|
71 |
+ - list note titles (configurable format w/ title, date, flags, category, |
|
72 |
+ keys, etc) |
|
73 |
+ |
|
74 |
+ - sort notes by date, alpha by title, category, favorite on top |
|
75 |
+ |
|
76 |
+ - search for notes using a Google style search pattern or Regular |
|
77 |
+ Expression |
|
78 |
+ |
|
79 |
+ - view note contents and meta data |
|
80 |
+ |
|
81 |
+ - pipe note contents to external command |
|
82 |
+ |
|
83 |
+ - create and edit notes (using your editor) |
|
84 |
+ |
|
85 |
+ - edit note category |
|
86 |
+ |
|
87 |
+ - delete notes |
|
88 |
+ |
|
89 |
+ - favorite/unfavorite notes |
|
90 |
+ |
|
91 |
+ - vi-like keybinds (fully configurable) |
|
92 |
+ |
|
93 |
+ - Colors! (fully configurable) |
|
94 |
+ |
|
95 |
+- Command Line (scripting) |
|
96 |
+ |
|
97 |
+ - force a full two-way sync with NextCloud Notes |
|
98 |
+ |
|
99 |
+ - all actions logged and easily reviewed |
|
100 |
+ |
|
101 |
+ - list note titles and keys |
|
102 |
+ |
|
103 |
+ - search for notes using a Google style search pattern or Regular |
|
104 |
+ Expression |
|
105 |
+ |
|
106 |
+ - dump note contents |
|
107 |
+ |
|
108 |
+ - create a new note (via stdin or editor) |
|
109 |
+ |
|
110 |
+ - import a note with raw json data (stdin or editor) |
|
111 |
+ |
|
112 |
+ - edit a note (via editor) |
|
113 |
+ |
|
114 |
+ - delete a note |
|
115 |
+ |
|
116 |
+ - favorite/unfavorite a note |
|
117 |
+ |
|
118 |
+ - view and edit note category |
|
119 |
+ |
|
120 |
+Acknowledgements |
|
121 |
+~~~~~~~~~~~~~~~~ |
|
122 |
+ |
|
123 |
+nncli is a fork of sncli_ by Eric Davis. This application further pulls in |
|
124 |
+and uses modified versions of the simplenote.py_ module by Daniel Schauenberg and |
|
125 |
+the notes_db.py module from nvpy_ by Charl P. Botha. |
|
126 |
+ |
|
127 |
+.. _sncli: https://github.com/insanum/sncli |
|
128 |
+.. _Python 3: http://python.org |
|
129 |
+.. _Urwid: http://urwid.org |
|
130 |
+.. _Requests: https://requests.readthedocs.org/en/master |
|
131 |
+.. _simplenote.py: https://github.com/mrtazz/simplenote.py |
|
132 |
+.. _nvpy: https://github.com/cpbotha/nvpy |
docs/Makefile (created)
|
1 |
+# Minimal makefile for Sphinx documentation |
|
2 |
+# |
|
3 |
+ |
|
4 |
+# You can set these variables from the command line. |
|
5 |
+SPHINXOPTS = |
|
6 |
+SPHINXBUILD = pipenv run sphinx-build |
|
7 |
+SPHINXPROJ = nncli |
|
8 |
+SOURCEDIR = source |
|
9 |
+BUILDDIR = build |
|
10 |
+ |
|
11 |
+# Put it first so that "make" without argument is like "make help". |
|
12 |
+help: |
|
13 |
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
|
14 |
+ |
|
15 |
+.PHONY: help Makefile |
|
16 |
+ |
|
17 |
+# Catch-all target: route all unknown targets to Sphinx using the new |
|
18 |
+# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). |
|
19 |
+%: Makefile |
|
20 |
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
docs/source/conf.py (created)
|
1 |
+# -*- coding: utf-8 -*- |
|
2 |
+# |
|
3 |
+# Configuration file for the Sphinx documentation builder. |
|
4 |
+# |
|
5 |
+# This file does only contain a selection of the most common options. For a |
|
6 |
+# full list see the documentation: |
|
7 |
+# http://www.sphinx-doc.org/en/master/config |
|
8 |
+ |
|
9 |
+# -- Path setup -------------------------------------------------------------- |
|
10 |
+ |
|
11 |
+# If extensions (or modules to document with autodoc) are in another directory, |
|
12 |
+# add these directories to sys.path here. If the directory is relative to the |
|
13 |
+# documentation root, use os.path.abspath to make it absolute, like shown here. |
|
14 |
+# |
|
15 |
+import os |
|
16 |
+import sys |
|
17 |
+sys.path.insert(0, os.path.abspath(os.path.sep.join(['..', '..']))) |
|
18 |
+import nncli |
|
19 |
+ |
|
20 |
+# -- Project information ----------------------------------------------------- |
|
21 |
+ |
|
22 |
+project = 'nncli' |
|
23 |
+copyright = '2018, Daniel Moch' |
|
24 |
+author = 'Daniel Moch' |
|
25 |
+ |
|
26 |
+# The short X.Y version |
|
27 |
+version = nncli.__version__ |
|
28 |
+# The full version, including alpha/beta/rc tags |
|
29 |
+release = nncli.__version__ |
|
30 |
+ |
|
31 |
+ |
|
32 |
+# -- General configuration --------------------------------------------------- |
|
33 |
+ |
|
34 |
+# If your documentation needs a minimal Sphinx version, state it here. |
|
35 |
+# |
|
36 |
+# needs_sphinx = '1.0' |
|
37 |
+ |
|
38 |
+# Add any Sphinx extension module names here, as strings. They can be |
|
39 |
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
|
40 |
+# ones. |
|
41 |
+extensions = [ |
|
42 |
+ 'sphinx.ext.autodoc', |
|
43 |
+ 'sphinx.ext.todo', |
|
44 |
+ 'sphinx.ext.intersphinx', |
|
45 |
+] |
|
46 |
+ |
|
47 |
+# Add any paths that contain templates here, relative to this directory. |
|
48 |
+templates_path = ['.templates'] |
|
49 |
+ |
|
50 |
+# The suffix(es) of source filenames. |
|
51 |
+# You can specify multiple suffix as a list of string: |
|
52 |
+# |
|
53 |
+# source_suffix = ['.rst', '.md'] |
|
54 |
+source_suffix = '.rst' |
|
55 |
+ |
|
56 |
+# The master toctree document. |
|
57 |
+master_doc = 'index' |
|
58 |
+ |
|
59 |
+# The language for content autogenerated by Sphinx. Refer to documentation |
|
60 |
+# for a list of supported languages. |
|
61 |
+# |
|
62 |
+# This is also used if you do content translation via gettext catalogs. |
|
63 |
+# Usually you set "language" from the command line for these cases. |
|
64 |
+language = None |
|
65 |
+ |
|
66 |
+# List of patterns, relative to source directory, that match files and |
|
67 |
+# directories to ignore when looking for source files. |
|
68 |
+# This pattern also affects html_static_path and html_extra_path . |
|
69 |
+exclude_patterns = [] |
|
70 |
+ |
|
71 |
+# The name of the Pygments (syntax highlighting) style to use. |
|
72 |
+pygments_style = 'sphinx' |
|
73 |
+ |
|
74 |
+ |
|
75 |
+# -- Options for HTML output ------------------------------------------------- |
|
76 |
+ |
|
77 |
+# The theme to use for HTML and HTML Help pages. See the documentation for |
|
78 |
+# a list of builtin themes. |
|
79 |
+# |
|
80 |
+html_theme = 'default' |
|
81 |
+ |
|
82 |
+# Theme options are theme-specific and customize the look and feel of a theme |
|
83 |
+# further. For a list of options available for each theme, see the |
|
84 |
+# documentation. |
|
85 |
+# |
|
86 |
+# html_theme_options = {} |
|
87 |
+ |
|
88 |
+# Add any paths that contain custom static files (such as style sheets) here, |
|
89 |
+# relative to this directory. They are copied after the builtin static files, |
|
90 |
+# so a file named "default.css" will overwrite the builtin "default.css". |
|
91 |
+html_static_path = ['.static'] |
|
92 |
+ |
|
93 |
+# Custom sidebar templates, must be a dictionary that maps document names |
|
94 |
+# to template names. |
|
95 |
+# |
|
96 |
+# The default sidebars (for documents that don't match any pattern) are |
|
97 |
+# defined by theme itself. Builtin themes are using these templates by |
|
98 |
+# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', |
|
99 |
+# 'searchbox.html']``. |
|
100 |
+# |
|
101 |
+# html_sidebars = {} |
|
102 |
+ |
|
103 |
+ |
|
104 |
+# -- Options for HTMLHelp output --------------------------------------------- |
|
105 |
+ |
|
106 |
+# Output file base name for HTML help builder. |
|
107 |
+htmlhelp_basename = 'nnclidoc' |
|
108 |
+ |
|
109 |
+ |
|
110 |
+# -- Options for LaTeX output ------------------------------------------------ |
|
111 |
+ |
|
112 |
+latex_elements = { |
|
113 |
+ # The paper size ('letterpaper' or 'a4paper'). |
|
114 |
+ # |
|
115 |
+ # 'papersize': 'letterpaper', |
|
116 |
+ |
|
117 |
+ # The font size ('10pt', '11pt' or '12pt'). |
|
118 |
+ # |
|
119 |
+ # 'pointsize': '10pt', |
|
120 |
+ |
|
121 |
+ # Additional stuff for the LaTeX preamble. |
|
122 |
+ # |
|
123 |
+ # 'preamble': '', |
|
124 |
+ |
|
125 |
+ # Latex figure (float) alignment |
|
126 |
+ # |
|
127 |
+ # 'figure_align': 'htbp', |
|
128 |
+} |
|
129 |
+ |
|
130 |
+# Grouping the document tree into LaTeX files. List of tuples |
|
131 |
+# (source start file, target name, title, |
|
132 |
+# author, documentclass [howto, manual, or own class]). |
|
133 |
+latex_documents = [ |
|
134 |
+ (master_doc, 'nncli.tex', 'nncli Documentation', |
|
135 |
+ 'Daniel Moch', 'manual'), |
|
136 |
+] |
|
137 |
+ |
|
138 |
+ |
|
139 |
+# -- Options for manual page output ------------------------------------------ |
|
140 |
+ |
|
141 |
+# One entry per manual page. List of tuples |
|
142 |
+# (source start file, name, description, authors, manual section). |
|
143 |
+man_pages = [ |
|
144 |
+ (master_doc, 'nncli', 'nncli Documentation', |
|
145 |
+ [author], 1) |
|
146 |
+] |
|
147 |
+ |
|
148 |
+ |
|
149 |
+# -- Options for Texinfo output ---------------------------------------------- |
|
150 |
+ |
|
151 |
+# Grouping the document tree into Texinfo files. List of tuples |
|
152 |
+# (source start file, target name, title, author, |
|
153 |
+# dir menu entry, description, category) |
|
154 |
+texinfo_documents = [ |
|
155 |
+ (master_doc, 'nncli', 'nncli Documentation', |
|
156 |
+ author, 'nncli', 'One line description of project.', |
|
157 |
+ 'Miscellaneous'), |
|
158 |
+] |
|
159 |
+ |
|
160 |
+ |
|
161 |
+# -- Extension configuration ------------------------------------------------- |
|
162 |
+ |
|
163 |
+# -- Options for intersphinx extension --------------------------------------- |
|
164 |
+intersphinx_mapping = {'python': ('https://docs.python.org/3', None), |
|
165 |
+ 'urwid': ('http://urwid.org', None)} |
|
166 |
+ |
|
167 |
+# -- Options for todo extension ---------------------------------------------- |
|
168 |
+ |
|
169 |
+# If true, `todo` and `todoList` produce output, else they produce nothing. |
|
170 |
+todo_include_todos = True |
|
171 |
+ |
|
172 |
+# -- Extension interface ----------------------------------------------------- |
|
173 |
+def setup(app): |
|
174 |
+ app.add_object_type('confval', 'confval', |
|
175 |
+ objname='configuration value', |
|
176 |
+ indextemplate='pair: %s; configuration value') |
docs/source/configuration.rst (created)
|
1 |
+.. _configuration: |
|
2 |
+ |
|
3 |
+Configuration |
|
4 |
+============= |
|
5 |
+ |
|
6 |
+The current NextCloud Notes API does not support oauth authentication so |
|
7 |
+your NextCloud Notes account password must be stored someplace |
|
8 |
+accessible to nncli. Use of the ``cfg_nn_password_eval`` option is |
|
9 |
+recommended (see :ref:`config-file`). |
|
10 |
+ |
|
11 |
+.. index:: single: configuration file |
|
12 |
+ |
|
13 |
+.. _config-file: |
|
14 |
+ |
|
15 |
+Configuration File |
|
16 |
+------------------ |
|
17 |
+ |
|
18 |
+nncli pulls in configuration from the ``config`` file located in the |
|
19 |
+standard location for your platform. |
|
20 |
+ |
|
21 |
+- Windows: ``%USERPROFILE%\AppData\Local\djmoch\nncli`` |
|
22 |
+ |
|
23 |
+- macOS: ``~/Library/Preferences/nncli`` |
|
24 |
+ |
|
25 |
+- \*nix: ``$XDG_CONFIG_HOME/nncli/config`` or |
|
26 |
+ ``$HOME/.config/nncli/config`` |
|
27 |
+ |
|
28 |
+The following directives are accepted within the ``config`` file: |
|
29 |
+ |
|
30 |
+.. index:: pair: configuration file; general options |
|
31 |
+ |
|
32 |
+General Options |
|
33 |
+~~~~~~~~~~~~~~~ |
|
34 |
+ |
|
35 |
+.. confval:: cfg_nn_host |
|
36 |
+ |
|
37 |
+ Sets the URL of the NextCloud instance to connect to. |
|
38 |
+ |
|
39 |
+ Required. |
|
40 |
+ |
|
41 |
+.. confval:: cfg_nn_username |
|
42 |
+ |
|
43 |
+ The user name to log in as. |
|
44 |
+ |
|
45 |
+ Required. |
|
46 |
+ |
|
47 |
+.. confval:: cfg_nn_password |
|
48 |
+ |
|
49 |
+ The password to use for log in. |
|
50 |
+ |
|
51 |
+ Optional. Overrides :confval:`cfg_nn_password_eval` if both are |
|
52 |
+ specified. |
|
53 |
+ |
|
54 |
+.. confval:: cfg_nn_password_eval |
|
55 |
+ |
|
56 |
+ A command to run to retrieve the password. The command should return |
|
57 |
+ the password on ``stdout``. |
|
58 |
+ |
|
59 |
+ Optional. Required if :confval:`cfg_nn_password` is not specified. |
|
60 |
+ |
|
61 |
+.. confval:: cfg_db_path |
|
62 |
+ |
|
63 |
+ Specifies the path of the local notes cache. |
|
64 |
+ |
|
65 |
+ Optional. Default value: |
|
66 |
+ |
|
67 |
+ - Windows: ``%USERPROFILE%\AppData\Local\djmoch\nncli\Cache`` |
|
68 |
+ |
|
69 |
+ - macOS: ``~/Library/Caches/nncli`` |
|
70 |
+ |
|
71 |
+ - \*nix: ``~/.cache/nncli`` |
|
72 |
+ |
|
73 |
+.. confval:: cfg_search_categories |
|
74 |
+ |
|
75 |
+ Set to ``yes`` to include categories in searches. Otherwise set to |
|
76 |
+ ``no``. |
|
77 |
+ |
|
78 |
+ Optional. Default value: ``yes`` |
|
79 |
+ |
|
80 |
+.. confval:: cfg_sort_mode |
|
81 |
+ |
|
82 |
+ Sets how notes are sorted in the console GUI. Set to ``date`` |
|
83 |
+ to have them sorted by date (newest on top). Set to ``alpha`` to have |
|
84 |
+ them sorted alphabetically. |
|
85 |
+ |
|
86 |
+ Optional. Default value: ``date`` |
|
87 |
+ |
|
88 |
+.. confval:: cfg_favorite_ontop |
|
89 |
+ |
|
90 |
+ Determines whether notes marked as favorite are sorted on top. |
|
91 |
+ |
|
92 |
+ Optional. Default value: ``yes`` |
|
93 |
+ |
|
94 |
+.. confval:: cfg_tabstop |
|
95 |
+ |
|
96 |
+ Sets the width of a tabstop character. |
|
97 |
+ |
|
98 |
+ Optional. Default value: ``4`` |
|
99 |
+ |
|
100 |
+.. confval:: cfg_format_strftime |
|
101 |
+ |
|
102 |
+ Sets the format of the note timestamp (``%D``) in the note title. The |
|
103 |
+ format values are the specified in :py:func:`time.strftime`. |
|
104 |
+ |
|
105 |
+ Optional. Default value: ``%Y/%m/%d`` |
|
106 |
+ |
|
107 |
+.. confval:: cfg_format_note_title |
|
108 |
+ |
|
109 |
+ Sets the format of each line in the console GUI note list. Various |
|
110 |
+ formatting tags are supported for dynamically building the title |
|
111 |
+ string. Each of these formatting tags supports a width specifier |
|
112 |
+ (decimal) and a left justification (``-``) like that supported by |
|
113 |
+ printf: |
|
114 |
+ |
|
115 |
+ .. code-block:: none |
|
116 |
+ |
|
117 |
+ %F - flags (fixed 2 char width) |
|
118 |
+ X - needs sync |
|
119 |
+ * - favorited |
|
120 |
+ %T - category |
|
121 |
+ %D - date |
|
122 |
+ %N - title |
|
123 |
+ |
|
124 |
+ The default note title format pushes the note category to the far |
|
125 |
+ right of the terminal and left justifies the note title after the |
|
126 |
+ date and flags. |
|
127 |
+ |
|
128 |
+ Optional. Default value: ``[%D] %F %-N %T`` |
|
129 |
+ |
|
130 |
+ Note that the ``%D`` date format is further defined by the strftime |
|
131 |
+ format specified in :confval:`cfg_format_strftime`. |
|
132 |
+ |
|
133 |
+.. confval:: cfg_status_bar |
|
134 |
+ |
|
135 |
+ Sets whether or not the status bar is visible at the top of the |
|
136 |
+ console GUI. |
|
137 |
+ |
|
138 |
+ Optional. Default value: ``yes`` |
|
139 |
+ |
|
140 |
+.. confval:: cfg_editor |
|
141 |
+ |
|
142 |
+ Sets the command to run when opening a note for editing. The special |
|
143 |
+ values ``{fname}`` and ``{line}`` can be used to specify respectively |
|
144 |
+ the file name and line number to pass to the command. |
|
145 |
+ |
|
146 |
+ Optional. Default value: ``$EDITOR`` if defined in the user's |
|
147 |
+ environment, else ``vim {fname} +{line}``. |
|
148 |
+ |
|
149 |
+.. confval:: cfg_pager |
|
150 |
+ |
|
151 |
+ Sets the command to run when opening a note for viewing in an |
|
152 |
+ external pager. |
|
153 |
+ |
|
154 |
+ Optional. Default value: ``$PAGER`` if defined in the user's |
|
155 |
+ environment, else ``less -c``. |
|
156 |
+ |
|
157 |
+.. confval:: cfg_diff |
|
158 |
+ |
|
159 |
+ .. todo:: Remove ``cfg_diff`` |
|
160 |
+ |
|
161 |
+.. confval:: cfg_max_logs |
|
162 |
+ |
|
163 |
+ Sets the number of log events to display together in the consule GUI |
|
164 |
+ footer. |
|
165 |
+ |
|
166 |
+ Optional. Default value: ``5`` |
|
167 |
+ |
|
168 |
+.. confval:: cfg_log_timeout |
|
169 |
+ |
|
170 |
+ Sets the rate to poll for log events. Unit is seconds. |
|
171 |
+ |
|
172 |
+ Optional. Default value: ``5`` |
|
173 |
+ |
|
174 |
+.. confval:: cfg_log_reversed |
|
175 |
+ |
|
176 |
+ Sets whether or not the log is displayed in reverse-chronological |
|
177 |
+ order. |
|
178 |
+ |
|
179 |
+ Optional. Default value: ``yes`` |
|
180 |
+ |
|
181 |
+.. confval:: cfg_tempdir |
|
182 |
+ |
|
183 |
+ Sets a directory path to store temporary files in. ``nncli`` uses |
|
184 |
+ :func:`tempfile.mkstemp` under the hood, and the most nuanced |
|
185 |
+ description of how this value is used can be found in the discussion |
|
186 |
+ of the ``dir`` keyword argument there. Basically you should not |
|
187 |
+ specify this if you want to use the platform-standard temporary |
|
188 |
+ folder. |
|
189 |
+ |
|
190 |
+ Optional. Default value: *[blank]* |
|
191 |
+ |
|
192 |
+.. index:: pair: configuration file; keybindings |
|
193 |
+ |
|
194 |
+Keybindings |
|
195 |
+~~~~~~~~~~~ |
|
196 |
+ |
|
197 |
+Keybindings specify the behavior of the console GUI, and are never |
|
198 |
+required in the ``config`` file. However, they all have default values, |
|
199 |
+as outlined below. More information on specifying keybindings can be |
|
200 |
+found in the :ref:`Urwid documentation <urwid:keyboard-input>`. |
|
201 |
+ |
|
202 |
+.. confval:: kb_help |
|
203 |
+ |
|
204 |
+ Press to enter the help screen. |
|
205 |
+ |
|
206 |
+ Default value: ``h`` |
|
207 |
+ |
|
208 |
+.. confval:: kb_quit |
|
209 |
+ |
|
210 |
+ Press to exit the console GUI. |
|
211 |
+ |
|
212 |
+ Default value: ``q`` |
|
213 |
+ |
|
214 |
+.. confval:: kb_sync |
|
215 |
+ |
|
216 |
+ Press to force a full, bi-directional sync with the server. |
|
217 |
+ |
|
218 |
+ Default value: ``S`` |
|
219 |
+ |
|
220 |
+.. confval:: kb_down |
|
221 |
+ |
|
222 |
+ Press to move down one row. |
|
223 |
+ |
|
224 |
+ Default value: ``j`` |
|
225 |
+ |
|
226 |
+.. confval:: kb_up |
|
227 |
+ |
|
228 |
+ Press to move one row up. |
|
229 |
+ |
|
230 |
+ Default value: ``k`` |
|
231 |
+ |
|
232 |
+.. confval:: kb_page_down |
|
233 |
+ |
|
234 |
+ Press to move one page down. |
|
235 |
+ |
|
236 |
+ Default value: ``space`` |
|
237 |
+ |
|
238 |
+.. confval:: kb_page_up |
|
239 |
+ |
|
240 |
+ Press to move one page up. |
|
241 |
+ |
|
242 |
+ Default value: ``b`` |
|
243 |
+ |
|
244 |
+.. confval:: kb_half_page_down |
|
245 |
+ |
|
246 |
+ Press to move one half-page down. |
|
247 |
+ |
|
248 |
+ Default value: ``ctrl d`` |
|
249 |
+ |
|
250 |
+.. confval:: kb_half_page_up |
|
251 |
+ |
|
252 |
+ Press to move one half-page up. |
|
253 |
+ |
|
254 |
+ Default value: ``ctrl u`` |
|
255 |
+ |
|
256 |
+.. confval:: kb_bottom |
|
257 |
+ |
|
258 |
+ Press to move to the last line. |
|
259 |
+ |
|
260 |
+ Default value: ``G`` |
|
261 |
+ |
|
262 |
+.. confval:: kb_top |
|
263 |
+ |
|
264 |
+ Press to move to the first line. |
|
265 |
+ |
|
266 |
+ Default value: ``g`` |
|
267 |
+ |
|
268 |
+.. confval:: kb_status |
|
269 |
+ |
|
270 |
+ Press to toggle the visibility of the status bar. |
|
271 |
+ |
|
272 |
+ Default value: ``s`` |
|
273 |
+ |
|
274 |
+.. confval:: kb_create_note |
|
275 |
+ |
|
276 |
+ Press to create a new note and open in the configured editor (see |
|
277 |
+ :confval:`cfg_editor`). |
|
278 |
+ |
|
279 |
+ Default value: ``C`` |
|
280 |
+ |
|
281 |
+.. confval:: kb_edit_note |
|
282 |
+ |
|
283 |
+ Press to edit the highlighted note in the configured editor (see |
|
284 |
+ :confval:`cfg_editor`). |
|
285 |
+ |
|
286 |
+ Default value: ``e`` |
|
287 |
+ |
|
288 |
+.. confval:: kb_view_note |
|
289 |
+ |
|
290 |
+ Press to view the highlighted note in read-only mode. |
|
291 |
+ |
|
292 |
+ Default value: ``enter`` |
|
293 |
+ |
|
294 |
+.. confval:: kb_view_note_ext |
|
295 |
+ |
|
296 |
+ Press to view the highlighted note in the configured pager (see |
|
297 |
+ :confval:`cfg_pager`). |
|
298 |
+ |
|
299 |
+ Default value: ``meta enter`` |
|
300 |
+ |
|
301 |
+.. confval:: kb_view_note_json |
|
302 |
+ |
|
303 |
+ Press to view the raw JSON contents of the highlighted note in |
|
304 |
+ read-only mode. |
|
305 |
+ |
|
306 |
+ Default value: ``O`` |
|
307 |
+ |
|
308 |
+.. confval:: kb_pipe_note |
|
309 |
+ |
|
310 |
+ Press to send the contents of the highlighted note to ``stdin`` of |
|
311 |
+ another program. A small command window opens at the bottom of the |
|
312 |
+ screen to enter the desired program. |
|
313 |
+ |
|
314 |
+ Default value: ``|`` |
|
315 |
+ |
|
316 |
+.. confval:: kb_view_next_note |
|
317 |
+ |
|
318 |
+ Press to view the contents of the next note in read-only mode. |
|
319 |
+ |
|
320 |
+ Default value: ``J`` |
|
321 |
+ |
|
322 |
+.. confval:: kb_view_prev_note |
|
323 |
+ |
|
324 |
+ Press to view the contents of the previous note in read-only mode. |
|
325 |
+ |
|
326 |
+ Default value: ``K`` |
|
327 |
+ |
|
328 |
+.. confval:: kb_view_log |
|
329 |
+ |
|
330 |
+ Press to view the log. |
|
331 |
+ |
|
332 |
+ Default value: ``l`` |
|
333 |
+ |
|
334 |
+.. confval:: kb_tabstop2 |
|
335 |
+ |
|
336 |
+ Press to set the tabstop for the internal pager to a width of two |
|
337 |
+ characters. |
|
338 |
+ |
|
339 |
+ Default value: ``2`` |
|
340 |
+ |
|
341 |
+.. confval:: kb_tabstop4 |
|
342 |
+ |
|
343 |
+ Press to set the tabstop for the internal pager to a width of four |
|
344 |
+ characters. |
|
345 |
+ |
|
346 |
+ Default value: ``4`` |
|
347 |
+ |
|
348 |
+.. confval:: kb_tabstop8 |
|
349 |
+ |
|
350 |
+ Press to set the tabstop for the internal pager to a width of eight |
|
351 |
+ characters. |
|
352 |
+ |
|
353 |
+ Default value: ``8`` |
|
354 |
+ |
|
355 |
+.. confval:: kb_search_gstyle |
|
356 |
+ |
|
357 |
+ Press to initiate a search of your notes against a Google-style |
|
358 |
+ search term. A command window will open at the bottom of the screen |
|
359 |
+ to enter your search term. |
|
360 |
+ |
|
361 |
+ Default value: ``/`` |
|
362 |
+ |
|
363 |
+.. confval:: kb_search_regex |
|
364 |
+ |
|
365 |
+ Press to initiate a search of your notes against a regular |
|
366 |
+ expression. A command window will open at the bottom of the screen to |
|
367 |
+ enter your search term. |
|
368 |
+ |
|
369 |
+ Default value: ``meta /`` |
|
370 |
+ |
|
371 |
+.. confval:: kb_search_prev_gstyle |
|
372 |
+ |
|
373 |
+ Press to initiate a reverse search of your notes against a |
|
374 |
+ Google-style search term. A command window will open at the bottom of |
|
375 |
+ the screen to enter your search term. |
|
376 |
+ |
|
377 |
+ Default value: ``?`` |
|
378 |
+ |
|
379 |
+.. confval:: kb_search_prev_regex |
|
380 |
+ |
|
381 |
+ Press to initiate a reverse search of your notes against a regular |
|
382 |
+ expression. A command window will open at the bottom of the screen |
|
383 |
+ to enter your search term. |
|
384 |
+ |
|
385 |
+ Default value: ``meta ?`` |
|
386 |
+ |
|
387 |
+.. confval:: kb_search_next |
|
388 |
+ |
|
389 |
+ Press after a search has been initiated to move to the next match. |
|
390 |
+ |
|
391 |
+ Default value: ``n`` |
|
392 |
+ |
|
393 |
+.. confval:: kb_search_prev |
|
394 |
+ |
|
395 |
+ Press after a search has been initiated to move to the previous |
|
396 |
+ match. |
|
397 |
+ |
|
398 |
+ Default value: ``N`` |
|
399 |
+ |
|
400 |
+.. confval:: kb_clear_search |
|
401 |
+ |
|
402 |
+ Press to clear the current search. |
|
403 |
+ |
|
404 |
+ Default value: ``A`` |
|
405 |
+ |
|
406 |
+.. confval:: kb_sort_date |
|
407 |
+ |
|
408 |
+ Press to display notes sorted by date. |
|
409 |
+ |
|
410 |
+ Default value: ``d`` |
|
411 |
+ |
|
412 |
+.. confval:: kb_sort_alpha |
|
413 |
+ |
|
414 |
+ Press to display notes sorted alphabetically. |
|
415 |
+ |
|
416 |
+ Default value: ``a`` |
|
417 |
+ |
|
418 |
+.. confval:: kb_sort_categories |
|
419 |
+ |
|
420 |
+ Press to display notes sorted by category. |
|
421 |
+ |
|
422 |
+ Default value: ``ctrl t`` |
|
423 |
+ |
|
424 |
+.. confval:: kb_note_delete |
|
425 |
+ |
|
426 |
+ Press to delete a note. The note will be deleted locally and |
|
427 |
+ reflected on the server after the next full sync (see |
|
428 |
+ :confval:`kb_sync`). |
|
429 |
+ |
|
430 |
+ Default value: ``D`` |
|
431 |
+ |
|
432 |
+.. confval:: kb_note_favorite |
|
433 |
+ |
|
434 |
+ Press to toggle the ``favorite`` flag for a note. |
|
435 |
+ |
|
436 |
+ Default value: ``p`` |
|
437 |
+ |
|
438 |
+.. confval:: kb_note_category |
|
439 |
+ |
|
440 |
+ Press to set/edit the note category. A command window will appear at |
|
441 |
+ the bottom of the screen containing the current category (if it has |
|
442 |
+ one). Set to an empty string to clear the category. |
|
443 |
+ |
|
444 |
+ Default value: ``t`` |
|
445 |
+ |
|
446 |
+.. confval:: kb_copy_note_text |
|
447 |
+ |
|
448 |
+ Press to copy the note text to the system clipboard. |
|
449 |
+ |
|
450 |
+ Default value: ``y`` |
|
451 |
+ |
|
452 |
+.. index:: pair: configuration file; colors |
|
453 |
+ |
|
454 |
+Colors |
|
455 |
+~~~~~~ |
|
456 |
+ |
|
457 |
+nncli utilizes the Python Urwid_ module to implement the console user |
|
458 |
+interface. |
|
459 |
+ |
|
460 |
+At this time, nncli does not yet support 256-color terminals and is |
|
461 |
+limited to just 16-colors. Color names that can be specified in the |
|
462 |
+``config`` file are listed :ref:`here <urwid:16-standard-foreground>`. |
|
463 |
+ |
|
464 |
+The following pairs of configuration values represent the foreground and |
|
465 |
+background colors for different elements of the console GUI. In each |
|
466 |
+case the configuration value corresponding to the foreground color ends |
|
467 |
+in ``_fg``, and the configuration value corresponding to the |
|
468 |
+background color ends in ``_bg``. The default color values are listed in |
|
469 |
+foreground/background format. |
|
470 |
+ |
|
471 |
+.. _Urwid: http://urwid.org |
|
472 |
+ |
|
473 |
+.. confval:: clr_default_fg |
|
474 |
+ |
|
475 |
+.. confval:: clr_default_bg |
|
476 |
+ |
|
477 |
+ The default foreground/background colors. |
|
478 |
+ |
|
479 |
+ Default values: ``default/default`` |
|
480 |
+ |
|
481 |
+.. confval:: clr_status_bar_fg |
|
482 |
+ |
|
483 |
+.. confval:: clr_status_bar_bg |
|
484 |
+ |
|
485 |
+ The foreground/background colors for the status bar. |
|
486 |
+ |
|
487 |
+ Default values: ``dark gray/light gray`` |
|
488 |
+ |
|
489 |
+.. confval:: clr_log_fg |
|
490 |
+ |
|
491 |
+.. confval:: clr_log_bg |
|
492 |
+ |
|
493 |
+ The foreground/background colors for the log. |
|
494 |
+ |
|
495 |
+ Default values: ``dark gray/light gray`` |
|
496 |
+ |
|
497 |
+.. confval:: clr_user_input_bar_fg |
|
498 |
+ |
|
499 |
+.. confval:: clr_user_input_bar_bg |
|
500 |
+ |
|
501 |
+ The foreground/background colors for the input bar. |
|
502 |
+ |
|
503 |
+ Default values: ``white/light red`` |
|
504 |
+ |
|
505 |
+.. confval:: clr_note_focus_fg |
|
506 |
+ |
|
507 |
+.. confval:: clr_note_focus_bg |
|
508 |
+ |
|
509 |
+ The foreground/background colors for the selected note. |
|
510 |
+ |
|
511 |
+ Default values: ``white/light red`` |
|
512 |
+ |
|
513 |
+.. confval:: clr_note_title_day_fg |
|
514 |
+ |
|
515 |
+.. confval:: clr_note_title_day_bg |
|
516 |
+ |
|
517 |
+ The foreground/background colors for notes edited within the past 24 |
|
518 |
+ hours. |
|
519 |
+ |
|
520 |
+ Default values: ``light red/default`` |
|
521 |
+ |
|
522 |
+.. confval:: clr_note_title_week_fg |
|
523 |
+ |
|
524 |
+.. confval:: clr_note_title_week_bg |
|
525 |
+ |
|
526 |
+ The foreground/background colors for notes edited within the past |
|
527 |
+ week, |
|
528 |
+ |
|
529 |
+ Default values: ``light green/default`` |
|
530 |
+ |
|
531 |
+.. confval:: clr_note_title_month_fg |
|
532 |
+ |
|
533 |
+.. confval:: clr_note_title_month_bg |
|
534 |
+ |
|
535 |
+ The foreground/background colors for notes edited within the past |
|
536 |
+ month. |
|
537 |
+ |
|
538 |
+ Default values: ``brown/default`` |
|
539 |
+ |
|
540 |
+.. confval:: clr_note_title_year_fg |
|
541 |
+ |
|
542 |
+.. confval:: clr_note_title_year_bg |
|
543 |
+ |
|
544 |
+ The foreground/background colors for notes edited within the past |
|
545 |
+ year. |
|
546 |
+ |
|
547 |
+ Default values: ``light blue/default`` |
|
548 |
+ |
|
549 |
+.. confval:: clr_note_title_ancient_fg |
|
550 |
+ |
|
551 |
+.. confval:: clr_note_title_ancient_bg |
|
552 |
+ |
|
553 |
+ The foreground/background colors for notes last edited more than one |
|
554 |
+ year ago. |
|
555 |
+ |
|
556 |
+ Default values: ``light blue/default`` |
|
557 |
+ |
|
558 |
+.. confval:: clr_note_date_fg |
|
559 |
+ |
|
560 |
+.. confval:: clr_note_date_bg |
|
561 |
+ |
|
562 |
+ The foreground/background colors for the note date (i.e. the ``%D`` |
|
563 |
+ portion of :confval:`cfg_format_note_title`). |
|
564 |
+ |
|
565 |
+ Default values: ``dark blue/default`` |
|
566 |
+ |
|
567 |
+.. confval:: clr_note_flags_fg |
|
568 |
+ |
|
569 |
+.. confval:: clr_note_flags_bg |
|
570 |
+ |
|
571 |
+ The foreground/background colors for the note flags (i.e., the ``%F`` |
|
572 |
+ portion of :confval:`cfg_format_note_title`). |
|
573 |
+ |
|
574 |
+ Default values: ``dark magenta/default`` |
|
575 |
+ |
|
576 |
+.. confval:: clr_note_category_fg |
|
577 |
+ |
|
578 |
+.. confval:: clr_note_category_bg |
|
579 |
+ |
|
580 |
+ The foreground/background colors for the note category (i.e., the |
|
581 |
+ ``%T`` portion of :confval:`cfg_format_note_title`). |
|
582 |
+ |
|
583 |
+ Default values: ``dark red/default`` |
|
584 |
+ |
|
585 |
+.. confval:: clr_note_content_fg |
|
586 |
+ |
|
587 |
+.. confval:: clr_note_content_bg |
|
588 |
+ |
|
589 |
+ The foreground/background colors for the note content as displayed |
|
590 |
+ in the internal pager. |
|
591 |
+ |
|
592 |
+ Default values: ``default/default`` |
|
593 |
+ |
|
594 |
+.. confval:: clr_note_content_focus_fg |
|
595 |
+ |
|
596 |
+.. confval:: clr_note_content_focus_bg |
|
597 |
+ |
|
598 |
+ The foreground/background colors for focused content within the |
|
599 |
+ internal pager. |
|
600 |
+ |
|
601 |
+ Default values: ``white/light red`` |
|
602 |
+ |
|
603 |
+.. confval:: clr_note_content_old_fg |
|
604 |
+ |
|
605 |
+.. confval:: clr_note_content_old_bg |
|
606 |
+ |
|
607 |
+ The foreground/background colors for old note content as displayed |
|
608 |
+ within the internal pager. |
|
609 |
+ |
|
610 |
+ Default values: ``yellow/dark gray`` |
|
611 |
+ |
|
612 |
+.. confval:: clr_note_content_old_focus_fg |
|
613 |
+ |
|
614 |
+.. confval:: clr_note_content_old_focus_bg |
|
615 |
+ |
|
616 |
+ The foreground/background colors for old note focused content as |
|
617 |
+ displayed within the internal pager. |
|
618 |
+ |
|
619 |
+ Default values: ``white/light red`` |
|
620 |
+ |
|
621 |
+.. confval:: clr_help_focus_fg |
|
622 |
+ |
|
623 |
+.. confval:: clr_help_focus_bg |
|
624 |
+ |
|
625 |
+ The foreground/background colors for focused content in the help |
|
626 |
+ screen. |
|
627 |
+ |
|
628 |
+ Default values: ``white/light red`` |
|
629 |
+ |
|
630 |
+.. confval:: clr_help_header_fg |
|
631 |
+ |
|
632 |
+.. confval:: clr_help_header_bg |
|
633 |
+ |
|
634 |
+ The foreground/background colors for header content in the help |
|
635 |
+ screen. |
|
636 |
+ |
|
637 |
+ Default values: ``dark blue/default`` |
|
638 |
+ |
|
639 |
+.. confval:: clr_help_config_fg |
|
640 |
+ |
|
641 |
+.. confval:: clr_help_config_bg |
|
642 |
+ |
|
643 |
+ The foreground/background colors for configuration option name (e.g., |
|
644 |
+ ``clr_help_focus_bg``) in the help screen. |
|
645 |
+ |
|
646 |
+ Default values: ``dark green/default`` |
|
647 |
+ |
|
648 |
+.. confval:: clr_help_value_fg |
|
649 |
+ |
|
650 |
+.. confval:: clr_help_value_bg |
|
651 |
+ |
|
652 |
+ The foreground/background colors for the value of a configuration |
|
653 |
+ option as set in ``config``. |
|
654 |
+ |
|
655 |
+ Default values: ``dark red/default`` |
|
656 |
+ |
|
657 |
+.. confval:: clr_help_descr_fg |
|
658 |
+ |
|
659 |
+.. confval:: clr_help_descr_bg |
|
660 |
+ |
|
661 |
+ The foreground/background colors for the configuration options |
|
662 |
+ description in the help screen. |
|
663 |
+ |
|
664 |
+ Default values: ``default/default`` |
|
665 |
+ |
|
666 |
+Examples |
|
667 |
+-------- |
|
668 |
+ |
|
669 |
+At the very least, the following example ``config`` will get you going |
|
670 |
+(using your account information): |
|
671 |
+ |
|
672 |
+.. code-block:: ini |
|
673 |
+ |
|
674 |
+ [nncli] |
|
675 |
+ cfg_nn_username = lebowski@thedude.com |
|
676 |
+ cfg_nn_password = nihilist |
|
677 |
+ cfg_nn_host = nextcloud.thedude.com |
|
678 |
+ |
|
679 |
+Start nncli with no arguments which starts the console GUI mode. nncli |
|
680 |
+will begin to sync your existing notes and you'll see log messages at |
|
681 |
+the bottom of the console. You can view these log messages at any time |
|
682 |
+by pressing the ``l`` key. |
|
683 |
+ |
|
684 |
+View the help by pressing ``h``. Here you'll see all the keybinds and |
|
685 |
+configuration items. The middle column shows the config name that can be |
|
686 |
+used in your ``config`` to override the default setting. |
|
687 |
+ |
|
688 |
+See example configuration file below for more notes. |
|
689 |
+ |
|
690 |
+.. code-block:: ini |
|
691 |
+ |
|
692 |
+ [nncli] |
|
693 |
+ cfg_nn_username = lebowski@thedude.com |
|
694 |
+ cfg_nn_password = nihilist |
|
695 |
+ cfg_nn_host = nextcloud.thedude.com |
|
696 |
+ |
|
697 |
+ ; as an alternate to cfg_nn_password you could use the following config item |
|
698 |
+ ; any shell command can be used; its stdout is used for the password |
|
699 |
+ ; trailing newlines are stripped for ease of use |
|
700 |
+ ; note: if both password config are given, cfg_nn_password will be used |
|
701 |
+ cfg_nn_password_eval = gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.nncli-pass.gpg |
|
702 |
+ |
|
703 |
+ ; see http://urwid.org/manual/userinput.html for examples of more key |
|
704 |
+ ; combinations |
|
705 |
+ kb_edit_note = space |
|
706 |
+ kb_page_down = ctrl f |
|
707 |
+ |
|
708 |
+ ; note that values must not be quoted |
|
709 |
+ clr_note_focus_bg = light blue |
|
710 |
+ |
|
711 |
+ ; if this editor config value is not provided, the $EDITOR env var will be |
|
712 |
+ ; used instead |
|
713 |
+ ; warning: if neither $EDITOR or cfg_editor is set, it will be impossible to |
|
714 |
+ ; edit notes |
|
715 |
+ cfg_editor = nvim |
|
716 |
+ |
|
717 |
+ ; alternatively, {fname} and/or {line} are substituted with the filename and |
|
718 |
+ ; current line number in nncli's pager. |
|
719 |
+ ; If {fname} isn't supplied, the filename is simply appended. |
|
720 |
+ ; examples: |
|
721 |
+ cfg_editor = nvim {fname} +{line} |
|
722 |
+ cfg_editor = nano +{line} |
|
723 |
+ |
|
724 |
+ ; this is also supported for the pager: |
|
725 |
+ cfg_pager = less -c +{line} -N {fname} |
docs/source/index.rst (created)
|
1 |
+.. nncli documentation master file, created by |
|
2 |
+ sphinx-quickstart on Thu Aug 30 11:10:44 2018. |
|
3 |
+ You can adapt this file completely to your liking, but it should at least |
|
4 |
+ contain the root `toctree` directive. |
|
5 |
+ |
|
6 |
+NextCloud Notes Command Line Interface |
|
7 |
+====================================== |
|
8 |
+ |
|
9 |
+.. include:: ../../README.rst |
|
10 |
+ |
|
11 |
+.. toctree:: |
|
12 |
+ :maxdepth: 2 |
|
13 |
+ :caption: Contents: |
|
14 |
+ |
|
15 |
+ configuration |
|
16 |
+ usage |
|
17 |
+ |
|
18 |
+ |
|
19 |
+Indices and tables |
|
20 |
+================== |
|
21 |
+ |
|
22 |
+* :ref:`genindex` |
|
23 |
+* :ref:`search` |
docs/source/usage.rst (created)
|
1 |
+Usage |
|
2 |
+===== |
|
3 |
+ |
|
4 |
+.. program:: nncli |
|
5 |
+ |
|
6 |
+When ``nncli`` is run without any options or arguments an interactive |
|
7 |
+console GUI will appear. The behavior of this interface is highly |
|
8 |
+configurable (see: :ref:`configuration`). |
|
9 |
+ |
|
10 |
+In addition to this default behavior, there are several options |
|
11 |
+available when calling ``nncli`` without a subcommand. |
|
12 |
+ |
|
13 |
+.. option:: --help, -h |
|
14 |
+ |
|
15 |
+Displays a brief decription of the ``nncli`` options and subcommands. |
|
16 |
+ |
|
17 |
+.. option:: --version, -V |
|
18 |
+ |
|
19 |
+Displays the version information. |
|
20 |
+ |
|
21 |
+Also available when calling ``nncli`` by itself is the ``--config`` |
|
22 |
+option, for which see: :ref:`general-options`. |
|
23 |
+ |
|
24 |
+Subcommands |
|
25 |
+----------- |
|
26 |
+ |
|
27 |
+There are a variety of subcommands available from the command line when |
|
28 |
+using ``nncli``. The intent is for these subcommands to enable |
|
29 |
+scripting against your NextCloud Notes database. The subcommands are: |
|
30 |
+ |
|
31 |
+- sync |
|
32 |
+ |
|
33 |
+- list |
|
34 |
+ |
|
35 |
+- export |
|
36 |
+ |
|
37 |
+- dump |
|
38 |
+ |
|
39 |
+- create |
|
40 |
+ |
|
41 |
+- import |
|
42 |
+ |
|
43 |
+- edit |
|
44 |
+ |
|
45 |
+- delete |
|
46 |
+ |
|
47 |
+- (un)favorite |
|
48 |
+ |
|
49 |
+- cat {get,set,rm} |
|
50 |
+ |
|
51 |
+These subcommands and the options available to them are described below. |
|
52 |
+ |
|
53 |
+.. _general-options: |
|
54 |
+ |
|
55 |
+General Subcommand Options |
|
56 |
+~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
57 |
+ |
|
58 |
+Several ``nncli`` options apply to multiple subcommands. They are: |
|
59 |
+ |
|
60 |
+.. option:: --verbose, -v |
|
61 |
+ |
|
62 |
+Print verbose logging information to ``stdout`` |
|
63 |
+ |
|
64 |
+.. option:: --nosync, -n |
|
65 |
+ |
|
66 |
+Operate only on the local notes cache. Do not reach out to the server. |
|
67 |
+ |
|
68 |
+.. option:: --regex, -r |
|
69 |
+ |
|
70 |
+For subcommands that accept a search string, treat the search string as |
|
71 |
+a regular expression. |
|
72 |
+ |
|
73 |
+.. option:: --key, -k |
|
74 |
+ |
|
75 |
+The ID of the note to operate on. This option is required for many of |
|
76 |
+the subcommands. |
|
77 |
+ |
|
78 |
+.. option:: --config, -c |
|
79 |
+ |
|
80 |
+Specify the config file to read from. This option is only required to |
|
81 |
+override the default location (see: :ref:`config-file`). |
|
82 |
+ |
|
83 |
+nncli sync |
|
84 |
+~~~~~~~~~~ |
|
85 |
+ |
|
86 |
+.. program:: nncli sync |
|
87 |
+ |
|
88 |
+Command format: ``nncli sync`` |
|
89 |
+ |
|
90 |
+Performs a full, bi-directional sync between the local notes cache and |
|
91 |
+the NextCloud Notes server. There are no available options for this |
|
92 |
+subcommand. |
|
93 |
+ |
|
94 |
+- Available options: None |
|
95 |
+ |
|
96 |
+- Arguments: None |
|
97 |
+ |
|
98 |
+nncli list |
|
99 |
+~~~~~~~~~~ |
|
100 |
+ |
|
101 |
+.. program:: nncli list |
|
102 |
+ |
|
103 |
+Command format: ``nncli list [search_string]`` |
|
104 |
+ |
|
105 |
+List notes by ID, flags, and title. Flags indicate whether the note has |
|
106 |
+been modified locally (``X``), and/or if it is marked as a favorite |
|
107 |
+(``*``). |
|
108 |
+ |
|
109 |
+- Available options: |
|
110 |
+ |
|
111 |
+ - ``--regex, -r`` See :ref:`general-options` |
|
112 |
+ |
|
113 |
+- Arguments: |
|
114 |
+ |
|
115 |
+ - ``search_string`` Optional. A search term used to refine the search. |
|
116 |
+ |
|
117 |
+nncli export |
|
118 |
+~~~~~~~~~~~~ |
|
119 |
+ |
|
120 |
+.. program:: nncli export |
|
121 |
+ |
|
122 |
+Command format: ``nncli export [search_string]`` |
|
123 |
+ |
|
124 |
+Exports notes in raw, JSON format. The JSON format is a superset of the |
|
125 |
+format outlined in the NextCloud Notes API specification with |
|
126 |
+information added for managing the local notes cache. Note that nncli |
|
127 |
+still stores all the notes data in the directory specified by |
|
128 |
+``cfg_db_path``, so for easy backups, it may be easier/quicker to simply |
|
129 |
+backup this entire directory. |
|
130 |
+ |
|
131 |
+- Available options: |
|
132 |
+ |
|
133 |
+ - :ref:`general-options` |
|
134 |
+ |
|
135 |
+ - ``--regex, -r`` Mutually exclusive with ``--key`` |
|
136 |
+ |
|
137 |
+ - ``--key, -k`` |
|
138 |
+ |
|
139 |
+- Arguments: |
|
140 |
+ |
|
141 |
+ - ``search_string`` Required if ``--regex`` is specified. A search |
|
142 |
+ term used to refine the search. |
|
143 |
+ |
|
144 |
+Example: |
|
145 |
+ |
|
146 |
+.. code-block:: sh |
|
147 |
+ |
|
148 |
+ # export a single note by id |
|
149 |
+ nncli -k somekeyid export |
|
150 |
+ |
|
151 |
+ # export all notes |
|
152 |
+ nncli export |
|
153 |
+ |
|
154 |
+ # export notes matching search string |
|
155 |
+ nncli [-r] export some search keywords or regex |
|
156 |
+ |
|
157 |
+nncli dump |
|
158 |
+~~~~~~~~~~ |
|
159 |
+ |
|
160 |
+.. program:: nncli dump |
|
161 |
+ |
|
162 |
+Command format: ``nncli dump [search_string]`` |
|
163 |
+ |
|
164 |
+Prints notes to ``stdout``. The printed format is the text of the note |
|
165 |
+preceeded by a header displaying information about the note title, key, |
|
166 |
+modified date, category, and flags. Flags indicate whether the note has |
|
167 |
+been modified locally (``X``), and/or if it is marked as a favorite |
|
168 |
+(``*``). |
|
169 |
+ |
|
170 |
+- Available options: |
|
171 |
+ |
|
172 |
+ - :ref:`general-options` |
|
173 |
+ |
|
174 |
+ - ``--regex, -r`` Mutually exclusive with ``--key`` |
|
175 |
+ |
|
176 |
+ - ``--key, -k`` |
|
177 |
+ |
|
178 |
+- Arguments: |
|
179 |
+ |
|
180 |
+ - ``search_string`` Required if ``--regex`` is specified. A search |
|
181 |
+ term used to refine the search. |
|
182 |
+ |
|
183 |
+nncli create |
|
184 |
+~~~~~~~~~~~~ |
|
185 |
+ |
|
186 |
+.. program:: nncli create |
|
187 |
+ |
|
188 |
+Command format: ``nncli create [-]`` |
|
189 |
+ |
|
190 |
+Create a note. Without arguments, this command will open your configured |
|
191 |
+editor. The note syncs to the server after the editor is closed. |
|
192 |
+ |
|
193 |
+- Available options: None |
|
194 |
+ |
|
195 |
+- Arguments: |
|
196 |
+ |
|
197 |
+ - `-` Optional. If specified, the note content is read from ``stdin``. |
|
198 |
+ |
|
199 |
+Example: |
|
200 |
+ |
|
201 |
+.. code-block:: sh |
|
202 |
+ |
|
203 |
+ # create a new note and open in editor |
|
204 |
+ nncli create |
|
205 |
+ |
|
206 |
+ # create a new note with contents of stdin |
|
207 |
+ echo 'hi' | nncli create - |
|
208 |
+ |
|
209 |
+nncli import |
|
210 |
+~~~~~~~~~~~~ |
|
211 |
+ |
|
212 |
+.. program:: nncli import |
|
213 |
+ |
|
214 |
+Command format: ``nncli import [-]`` |
|
215 |
+ |
|
216 |
+Import a JSON-formatted note. nncli can import notes from raw json data |
|
217 |
+(via stdin or editor). Allowed fields are ``content``, ``category``, |
|
218 |
+``favorite``, and ``modified``. |
|
219 |
+ |
|
220 |
+- Available options: None |
|
221 |
+ |
|
222 |
+- Arguments: |
|
223 |
+ |
|
224 |
+ - ``-`` Optional. If specified, the note content is read from ``stdin``. |
|
225 |
+ |
|
226 |
+Example: |
|
227 |
+ |
|
228 |
+.. code-block:: none |
|
229 |
+ |
|
230 |
+ echo '{"category":"testing","content":"New note!"}' | nncli import - |
|
231 |
+ |
|
232 |
+nncli edit |
|
233 |
+~~~~~~~~~~ |
|
234 |
+ |
|
235 |
+.. program:: nncli edit |
|
236 |
+ |
|
237 |
+Command format: ``nncli -k <key> edit`` |
|
238 |
+ |
|
239 |
+Open the note specified by ``<key>`` in the configured editor. The note |
|
240 |
+syncs to the server after the editor is saved and closed. |
|
241 |
+ |
|
242 |
+- Available options: |
|
243 |
+ |
|
244 |
+ - ``--key, -k`` Required. See :ref:`general-options` |
|
245 |
+ |
|
246 |
+- Arguments: None |
|
247 |
+ |
|
248 |
+nncli delete |
|
249 |
+~~~~~~~~~~~~ |
|
250 |
+ |
|
251 |
+.. program:: nncli delete |
|
252 |
+ |
|
253 |
+Command format: ``nncli -k <key> delete`` |
|
254 |
+ |
|
255 |
+Delete the note specified by ``<key>``. |
|
256 |
+ |
|
257 |
+- Available options: |
|
258 |
+ |
|
259 |
+ - ``--key, -k`` Required. See :ref:`general-options` |
|
260 |
+ |
|
261 |
+- Arguments: None |
|
262 |
+ |
|
263 |
+nncli favorite |
|
264 |
+~~~~~~~~~~~~~~ |
|
265 |
+ |
|
266 |
+.. program:: nncli favorite |
|
267 |
+ |
|
268 |
+Command format: ``nncli -k <key> favorite|unfavorite`` |
|
269 |
+ |
|
270 |
+Favorite (or unfavorite) the note specified by ``<key>``. |
|
271 |
+ |
|
272 |
+- Available options: |
|
273 |
+ |
|
274 |
+ - ``--key, -k`` Required. See :ref:`general-options` |
|
275 |
+ |
|
276 |
+- Arguments: None |
|
277 |
+ |
|
278 |
+nncli cat |
|
279 |
+~~~~~~~~~ |
|
280 |
+ |
|
281 |
+.. program:: nncli cat |
|
282 |
+ |
|
283 |
+Command format: ``nncli -k <key> cat get|set|rm`` |
|
284 |
+ |
|
285 |
+Read or modify a note category from the command line. |
|
286 |
+ |
|
287 |
+- Available options: |
|
288 |
+ |
|
289 |
+ - ``--key, -k`` Required. See :ref:`general-options` |
|
290 |
+ |
|
291 |
+- Arguments: |
|
292 |
+ |
|
293 |
+ - ``get`` Get the note category |
|
294 |
+ |
|
295 |
+ - ``set`` Set the note category |
|
296 |
+ |
|
297 |
+ - ``rm`` Remove the note category |
|
298 |
+ |
|
299 |
+Example: |
|
300 |
+ |
|
301 |
+.. code-block:: sh |
|
302 |
+ |
|
303 |
+ # Retrieve note category (e.g. "category1") |
|
304 |
+ nncli -k somekeyid cat get |
|
305 |
+ # Returns "category1" |
|
306 |
+ |
|
307 |
+ # Add a category to a note, overwriting any existing one |
|
308 |
+ nncli -k somekeyid cat set "category3" |
|
309 |
+ # Now tagged as "category3" |
|
310 |
+ |
|
311 |
+ # Remove a category from a note |
|
312 |
+ nncli -k somekeyid cat rm |
|
313 |
+ # Note now has no category |
|
314 |
+ |
|
315 |
+Console GUI Usage |
|
316 |
+----------------- |
|
317 |
+ |
|
318 |
+.. index:: single: searching |
|
319 |
+ |
|
320 |
+Searching |
|
321 |
+~~~~~~~~~ |
|
322 |
+ |
|
323 |
+nncli supports two styles of search strings. First is a Google style |
|
324 |
+search string and second is a Regular Expression. |
|
325 |
+ |
|
326 |
+A Google style search string is a group of tokens (separated by spaces) |
|
327 |
+with an implied *AND* between each token. This style search is case |
|
328 |
+insensitive. For example: |
|
329 |
+ |
|
330 |
+.. code-block:: none |
|
331 |
+ |
|
332 |
+ /category:category1 category:category2 word1 "word2 word3" category:category3 |
|
333 |
+ |
|
334 |
+Regular expression searching also supports the use of flags (currently |
|
335 |
+only case-insensitive) by adding a final forward slash followed by the |
|
336 |
+flags. The following example will do a case-insensitive search for |
|
337 |
+``something``: |
|
338 |
+ |
|
339 |
+.. code-block:: none |
|
340 |
+ |
|
341 |
+ (regex) /something/i |
|
342 |
+ |
|
343 |
+.. index:: single: modelines |
|
344 |
+ |
|
345 |
+Modelines |
|
346 |
+~~~~~~~~~ |
|
347 |
+ |
|
348 |
+Advanced text editors usually tailor their behavior based on the file |
|
349 |
+type being edited. For such editors, notes opened through nncli should |
|
350 |
+be treated as Markdown by default. However, you can change this |
|
351 |
+on a per-note basis through the use of modelines. In Vim, for instance, |
|
352 |
+a modeline is a comment line conforming to the pattern below:: |
|
353 |
+ |
|
354 |
+ :: vim: ft=rst |
|
355 |
+ |
|
356 |
+Now when you edit this note Vim will automatically load the rst plugin. |
nncli (deleted)
1 |
|
-#!/usr/bin/env python3 |
2 |
|
-# |
3 |
|
-# The MIT License (MIT) |
4 |
|
-# |
5 |
|
-# Copyright (c) 2018 Daniel Moch |
6 |
|
-# |
7 |
|
-# Permission is hereby granted, free of charge, to any person obtaining a copy |
8 |
|
-# of this software and associated documentation files (the "Software"), to deal |
9 |
|
-# in the Software without restriction, including without limitation the rights |
10 |
|
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
11 |
|
-# copies of the Software, and to permit persons to whom the Software is |
12 |
|
-# furnished to do so, subject to the following conditions: |
13 |
|
-# |
14 |
|
-# The above copyright notice and this permission notice shall be included in all |
15 |
|
-# copies or substantial portions of the Software. |
16 |
|
-# |
17 |
|
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
18 |
|
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
19 |
|
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
20 |
|
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
21 |
|
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
22 |
|
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
23 |
|
-# SOFTWARE. |
24 |
|
-# |
25 |
|
- |
26 |
|
-# |
27 |
|
-# ** The MIT License ** |
28 |
|
-# |
29 |
|
-# Copyright (c) 2014 Eric Davis (edavis@insanum.com) |
30 |
|
-# |
31 |
|
-# Permission is hereby granted, free of charge, to any person obtaining a copy |
32 |
|
-# of this software and associated documentation files (the "Software"), to deal |
33 |
|
-# in the Software without restriction, including without limitation the rights |
34 |
|
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
35 |
|
-# copies of the Software, and to permit persons to whom the Software is |
36 |
|
-# furnished to do so, subject to the following conditions: |
37 |
|
-# |
38 |
|
-# The above copyright notice and this permission notice shall be included in all |
39 |
|
-# copies or substantial portions of the Software. |
40 |
|
-# |
41 |
|
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
42 |
|
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
43 |
|
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
44 |
|
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
45 |
|
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
46 |
|
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
47 |
|
-# SOFTWARE. |
48 |
|
-# |
49 |
|
-# Dude... just buy me a beer. :-) |
50 |
|
-# |
51 |
|
- |
52 |
|
-from nnotes_cli import nncli |
53 |
|
- |
54 |
|
-if __name__ == '__main__': |
55 |
|
- nncli.main() |
56 |
|
- |
nncli/__init__.py (created)
|
1 |
+# -*- encoding: utf-8 -*- |
|
2 |
+"""NextCloud Notes Command Line Interface""" |
|
3 |
+ |
|
4 |
+__version__ = '0.2.0' |
nncli/__main__.py (created)
|
1 |
+# -*- encoding: utf-8 -*- |
|
2 |
+"""nncli main module""" |
|
3 |
+import nncli.nncli |
|
4 |
+ |
|
5 |
+if __name__ == '__main__': |
|
6 |
+ nncli.nncli.main() |
nnotes_cli/__init__.py (deleted)
1 |
|
-try: |
2 |
|
- from . import version |
3 |
|
- __version__ = version.version |
4 |
|
-except ImportError: |
5 |
|
- try: |
6 |
|
- from setuptools_scm import get_version |
7 |
|
- __version__ = get_version(root='..', relative_to=__file__) |
8 |
|
- except: |
9 |
|
- __version__ = '??-dev' |
10 |
|
- |
11 |
|
-__productname__ = 'nncli' |
12 |
|
-__copyright__ = "Copyright (c) 2018 Daniel Moch" |
13 |
|
-__author__ = "Daniel Moch" |
14 |
|
-__author_email__ = "daniel@danielmoch.com" |
15 |
|
-__description__ = "NextCloud Notes Command Line Interface" |
16 |
|
-__url__ = "https://github.com/djmoch/nncli" |
17 |
|
-__license__ = "MIT" |
nnotes_cli/clipboard.py --> nncli/clipboard.py
|
1 |
+# -*- encoding: utf-8 -*- |
|
2 |
+ |
1 |
3 |
import os |
2 |
4 |
from distutils import spawn |
3 |
|
- |
4 |
5 |
|
5 |
6 |
class Clipboard(object): |
6 |
7 |
def __init__(self): |
nnotes_cli/config.py --> nncli/config.py
1 |
|
-# |
2 |
|
-# The MIT License (MIT) |
3 |
|
-# |
4 |
|
-# Copyright (c) 2018 Daniel Moch |
5 |
|
-# |
6 |
|
-# Permission is hereby granted, free of charge, to any person obtaining a copy |
7 |
|
-# of this software and associated documentation files (the "Software"), to deal |
8 |
|
-# in the Software without restriction, including without limitation the rights |
9 |
|
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
10 |
|
-# copies of the Software, and to permit persons to whom the Software is |
11 |
|
-# furnished to do so, subject to the following conditions: |
12 |
|
-# |
13 |
|
-# The above copyright notice and this permission notice shall be included in all |
14 |
|
-# copies or substantial portions of the Software. |
15 |
|
-# |
16 |
|
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 |
|
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 |
|
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
19 |
|
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
20 |
|
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
21 |
|
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
22 |
|
-# SOFTWARE. |
23 |
|
-# |
24 |
|
- |
25 |
|
-# Copyright (c) 2014 Eric Davis |
26 |
|
-# Licensed under the MIT License |
|
1 |
+# -*- encoding: utf-8 -*- |
27 |
2 |
|
28 |
3 |
import os, sys, urwid, collections, configparser, subprocess |
29 |
4 |
|
|
|
. . . |
296 |
271 |
|
297 |
272 |
def get_color_descr(self, name): |
298 |
273 |
return self.colors[name][1] |
299 |
|
- |
nnotes_cli/nextcloud_note.py --> nncli/nextcloud_note.py
1 |
|
-# |
2 |
|
-# The MIT License (MIT) |
3 |
|
-# |
4 |
|
-# Copyright (c) 2018 Daniel Moch |
5 |
|
-# |
6 |
|
-# Permission is hereby granted, free of charge, to any person obtaining a copy |
7 |
|
-# of this software and associated documentation files (the "Software"), to deal |
8 |
|
-# in the Software without restriction, including without limitation the rights |
9 |
|
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
10 |
|
-# copies of the Software, and to permit persons to whom the Software is |
11 |
|
-# furnished to do so, subject to the following conditions: |
12 |
|
-# |
13 |
|
-# The above copyright notice and this permission notice shall be included in all |
14 |
|
-# copies or substantial portions of the Software. |
15 |
|
-# |
16 |
|
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 |
|
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 |
|
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
19 |
|
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
20 |
|
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
21 |
|
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
22 |
|
-# SOFTWARE. |
23 |
|
-# |
24 |
|
- |
25 |
|
-# Copyright (c) 2014 Eric Davis |
26 |
|
-# This file is *slightly* modified from simplynote.py. |
27 |
|
- |
28 |
1 |
# -*- coding: utf-8 -*- |
29 |
|
-""" |
30 |
|
- nextcloud_note.py |
31 |
|
- ~~~~~~~~~~~~~~ |
32 |
|
- |
33 |
|
- Python library for accessing the NextCloud Notes API (v0.2) |
34 |
|
- |
35 |
|
- Modified from simplnote.py |
36 |
|
- :copyright: (c) 2011 by Daniel Schauenberg |
37 |
|
- :license: MIT, see LICENSE for more details. |
38 |
|
-""" |
39 |
2 |
|
40 |
3 |
import urllib.parse |
41 |
4 |
from requests.exceptions import RequestException, ConnectionError |
nnotes_cli/nncli.py --> nncli/nncli.py
1 |
|
-# |
2 |
|
-# The MIT License (MIT) |
3 |
|
-# |
4 |
|
-# Copyright (c) 2018 Daniel Moch |
5 |
|
-# |
6 |
|
-# Permission is hereby granted, free of charge, to any person obtaining a copy |
7 |
|
-# of this software and associated documentation files (the "Software"), to deal |
8 |
|
-# in the Software without restriction, including without limitation the rights |
9 |
|
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
10 |
|
-# copies of the Software, and to permit persons to whom the Software is |
11 |
|
-# furnished to do so, subject to the following conditions: |
12 |
|
-# |
13 |
|
-# The above copyright notice and this permission notice shall be included in all |
14 |
|
-# copies or substantial portions of the Software. |
15 |
|
-# |
16 |
|
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 |
|
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 |
|
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
19 |
|
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
20 |
|
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
21 |
|
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
22 |
|
-# SOFTWARE. |
23 |
|
-# |
24 |
|
- |
25 |
|
-# Copyright (c) 2014 Eric Davis |
26 |
|
-# Licensed under the MIT License |
|
1 |
+# -*- encoding: utf-8 -*- |
27 |
2 |
|
28 |
3 |
import os, sys, getopt, re, signal, time, datetime, shlex, hashlib |
29 |
4 |
import subprocess, threading, logging |
30 |
5 |
import copy, json, urwid, datetime |
31 |
|
-import nnotes_cli |
|
6 |
+import nncli |
32 |
7 |
from . import view_titles, view_note, view_help, view_log, user_input |
33 |
8 |
from . import utils, temp |
34 |
9 |
from .config import Config |
|
|
. . . |
1173 |
1148 |
sys.exit(0) |
1174 |
1149 |
|
1175 |
1150 |
def version(): |
1176 |
|
- version_info = '' |
1177 |
|
- version_info += nnotes_cli.__productname__ + ' v' + \ |
1178 |
|
- nnotes_cli.__version__ + "\n" |
1179 |
|
- version_info += nnotes_cli.__description__ + "\n\n" |
1180 |
|
- version_info += nnotes_cli.__copyright__ + "\n" |
1181 |
|
- version_info += "Written by " + nnotes_cli.__author__ + \ |
1182 |
|
- " and others\n" |
1183 |
|
- version_info += "Licensed under the terms of the " + \ |
1184 |
|
- nnotes_cli.__license__ + " license\n" |
1185 |
|
- version_info += "The latest code is available at: " + \ |
1186 |
|
- nnotes_cli.__url__ |
|
1151 |
+ version_info = 'nncli {}'.format(nncli.__version__) |
1187 |
1152 |
print(version_info) |
1188 |
1153 |
exit(0) |
1189 |
1154 |
|
|
|
. . . |
1338 |
1303 |
|
1339 |
1304 |
else: |
1340 |
1305 |
usage() |
1341 |
|
- |
nnotes_cli/notes_db.py --> nncli/notes_db.py
1 |
|
-# |
2 |
|
-# The MIT License (MIT) |
3 |
|
-# |
4 |
|
-# Copyright (c) 2018 Daniel Moch |
5 |
|
-# |
6 |
|
-# Permission is hereby granted, free of charge, to any person obtaining a copy |
7 |
|
-# of this software and associated documentation files (the "Software"), to deal |
8 |
|
-# in the Software without restriction, including without limitation the rights |
9 |
|
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
10 |
|
-# copies of the Software, and to permit persons to whom the Software is |
11 |
|
-# furnished to do so, subject to the following conditions: |
12 |
|
-# |
13 |
|
-# The above copyright notice and this permission notice shall be included in all |
14 |
|
-# copies or substantial portions of the Software. |
15 |
|
-# |
16 |
|
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 |
|
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 |
|
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
19 |
|
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
20 |
|
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
21 |
|
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
22 |
|
-# SOFTWARE. |
23 |
|
-# |
24 |
|
- |
25 |
|
-# Copyright (c) 2014 Eric Davis |
26 |
|
-# This file is *heavily* modified from nvpy. |
27 |
|
- |
28 |
|
-# nvPY: cross-platform note-taking app with simplenote syncing |
29 |
|
-# copyright 2012 by Charl P. Botha <cpbotha@vxlabs.com> |
30 |
|
-# new BSD license |
|
1 |
+# -*- encoding: utf-8 -*- |
31 |
2 |
|
32 |
3 |
import os, time, re, glob, json, copy, threading |
33 |
4 |
from . import utils |
|
|
. . . |
675 |
646 |
self.go_cond.acquire() |
676 |
647 |
self.go_cond.notify() |
677 |
648 |
self.go_cond.release() |
678 |
|
- |
nnotes_cli/temp.py --> nncli/temp.py
1 |
|
- |
2 |
|
-# Copyright (c) 2014 Eric Davis |
3 |
|
-# Licensed under the MIT License |
|
1 |
+# -*- encoding: utf-8 -*- |
4 |
2 |
|
5 |
3 |
import os, json, tempfile |
6 |
4 |
|
nnotes_cli/user_input.py --> nncli/user_input.py
1 |
|
- |
2 |
|
-# Copyright (c) 2014 Eric Davis |
3 |
|
-# Licensed under the MIT License |
|
1 |
+# -*- encoding: utf-8 -*- |
4 |
2 |
|
5 |
3 |
import urwid |
6 |
4 |
|
|
|
. . . |
23 |
21 |
else: |
24 |
22 |
return super(UserInput, self).keypress(size, key) |
25 |
23 |
return None |
26 |
|
- |
nnotes_cli/utils.py --> nncli/utils.py
1 |
|
-# |
2 |
|
-# The MIT License (MIT) |
3 |
|
-# |
4 |
|
-# Copyright (c) 2018 Daniel Moch |
5 |
|
-# |
6 |
|
-# Permission is hereby granted, free of charge, to any person obtaining a copy |
7 |
|
-# of this software and associated documentation files (the "Software"), to deal |
8 |
|
-# in the Software without restriction, including without limitation the rights |
9 |
|
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
10 |
|
-# copies of the Software, and to permit persons to whom the Software is |
11 |
|
-# furnished to do so, subject to the following conditions: |
12 |
|
-# |
13 |
|
-# The above copyright notice and this permission notice shall be included in all |
14 |
|
-# copies or substantial portions of the Software. |
15 |
|
-# |
16 |
|
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 |
|
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 |
|
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
19 |
|
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
20 |
|
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
21 |
|
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
22 |
|
-# SOFTWARE. |
23 |
|
-# |
24 |
|
- |
25 |
|
-# Copyright (c) 2014 Eric Davis |
26 |
|
-# This file is *heavily* modified from nvpy. |
27 |
|
- |
28 |
|
-# nvPY: cross-platform note-taking app with simplenote syncing |
29 |
|
-# copyright 2012 by Charl P. Botha <cpbotha@vxlabs.com> |
30 |
|
-# new BSD license |
|
1 |
+# -*- encoding: utf-8 -*- |
31 |
2 |
|
32 |
3 |
import datetime, random, re |
33 |
4 |
|
nnotes_cli/view_help.py --> nncli/view_help.py
1 |
|
- |
2 |
|
-# Copyright (c) 2014 Eric Davis |
3 |
|
-# Licensed under the MIT License |
|
1 |
+# -*- encoding: utf-8 -*- |
4 |
2 |
|
5 |
3 |
import re, urwid |
6 |
4 |
|
|
|
. . . |
125 |
123 |
|
126 |
124 |
def keypress(self, size, key): |
127 |
125 |
return key |
128 |
|
- |
nnotes_cli/view_log.py --> nncli/view_log.py
1 |
|
- |
2 |
|
-# Copyright (c) 2014 Eric Davis |
3 |
|
-# Licensed under the MIT License |
|
1 |
+# -*- encoding: utf-8 -*- |
4 |
2 |
|
5 |
3 |
import urwid |
6 |
4 |
|
|
|
. . . |
47 |
45 |
|
48 |
46 |
def keypress(self, size, key): |
49 |
47 |
return key |
|