Transition calls to getpermission to interactive.
This commit is contained in:
parent
4120c3dfcc
commit
35281c81ab
8 changed files with 16 additions and 16 deletions
|
@ -18,7 +18,7 @@ import re
|
|||
import sys
|
||||
import unicodedata
|
||||
|
||||
from voussoirkit import getpermission
|
||||
from voussoirkit import interactive
|
||||
from voussoirkit import safeprint
|
||||
from voussoirkit import spinal
|
||||
from voussoirkit import stringtools
|
||||
|
@ -74,7 +74,7 @@ def brename(transformation, autoyes=False, recurse=False):
|
|||
|
||||
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
|
||||
# occurs before renaming the directory itself. If you rename the
|
||||
# directory first, then the path to the file is invalid by the time
|
||||
|
|
|
@ -5,7 +5,7 @@ import pyperclip
|
|||
import re
|
||||
import sys
|
||||
|
||||
from voussoirkit import getpermission
|
||||
from voussoirkit import interactive
|
||||
from voussoirkit import pipeable
|
||||
from voussoirkit import spinal
|
||||
from voussoirkit import winglob
|
||||
|
@ -25,7 +25,7 @@ def contentreplace(filename, replace_from, replace_to, autoyes=False, do_regex=F
|
|||
if occurances == 0:
|
||||
return
|
||||
|
||||
if not (autoyes or getpermission.getpermission('Replace?')):
|
||||
if not (autoyes or interactive.getpermission('Replace?')):
|
||||
return
|
||||
|
||||
if do_regex:
|
||||
|
|
|
@ -10,7 +10,7 @@ import os
|
|||
import re
|
||||
import sys
|
||||
|
||||
from voussoirkit import getpermission
|
||||
from voussoirkit import interactive
|
||||
from voussoirkit import pathclass
|
||||
from voussoirkit import safeprint
|
||||
|
||||
|
@ -78,7 +78,7 @@ def fileprefix(
|
|||
message = f'{oldname} -> {newname}'
|
||||
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:
|
||||
os.rename(oldname, newname)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import argparse
|
|||
import os
|
||||
import sys
|
||||
|
||||
from voussoirkit import getpermission
|
||||
from voussoirkit import interactive
|
||||
from voussoirkit import spinal
|
||||
|
||||
def filepull(pull_from='.', autoyes=False):
|
||||
|
@ -31,7 +31,7 @@ def filepull(pull_from='.', autoyes=False):
|
|||
for f in files:
|
||||
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:
|
||||
local = os.path.join('.', f.basename)
|
||||
os.rename(f.absolute_path, local)
|
||||
|
|
|
@ -9,7 +9,7 @@ import traceback
|
|||
import zipfile
|
||||
|
||||
from voussoirkit import clipext
|
||||
from voussoirkit import getpermission
|
||||
from voussoirkit import interactive
|
||||
|
||||
FILENAME_BADCHARS = '\\/:*?<>|"'
|
||||
|
||||
|
@ -82,7 +82,7 @@ def getcrx(extension_id, auto_overwrite=None):
|
|||
permission = True
|
||||
if auto_overwrite is None:
|
||||
message = f'"{crx_filename}" already exists. Overwrite?'
|
||||
permission = getpermission.getpermission(message)
|
||||
permission = interactive.getpermission(message)
|
||||
else:
|
||||
permission = False
|
||||
else:
|
||||
|
|
|
@ -8,7 +8,7 @@ import send2trash
|
|||
import sys
|
||||
import winshell
|
||||
|
||||
from voussoirkit import getpermission
|
||||
from voussoirkit import interactive
|
||||
from voussoirkit import pathclass
|
||||
from voussoirkit import spinal
|
||||
|
||||
|
@ -38,7 +38,7 @@ def prune_shortcuts(recurse=False, autoyes=False):
|
|||
print(lnk.absolute_path)
|
||||
print()
|
||||
|
||||
if autoyes or getpermission.getpermission('Is that ok?'):
|
||||
if autoyes or interactive.getpermission('Is that ok?'):
|
||||
for lnk in stale:
|
||||
print(lnk.absolute_path)
|
||||
send2trash.send2trash(lnk.absolute_path)
|
||||
|
|
|
@ -6,7 +6,7 @@ import sys
|
|||
import textwrap
|
||||
import time
|
||||
|
||||
from voussoirkit import getpermission
|
||||
from voussoirkit import interactive
|
||||
from voussoirkit import passwordy
|
||||
from voussoirkit import winwhich
|
||||
|
||||
|
@ -374,7 +374,7 @@ def pypi_release(do_tag=False, versionbump='patch'):
|
|||
|
||||
linebreak()
|
||||
|
||||
if not getpermission.getpermission(f'READY TO RELEASE {name} {new_version}.'):
|
||||
if not interactive.getpermission(f'READY TO RELEASE {name} {new_version}.'):
|
||||
return
|
||||
|
||||
write_setup(setup_py)
|
||||
|
|
|
@ -10,7 +10,7 @@ import argparse
|
|||
import sys
|
||||
import winreg
|
||||
|
||||
from voussoirkit import getpermission
|
||||
from voussoirkit import interactive
|
||||
from voussoirkit import pathclass
|
||||
|
||||
def extension_registry(ico_file, human_name=None):
|
||||
|
@ -32,7 +32,7 @@ def extension_registry(ico_file, human_name=None):
|
|||
|
||||
prompt = '\n'.join(prompt)
|
||||
|
||||
if not getpermission.getpermission(prompt):
|
||||
if not interactive.getpermission(prompt):
|
||||
return
|
||||
|
||||
dot_key = winreg.CreateKey(winreg.HKEY_CLASSES_ROOT, dot_ex)
|
||||
|
|
Loading…
Reference in a new issue