Esempio n. 1
0
# modify it under the terms of the GNU Lesser 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 Lesser 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.
#
# This file contains code from Gazpacho
# Copyright (C) 2005 by Async Open Source
''' sacam module '''

import os

from kiwi.environ import Library

DIRNAME = os.path.abspath(
    os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))

LIB = Library('sacam', root=DIRNAME)
if LIB.uninstalled:
    LIB.add_global_resource('glade', 'glade')
    LIB.add_global_resource('doc', 'doc')
    LIB.add_global_resource('xml', 'xml')
LIB.enable_translation("sacam")
Esempio n. 2
0
# if gobject.pygtk_version[:2] < (2, 8, 0):
#     raise ImportError("Your PyGTK/PyGObject version is too old, found %s, "
#                       "but 2.8.0 or higher is required by kiwi" % (
#         ('.'.join(map(str, gobject.pygtk_version))),))

from kiwi.__version__ import version as kiwi_version
from kiwi.environ import EnvironmentError, Library


assert kiwi_version # pyflakes

library = Library('kiwi')
if library.uninstalled:
    try:
        library.add_global_resource('glade', 'glade')
    except EnvironmentError:
        pass
library.enable_translation()

# Be careful to not export too much
del Library, gobject

class ValueUnset:
    """To differentiate from places where None is a valid default. Used
    mainly in the Kiwi Proxy"""
    pass

__all__ = ['ValueUnset', 'kiwi_version']

# by default locale uses the C locale but our date conversions use the user
Esempio n. 3
0
    import stoqlib
    # This is the dir containing stoq/kiwi/stoqdrivers/etc
    checkout = os.path.dirname(
        os.path.dirname(os.path.dirname(stoqlib.__file__)))

    # If there's n foobar plugin on the checkout, it will expand to find:
    #     CHECKOUT/<git_repository>/foobar/foobar.plugin
    for filename in glob.iglob(os.path.join(checkout, '*', '*', '*.plugin')):
        # In the example above, the path here is expected to be on
        # <git_repository>, not on <git_repository>/foobar/
        yield os.path.dirname(os.path.dirname(filename))


library = Library('stoq', root='..' + os.sep + '..')
if library.uninstalled:
    library.add_global_resource('csv', 'data/csv')
    library.add_global_resource('docs', '.')
    library.add_global_resource('glade', 'data/glade')
    library.add_global_resource('html', 'data/html')
    library.add_global_resource('misc', 'data/misc')
    library.add_global_resource('pixmaps', 'data/pixmaps')
    library.add_global_resource('sql', 'data/sql')
    library.add_global_resource('template', 'data/template')
    library.add_global_resource('uixml', 'data/uixml')
    library.add_resource('plugin', 'plugins')
    for dirname in _get_external_plugins_paths():
        library.add_resource('plugin', dirname)
    externals = os.path.join(library.get_root(), 'external')
else:
    # root = $prefix/lib/pythonX.Y/site-packages
    # We want $prefix/lib/stoqlib, eg ../../stoqlib
Esempio n. 4
0
# 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 Lesser 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.
#
# This file contains code from Gazpacho
# Copyright (C) 2005 by Async Open Source

''' sacam module '''

import os

from kiwi.environ import Library

DIRNAME = os.path.abspath(
    os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))

LIB = Library('sacam', root=DIRNAME)
if LIB.uninstalled:
    LIB.add_global_resource('glade', 'glade')
    LIB.add_global_resource('doc', 'doc')
    LIB.add_global_resource('xml', 'xml')
LIB.enable_translation("sacam")
Esempio n. 5
0
            "Error was: %s" % e)

# if gobject.pygtk_version[:2] < (2, 8, 0):
#     raise ImportError("Your PyGTK/PyGObject version is too old, found %s, "
#                       "but 2.8.0 or higher is required by kiwi" % (
#         ('.'.join(map(str, gobject.pygtk_version))),))

from kiwi.__version__ import version as kiwi_version
from kiwi.environ import Library


assert kiwi_version # pyflakes

library = Library('kiwi')
if library.uninstalled:
    library.add_global_resource('glade', 'glade')
    library.add_global_resource('pixmap', 'pixmaps')
library.enable_translation()

# Be careful to not export too much
del Library, gobject

class ValueUnset:
    """To differentiate from places where None is a valid default. Used
    mainly in the Kiwi Proxy"""
    pass

__all__ = ['ValueUnset', 'kiwi_version']

# by default locale uses the C locale but our date conversions use the user
# locale so we need to set the locale to that one
Esempio n. 6
0
--- gazpacho/__init__.py.orig	2007-07-29 07:57:30 UTC
+++ gazpacho/__init__.py
@@ -16,19 +16,20 @@
 import os
 
 from kiwi.environ import Library
+from kiwi.environ import _KiwiProvider
 
 dirname = os.path.abspath(
     os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
 
 lib = Library('gazpacho', root=dirname)
 if lib.uninstalled:
-    lib.add_global_resource('catalog', 'catalogs')
-    lib.add_global_resource('glade', 'glade')
-    lib.add_global_resource('resource', 'resources')
-    lib.add_global_resource('doc', '.')
-    lib.add_global_resource('pixmap', 'pixmaps')
-    lib.add_global_resource('pixmap', 'pixmaps/kiwi')
-    lib.add_global_resource('plugins', 'plugins')
+    _KiwiProvider.add_resource('catalog', os.path.join(dirname, 'catalog'))
+    _KiwiProvider.add_resource('glade', os.path.join(dirname, 'glade'))
+    _KiwiProvider.add_resource('resource', os.path.join(dirname, 'resources'))
+    _KiwiProvider.add_resource('doc', os.path.join(dirname, '.'))
+    _KiwiProvider.add_resource('pixmap', os.path.join(dirname, 'pixmaps'))
+    _KiwiProvider.add_resource('pixmap', os.path.join(dirname, 'pixmaps/kiwi'))
+    _KiwiProvider.add_resource('plugins', os.path.join(dirname, 'plugins'))
 lib.enable_translation()
 
 __version__ = "0.7.2"
Esempio n. 7
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.
##
## Author(s):   Henrique Romano <*****@*****.**>
##              Johan Dahlin <*****@*****.**>
##

__version__ = (0, 9, 21)

from kiwi.environ import Library

__all__ = ["library"]

library = Library("stoqdrivers", root="..")
if library.uninstalled:
    library.add_global_resource("conf", "stoqdrivers/conf")
library.enable_translation()
Esempio n. 8
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')


Esempio n. 9
0
"""

import sys
import os
import gtk.glade
from kiwi.environ import Library

#if os.name in ['win32', 'windows', 'nt']:
#    sys.stderr = sys.stdout

# Adicionando paths para achar os resources

lib = Library('crisk', '../../')

if lib.uninstalled:
    lib.add_global_resource('glade', 'glade')
    lib.add_global_resource('pixmaps', 'pixmaps')

lib.enable_translation('crisk')
lib.set_application_domain('crisk')

__author__ = 'José de Paula E. Júnior (coredump)'
__url__ = 'http://coredump.github.com/crisk/'
__version__ = '0.3'
__shortdescription__ = 'Simple Risk Management Tool'
__description__ = """
Crisk is a simple tool for Risk Management, aimed at security officers,
security consultants and risk professionals.
"""
__license__ = """
Copyright 2009 José de Paula Eufrásio Júnior <*****@*****.**>
Esempio n. 10
0
# 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 Lesser 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.

import os

from kiwi.environ import Library

dirname = os.path.abspath(
    os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))

lib = Library('gazpacho', root=dirname)
if lib.uninstalled:
    lib.add_global_resource('catalog', 'catalogs')
    lib.add_global_resource('glade', 'glade')
    lib.add_global_resource('resource', 'resources')
    lib.add_global_resource('doc', '.')
    lib.add_global_resource('pixmap', 'pixmaps')
lib.enable_translation()

__version__ = "0.7.2"

Esempio 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.
##
## Author(s):   Henrique Romano <*****@*****.**>
##              Johan Dahlin <*****@*****.**>
##

__version__ = (0, 9, 17)

from kiwi.environ import Library

__all__ = ["library"]

library = Library("stoqdrivers", root="..")
if library.uninstalled:
    library.add_global_resource("conf", "stoqdrivers/conf")
library.enable_translation()
Esempio n. 12
0
""" 

import sys
import os
import gtk.glade
from kiwi.environ import Library

#if os.name in ['win32', 'windows', 'nt']:
#    sys.stderr = sys.stdout

# Adicionando paths para achar os resources

lib = Library('crisk', '../../')

if lib.uninstalled:
    lib.add_global_resource('glade', 'glade')
    lib.add_global_resource('pixmaps', 'pixmaps')

lib.enable_translation('crisk')
lib.set_application_domain('crisk')



__author__ = 'José de Paula E. Júnior (coredump)'
__url__ = 'http://coredump.github.com/crisk/'
__version__ = '0.3'
__shortdescription__ = 'Simple Risk Management Tool'
__description__ = """
Crisk is a simple tool for Risk Management, aimed at security officers,
security consultants and risk professionals.
"""
Esempio n. 13
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("lintgtk")
if lib.uninstalled:
    if os.path.exists("/usr/share/lintgtk"):
        lib.add_global_resource('glade', '/usr/share/lintgtk/glade')
        lib.add_global_resource('images', '/usr/share/lintgtk/images')
    else:
        environ.add_resource('glade', 'glade')
        environ.add_resource('images', 'images')


Esempio n. 14
0
##
##
## Author(s): Stoq Team <*****@*****.**>
##
##

import os
import site

from kiwi.environ import Library

__all__ = ['library']

library = Library('stoq', root='..' + os.sep + '..')
if library.uninstalled:
    library.add_global_resource('config', 'data/config')
    library.add_global_resource('csv', 'data/csv')
    library.add_global_resource('docs', '.')
    library.add_global_resource('glade', 'data/glade')
    library.add_global_resource('html', 'data/html')
    library.add_global_resource('misc', 'data/misc')
    library.add_global_resource('pixmaps', 'data/pixmaps')
    library.add_global_resource('sql', 'data/sql')
    library.add_global_resource('template', 'data/template')
    library.add_global_resource('uixml', 'data/uixml')
    library.add_resource('plugin', 'plugins')
    externals = os.path.join(library.get_root(), 'external')
else:
    # root = $prefix/lib/pythonX.Y/site-packages
    # We want $prefix/lib/stoqlib, eg ../../stoqlib
    externals = os.path.join(library.prefix, 'lib', 'stoqlib')
Esempio n. 15
0
            "PyGTK 2.8 or PyGObject 2.9.0 or higher is required by kiwi\n"
            "Error was: %s" % e)

# if gobject.pygtk_version[:2] < (2, 8, 0):
#     raise ImportError("Your PyGTK/PyGObject version is too old, found %s, "
#                       "but 2.8.0 or higher is required by kiwi" % (
#         ('.'.join(map(str, gobject.pygtk_version))),))

from kiwi.__version__ import version as kiwi_version
from kiwi.environ import Library

assert kiwi_version  # pyflakes

library = Library('kiwi')
if library.uninstalled:
    library.add_global_resource('glade', 'glade')
    library.add_global_resource('pixmap', 'pixmaps')
library.enable_translation()

# Be careful to not export too much
del Library, gobject


class ValueUnset:
    """To differentiate from places where None is a valid default. Used
    mainly in the Kiwi Proxy"""
    pass


__all__ = ['ValueUnset', 'kiwi_version']