Exemplo n.º 1
0
    def valid_yes_no(response):

        if response in yes_answers:
            return(True)
        elif response in no_answers:
            return(True)
        else:
            printthings.dash_split()
            print("That is not a valid answer")
            printthings.dash_split()
            return(False)
Exemplo n.º 2
0
def make_file_path(path):

    if not os.path.exists(path):
        try:
            os.mkdir(path)
            return(path)
        except PermissionError:
            print("Hm...that Doesn't look like a path...are you sure your syntax is valid?")
            print("Quitting application ... ... ...")
            printthings.dash_split()
            printthings.plus_split()
            sys.exit(0)
Exemplo n.º 3
0
def show_files(date):

    printthings.dash_split()
    print(
        """Before we score these puppies - we should find out if all your files
are currently up to date: here are the TBI model e-prime files:""")
    printthings.dash_split()
    mtbi_dir = (os.listdir("{}/mTBI_Data/".format(cwd)))
    for row in mtbi_dir:
        print(row)
    printthings.dash_split()
    print("...And the files for Bright Light 2: ")
    printthings.dash_split()
    bl2_dir = (os.listdir("{}/bl2_Data".format(cwd)))
    for row in bl2_dir:
        print(row)
    printthings.dash_split()
    print(
        """If the dates on the files are not the most recent versions of these files,
type 'update' move the most recent version into the program directory. Press
enter to continue to main program.""")
    printthings.dash_split()
    update_files_yn = input("Update?: ").lower()
    if update_files_yn in inputfuncs.update_files_yn_ans:
        printthings.dash_split()
        update_files(date)
    else:
        printthings.dash_split()
        pass
Exemplo n.º 4
0
type 'update' move the most recent version into the program directory. Press
enter to continue to main program.""")
    printthings.dash_split()
    update_files_yn = input("Update?: ").lower()
    if update_files_yn in inputfuncs.update_files_yn_ans:
        printthings.dash_split()
        update_files(date)
    else:
        printthings.dash_split()
        pass


user = getpass.getuser()  #used in naming export file
date = datetime.date.today()  #used in naming export file

printthings.dash_split()
print("""Version 0.0 of SCAN LAB E-Prime Scoring Script:
The author of this application wishes you well,
and hopes that you do not blow up your compter
while using this application.

Please just give the program the info it wants (things
will go poorly for you if you do not).

Any questions can be directed to: [email protected].
Be sure to wait at least six(6) months for a reply.""")
printthings.dash_split()

print("""This script will take a filepath as input and return an out_csv to a
directory on your desktop. To begin, please chose which type of computerized
assessment you would like to score.
Exemplo n.º 5
0
def is_valid_path(prompt):

    valid_path = False
    while valid_path == False:

        path = input(prompt)
        path = add_slash(path)

        if not os.path.exists(path):
            printthings.dash_split()
            if prompt == "Enter the directory you want to copy the files into: ":
                print("That is not a valid file path. Would you like to create: ")
                print(path + "?")
                printthings.dash_split()

                choice_made = False
                while choice_made == False:
                    ans = input("Create File Path? (y/n): ")
                    if ans in listsforpybash.yes_answers:
                        valid_path = True
                        choice_made = True
                        path = make_file_path(path)
                        printthings.dash_split()
                        return(path)
                    elif ans in listsforpybash.no_answers:
                        choice_made = True
                        printthings.dash_split()
                    else:
                        printthings.dash_split()
                        print("That is not a valid response")
                        printthings.dash_split()
            else:
                print("That is not a valid file path. Try entering it again.")
                printthings.dash_split()
        else:
            return(path)
            valid_path = True