def save_last_sync(self, ids, process):
        try:
            spec = {'_id': 'last_sync'}
            document = {'$set': {process: ids}}
            self.db.internal.update(spec, document, upsert=True)
        except Exception as e:
            raise DatabaseException(e)
def runcmd(cmd, **kw):  # same code as in getlino.py
    """Run the cmd similar as os.system(), but stop when Ctrl-C."""
    # kw.update(stdout=subprocess.PIPE)
    # kw.update(stderr=subprocess.STDOUT)
    kw.update(shell=True)
    kw.update(universal_newlines=True)
    kw.update(check=True)
    # subprocess.check_output(cmd, **kw)
    subprocess.run(cmd, **kw)
    # os.system(cmd)