Exemple #1
0
import findrox
findrox.version(2, 0, 3)
import rox
from rox import choices, OptionsBox


def build_filechooser(self, node, label, option):
    """<filechooser name='...' label='...'/>Tooltip</filechooser>.
	Lets the user choose a file (using a GtkFileChooser or by drag-and-drop).
	Note: Since the FileChooserButton widget requires GTK >= 2.6, lesser GTK
	versions will just show a normal text entry box, which should work with DND.
	"""
    if g.gtk_version >= (2, 6, 0):
        filebutton = g.FileChooserButton(label)
        eb = g.EventBox()
        eb.add(filebutton)
        clearbutton = g.Button("Clear")
        self.may_add_tip(eb, node)
        hbox = g.HBox(False, 4)
        if label:
            hbox.pack_start(g.Label(label + ":"), False, True, 0)
        hbox.pack_start(eb, True, True, 0)
        hbox.pack_start(clearbutton, False, True, 0)
        self.handlers[option] = (lambda: filebutton.get_filename(),
                                 lambda: filebutton.set_filename(option.value))
        filebutton.connect('selection-changed',
                           lambda w: self.check_widget(option))
        clearbutton.connect('clicked', lambda w: filebutton.set_filename(""))
        return [hbox]
    else:
        # Fallback to text input
Exemple #2
0
#!/usr/bin/env python

import findrox; findrox.version(1, 9, 8)

no_gui_mode = 1

from Beep import Beep

import gc
#gc.set_debug(gc.DEBUG_LEAK)

try:
	import rox
except:
	print "(no GUI, but that's OK)"

import rox
from rox import choices

def error(message, title = 'Error'):
	print "*********", title
	print message, "\n"
rox.report_error = error
def exc(): raise
rox.report_exception = exc

import sys
#from xml.dom import ext
from Ft.Xml.Domlette import PrettyPrint

from Model import Model
Exemple #3
0
if __name__ == '__main__':
	import findrox; findrox.version(1, 99, 11)
import os, sys
from support import shell_escape, Tmp
import rox
from rox.processes import PipeThroughCommand

current_command = None

def pipe_through_command(command, src, dst):
	global current_command
	assert not current_command
	try:
		src.seek(0)
	except:
		pass
	current_command = PipeThroughCommand(command, src, dst)
	try:
		current_command.wait()
	finally:
		current_command = None

operations = []
class Operation:
	add_extension = False
	
	def __init__(self, extension):
		operations.append(self)
		self.extension = extension
	
	def can_handle(self, data):