def _provide_app_info(): from stoqlib.lib.interfaces import IAppInfo from stoqlib.lib.appinfo import AppInfo info = AppInfo() info.set(u"name", u"Stoqlib") info.set(u"version", u"1.0.0") provide_utility(IAppInfo, info)
def _provide_app_info(self): # FIXME: The webservice need the IAppInfo provided to get the stoq # version. We cannot do that workaround there because we don't want to # import stoq inside stoqlib. Either way, this code to download the # egg will move to the plugin dialog soon. from kiwi.component import provide_utility from stoqlib.lib.appinfo import AppInfo from stoqlib.lib.interfaces import IAppInfo import stoq info = AppInfo() info.set("version", stoq.version) provide_utility(IAppInfo, info)
def _download_plugin(self, manager, plugin_name): # FIXME: The webservice need the IAppInfo provided to get the stoq # version. We cannot do that workaround there because we don't want to # import stoq inside stoqlib. Either way, this code to download the # egg will move to the plugin dialog soon. from kiwi.component import provide_utility from stoqlib.lib.appinfo import AppInfo from stoqlib.lib.interfaces import IAppInfo import stoq info = AppInfo() info.set("version", stoq.version) provide_utility(IAppInfo, info) from twisted.internet import reactor d = manager.download_plugin(plugin_name) def stop_reactor(*args): if reactor.running: reactor.stop() d.addCallback(stop_reactor) d.addErrback(stop_reactor) reactor.run()
def setup_stoq(): info = AppInfo() info.set('name', "stoqserver") info.set('version', stoqserver.version_str) info.set('ver', stoqserver.version_str) provide_utility(IAppInfo, info, replace=True) # FIXME: Maybe we should check_schema and load plugins here? setup(config=get_config(), options=None, register_station=False, check_schema=False, load_plugins=True)
def _setup_stoq(self): info = AppInfo() info.set('name', "stoqserver") info.set('version', stoqserver.version_str) info.set('ver', stoqserver.version_str) provide_utility(IAppInfo, info, replace=True) # FIXME: Maybe we should check_schema and load plugins here? setup(config=get_config(), options=None, register_station=False, check_schema=False, load_plugins=True)
def _set_app_info(self): from kiwi.component import provide_utility from stoqlib.lib.appinfo import AppInfo from stoqlib.lib.kiwilibrary import library from stoqlib.lib.interfaces import IAppInfo import stoq # FIXME: use only stoq.stoq_version here and all other callsites of # IAppInfo stoq_version = stoq.version stoq_ver = stoq.stoq_version if hasattr(library, 'get_revision'): rev = library.get_revision() if rev is not None: stoq_version += ' ' + rev stoq_ver += (rev, ) info = AppInfo() info.set("name", "Stoq") info.set("version", stoq_version) info.set("ver", stoq_ver) info.set("log", self._log_filename) provide_utility(IAppInfo, info)
def _set_app_info(self): from kiwi.component import provide_utility from stoqlib.lib.appinfo import AppInfo from stoqlib.lib.kiwilibrary import library from stoqlib.lib.interfaces import IAppInfo import stoq # FIXME: use only stoq.stoq_version here and all other callsites of # IAppInfo stoq_version = stoq.version stoq_ver = stoq.stoq_version if hasattr(library, 'get_revision'): rev = library.get_revision() if rev is not None: stoq_version += ' ' + rev stoq_ver += (rev,) info = AppInfo() info.set("name", "Stoq") info.set("version", stoq_version) info.set("ver", stoq_ver) info.set("log", self._log_filename) provide_utility(IAppInfo, info)
def setup_stoq(register_station=False, name='stoqserver', version=stoqserver.version_str): info = AppInfo() info.set('name', name) info.set('version', version) info.set('ver', version) provide_utility(IAppInfo, info, replace=True) setup(config=get_config(), options=None, register_station=register_station, check_schema=True, load_plugins=True) # This is needed for api calls that requires the current branch set, # e.g. Sale.confirm main_company = api.sysparam.get_object( api.get_default_store(), 'MAIN_COMPANY') provide_utility(ICurrentBranch, main_company, replace=True)
def setup_stoq(register_station=False, name='stoqserver', version=stoqserver.version_str): info = AppInfo() info.set('name', name) info.set('version', version) info.set('ver', version) provide_utility(IAppInfo, info, replace=True) # FIXME: Maybe we should check_schema and load plugins here? setup(config=get_config(), options=None, register_station=register_station, check_schema=False, load_plugins=True) # This is needed for api calls that requires the current branch set, # e.g. Sale.confirm main_company = api.sysparam.get_object( api.get_default_store(), 'MAIN_COMPANY') provide_utility(ICurrentBranch, main_company, replace=True)