def __init__(self): CTK.XMLRPCProxy.__init__( self, name='cherokee-market-block2', xmlrpc_func=lambda: XmlRpcServer(OWS_RPC).get_block_market_2( CTK.i18n.active_lang, VERSION), format_func=lambda x: x, debug=DEBUG)
def update_cache(): global cached_info global cache_expiration if not cached_info or cache_expiration < time.time(): xmlrpc = XmlRpcServer(OWS_APPS_AUTH, OWS_Login.login_user, OWS_Login.login_password) cached_info = xmlrpc.get_user_apps() cache_expiration = time.time() + EXPIRATION
def __init__(self): CTK.Box.__init__(self) if Latest_Release.cache_info and \ Latest_Release.cache_expiration > time.time(): self += CTK.RawHTML(self.cache_info) else: self += CTK.XMLRPCProxy( 'cherokee-latest-release', xmlrpc_func=XmlRpcServer(OWS_RPC).get_latest, format_func=self.format, debug=True)
def __init__(self): CTK.Box.__init__(self, {'class': 'market-my-library'}) self += CTK.RawHTML('<h3>%s</h3>' % (_('My Library'))) if cached_info and cache_expiration > time.time(): self += CTK.RawHTML(self.format_func(cached_info, from_cache=True)) else: self += CTK.XMLRPCProxy( name='cherokee-my-library', xmlrpc_func=lambda: XmlRpcServer( OWS_APPS_AUTH, OWS_Login.login_user, OWS_Login. login_password).get_user_apps(), format_func=self.format_func, debug=OWS_DEBUG)
def Review_Apply(): rate = CTK.post.get_val('rate') title = CTK.post.get_val('title') review = CTK.post.get_val('review') app_id = CTK.post.get_val('application_id') # OWS auth xmlrpc = XmlRpcServer(OWS_APPS_AUTH, OWS_Login.login_user, OWS_Login.login_password) try: ok = xmlrpc.set_review(app_id, rate, CTK.util.to_unicode(title), CTK.util.to_unicode(review)) except: ok = False return {'ret': ('error', 'ok')[ok]}
def Exception_Handler_Apply(): # Collect information info = {} info['log'] = Install_Log.get_full_log() info['user'] = OWS_Login.login_user info['comments'] = CTK.post['comments'] info['platform'] = SystemInfo.get_info() info['cfg'] = CTK.cfg.serialize() info['tmp!market!install'] = CTK.cfg['tmp!market!install'].serialize() # Send it xmlrpc = XmlRpcServer(OWS_APPS_INSTALL, user=OWS_Login.login_user, password=OWS_Login.login_password) install_info = xmlrpc.report_exception(info) return CTK.cfg_reply_ajax_ok()
def __init__(self): CTK.Container.__init__(self) # Skip the XML-RPC if OWS is inactive if not int(CTK.cfg.get_val('admin!ows!enabled', OWS_ENABLE)): return # Instance the XML-RPC Proxy object if Index_Block2.cached: self += CTK.RawHTML(Index_Block2.cached) else: self += CTK.XMLRPCProxy( name='cherokee-index-block2', xmlrpc_func=lambda: XmlRpcServer(OWS_RPC).get_block_index_2( CTK.i18n.active_lang, VERSION), format_func=self.format_func, debug=DEBUG)
def Report_Apply(): app_id = CTK.post.get_val('app_id') report = CTK.post.get_val('report') app_logs = get_logs(app_id) sysinfo = SystemInfo.get_info() cfg = str(CTK.cfg) # OWS Open xmlrpc = XmlRpcServer(OWS_APPS_CENTER, OWS_Login.login_user, OWS_Login.login_password) try: ok = xmlrpc.report_application( app_id, # int CTK.util.to_unicode(report), # string CTK.util.to_unicode(app_logs), # list CTK.util.to_unicode(sysinfo), # dict CTK.util.to_unicode(cfg)) # string except: ok = False return {'ret': ('error', 'ok')[ok]}
def __init__(self): CTK.XMLRPCProxy.__init__(self, 'cherokee-tweets', XmlRpcServer(OWS_RPC).get_tweets, self.format, debug=True)
def __init__(self): CTK.XMLRPCProxy.__init__(self, 'cherokee-mailing-list', XmlRpcServer(OWS_RPC).get_mailing_list, self.format, debug=True)