Ejemplo n.º 1
0
def Main():
    """ The main point of entry for the checker service.

    This will set up the DBUS and glib extensions, the gobject/glib main loop,
    and start the service.
    """
    global log
    log = Log("rabbitvcs.services.checkerservice:main")
    log.debug("Checker: starting service: %s (%s)" %
              (OBJECT_PATH, os.getpid()))

    # We need this to for the client to be able to do asynchronous calls
    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

    # The following calls are required to make DBus thread-aware and therefore
    # support the ability run threads.
    helper.gobject_threads_init()
    dbus.mainloop.glib.threads_init()

    # This registers our service name with the bus
    session_bus = dbus.SessionBus()
    service_name = dbus.service.BusName(SERVICE, session_bus)

    mainloop = GLib.MainLoop()

    checker_service = StatusCheckerService(session_bus, mainloop)

    GLib.idle_add(output_and_flush, "Started status checker service\n")

    mainloop.run()

    log.debug("Checker: ended service: %s (%s)" % (OBJECT_PATH, os.getpid()))
Ejemplo n.º 2
0
from rabbitvcs.util.contextmenu import GtkFilesContextMenu, \
    GtkContextMenuCaller, GtkFilesContextMenuConditions, GtkContextMenu
from rabbitvcs.util.contextmenuitems import MenuItem, MenuUpdate, \
    MenuSeparator
import rabbitvcs.ui.widget
import rabbitvcs.ui.dialog
import rabbitvcs.ui.action
from rabbitvcs.util.log import Log
from rabbitvcs.util.decorators import gtk_unsafe

log = Log("rabbitvcs.ui.checkmods")

from rabbitvcs import gettext
_ = gettext.gettext

helper.gobject_threads_init()


class SVNCheckForModifications(InterfaceView):
    """
    Provides a way for the user to see what files have been changed on the
    repository.

    """
    def __init__(self, paths, base_dir=None):
        InterfaceView.__init__(self, "checkmods", "CheckMods")

        self.paths = paths
        self.base_dir = base_dir
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()
Ejemplo n.º 3
0
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GObject, Gdk

from rabbitvcs.ui import InterfaceView
import rabbitvcs.ui.widget
import rabbitvcs.ui.dialog
import rabbitvcs.util
import rabbitvcs.vcs
from rabbitvcs.util import helper
from rabbitvcs.ui.dialog import MessageBox
from rabbitvcs.util.decorators import gtk_unsafe

from rabbitvcs import gettext
_ = gettext.gettext

helper.gobject_threads_init()

from rabbitvcs.util.log import Log
log = Log("rabbitvcs.ui.action")

class VCSNotifier(InterfaceView):
    """
    Provides a base class to handle threaded/gtk_unsafe calls to our vcs

    """

    def __init__(self, callback_cancel=None, visible=True):
        InterfaceView.__init__(self)

        if visible:
            self.show()