How to use the sarge.Feeder function in sarge

To help you get started, we’ve selected a few sarge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ThiefMaster / fsnotifier-remote / View on Github external
exe_dir = os.path.dirname(os.path.realpath(sys.executable if hasattr(sys, 'frozen') else sys.argv[0]))
    config_file = os.path.join(exe_dir, 'fsnotifier.yaml')

        with open(config_file) as f:
            config = yaml.load(f)
    except FileNotFoundError:
        print('Config file not found: {}'.format(config_file))

    logfile = open(config['log']['file'] if config['log']['enabled'] else os.devnull, 'w')
    config['reverse_mapping'] = {v: '{}:'.format(k) for k, v in config['mapping'].items()}

    # Local notifier
    local_stdin = sarge.Feeder()
    local_watcher =['fsnotifier']['local'], stdout=sarge.Capture(), input=local_stdin, async_=True)
    local_monitor = LocalMonitorThread(daemon=True)

    # Remote notifier
    ssh_conn = paramiko.SSHClient()
    ssh_conn.connect(config['ssh']['host'], username=config['ssh']['user'], allow_agent=True)
    ssh_stdin, ssh_stdout, _ = ssh_conn.exec_command(config['fsnotifier']['remote'])
    remote_monitor = RemoteMonitorThread(daemon=True)


    receiving_roots = False
    new_roots = []
    while True:


A wrapper for subprocess which provides command pipeline functionality.

Latest version published 2 years ago

Package Health Score

49 / 100
Full package analysis