def open_selection_command(self, event=None): try: selection = self.root.selection_get() except TclError: self.root.bell() return uri = string.joinfields(string.split(selection), '') self.context.load(grailutil.complete_url(uri))
def open_uri_command(self, event=None): import OpenURIDialog dialog = OpenURIDialog.OpenURIDialog(self.root) uri, new = dialog.go() if uri: if new: browser = Browser(self.master, self.app) else: browser = self browser.context.load(grailutil.complete_url(uri))
geometry = prefs.Get('browser', 'initial-geometry') display = None user_init = 1 for o, a in opts: if o in ('-i', '--noimages'): load_images = 0 if o in ('-g', '--geometry'): geometry = a if o in ('-d', '--display'): display = a if o == "-q": user_init = 0 if args: url = grailutil.complete_url(args[0]) else: url = None global app app = Application(prefs=prefs, display=display) app.embedded = embedded if __name__ != '__main__': import __main__ __main__.app = app __main__.GRAILVERSION = GRAILVERSION def load_images_vis_prefs(app=app): app.load_images = app.prefs.GetBoolean('browser', 'load-images') try: app.load_images = load_images except NameError:
def load_from_entry(self, event): url = string.strip(self.entry.get()) if url: self.context.load(grailutil.complete_url(url)) else: self.root.bell()