Пример #1
0
def register_shop(package, name):
    base_path = '../%s/%s' % (package, name)
    # Register shop
    shops.append(name)
    # Import project
    exec('import %s.%s' % (package, name))
    # Get config
    config_path = get_abspath('%s/setup.conf' % base_path)
    config = ro_database.get_handler(config_path, ITWSHOPConfig)
    # Register skin
    register_shop_skin(u'Skin %s' % name, package, '%s/ui/' % name, name, config)
    # Register domain for i18n
    register_domain(name, get_abspath('%s/locale' % base_path))
    # Register modules
    project_modules = []
    modules_path = get_abspath(join_paths(base_path, 'modules'))
    if exists(modules_path) or name == 'ecox':
        project_modules = [f for f in listdir(modules_path)
              if isdir(get_abspath('%s/%s' % (modules_path, f)))]
        for m in project_modules:
            exec('import %s.%s.modules.%s' % (package, name, m))
    # Print
    print 'Name: ',  name
    print 'URL: ', config.get_value('url')
    print 'Modules: [%s], %s' % (len(project_modules), project_modules)
Пример #2
0
        def __init__(self, name, _prefix=None, **kw):
            apply(LocalPageTemplateFile.inheritedAttribute('__init__'),
                  (self, name, _prefix), kw)

            domain = get_abspath(_prefix, 'locale')
            self.class_domain = domain
            register_domain(domain, domain)
Пример #3
0
def register_shop(package, name):
    base_path = '../%s/%s' % (package, name)
    # Register shop
    shops.append(name)
    # Import project
    exec('import %s.%s' % (package, name))
    # Get config
    config_path = get_abspath('%s/setup.conf' % base_path)
    config = ro_database.get_handler(config_path, ITWSHOPConfig)
    # Register skin
    register_shop_skin(u'Skin %s' % name, package, '%s/ui/' % name, name,
                       config)
    # Register domain for i18n
    register_domain(name, get_abspath('%s/locale' % base_path))
    # Register modules
    project_modules = []
    modules_path = get_abspath(join_paths(base_path, 'modules'))
    if exists(modules_path) or name == 'ecox':
        project_modules = [
            f for f in listdir(modules_path)
            if isdir(get_abspath('%s/%s' % (modules_path, f)))
        ]
        for m in project_modules:
            exec('import %s.%s.modules.%s' % (package, name, m))
    # Print
    print 'Name: ', name
    print 'URL: ', config.get_value('url')
    print 'Modules: [%s], %s' % (len(project_modules), project_modules)
Пример #4
0
import docutils

# Import from itools
from itools.core import get_abspath, get_version
from itools.gettext import register_domain

# Import from ikaaro
from ikaaro.skins import register_skin

# Import from wiki
from folder import WikiFolder


# The version
__version__ = get_version()

# Register skin
register_skin('wiki', get_abspath('ui'))

# Register the wiki domain
register_domain('wiki', get_abspath('locale'))

# Updates
if argv[0].endswith('icms-update.py'):
    import obsolete
    obsolete

# Silent pyflakes
docutils
WikiFolder
Пример #5
0
from user import ShopUser
import forms_generator
from registry import register_shop_skin
from shop import Shop
from website import ShopWebSite

# Import from package
import feed_views
import modules
import news
import sidebar
import skin
import user
import cross_selling
import cross_selling_section

# Make the product version available to Python code
__version__ = get_version()

# Register the shop domain
path = get_abspath('locale')
register_domain('shop', path)

# Register default skin
register_shop_skin(MSG(u'Default Skin'),
    'shop', 'ui/default_skin/', 'default_skin')

# XXX Override Monkey patch itws
# We want that public images on user profil are visible
ShopUser.is_allowed_to_view = AccessControl.is_allowed_to_view
Пример #6
0
 def __init__(self, namespace):
     mname = namespace['__name__']
     domain = get_abspath('locale', mname=mname)
     self.class_domain = domain
     register_domain(domain, domain)
Пример #7
0
 def __init__(self, namespace):
     mname = namespace['__name__']
     domain = get_abspath('locale', mname=mname)
     self.class_domain = domain
     register_domain(domain, domain)
Пример #8
0
import root
import text
from webpage import WebPage

# Check for required software
for name, import_path, reason in [
    ("poppler", "itools.pdf.pdftotext", "PDF indexation"),
    ("wv2", "itools.office.doctotext", "DOC indexation"),
    ("xlrd", "xlrd", "XLS indexation")
]:
    try:
        __import__(import_path)
    except ImportError:
        print '%s: You need to install "%s" and reinstall itools.' % (reason,
                                                                      name)

# The version
__version__ = get_version()

# Import required modules
import users

# Register the itools domain
path = get_abspath('locale')
register_domain('ikaaro', path)

# Register document types
register_document_type(WebPage)
register_document_type(Folder)
register_document_type(File)
Пример #9
0
 def __init__(self, namespace):
     domain = get_abspath(namespace, 'locale')
     self.class_domain = domain
     register_domain(domain, domain)
Пример #10
0
import news
import feed_views
import OPML
import sitemap
import skin
import theme
import turning_footer
import webpage
import widgets
import ws_neutral

# Import obsolete if command is icms-update.py
if sys.argv[0].endswith('icms-update.py'):
    import obsolete
    print 'Imported', obsolete.__name__

# Make the product version available to Python code
__version__ = get_version()

# Register the itws domain
register_domain('itws', get_abspath('locale'))

# Override User is_allowed_to_view
User.is_allowed_to_view = User.is_allowed_to_edit

# Silent pyflakes
skin, about, OPML, bar, sitemap, turning_footer, ws_neutral, webpage,
widgets, theme, feed_views, news

register_skin('itws-icons', get_abspath('ui/itws-icons'))
Пример #11
0
# Import from itools
from itools.core import get_abspath, get_version
from itools.gettext import register_domain

# Import from ikaaro
from ikaaro.registry import register_document_type
from ikaaro.website import WebSite

# Import from crm
from crm import CRM

# Make the product version available to Python code
__version__ = get_version()

# Register the crm domain
path = get_abspath('locale')
register_domain('crm', path)

# Import obsolete if command is icms-update.py
if argv[0].endswith('icms-update.py'):
    import obsolete
    print 'Imported', obsolete.__name__

# Activate crm as an itws website's document type
#register_document_type(CRM, WebSite.class_id)

# Silent pyflakes
CRM, WebSite, register_document_type

Пример #12
0

# Import from itools
from itools import get_version
from itools.core import get_abspath
from itools.gettext import register_domain

# Import from ikaaro
from ikaaro.skins import register_skin

# Import from here 
from root import Root
import skins
import user

# Make the product version available to Python code
__version__ = get_version()

# Register the tzm domain
register_domain('tzm', get_abspath('locale'))

# Register core skins
register_skin('core', get_abspath('ui/core'))
register_skin('icons', get_abspath('ui/icons'))
register_skin('js_calendar', get_abspath('ui/js_calendar'))
register_skin('progressbar', get_abspath('ui/progressbar'))
register_skin('tiny_mce', get_abspath('ui/tiny_mce'))
register_skin('wiki', get_abspath('ui/wiki'))
register_skin('data', get_abspath('ui/data'))

Пример #13
0
# Copyright (C) 2010 J. David Ibáñez <*****@*****.**>
# Import from the Standard Library
from os import listdir

# Import from itools
from itools.gettext import MSG
from itools.gettext import register_domain

# Register the application's domain
register_domain('__main__', 'locale')


def say_hello():
    message = MSG(u'Hello World')
    print message.gettext()


def get_template(name):
    # What are the possibilities ?
    languages = [
        x.rsplit('.', 1)[1] for x in listdir('.') if x.startswith(name)
    ]
    # A good language ?
    language = select_language(languages)
    # No
    if language is None:
        # English ?
        if 'en' in languages:
            language = 'en'
        # No, the first one, ...
        else:
Пример #14
0
from webpage import WebPage


# Check for required software
for name, import_path, reason in [
        ("poppler", "itools.pdf.pdftotext", "PDF indexation"),
        ("wv2", "itools.office.doctotext", "DOC indexation"),
        ("xlrd", "xlrd", "XLS indexation")]:
    try:
        __import__(import_path)
    except ImportError:
        print '%s: You need to install "%s" and reinstall itools.' % (reason,
                name)


# The version
__version__ = get_version()


# Import required modules
import users

# Register the itools domain
path = get_abspath('locale')
register_domain('ikaaro', path)

# Register document types
register_document_type(WebPage)
register_document_type(Folder)
register_document_type(File)
Пример #15
0
from user import ShopUser
import forms_generator
from registry import register_shop_skin
from shop import Shop
from website import ShopWebSite

# Import from package
import feed_views
import modules
import news
import sidebar
import skin
import user
import cross_selling
import cross_selling_section

# Make the product version available to Python code
__version__ = get_version()

# Register the shop domain
path = get_abspath('locale')
register_domain('shop', path)

# Register default skin
register_shop_skin(MSG(u'Default Skin'), 'shop', 'ui/default_skin/',
                   'default_skin')

# XXX Override Monkey patch itws
# We want that public images on user profil are visible
ShopUser.is_allowed_to_view = AccessControl.is_allowed_to_view
Пример #16
0
# Copyright (C) 2010 J. David Ibáñez <*****@*****.**>
# Import from the Standard Library
from os import listdir

# Import from itools
from itools.gettext import MSG
from itools.gettext import register_domain

# Register the application's domain
register_domain('__main__', 'locale')


def say_hello():
    message = MSG(u'Hello World')
    print message.gettext()


def get_template(name):
    # What are the possibilities ?
    languages = [
        x.rsplit('.', 1)[1] for x in listdir('.') if x.startswith(name) ]
    # A good language ?
    language = select_language(languages)
    # No
    if language is None:
        # English ?
        if 'en' in languages:
            language = 'en'
        # No, the first one, ...
        else:
            language = languages[0]
Пример #17
0
# 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.

# Import from itools
from itools.core import get_version, get_abspath
from itools.gettext import register_domain

# Import from goodforms
from root import Root
from skin import Skin
import user

# Give a version
__version__ = get_version()

# Give a language
register_domain('goodforms', get_abspath('locale'))

# Silent Pyflakes
__all__ = [
    'Root',
    'user',
    'Skin',
]