Syncs a file

    :param filename: File to check out
    :type filename: str
    :param connection: Connection object to use
    :type connection: :py:class:`Connection`
497125
def sync(filename, connection=None):
    
    c = connection or connect()
    rev = c.ls(filename)
    if rev:
        rev[0].sync()
1246991
def check_connection (self):
        
        if (self.parent_url is not None and
           not self.parent_url.startswith(u"file:")):
            msg = _("local files are only checked without parent URL or when the parent URL is also a file")
            raise LinkCheckerError(msg)
        if self.is_directory():
            self.set_result(_("directory"))
        else:
            url = fileutil.pathencode(self.url)
            self.url_connection = urlopen(url)
            self.check_case_sensitivity()
562116
def check_file(filename=None, show_filename=False, add_semicolon=False):
    
    # either work with sys.stdin or open the file
    if filename is not None:
        with open(filename, "r") as filelike:
            sql_string = filelike.read()
    else:
        with sys.stdin as filelike:
            sql_string = sys.stdin.read()

    success, msg = check_string(sql_string, add_semicolon=add_semicolon)

    # report results
    result = 0
    if not success:
        # possibly show the filename with the error message
        prefix = ""
        if show_filename and filename is not None:
            prefix = filename + ": "
        print(prefix + msg)
        result = 1

    return result
510161
def get_file(self, filename):
        
        log.debug('[%s]: reading: //%s/%s', self.name, self.name, filename)
        try:
            blob = self.repo.head.commit.tree/filename
            return blob.data_stream
        except KeyError as err:
            raise GitError(err)
286088
def commit(self):
		
		try:
			if self.connection is not None:
				self.connection.commit()
				self._updateCheckTime()
				self.release()
		except Exception, e:
			pass
243285
def synchronize! updater
      source_hash[updater.filename] = source_hash[updater.filename].synchronize(updater)
    end
287917
def addFilename( self, filename ):
        
        filename = os.path.normpath(nativestring(filename))
        
        if filename in self._filenames:
            self._filenames.remove(filename)
        
        self._filenames.insert(0, filename)
        self._filenames = self._filenames[:self.maximumLength()]
        
        self.refresh()
208230
def from_filename(cls, filename, sync_from_start=True):
        
        # Inline imports: the Pygments dependency is optional!
        from pygments.util import ClassNotFound
        from pygments.lexers import get_lexer_for_filename

        try:
            pygments_lexer = get_lexer_for_filename(filename)
        except ClassNotFound:
            return SimpleLexer()
        else:
            return cls(pygments_lexer.__class__, sync_from_start=sync_from_start)
1047416
public void setConnection(Connection connection, boolean csv) {
		this.connection = connection;
		this.csv = csv;
        try {
            dialect = DialectUtil.getDialect(connection);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if  (chart != null) {
            if (chart.getReport().getQuery() != null) {
                chart.getReport().getQuery().setDialect(dialect);
            }           
        }
    }
936243
def send(self, filenames=None):
        
        try:
            with self.ssh_client.connect() as ssh_conn:
                with self.sftp_client.connect(ssh_conn) as sftp_conn:
                    for filename in filenames:
                        sftp_conn.copy(filename=filename)
                        self.archive(filename=filename)
                        if self.update_history_model:
                            self.update_history(filename=filename)
        except SSHClientError as e:
            raise TransactionFileSenderError(e) from e
        except SFTPClientError as e:
            raise TransactionFileSenderError(e) from e
        return filenames
735561
def unwatch_from_file(connection, file_name):
    
    with open(file_name, 'r') as filehandle:
        for line in filehandle.xreadlines():
            volume, interval, retention = line.rstrip().split(',')
            unwatch(connection, get_volume_id(connection, volume))
92293
def sync(self):
        """"""
        if self.filepath:
            serialised_file = open(self.filepath, "w")
            json.dump(self.state, serialised_file)
            serialised_file.close()
        else:
            print("Filepath to the persistence file is not set. State cannot be synced to disc.")
685865
def update(self, fname):
        
        ltfh = FileHandler(fname)
        self._log.addHandler(ltfh)
777070
def input_file(self, filename, lines=None, expected=None, line_offset=0):
        """"""
        if self.options.verbose:
            print('checking %s' % filename)
        fchecker = self.checker_class(
            filename, lines=lines, options=self.options)
        return fchecker.check_all(expected=expected, line_offset=line_offset)
1187158
function _syncWithFileSystem() {
        _mrofList = _mrofList.filter(function (e) {return e; });
        return Async.doSequentially(_mrofList, _checkExt, false);
    }
335771
def file_source(self, filename):
        
        lines = []
        try:
            with self.filesystem.open(filename) as f:
                line_statuses = dict(self.line_statuses(filename))
                for lineno, source in enumerate(f, start=1):
                    line_status = line_statuses.get(lineno)
                    line = Line(lineno, source, line_status, None)
                    lines.append(line)

        except self.filesystem.FileNotFound as file_not_found:
            lines.append(
                Line(0, '%s not found' % file_not_found.path, None, None)
            )

        return lines
624843
def idmap_sync(connection):
	
	xmldoc = get_xml(connection)
	for tbl in xmldoc.getElementsByTagName(DBTable.tagName):
		tbl.sync_next_id()
	xmldoc.unlink()