borgbackup/borg
Thomas Waldmann b2dedee3c8 refactor yes(), cleanup env var semantics, fixes #355
refactorings:

- introduced concept of default answer:

if the answer string is in the defaultish sequence, the return value of yes() will be the default.
e.g. if just pressing <enter> when asked on the console or if an empty string or "default" is
in the environment variable for overriding.

if an environment var has an invalid value and no retries are enabled: return default
if retries are enabled, next retry won't use the env var again, but either ask via input().

- simplify:

only one default - this should be a SAFE default as it is used in some special conditions
like EOF or invalid input with retries disallowed.

no isatty() magic, the "yes" shell command exists, so we could receive input even if it is not from a tty.

- clean:

separate retry flag from retry_msg
2016-01-24 16:04:00 +01:00
..
testsuite refactor yes(), cleanup env var semantics, fixes #355 2016-01-24 16:04:00 +01:00
__init__.py propperly handle borg._version using setuptools_scm 2015-08-22 15:54:40 +02:00
__main__.py add a __main__.py to nuitka works 2015-07-20 16:16:32 +02:00
_chunker.c use PyMemoryView_FromMemory (py 3.3+) 2016-01-24 15:36:04 +01:00
_hashindex.c hashindex: explain hash_sizes 2016-01-14 14:39:59 +01:00
archive.py change the builtin default for --chunker-params, create 2MiB chunks, fixes #343 2016-01-24 15:44:09 +01:00
archiver.py refactor yes(), cleanup env var semantics, fixes #355 2016-01-24 16:04:00 +01:00
cache.py refactor yes(), cleanup env var semantics, fixes #355 2016-01-24 16:04:00 +01:00
chunker.pyx cython code: add some int types to get rid of unspecific python add / subtract operations 2015-09-10 23:12:12 +02:00
compress.pyx remove misc. compat code not needed for py 3.4+ 2016-01-24 15:16:05 +01:00
crypto.pyx use os.urandom instead of own cython openssl RAND_bytes wrapper, fixes #493 2016-01-24 15:40:04 +01:00
fuse.py suppress unneeded exception context (PEP 409) 2016-01-24 15:36:04 +01:00
hash_sizes.py hashtable size follows a growth policy, fixes #527 2016-01-14 14:39:59 +01:00
hashindex.pyx hashindex_add C implementation 2015-12-07 19:13:58 +01:00
helpers.py refactor yes(), cleanup env var semantics, fixes #355 2016-01-24 16:04:00 +01:00
key.py use os.urandom instead of own cython openssl RAND_bytes wrapper, fixes #493 2016-01-24 15:40:04 +01:00
locking.py suppress unneeded exception context (PEP 409) 2016-01-24 15:36:04 +01:00
logger.py sane remote logging, remote stderr, fixes #461 2015-12-12 22:15:08 +01:00
lrucache.py Merge branch 'master' into lrucache 2015-08-14 10:59:21 +01:00
platform.py label platform code, exclude freebsd and unknown platform from coverage measurement 2015-11-01 23:06:52 +01:00
platform_darwin.pyx acls (darwin): use helper functions safe_encode/safe_decode 2015-10-19 02:32:29 +02:00
platform_freebsd.pyx acls (freebsd): use helper functions safe_encode/safe_decode 2015-10-19 01:43:46 +02:00
platform_linux.pyx acls (linux): helper functions safe_encode/safe_decode 2015-10-19 01:40:15 +02:00
remote.py change encryption to be on by default (repokey mode) 2016-01-24 15:44:09 +01:00
repository.py change encryption to be on by default (repokey mode) 2016-01-24 15:44:09 +01:00
shellpattern.py Add shell-style pattern syntax 2016-01-21 16:07:24 +01:00
upgrader.py Fix upgrade without ~/attic/keys existing. 2016-01-19 11:29:18 +01:00
xattr.py remove misc. compat code not needed for py 3.4+ 2016-01-24 15:16:05 +01:00