示例#1
0
def stop_music():
    if ad.is_ubuntu():
        os.system("rhythmbox-client --stop")
        return "Music stopped"

    else:
        return "Not available for windows yet"
示例#2
0
def remind(msg, date, time):

    reminder_time = time[0].split(':')
    current_time = get_time().split('-')

    today_date = get_date().split('-')
    months = [
        'jan', 'feb', 'march', 'april', 'may', 'june', 'july', 'aug', 'sep',
        'oct', 'nov', 'dec'
    ]

    reminder_date = date.split(' ')
    # print(today_date[1])
    # print(months.index(reminder_date[1].lower())+1)
    if int(today_date[1]) == months.index(reminder_date[1].lower()) + 1:
        if reminder_time[0] == current_time[0] and reminder_time[
                1] == current_time[1]:
            remind_msg = 'notify-send "' + msg + '"'
            if ad.is_ubuntu():
                os.system(remind_msg)
            else:
                from win10toast import ToastNotifier
                toaster = ToastNotifier()
                toaster.show_toast("Virtual Assistant", msg)

            return True

    return False
示例#3
0
def pause_music():
    if ad.is_ubuntu():
        os.system("rhythmbox-client --pause")
        return "Music paused"
    else:
        #windows code
        return "For windows its not available it"
示例#4
0
def previous_song():

    if ad.is_ubuntu():
        os.system("rhythmbox-client --previous")
        return "Playing Previous Song"

    else:
        return "For windows its not available"
示例#5
0
def next_song():

    if ad.is_ubuntu():
        os.system("rhythmbox-client --next")
        return "Playing Next Song"

    else:
        return "For windows its not available"
示例#6
0
def stop_music():

    if ad.is_ubuntu():
        os.system("rhythmbox-client --stop")
        return "Music Stoped"

    else:
        return "For windows its not available"
示例#7
0
def play_music():
    if ad.is_ubuntu():
        os.system("rhythmbox-client --play")
        return "Playing Music"

    else:
        #windows code
        return "For windows its not available it"
示例#8
0
def play_music():

    if ad.is_ubuntu():
        os.system("rhythmbox-client --play")
        return "Playing Music"

    else:
        os.startfile(os.path.join(music_path, songs[0]))
        return "Playing Music"
示例#9
0
def play_specific_song(song_name):

    song_name = song_name.replace('play', '')
    if ad.is_ubuntu():
        file_search.set_root(music_path)
        songs = file_search.searchFile(song_name)
        try:
            song_uri = songs[0]
            command = 'rhythmbox-client --play-uri="' + song_uri + '"'
            os.system(command)
            return ("playing  " + song_name)
        except:
            return ("song not found in your computer")

    else:
        return "not availble for windows yet"
def change_wallpaper():

    if ad.is_ubuntu():
        wallpaper_path = '/home/shivam-gupta/Pictures/Wallpapers'
        wallpapers = os.listdir(wallpaper_path)
        #os.system("export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/")
        wallpaper = random.choice(wallpapers)
        command = 'export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/' + '\n' + 'gsettings set org.gnome.desktop.background picture-uri file:///' + wallpaper_path + "/" + wallpaper
        os.system(command)
        return "Wallpaper changed"
    else:
        import ctypes
        SPI_SETDESKWALLPAPER = 20
        ctypes.windll.user32.SystemParametersInfoW(
            SPI_SETDESKWALLPAPER, 0,
            'C:\\Users\\shiva\\Desktop\\AI_Virtual_Assistant\\image.jpg', 0)
        return "Wallpaper changed"
示例#11
0
def play_specific_song(song_name):
    song_name = song_name.replace('play ', '')
    if ad.is_ubuntu():
        file_search.set_root(music_path)
        songs = file_search.searchFile(song_name)
        try:
            song_uri = songs[0]
            command = 'rhythmbox-client --play-uri="' + song_uri + '"'
            os.system(command)
            return "Playing " + song_name
        except:
            return ("Song not found in your computer")

    else:
        file_search.set_root(music_path)
        songs = file_search.searchFile(song_name)
        try:
            os.startfile(os.path.join(music_path, songs[0]))
            return "Playing " + song_name
        except:
            return "Song not found in your computer"
示例#12
0
from output_module import output
import welcome
import os
import assistant_details as ad
from database import listen_is_on
from listen_module import listen
import AssistantGUI as gui
from automatic import check_last_modify

from pathlib import Path
my_file = Path("setup.py")

if my_file.is_file():
    import setup

if ad.is_ubuntu():
    os.system('clear')
else:
    os.system('cls')


def installation():
    f = open("setup.py", "a")
    print("-----------Welcome to Virtual Assistant------------")
    output("Before starting few Setup is required")
    output("Should I Call You Ma'am or Sir or whatever you say")
    status = take_input()
    statement1 = 'status = "' + status + '"' + '\n'
    f.write(statement1)
    output("Do you want to set the path for music")
    ans = take_input()
示例#13
0
def previous_song():
    if ad.is_ubuntu():
        os.system("rhythmbox-client --previous")
        return "Playing previous song"
    else:
        return "not availble for windows yet"
示例#14
0
def next_song():
    if ad.is_ubuntu():
        os.system("rhythmbox-client --next")
        return "Playing next song"
    else:
        return "not availble for windows yet"