Exemple #1
0
def copyFile(source, destination, verbose=True):
    """convenience function to copy a file from the local disk to a file server.
    returns true if the file was copied.
    """
    loglevel = LogLevel.level
    if not verbose:
        LogLevel.level = 0
    config = ClientConfiguration()
    config.loadDefault()
    client = CmClient(config)
    ok = client.copy(source, destination)
    LogLevel.set(loglevel)
    return ok
Exemple #2
0
def copyFile(source, destination, verbose=True):
    """convenience function to copy a file from the local disk to a file server.
    returns true if the file was copied.
    """
    loglevel = LogLevel.level
    if not verbose:
        LogLevel.level = 0
    config = ClientConfiguration()
    config.loadDefault()
    client = CmClient(config)
    ok = client.copy(source, destination)
    LogLevel.set(loglevel)
    return ok
Exemple #3
0
def cacheFile(filename, verbose=True):
    """convenience function to cache a file to the local disk.
    returns the path of the cached file.
    """
    loglevel = LogLevel.level
    if not verbose:
        LogLevel.level = 0
    config = ClientConfiguration()
    config.loadDefault()
    client = CmClient(config)
    cachedFile, ok = client.fetch(filename)
    LogLevel.set(loglevel)
    return cachedFile
Exemple #4
0
def cacheFile(filename, verbose=True):
    """convenience function to cache a file to the local disk.
    returns the path of the cached file.
    """
    loglevel = LogLevel.level
    if not verbose:
        LogLevel.level = 0
    config = ClientConfiguration()
    config.loadDefault()
    client = CmClient(config)
    cachedFile, ok = client.fetch(filename)
    LogLevel.set(loglevel)
    return cachedFile