Commit 47379906 by willmcgugan

hide dotfiles fix from Andrew

parent 25df7c95
...@@ -1179,10 +1179,14 @@ class FS(object): ...@@ -1179,10 +1179,14 @@ class FS(object):
print_fs(self, max_levels=max_levels) print_fs(self, max_levels=max_levels)
tree = printtree tree = printtree
def browse(self): def browse(self, hide_dotfiles=False):
"""Displays the FS tree in a graphical window (requires wxPython)""" """Displays the FS tree in a graphical window (requires wxPython)
:param hide_dotfiles: If True, files and folders that begin with a dot will be hidden
"""
from fs.browsewin import browse from fs.browsewin import browse
browse(self) browse(self, hide_dotfiles)
def getmmap(self, path, read_only=False, copy=False): def getmmap(self, path, read_only=False, copy=False):
"""Returns a mmap object for this path. """Returns a mmap object for this path.
......
...@@ -183,12 +183,12 @@ def browse(fs, hide_dotfiles=False): ...@@ -183,12 +183,12 @@ def browse(fs, hide_dotfiles=False):
object. Double-click a file/folder to display extra info. object. Double-click a file/folder to display extra info.
:param fs: A filesystem object :param fs: A filesystem object
:param hide_fotfiles: If True, files and folders that begin with a dot will be hidden :param hide_dotfiles: If True, files and folders that begin with a dot will be hidden
""" """
app = wx.PySimpleApp() app = wx.PySimpleApp()
frame = BrowseFrame(fs, hide_dotfiles=True) frame = BrowseFrame(fs, hide_dotfiles=hide_dotfiles)
frame.Show() frame.Show()
app.MainLoop() app.MainLoop()
...@@ -196,4 +196,4 @@ def browse(fs, hide_dotfiles=False): ...@@ -196,4 +196,4 @@ def browse(fs, hide_dotfiles=False):
if __name__ == "__main__": if __name__ == "__main__":
from osfs import OSFS from osfs import OSFS
home_fs = OSFS("~/") home_fs = OSFS("~/")
browse(home_fs) browse(home_fs, True)
...@@ -78,4 +78,3 @@ def run(): ...@@ -78,4 +78,3 @@ def run():
if __name__ == "__main__": if __name__ == "__main__":
sys.exit(run()) sys.exit(run())
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment