def _build_widget(self): self.widget = gtk.FileChooserButton(self.title) self.widget.props.local_only = not Vfs.backend_supports_remote_uri_schemes() self.widget.connect("selection-changed", self._selection_changed) if self.directory: self.widget.set_action(gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER) else: self.widget.set_action(gtk.FILE_CHOOSER_ACTION_OPEN)
def _build_widget(self): self.widget = gtk.FileChooserButton(self.title) self.widget.props.local_only = not Vfs.backend_supports_remote_uri_schemes( ) self.widget.connect("selection-changed", self._selection_changed) if self.directory: self.widget.set_action(gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER) else: self.widget.set_action(gtk.FILE_CHOOSER_ACTION_OPEN)
#common sets up the conduit environment from common import * import conduit.vfs as Vfs import conduit.vfs.File as VfsFile import conduit.utils as Utils ok("--- TESTING VFS WITH FILE IMPL: %s" % Vfs.backend_name(), True) ok("Supports remote uri schemes: %s" % Vfs.backend_supports_remote_uri_schemes(), True) safe = '/&=:@' unsafe = ' !<>#%()[]{}' safeunsafe = '%20%21%3C%3E%23%25%28%29%5B%5D%7B%7D' ok("Dont escape path characters",Vfs.uri_escape(safe+unsafe) == safe+safeunsafe) ok("Unescape back to original",Vfs.uri_unescape(safe+safeunsafe) == safe+unsafe) ok("Get protocol", Vfs.uri_get_protocol("file:///foo/bar") == "file://") name, ext = Vfs.uri_get_filename_and_extension("file:///foo/bar.ext") ok("Get filename (%s,%s)" % (name,ext), name == "bar" and ext == ".ext") ok("file:///home exists", Vfs.uri_exists("file:///home") == True) ok("/home exists", Vfs.uri_exists("/home") == True) ok("/home is folder", Vfs.uri_is_folder("/home") == True) ok("/foo/bar does not exist", Vfs.uri_exists("/foo/bar") == False) ok("format uri", Vfs.uri_format_for_display("file:///foo") == "/foo") tmpdiruri = Utils.new_tempdir() # Test the folder scanner theading stuff fileuri = Utils.new_tempfile("bla").get_local_uri() stm = VfsFile.FolderScannerThreadManager(maxConcurrentThreads=1) def prog(*args): pass