|
@ -4,15 +4,7 @@ from shutil import copyfile |
|
|
import logging |
|
|
import logging |
|
|
logger = logging.getLogger('Prismedia') |
|
|
logger = logging.getLogger('Prismedia') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def overwrite_or_not(question): |
|
|
|
|
|
while True: |
|
|
|
|
|
reply = str(input(question + ' (Yes/[No]): ') or "No").lower().strip() |
|
|
|
|
|
if reply[:1] == 'y': |
|
|
|
|
|
return True |
|
|
|
|
|
if reply[:1] == 'n': |
|
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from . import utils |
|
|
|
|
|
|
|
|
def genconfig(): |
|
|
def genconfig(): |
|
|
path = join(dirname(__file__), 'config') |
|
|
path = join(dirname(__file__), 'config') |
|
@ -22,7 +14,7 @@ def genconfig(): |
|
|
final_f = f.replace(".sample", "") |
|
|
final_f = f.replace(".sample", "") |
|
|
overwrite = True |
|
|
overwrite = True |
|
|
if exists(final_f): |
|
|
if exists(final_f): |
|
|
overwrite = overwrite_or_not(final_f + " already exists. Do you want to overwrite it?") |
|
|
|
|
|
|
|
|
overwrite = utils.ask_overwrite(final_f + " already exists. Do you want to overwrite it?") |
|
|
|
|
|
|
|
|
if overwrite: |
|
|
if overwrite: |
|
|
copyfile(join(path, f), final_f) |
|
|
copyfile(join(path, f), final_f) |
|
|