Exemplo n.º 1
0
    def activate(self):
        environ.add_resource("glade", os.path.join(os.path.dirname(__file__), "glade"))
        # Do this in a nested import so we can import the plugin without
        # importing gtk.
        from ecf.ecfui import ECFUI

        self.ui = ECFUI()
Exemplo n.º 2
0
 def activate(self):
     environ.add_resource('glade',
                          os.path.join(os.path.dirname(__file__), 'glade'))
     # Do this in a nested import so we can import the plugin without
     # importing gtk.
     from ecf.ecfui import ECFUI
     self.ui = ECFUI()
Exemplo n.º 3
0
def _parse_gazpacho_path():
    """
    Parses the environment variable GAZPACHO_PATH and
    process all the directories in there
    """

    import gazpacho.widgets

    for path in os.environ.get('GAZPACHO_PATH', '').split(os.pathsep):
        if not path:
            continue

        environ.add_resource('pixmap', os.path.join(path, 'resources'))
        environ.add_resource('catalog', path)
        environ.add_resource('resource', os.path.join(path, 'resources'))
        environ.add_resource('glade', path)

        # library uses gazpacho.widgets as a base for plugins,
        # attach ourselves to it's __path__ so imports will work
        gazpacho.widgets.__path__.append(path)
Exemplo n.º 4
0
 def activate(self):
     environ.add_resource('glade', os.path.join(plugin_root, 'glade'))
     self.ui = BooksUI()
Exemplo n.º 5
0
 def get_migration(self):
     environ.add_resource('booksql', os.path.join(plugin_root, 'sql'))
     return PluginSchemaMigration(self.name, 'booksql', ['*.sql'])
Exemplo n.º 6
0
    pass

import gtk


def refresh_gui(delay=0):
    while gtk.events_pending():
        gtk.main_iteration_do(block=False)
    time.sleep(delay)

dir = os.path.dirname(__file__)
if not dir in sys.path:
    sys.path.insert(0, os.path.join(dir))

from kiwi.environ import environ
environ.add_resource('glade', dir)

from kiwi.python import ClassInittableObject

import kiwi


def _list_recursively(directory, pattern):
    matches = []
    for root, dirnames, filenames in os.walk(directory):
        for filename in fnmatch.filter(filenames, pattern):
            # skip backup files
            if (filename.startswith('.#') or
                filename.endswith('~')):
                continue
            matches.append(os.path.join(root, filename))
Exemplo n.º 7
0
 def activate(self):
     environ.add_resource('glade',
                          os.path.join(os.path.dirname(__file__), 'glade'))
     self.ui = OpticalUI()
Exemplo n.º 8
0
 def get_migration(self):
     environ.add_resource('opticalsql',
                          os.path.join(os.path.dirname(__file__), 'sql'))
     return PluginSchemaMigration(self.name, 'opticalsql', ['*.sql'])
Exemplo n.º 9
0
from gtk import glade
import gobject

from kiwi.environ import environ
from kiwi.ui.delegates import GladeDelegate

from twisted.python.reflect import namedAny

from flumotion.common.pygobject import gsignal
from flumotion.configure import configure
from flumotion.ui.kiwipatches import install_patches

__version__ = "$Rev$"

# FIXME: Move to kiwi initialization
environ.add_resource('glade', configure.gladedir)

install_patches()


def _unbrokenNamedAny(qual):
    # ihooks breaks namedAny, so split up by module, attribute
    module_name, attribute = qual.rsplit(".", 1)
    module = namedAny(module_name)
    return getattr(module, attribute, None)


def _flumotion_glade_custom_handler(xml, proc, name, *args):
    widget_class = _unbrokenNamedAny(proc)
    if widget_class is None:
        mod, attr = proc.rsplit(".", 1)
Exemplo n.º 10
0
#globals.confDir = "%s%s%s" % (os.getenv(sys_var), os.sep, ".morphine") 
globals.confDir = xdg.BaseDirectory.save_config_path(globals.appName)
# Get the config file path
globals.cfgFile = os.path.join(globals.confDir, 'config.ini')

globals.dataDir = "@dataDir@"
if globals.dataDir == '@' + 'dataDir@':
    globals.dataDir = os.path.join(basedir, 'data')
globals.imageDir = os.path.join(globals.dataDir, 'images')
#globals.logger = Logger()


# FIXME: Quick hack for enable kiwi to find the glade file
from kiwi.environ import environ 
environ.add_resource('glade', globals.gladePath)

# find out if they are asking for help
HELP = False
for val in sys.argv:
    if val == '-h' or val == '--help': HELP = True

import pygtk
pygtk.require('2.0')
import gtk

from src import main as morphin
from src.services import config
from optparse import OptionParser 

Exemplo n.º 11
0
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

from kiwi.environ import Library, environ
import os

lib = Library("metanomon")
if lib.uninstalled:
    if os.path.exists("/usr/share/metanomon"):
        lib.add_global_resource('glade', '/usr/share/metanomon/glade')
        lib.add_global_resource('images', '/usr/share/metanomon/images')
    else:
        environ.add_resource('glade', 'glade')
        environ.add_resource('images', 'images')


Exemplo n.º 12
0
 def get_migration(self):
     environ.add_resource("ecfsql", os.path.join(os.path.dirname(__file__), "sql"))
     return PluginSchemaMigration(self.name, "ecfsql", ["*.sql"])
Exemplo n.º 13
0
import gtk
from gtk import glade
import gobject
from kiwi.environ import environ
from kiwi.ui.delegates import GladeDelegate
from twisted.python.reflect import namedAny

from flumotion.common.pygobject import gsignal
from flumotion.configure import configure
from flumotion.ui.kiwipatches import install_patches

__version__ = "$Rev$"

# FIXME: Move to kiwi initialization
environ.add_resource("glade", configure.gladedir)

install_patches()


def _unbrokenNamedAny(qual):
    # ihooks breaks namedAny, so split up by module, attribute
    module_name, attribute = qual.rsplit(".", 1)
    module = namedAny(module_name)
    return getattr(module, attribute, None)


def _flumotion_glade_custom_handler(xml, proc, name, *args):
    widget_class = _unbrokenNamedAny(proc)
    if widget_class is None:
        mod, attr = proc.rsplit(".", 1)
Exemplo n.º 14
0
from gtk import glade
import gobject

from kiwi.environ import environ
from kiwi.ui.delegates import GladeDelegate

from twisted.python.reflect import namedAny

from flumotion.common.pygobject import gsignal
from flumotion.configure import configure
from flumotion.ui.kiwipatches import install_patches

__version__ = "$Rev$"

# FIXME: Move to kiwi initialization
environ.add_resource('glade', configure.gladedir)

install_patches()


def _unbrokenNamedAny(qual):
    # ihooks breaks namedAny, so split up by module, attribute
    module_name, attribute = qual.rsplit(".", 1)
    module = namedAny(module_name)
    return getattr(module, attribute, None)


def _flumotion_glade_custom_handler(xml, proc, name, *args):
    widget_class = _unbrokenNamedAny(proc)
    if widget_class is None:
        mod, attr = proc.rsplit(".", 1)
Exemplo n.º 15
0
"""Gazpacho integration: loader and extensions"""

# Copyright (c) 2001-2009 ElevenCraft Inc.
# See LICENSE for details.

# Set up the kiwi environment, using brute force evilness.
from kiwi.environ import environ
import os
import sys
if hasattr(sys, 'frozen'):
    root = os.path.dirname(sys.executable)
else:
    import schevogtk2
    root = schevogtk2.__path__[0]
environ._root = root  # XXX Evil hackery.
environ.add_resource(resource='glade', path='glade')


from gazpacho.loader.custom import (
    Adapter, PythonWidgetAdapter, adapter_registry)


# Schevo widgets.
from schevogtk2.entitygrid import EntityGrid
from schevogtk2.extentgrid import ExtentGrid
from schevogtk2.field import FieldLabel
from schevogtk2.field import DynamicField
from schevogtk2.relatedgrid import RelatedGrid


class EntityGridAdapter(PythonWidgetAdapter):
Exemplo n.º 16
0
 def activate(self):
     environ.add_resource('glade', os.path.join(plugin_root, 'glade'))
     # Do this in a nested import so we can import the plugin without
     # importing gtk.
     from ecfui import ECFUI
     self.ui = ECFUI()