Transition calls to getpermission to interactive.

This commit is contained in:
voussoir 2020-12-07 00:54:00 -08:00
parent 4120c3dfcc
commit 35281c81ab
8 changed files with 16 additions and 16 deletions

View file

@ -18,7 +18,7 @@ import re
import sys import sys
import unicodedata import unicodedata
from voussoirkit import getpermission from voussoirkit import interactive
from voussoirkit import safeprint from voussoirkit import safeprint
from voussoirkit import spinal from voussoirkit import spinal
from voussoirkit import stringtools from voussoirkit import stringtools
@ -74,7 +74,7 @@ def brename(transformation, autoyes=False, recurse=False):
loop(pairs, dry=True) loop(pairs, dry=True)
if autoyes or getpermission.getpermission('Is this correct?'): if autoyes or interactive.getpermission('Is this correct?'):
# Sort in reverse so that renaming a file inside a directory always # Sort in reverse so that renaming a file inside a directory always
# occurs before renaming the directory itself. If you rename the # occurs before renaming the directory itself. If you rename the
# directory first, then the path to the file is invalid by the time # directory first, then the path to the file is invalid by the time

View file

@ -5,7 +5,7 @@ import pyperclip
import re import re
import sys import sys
from voussoirkit import getpermission from voussoirkit import interactive
from voussoirkit import pipeable from voussoirkit import pipeable
from voussoirkit import spinal from voussoirkit import spinal
from voussoirkit import winglob from voussoirkit import winglob
@ -25,7 +25,7 @@ def contentreplace(filename, replace_from, replace_to, autoyes=False, do_regex=F
if occurances == 0: if occurances == 0:
return return
if not (autoyes or getpermission.getpermission('Replace?')): if not (autoyes or interactive.getpermission('Replace?')):
return return
if do_regex: if do_regex:

View file

@ -10,7 +10,7 @@ import os
import re import re
import sys import sys
from voussoirkit import getpermission from voussoirkit import interactive
from voussoirkit import pathclass from voussoirkit import pathclass
from voussoirkit import safeprint from voussoirkit import safeprint
@ -78,7 +78,7 @@ def fileprefix(
message = f'{oldname} -> {newname}' message = f'{oldname} -> {newname}'
safeprint.safeprint(message) safeprint.safeprint(message)
if autoyes or getpermission.getpermission('Is this correct?'): if autoyes or interactive.getpermission('Is this correct?'):
for (oldname, newname) in rename_pairs: for (oldname, newname) in rename_pairs:
os.rename(oldname, newname) os.rename(oldname, newname)

View file

@ -5,7 +5,7 @@ import argparse
import os import os
import sys import sys
from voussoirkit import getpermission from voussoirkit import interactive
from voussoirkit import spinal from voussoirkit import spinal
def filepull(pull_from='.', autoyes=False): def filepull(pull_from='.', autoyes=False):
@ -31,7 +31,7 @@ def filepull(pull_from='.', autoyes=False):
for f in files: for f in files:
print(f.basename) print(f.basename)
if autoyes or getpermission.getpermission(f'Move {len(files)} files?'): if autoyes or interactive.getpermission(f'Move {len(files)} files?'):
for f in files: for f in files:
local = os.path.join('.', f.basename) local = os.path.join('.', f.basename)
os.rename(f.absolute_path, local) os.rename(f.absolute_path, local)

View file

@ -9,7 +9,7 @@ import traceback
import zipfile import zipfile
from voussoirkit import clipext from voussoirkit import clipext
from voussoirkit import getpermission from voussoirkit import interactive
FILENAME_BADCHARS = '\\/:*?<>|"' FILENAME_BADCHARS = '\\/:*?<>|"'
@ -82,7 +82,7 @@ def getcrx(extension_id, auto_overwrite=None):
permission = True permission = True
if auto_overwrite is None: if auto_overwrite is None:
message = f'"{crx_filename}" already exists. Overwrite?' message = f'"{crx_filename}" already exists. Overwrite?'
permission = getpermission.getpermission(message) permission = interactive.getpermission(message)
else: else:
permission = False permission = False
else: else:

View file

@ -8,7 +8,7 @@ import send2trash
import sys import sys
import winshell import winshell
from voussoirkit import getpermission from voussoirkit import interactive
from voussoirkit import pathclass from voussoirkit import pathclass
from voussoirkit import spinal from voussoirkit import spinal
@ -38,7 +38,7 @@ def prune_shortcuts(recurse=False, autoyes=False):
print(lnk.absolute_path) print(lnk.absolute_path)
print() print()
if autoyes or getpermission.getpermission('Is that ok?'): if autoyes or interactive.getpermission('Is that ok?'):
for lnk in stale: for lnk in stale:
print(lnk.absolute_path) print(lnk.absolute_path)
send2trash.send2trash(lnk.absolute_path) send2trash.send2trash(lnk.absolute_path)

View file

@ -6,7 +6,7 @@ import sys
import textwrap import textwrap
import time import time
from voussoirkit import getpermission from voussoirkit import interactive
from voussoirkit import passwordy from voussoirkit import passwordy
from voussoirkit import winwhich from voussoirkit import winwhich
@ -374,7 +374,7 @@ def pypi_release(do_tag=False, versionbump='patch'):
linebreak() linebreak()
if not getpermission.getpermission(f'READY TO RELEASE {name} {new_version}.'): if not interactive.getpermission(f'READY TO RELEASE {name} {new_version}.'):
return return
write_setup(setup_py) write_setup(setup_py)

View file

@ -10,7 +10,7 @@ import argparse
import sys import sys
import winreg import winreg
from voussoirkit import getpermission from voussoirkit import interactive
from voussoirkit import pathclass from voussoirkit import pathclass
def extension_registry(ico_file, human_name=None): def extension_registry(ico_file, human_name=None):
@ -32,7 +32,7 @@ def extension_registry(ico_file, human_name=None):
prompt = '\n'.join(prompt) prompt = '\n'.join(prompt)
if not getpermission.getpermission(prompt): if not interactive.getpermission(prompt):
return return
dot_key = winreg.CreateKey(winreg.HKEY_CLASSES_ROOT, dot_ex) dot_key = winreg.CreateKey(winreg.HKEY_CLASSES_ROOT, dot_ex)