Exemplo n.º 1
0
def __dir__() -> List[str]:
    global results
    if not results:
        results = generate()
    if location.get_current_location() == sys.intern("Australia"):
        return results
    this = sys.modules[__name__]
    return dir(this)
Exemplo n.º 2
0
def worldmap():
    if location.get_current_location() == sys.intern("Australia"):
        from IPython.display import Image
        return Image("ausMap.png")
    else:
        from IPython.display import display, Javascript
        import folium
        m = folium.Map(location=[0,0], zoom_start=2)
        display(m)
        return Javascript('this.element.attr("class", "mymapoutput")')
Exemplo n.º 3
0
    def more_halloween(*args, **kwargs):
        """🎃🎃🎃 Let's make this more awesome!!! 🎃🎃🎃"""
        halloween_prefix = "🎃🎃🎃"
        halloween_suffix = "🎃🎃🎃"
        #print("==get_cl()=", location.get_current_location())
        #print(id(location.current_location))
        #print("==cl==", location.current_location)
        if location.get_current_location() == "Australia":
            nonlocal australia_called
            australia_called += 1
            if australia_called == 1:
                raise HalloweenException(
                    "🎃🎃🎃 Pumpkins aren't in season in Australia now... 🎃🎃🎃")
            elif australia_called == 2:
                raise HalloweenException(
                    "Seems like you still really want to celebrate Halloween in Australia, "
                    "perhaps you should consider travelling to the northern hemisphere using "
                    "southern_hemisphere.travel_to('Chicago') ?")
            elif australia_called >= 3:

                halloween_prefix = "🦘🦘🦘"
                halloween_suffix = "🦘🦘🦘"
        res = spooky(*args, **kwargs)
        if location.trick_or_treat_state == location.TrickOrTreatState.MORE_TREATS:
            trick_or_treat_prefix = make_treat_prefix(more_icons=True)
            trick_or_treat_suffix = make_treat_prefix(more_icons=True)
            return halloween_prefix + trick_or_treat_prefix + TREAT + trick_or_treat_suffix + halloween_suffix
        elif location.trick_or_treat_state == location.TrickOrTreatState.MORE_TRICKS:
            trick_or_treat_prefix = make_trick_prefix(more_icons=True)
            trick_or_treat_suffix = make_trick_prefix(more_icons=True)
            return halloween_prefix + trick_or_treat_prefix + TRICK + trick_or_treat_suffix + halloween_suffix
        if res == TRICK:
            return halloween_prefix + make_trick_prefix(
            ) + res + make_trick_prefix() + halloween_suffix
        elif res == TREAT:
            return halloween_prefix + make_treat_prefix(
            ) + res + make_treat_prefix() + halloween_suffix
        else:
            return res
Exemplo n.º 4
0
def find_location():
    print('Get current location',end='')
    global current_location
    while True:
        current_location = location.get_current_location()