import random as rn
import json
import os


# Maybe integrate this to appdata module

# TODO: Change the ubication of the json file

def quotes_load():

    # This function loads the json file and add it to a variable named quotes
    if os.path.isfile("./modules/quotes.json") and os.stat("./modules/quotes.json").st_size != 0:
        old_file = open("./modules/quotes.json", "r+")
        data = json.loads(old_file.read())
        quotes = rn.choice(list(data["quotes"]))
        return quotes

    # TODO: Change the way of how the project generates a json,
    #       right now is only for development purposes.

    else:
        # You need to run this is you delete quotes.json
        old_file = open("./modules/quotes.json", "w+")
        data = {"quotes": ["Success is the sum of small efforts, repeated day after day.",
                           "You can do it!"]}
        old_file.seek(0)
        old_file.write(json.dumps(data))


class QuotesData:
    pass

d59940721a15b942a9fd523751240beb074539c0
<mask token>

<mask token>


class QuotesData:
    pass

<mask token>


def quotes_load():
    if os.path.isfile('./modules/quotes.json') and os.stat(
        './modules/quotes.json').st_size != 0:
        old_file = open('./modules/quotes.json', 'r+')
        data = json.loads(old_file.read())
        quotes = rn.choice(list(data['quotes']))
        return quotes
    else:
        old_file = open('./modules/quotes.json', 'w+')
        data = {'quotes': [
            'Success is the sum of small efforts, repeated day after day.',
            'You can do it!']}
        old_file.seek(0)
        old_file.write(json.dumps(data))


class QuotesData:
    pass

import random as rn
import json
import os


def quotes_load():
    if os.path.isfile('./modules/quotes.json') and os.stat(
        './modules/quotes.json').st_size != 0:
        old_file = open('./modules/quotes.json', 'r+')
        data = json.loads(old_file.read())
        quotes = rn.choice(list(data['quotes']))
        return quotes
    else:
        old_file = open('./modules/quotes.json', 'w+')
        data = {'quotes': [
            'Success is the sum of small efforts, repeated day after day.',
            'You can do it!']}
        old_file.seek(0)
        old_file.write(json.dumps(data))


class QuotesData:
    pass

import random as rn
import json
import os


# Maybe integrate this to appdata module

# TODO: Change the ubication of the json file

def quotes_load():

    # This function loads the json file and add it to a variable named quotes
    if os.path.isfile("./modules/quotes.json") and os.stat("./modules/quotes.json").st_size != 0:
        old_file = open("./modules/quotes.json", "r+")
        data = json.loads(old_file.read())
        quotes = rn.choice(list(data["quotes"]))
        return quotes

    # TODO: Change the way of how the project generates a json,
    #       right now is only for development purposes.

    else:
        # You need to run this is you delete quotes.json
        old_file = open("./modules/quotes.json", "w+")
        data = {"quotes": ["Success is the sum of small efforts, repeated day after day.",
                           "You can do it!"]}
        old_file.seek(0)
        old_file.write(json.dumps(data))


class QuotesData:
    pass
