Ejemplo n.º 1
0
def insert_unload_reload(ar: rumps.MenuItem, j: launchd.LaunchdJob):
    print(j.plistfilename)
    ar.add(
        rumps.MenuItem("Unload",
                       callback=lambda x: launchd.unload(j.plistfilename)))
    ar.add(
        rumps.MenuItem("Reload",
                       callback=lambda x: launchd.unload(j.plistfilename) and
                       launchd.load(j.plistfilename)))
Ejemplo n.º 2
0
def uninstall(label):
    '''
    Utility function to remove a .plist file and unload it

    :param label: job label
    '''
    if launchd.LaunchdJob(label).exists():
        fname = launchd.plist.discover_filename(label)
        launchd.unload(fname)
        os.unlink(fname)
Ejemplo n.º 3
0
def uninstall(label):
    '''
    Utility function to remove a .plist file and unload it

    :param label: job label
    '''
    if launchd.LaunchdJob(label).exists():
        fname = launchd.plist.discover_filename(label)
        launchd.unload(fname)
        os.unlink(fname)
Ejemplo n.º 4
0
def plist_launch_uninstall(label, scope):
    fname = launchd.plist.discover_filename(label, scope)
    if not fname:
        raise Exception(f"{label}.plist not found.")
    launchd.unload(fname)
    os.unlink(fname)