예제 #1
0
def wxapp_converter():
    """Standalon application."""
    app = awx.App()
    frame = ConverterFrame(None)
    frame.Show()
    app.SetTopWindow(frame)
    return app
예제 #2
0
파일: editor.py 프로젝트: fgoudreault/abipy
def wxapp_showfiles(filenames=None, dirpath=None, walk=True, wildcard=None):
    """
    Standalone applications that reads the content of the files specified 
    in input and show them in a notebook.

    Args:
        filenames:
            List of files to show in the notebook. Defaults to an empty list.
        dirpath:
            Directory to scan for additional files.
        walk:
            Used only if dirpath is not None.
            If True, we scan all the files contained within dirpath and 
            we add them to the list if their name match the regular expression 
            given in wildcard.
        wildcard:
            String with regular expressions separated by |.
            Only the files matching one of the regular expressions will be showed.
            example: wildcard="*.nc|*.txt" shows only the files whose extension is in ["nc", "txt"].

    Returns:
        `wxpython` application.
    """
    app = awx.App()
    frame = TextNotebookFrame.from_files_and_dir(None,
                                                 filenames=filenames,
                                                 dirpath=dirpath,
                                                 walk=walk,
                                                 wildcard=wildcard)
    frame.Show()
    return app
예제 #3
0
파일: comparison.py 프로젝트: gmrigna/abipy
def wxapp_comparison(dirpaths=None, filepaths=None, wildcard=None):
    app = awx.App()
    frame = ComparisonFrame(None,
                            dirpaths=dirpaths,
                            filepaths=filepaths,
                            wildcard=wildcard)
    frame.Show()
    return app
예제 #4
0
def wxapp_listbrowser(dirpaths=None, filepaths=None, wildcard=""):
    """Standalone application ListBroweser."""
    app = awx.App()
    frame = FileListFrame(None,
                          dirpaths=dirpaths,
                          filepaths=filepaths,
                          wildcard=wildcard)
    frame.Show()
    return app
예제 #5
0
def wxapp_dirbrowser(dirpath):
    """Standalone application.for DirBrowser."""
    if dirpath is None:
        dirpath = " "
    else:
        dirpath = os.path.abspath(dirpath)

    app = awx.App()
    frame = DirBrowserFrame(None, dir=dirpath)
    frame.Show()
    return app
예제 #6
0
파일: structure.py 프로젝트: zbwang/abipy
def wxapp_structure_converter(obj):
    """
    Standalong WX application for structure conversion.

    Args:
        obj:
            Structure object, filename or object with a structure attribute.
    """
    app = awx.App()
    frame = StructureConverterFrame(None, obj)
    app.SetTopWindow(frame)
    frame.Show()

    return app
예제 #7
0
def wxapp_scissors(filepath):
    app = awx.App()
    ScissorsBuilderFrame(None, filepath).Show()
    return app
예제 #8
0
파일: flowviewer.py 프로젝트: gmrigna/abipy
def wxapp_flow_viewer(works):
    """Standalone application for `FlowViewerFrame`."""
    app = awx.App()
    FlowViewerFrame(None, works).Show()
    return app
예제 #9
0
def wxapp_fftprof():
    """Stand alone application."""
    app = awx.App()
    frame = FFTProfFrame(None)
    frame.Show()
    return app
예제 #10
0
파일: editor.py 프로젝트: fgoudreault/abipy
            Only the files matching one of the regular expressions will be showed.
            example: wildcard="*.nc|*.txt" shows only the files whose extension is in ["nc", "txt"].

    Returns:
        `wxpython` application.
    """
    app = awx.App()
    frame = TextNotebookFrame.from_files_and_dir(None,
                                                 filenames=filenames,
                                                 dirpath=dirpath,
                                                 walk=walk,
                                                 wildcard=wildcard)
    frame.Show()
    return app


if __name__ == "__main__":
    app = awx.App()
    frame = EditorNotebookFrame()
    #frame = wx.Frame(None, -1)
    #notebook = EditorNotebook(frame)
    for filename in ["editor.py", "__init__.py"]:
        frame.bufferCreate(filename=filename)

    #Editor(frame)
    frame.Show()
    #frame = EditorFrame()
    #frame.bufferCreate(file.path)
    #frame = EditorNotebookFrame(filename=file.path)
    app.MainLoop()