Ejemplo n.º 1
0
def test_write(testfile_path = "dfs_test.txt", 
               testfile_contents = "Test File Contents",
               testfile_start_offset = None):
    
    params = map(str, (testfile_path, testfile_contents, testfile_start_offset))
    print "Running test_write (%s, \"%s\", offset=%s)" % tuple(params)
    
    dfs.write(testfile_path, testfile_contents, testfile_start_offset)
Ejemplo n.º 2
0
def handle_exception(tracefile):
    """
    Write the last traceback to the given file on the DFS.

    :Parameters:
        tracefile : string
            Name of the file where to save the traceback on the DFS
    """
    import traceback
    type, value, trace = sys.exc_info()
    message = traceback.format_exception(type, value, trace)
    errorfile = get_errorfile(tracefile)
    dfs.write(errorfile, ''.join(message))
Ejemplo n.º 3
0
def handle_exception(tracefile):
    """
    Write the last traceback to the given file on the DFS.

    :Parameters:
        tracefile : string
            Name of the file where to save the traceback on the DFS
    """
    import traceback
    type, value, trace = sys.exc_info()
    message = traceback.format_exception(type, value, trace)
    errorfile = get_errorfile(tracefile)
    dfs.write(errorfile, ''.join(message))