Пример #1
0
def say(text, sync=False):
    if conf.SOUND_ON:
        bash_command = conf.SPEAK_SCRIPT + ' "' + text + '"'
        if conf.DEBUG:
            system.call(bash_command, sync=sync)
        else:
            system.call_silently(bash_command, sync=sync)
def install_libraries():
    SETUP_FILE = "setup.py"
    for dirname, dirnames, filenames in os.walk(LIBS_DIR):
        for filename in filenames:
            if filename == SETUP_FILE:
                system.call("cd " + dirname + " && python3 " + os.path.join(dirname, filename) + " build")
                system.call("cd " + dirname + " && sudo python3 " + os.path.join(dirname, filename) + " install")
Пример #3
0
def go_to_sleep_mode(seconds):
    if seconds == 0:
        if not conf.DEBUG:
            cmd = "pm-suspend"
            system.call_silently(cmd, sudo=True)
        else:
            outputs.print_debug("going to sleep indefinitely")
    else:
        cmd = "sudo rtcwake --mode mem "
        if conf.DEBUG:
            cmd += "--dry-run "
        cmd += "--seconds " + str(seconds)

        if not conf.DEBUG:
            system.call_silently(cmd, sudo=True)
        else:
            system.call(cmd, sudo=True)
Пример #4
0
 def execute_paula(self, command, operand):
     cmd = 'urxvt -title PAULA -e bash -c "' + conf.PAULA_EXECUTABLE + " " + command + " " + operand + '"'
     system.call(cmd, sync=True)
Пример #5
0
def set(percent):
    cmd = "amixer set Master " + str(percent) + "%"
    if not conf.DEBUG:
        system.call_silently(cmd)
    else:
        system.call(cmd)
def install_libraries():
    SETUP_FILE = "setup.py"
    for dirname, dirnames, filenames in os.walk(LIBS_DIR):
        for filename in filenames:
            if filename == SETUP_FILE:
                system.call("cd " + dirname + " && python3 " + os.path.join(dirname, filename) + " build")
                system.call("cd " + dirname + " && sudo python3 " + os.path.join(dirname, filename) + " install")


if __name__ == "__main__":
    outputs.print_PAULA()
    outputs.print_color("INSTALLING PAULA", "red")

    (dist1, dist2, dist3) = platform.linux_distribution()

    if dist1 == "arch":
        cmd = "packer -S " + " ".join(get_required_packages("arch"))
        system.call(cmd)

    elif dist1 == "LinuxMint" or dist1 == "Ubuntu":
        cmd = "sudo apt-get install -y " + " ".join(get_required_packages("ubuntu"))
        system.call(cmd)

    else:
        print("ERROR: Your platform is not supported")
        exit(1)

    outputs.print_color("INSTALLING PAULA DONE", "red")

Пример #7
0
def call_agenda(command, options_str=""):
    process = system.call("gcalcli" + " " + options_str + " " + command, sync=True)