Beispiel #1
0
def print_data(mandatoryTasks, optionaltasks, pastduetasks, taskController):
    # Printing Tasks
    colorMandatory = "255;2;151:"
    colorOptional = "2;255;232:"
    colorPastdue = "255;255;255:"

    mandatoryTasksStr = []
    for task in mandatoryTasks:
        mandatoryTasksStr.append(task.get_list_print_data())

    optionalTasksStr = []
    for task in optionaltasks:
        optionalTasksStr.append(task.get_list_print_data())

    pastdueTasksStr = []
    for task in pastduetasks:
        pastdueTasksStr.append(task.get_list_print_data())

    print_figlet("Mandatory", font="slant", colors=colorMandatory)
    taskController.print_task_table(mandatoryTasksStr)

    print_figlet("Optional", font="slant", colors=colorOptional)
    taskController.print_task_table(optionalTasksStr)

    print_figlet("Past-Due", font="slant", colors=colorPastdue)
    taskController.print_task_table(pastdueTasksStr)

    print("")

    today = date.today()
    dateStr = today.strftime("%d-%B-%Y")
    cowsay.tux("Current Date : " + dateStr)
Beispiel #2
0
def main():
    gender = user_info.inputGender("What is your gender: Male or Female? \n")
    age_group = user_info.inputAge("How old are you? \n")

    profile = user_profile.inputProfile(
        "Do you have a profile: [YES or NO] \n")
    if profile == "YES":
        run_profile = user_profile.inputProfile(
            "Is your profile for the run event: [YES or NO] \n")
        if run_profile == "YES":
            aerobic = user_profile.inputAltAerobic(
                "Select the number of which alterante event you take \n1. Walk, 2. Stationary-Cycle Ergometer, 3. Bicycle, 4. Swim: \n"
            )
            other_profile = user_profile.inputProfile(
                "Do you have another profile: [YES or NO] \n")
            if other_profile == "YES":
                pushup_profile = user_profile.inputProfile(
                    "Is your profile for the pushup event: [YES or NO] \n")
                situp_profile = user_profile.inputProfile(
                    "Is your profile for the situp event: [YES or NO] \n")
            else:
                pushup_profile = "NO"
                situp_profile = "NO"
        else:
            pushup_profile = user_profile.inputProfile(
                "Is your profile for the pushup event: [YES or NO] \n")
            situp_profile = user_profile.inputProfile(
                "Is your profile for the situp event: [YES or NO] \n")
            run_profile = "NO"
            aerobic = "run"
    else:
        pushup_profile = "NO"
        situp_profile = "NO"
        run_profile = "NO"
        aerobic = "run"

    if pushup_profile == "YES":
        pushupScore = "60"
    else:
        pushupRAW = user_raw.inputPushup("How many pushups did you do? \n")
        pushupScore = str(eval_score.evalPushup(pushupRAW, gender, age_group))

    if situp_profile == "YES":
        situpScore = "60"
    else:
        situpRAW = user_raw.inputSitup("How many situps did you do? \n")
        situpScore = str(eval_score.evalSitup(situpRAW, gender, age_group))

    evaltime = user_raw.inputRun("enter time you completed the " + aerobic +
                                 " [16:36]: \n")
    aerobicScore = str(
        eval_score.evalAerobic(evaltime, gender, age_group, aerobic))

    total = int(pushupScore) + int(situpScore) + int(aerobicScore)
    cowsay.tux("Your pushup score is " + pushupScore +
               "\n Your situp score is " + situpScore +
               "\n Your run score is " + aerobicScore +
               "\n You total score is " + str(total))
Beispiel #3
0
def browse():
    resp = requests.get('http://cve.circl.lu/api/browse')
    t = json.loads(resp.text)
    result = pd.DataFrame(t['vendor'],columns=['vendors'])  
    p= print(tabulate(result, headers='keys', tablefmt='psql'))
    csv_Input = int(input("Please, enter the 'CSV' as options to get csv :\n [1].YES\n [2].NO\n"))
    if csv_Input == '1':
        result.to_csv('./Browse_CSV.csv')
    else:
        cowsay.tux("Adois Amigo !")
    return p
Beispiel #4
0
def main():
    cowsay.tux("Let's incubate!")
    validate_incubator_name()
    initialize_system()
    incubator_id = get_incubator_id()
    while True:
        adjust_lights()
        if is_lights_on():
            take_picture()
        if sensor:
            write_to_database(incubator_id)
        time.sleep(SLEEP_INTERVAL_SEC)
Beispiel #5
0
def ask_question(prompt):
    global correct_answers, total_asked
    question, answer, choices = [
        prompt[k] for k in ('question', 'answer', 'choices')
    ]

    cowsay.cow(question)
    for choice, description in choices:
        print choice, description
    guess = raw_input('whatcha think? ')

    if guess.lower() == answer[0]:
        cowsay.tux('Yaaasss! %s, %s' % (random.choice(glow_ups), answer[1]))
        correct_answers += 1
    else:
        cowsay.tux('Oops! Nice try but it\'s %s' % answer[1])
    total_asked += 1
def main():
    cowsay.tux("Let's incubate!")
    validate_incubator_name()
    initialize_system()
    incubator_id = get_incubator_id()
    sensor_time = time.time()
    camera_time = time.time()
    while True:
        adjust_lights()
        camera_delta = (time.time() - camera_time)
        sensor_delta = (time.time() - sensor_time)
        if is_lights_on() and (camera_delta > CAMERA_FREQ_SECONDS):
            take_picture()
            camera_time += CAMERA_FREQ_SECONDS
        if sensor and (sensor_delta > SENSOR_FREQ_SECONDS):
            is_success = write_to_database(incubator_id)
            if is_success:
                sensor_time += SENSOR_FREQ_SECONDS
        logger.info(f"System heartbeat: {datetime.datetime.now()}")
        time.sleep(5)
Beispiel #7
0
    def execute(self):
        '''
            This function must be present in each and every python module
        '''
        if (self.set_character is None):
            stderr.write('Please specify \'set_character\' value in yaml!')
            exit(1)
        if (self.text is None):
            stderr.write('Please specify \'text\' value in yaml!')
            exit(1)

        if (self.set_character.lower() == 'tux'):
            tux(self.text)

        elif (self.set_character.lower() == 'dragon'):
            dragon(self.text)
        elif (self.set_character.lower() == 'cheese'):
            cheese(self.text)
        else:
            print("Specified cowsay character :: {0} is not present!".format(
                self.set_character))
Beispiel #8
0
def draw_name(df, amount, repeat, display, acowsay):
    while not df.empty:
        clear_terminal()
        loading_animation()
        clear_terminal()
        chosen_name = []
        for i in range(0, amount):
            if df.empty:
                break
            chosen_name.append(df.loc[df.sample().index[0], 'Names'])
            if not repeat:
                df = df[df["Names"].str.contains(chosen_name[i])==False]
        if display and not df.empty:
            print(df)
        if acowsay:
            cowsay.tux(', '.join(chosen_name))
        else:
            print(f"\nChosen Name/s: {', '.join(chosen_name)}")
        ask_choose_again()
    else:
        print("\nProgram Ended.\nList of names is now empty.")
        sys.exit(0)
Beispiel #9
0
import cowsay
# print(cowsay.char_names)
name = input('Enter your name : ')
string = f'Hello {name}'

cowsay.daemon(string)
cowsay.cow(string)
cowsay.dragon(string)
cowsay.beavis(string)
cowsay.cheese(string)
cowsay.ghostbusters(string)
cowsay.kitty(string)
cowsay.meow(string)
cowsay.milk(string)
cowsay.pig(string)
cowsay.stegosaurus(string)
cowsay.stimpy(string)
cowsay.turkey(string)
cowsay.turtle(string)
cowsay.tux(string)
Beispiel #10
0
import cowsay

# Documentation: https://pypi.org/project/cowsay/
cowsay.tux("Hello guys..... AHahahhahahah!")
cowsay.cow("Hello World!")
cowsay.trex('Hello (extinct) World')

cowsay.dragon(
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris blandit rhoncus nibh. Mauris mi mauris, molestie vel metus sit amet, aliquam vulputate nibh."
)

# More characters
print(cowsay.char_names)
Beispiel #11
0
import cowsay

cowsay.tux("@ackercode")
Beispiel #12
0
    Curr_Path = pathlib.Path().absolute()
    print('\n')
    print("Last_CVE.csv generated at ",Curr_Path)
    return result

# dbinfo
def db_info():
    resp = requests.get('http://cve.circl.lu/api/dbInfo')
    t = json.loads(resp.text)
    p= (json.dumps(t, indent=4, sort_keys=True))
    print(p)

try:
    if sys.argv[1] == '-b' or sys.argv[1] == '--browse':
        browse()
    elif sys.argv[1] == '-v' or sys.argv[1] == '--vendor':
        data = input("Enter the keyword, to search for vendor :")
        browse_vendors(data)
    elif sys.argv[1] == '-c' or sys.argv[1] == '--CVE':
        data = input("Enter the CVE id :")
        cve_ID(data)
    elif sys.argv[1] == '-lc' or sys.argv[1] == '--lastcve':
        Last_CVE()
    elif sys.argv[1] == '-db' or sys.argv[1] == '--dbinfo':
        db_info()
    elif sys.argv[1] == '-h' or sys.argv[1] == '--help':
        cowsay.tux("Use any following options\n [1]. Browse [or] -b\n [2]. Vendor [or] -v\n [3]. CVE [or] -c\n [4]. LastCVE [or] -lc\n [5]. DBinfo [or] -db\n kindly follow the format\n python CIRCL_CVE.py [OPTIONS] eg:--db ")
    else:
        cowsay.tux("Use any following options\n [1]. Browse [or] -b\n [2]. Vendor [or] -v\n [3]. CVE [or] -c\n [4]. LastCVE [or] -lc\n [5]. DBinfo [or] -db\n kindly follow the format\n python CIRCL_CVE.py [OPTIONS] eg:--db ")
except:
    cowsay.tux("Use any following options\n [1]. Browse [or] -b\n [2]. Vendor [or] -v\n [3]. CVE [or] -c\n [4]. LastCVE [or] -lc\n [5]. DBinfo [or] -db\n kindly follow the format\n python CIRCL_CVE.py [OPTIONS] eg:--db ")
Beispiel #13
0
def baz():
    return cowsay.tux('hi')
Beispiel #14
0
import cowsay

#for i in [‘beavis’, ‘cheese’, ‘daemon’, ‘cow’, ‘dragon’, ‘ghostbusters’, ‘kitty’, ‘meow’, ‘milk’, ‘stegosaurus’, ‘stimpy’, ‘turkey’, ‘turtle’, ‘tux’]
cowsay.tux("hallo")
#    pass
Beispiel #15
0
import cowsay
cowsay.tux("Poetry is awesome!")
Beispiel #16
0
import cowsay
cowsay.tux("Dentsu Python Classroom")
Beispiel #17
0
def whatup(name):
    hello.say_hello(name)
    cowsay.tux('yo! whatup?')
async def tux(ctx, *, text):
    await ctx.send('```' + cowsay.tux(text) + '```')