def GetExportPath(G2frame):
    """Determines the default location to use for writing files. Tries sequentially
    G2frame.LastExportDir and G2frame.LastGPXdir.
    
    :returns: a string containing the path to be used when writing files or '.'
      if none of the above are specified.
    """
    if G2frame.LastExportDir:
        return G2frame.LastExportDir
    elif G2frame.LastGPXdir:
        return G2frame.LastGPXdir
    else:
        return '.'
