Transition calls to getpermission to interactive.

This commit is contained in:
voussoir 2020-12-07 00:54:53 -08:00
parent a604cfa5cd
commit a91366149b
2 changed files with 10 additions and 10 deletions

View file

@ -1,7 +1,7 @@
import argparse import argparse
import sys import sys
from voussoirkit import getpermission from voussoirkit import interactive
from voussoirkit import pathclass from voussoirkit import pathclass
from voussoirkit import stringtools from voussoirkit import stringtools
from voussoirkit import vlogging from voussoirkit import vlogging
@ -143,7 +143,7 @@ def add_remove_tag_argparse(args, action):
elif action == 'remove': elif action == 'remove':
photo.remove_tag(tag) photo.remove_tag(tag)
if args.autoyes or getpermission.getpermission('Commit?'): if args.autoyes or interactive.getpermission('Commit?'):
photodb.commit() photodb.commit()
def digest_directory_argparse(args): def digest_directory_argparse(args):
@ -160,7 +160,7 @@ def digest_directory_argparse(args):
for result in digest: for result in digest:
print(result) print(result)
if args.autoyes or getpermission.getpermission('Commit?'): if args.autoyes or interactive.getpermission('Commit?'):
photodb.commit() photodb.commit()
def easybake_argparse(args): def easybake_argparse(args):
@ -168,7 +168,7 @@ def easybake_argparse(args):
for eb_string in args.eb_strings: for eb_string in args.eb_strings:
notes = photodb.easybake(eb_string) notes = photodb.easybake(eb_string)
if args.autoyes or getpermission.getpermission('Commit?'): if args.autoyes or interactive.getpermission('Commit?'):
photodb.commit() photodb.commit()
def init_argparse(args): def init_argparse(args):
@ -179,7 +179,7 @@ def purge_deleted_photos_argparse(args):
photodb = find_photodb() photodb = find_photodb()
for deleted in photodb.purge_deleted_files(): for deleted in photodb.purge_deleted_files():
print(deleted) print(deleted)
if args.autoyes or getpermission.getpermission('Commit?'): if args.autoyes or interactive.getpermission('Commit?'):
photodb.commit() photodb.commit()
def purge_empty_albums_argparse(args): def purge_empty_albums_argparse(args):
@ -187,7 +187,7 @@ def purge_empty_albums_argparse(args):
for deleted in photodb.purge_empty_albums(): for deleted in photodb.purge_empty_albums():
print(deleted) print(deleted)
if args.autoyes or getpermission.getpermission('Commit?'): if args.autoyes or interactive.getpermission('Commit?'):
photodb.commit() photodb.commit()
def search_argparse(args): def search_argparse(args):
@ -230,7 +230,7 @@ def set_unset_searchhidden_argparse(args, searchhidden):
print(photo) print(photo)
photo.set_searchhidden(searchhidden) photo.set_searchhidden(searchhidden)
if args.autoyes or getpermission.getpermission('Commit?'): if args.autoyes or interactive.getpermission('Commit?'):
photodb.commit() photodb.commit()
def tag_breplace_argparse(args): def tag_breplace_argparse(args):
@ -260,7 +260,7 @@ def tag_breplace_argparse(args):
if not args.autoyes: if not args.autoyes:
for (tag_name, new_name, printline) in renames: for (tag_name, new_name, printline) in renames:
print(printline) print(printline)
if not getpermission.getpermission('Ok?', must_pick=True): if not interactive.getpermission('Ok?', must_pick=True):
return return
for (tag_name, new_name, printline) in renames: for (tag_name, new_name, printline) in renames:

View file

@ -9,7 +9,7 @@ import code
import sys import sys
import traceback import traceback
from voussoirkit import getpermission from voussoirkit import interactive
from voussoirkit import vlogging from voussoirkit import vlogging
import etiquette import etiquette
@ -52,7 +52,7 @@ def erepl_argparse(args):
if len(P.savepoints) == 0: if len(P.savepoints) == 0:
break break
print('You have uncommited changes, are you sure you want to quit?') print('You have uncommited changes, are you sure you want to quit?')
if getpermission.getpermission(): if interactive.getpermission():
break break
def main(argv): def main(argv):