コード例 #1
0
def get_newsletter_module():
    try:
        modulename = config_value('NEWSLETTER', 'MODULE')
    except AttributeError:
        modulename = 'satchmo_ext.newsletter.ignore'

    return load_module(modulename)
コード例 #2
0
ファイル: values.py プロジェクト: hnejadi/xerobis
 def load_module(self, module):
     """Load a child module"""
     value = self._value()
     if value == NOTSET:
         raise SettingNotSet("%s.%s", self.group.key, self.key)
     else:
         return load_module("%s.%s" % (value, module))
コード例 #3
0
ファイル: __init__.py プロジェクト: DrOctogon/Satchmo
def get_newsletter_module():
    try:
        modulename = config_value('NEWSLETTER', 'MODULE')
    except AttributeError:
        modulename = 'satchmo_ext.newsletter.ignore'
        
    return load_module(modulename)
コード例 #4
0
ファイル: config.py プロジェクト: kidaa30/pops
def shipping_methods():
    methods = []
    modules = config_value("SHIPPING", "MODULES")
    log.debug("Getting shipping methods: %s", modules)
    for m in modules:
        module = load_module(m)
        methods.extend(module.get_methods())
    return methods
コード例 #5
0
def shipping_methods():
    methods = []
    modules = config_value('SHIPPING', 'MODULES')
    log.debug('Getting shipping methods: %s', modules)
    for m in modules:
        module = load_module(".".join([m, 'methods']))
        methods.extend(module.get_methods())
    return methods
コード例 #6
0
ファイル: config.py プロジェクト: mpango/satchmo
def shipping_methods():
    methods = []
    modules = config_value('SHIPPING', 'MODULES')
    log.debug('Getting shipping methods: %s', modules)
    for m in modules:
        module = load_module(m)
        methods.extend(module.get_methods())
    return methods
コード例 #7
0
ファイル: values.py プロジェクト: hnejadi/xerobis
 def to_python(self, value):
     if value == NOTSET:
         v = {}            
     else:
         v = load_module(value)
     return v
コード例 #8
0
ファイル: config.py プロジェクト: kidaa30/pops
        default=True,
        ordering=15,
    )
)


# --- Load default shipping modules.  Ignore import errors, user may have deleted them. ---
# DO NOT ADD 'tiered' or 'no' to this list.
# 'no' is used internally
# 'Tiered' is special, since it needs to be added as a module.  To enable it,
# just add shipping.modules.tiered to your INSTALLED_APPS
_default_modules = ("canadapost", "dummy", "fedex_web_services", "flat", "per", "ups", "usps")

for module in _default_modules:
    try:
        load_module("shipping.modules.%s.config" % module)
    except ImportError:
        log.debug("Could not load default shipping module configuration: %s", module)

# --- Load any extra shipping modules. ---
extra_shipping = get_satchmo_setting("CUSTOM_SHIPPING_MODULES")

for extra in extra_shipping:
    try:
        load_module("%s.config" % extra)
    except ImportError:
        log.warn("Could not load shipping module configuration: %s" % extra)


class ShippingModuleNotFound(Exception):
    def __init__(self, key):
コード例 #9
0
ファイル: config.py プロジェクト: eyeyunianto/satchmo
    help_text=_("If yes, then all products and the cart will display with tax included."),
    default=False
))

PRODUCTS_TAXABLE_BY_DEFAULT = config_register(BooleanValue(TAX_GROUP,
    'PRODUCTS_TAXABLE_BY_DEFAULT',
    description=_("New products are automatically made taxable"),
    help_text=_("Whether newly created products should be taxable by default."),
    default=False
))

TAX_AREA_ADDRESS = config_register(
        StringValue(TAX_GROUP,
        'TAX_AREA_ADDRESS',
        description=_("Should tax be calculated based on shipping or billing address?"),
        help_text=_("This will only be used if tax is calculated based on an address."),
        choices = (
            (('ship', 'Shipping')),
            (('bill', 'Billing')),
        ),
        default = 'ship')
        )

# --- Load any extra tax modules. ---
extra_tax = get_satchmo_setting('CUSTOM_TAX_MODULES')
for extra in extra_tax:
    try:
        load_module("%s.config" % extra)
    except ImportError:
        log.warn('Could not load tax module configuration: %s' % extra)
コード例 #10
0
ファイル: utils.py プロジェクト: jtslade/satchmo-svn
def get_tax_processor(order=None, user=None):
    modulename = config_value("TAX", "MODULE")
    mod = load_module(modulename + u".processor")
    return mod.Processor(order=order, user=user)
コード例 #11
0
ファイル: config.py プロジェクト: tcv1/satchmo
    help_text=_("If yes, then all products and the cart will display with tax included."),
    default=False
))

PRODUCTS_TAXABLE_BY_DEFAULT = config_register(BooleanValue(TAX_GROUP,
    'PRODUCTS_TAXABLE_BY_DEFAULT',
    description=_("New products are automatically made taxable"),
    help_text=_("Whether newly created products should be taxable by default."),
    default=False
))

TAX_AREA_ADDRESS = config_register(
        StringValue(TAX_GROUP,
        'TAX_AREA_ADDRESS',
        description=_("Should tax be calculated based on shipping or billing address?"),
        help_text=_("This will only be used if tax is calculated based on an address."),
        choices = (
            (('ship', 'Shipping')),
            (('bill', 'Billing')),
        ),
        default = 'ship')
        )

# --- Load any extra tax modules. ---
extra_tax = get_satchmo_setting('CUSTOM_TAX_MODULES')
for extra in extra_tax:
    try:
        load_module("%s.config" % extra)
    except ImportError:
        log.warn('Could not load tax module configuration: %s' % extra)
コード例 #12
0
ファイル: utils.py プロジェクト: hnejadi/xerobis
def get_tax_processor(order=None, user=None):
    modulename = config_value('TAX','MODULE')
    mod = load_module(modulename + u'.tax')
    return mod.Processor(order=order,user=user)
コード例 #13
0
def get_tax_processor(order=None, user=None):
    modulename = config_value('TAX', 'MODULE')
    mod = load_module(u'%s.processor' % modulename)
    return mod.Processor(order=order, user=user)
コード例 #14
0
                 'SELECT_CHEAPEST',
                 description=_("Select least expensive by default?"),
                 default=True,
                 ordering=15))

# --- Load default shipping modules.  Ignore import errors, user may have deleted them. ---
# DO NOT ADD 'tiered' or 'no' to this list.
# 'no' is used internally
# 'Tiered' is special, since it needs to be added as a module.  To enable it,
# just add shipping.modules.tiered to your INSTALLED_APPS
_default_modules = ('canadapost', 'dummy', 'fedex_web_services', 'flat', 'per',
                    'ups', 'usps')

for module in _default_modules:
    try:
        load_module("shipping.modules.%s.config" % module)
    except ImportError:
        log.debug('Could not load default shipping module configuration: %s',
                  module)

# --- Load any extra shipping modules. ---
extra_shipping = get_satchmo_setting('CUSTOM_SHIPPING_MODULES')

for extra in extra_shipping:
    try:
        load_module("%s.config" % extra)
    except ImportError:
        log.warn('Could not load shipping module configuration: %s' % extra)


class ShippingModuleNotFound(Exception):
コード例 #15
0
ファイル: config.py プロジェクト: hnejadi/xerobis
        help_text=_("If False, then the credit card will never be written to disk.  For PCI compliance, this is required unless you have your database server on a separate server not connected to the internet."),
        default=False),

    BooleanValue(PAYMENT_GROUP,
        'USE_DISCOUNTS',
        description=_("Use discounts"),
        help_text=_("""If disabled, customers will not be asked for any discount codes."""),
        default=True)
)

# --- Load default payment modules.  Ignore import errors, user may have deleted them. ---
_default_modules = ('authorizenet','dummy','google','paypal', 'trustcommerce', 'cybersource', 'autosuccess', 'cod', 'protx', 'sermepa')

for module in _default_modules:
    try:
        load_module("payment.modules.%s.config" % module)
    except ImportError:
        log.debug('Could not load default payment module configuration: %s', module)

# --- Load any extra payment modules. ---
extra_payment = get_satchmo_setting('CUSTOM_PAYMENT_MODULES')

for extra in extra_payment:
    try:
        load_module("%s.config" % extra)
    except ImportError:
        log.warn('Could not load payment module configuration: %s' % extra)

# --- helper functions ---

def active_modules():
コード例 #16
0
ファイル: config.py プロジェクト: grengojbo/fsa
            ('warning', _('Warning')),
            ('err', _('Error')),
            ('crit', _('Crit')),
            ('alert', _('Alert'))
        )),
    PositiveIntegerValue(LOG_GROUP, 'log_level', default = 0,
        ordering=3,
        description = _('Log level')
    )
)

#_default_modules = ('acl','event_socket')
_default_modules = ('acl','cdr')
for module in _default_modules:
    try:
        load_module("fsa.%s.config" % module)
        log.debug('load: fsa.%s.config', module)
    except ImportError:
        log.debug('Could not load default module configuration: %s', module)

# --- Load any extra payment modules. ---
extra_modules = ('event_socket','limit', 'sofia', 'lcr', 'odbc_query')

for extra in extra_modules:
    try:
        load_module("fsa.server.modules.%s.config" % extra)
        log.debug('load: fsa.server.modules.%s.config', extra)
    except ImportError:
        log.warn('Could not load module configuration: %s' % extra)

# --- helper functions ---