diff libervia/pages/events/page_meta.py @ 1216:b2d067339de3

python 3 port: /!\ Python 3.6+ is now needed to use libervia /!\ instability may occur and features may not be working anymore, this will improve with time /!\ TxJSONRPC dependency has been removed The same procedure as in backend has been applied (check backend commit ab2696e34d29 logs for details). Removed now deprecated code (Pyjamas compiled browser part, legacy blog, JSON RPC related code). Adapted code to work without `html` and `themes` dirs.
author Goffi <goffi@goffi.org>
date Tue, 13 Aug 2019 19:12:31 +0200
parents 92ca86e417e3
children f511f8fbbf8a
line wrap: on
line diff
--- a/libervia/pages/events/page_meta.py	Tue Aug 13 09:39:33 2019 +0200
+++ b/libervia/pages/events/page_meta.py	Tue Aug 13 19:12:31 2019 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
 from libervia.server.constants import Const as C
@@ -9,21 +9,21 @@
 log = getLogger(__name__)
 """ticket handling pages"""
 
-name = u"events"
+name = "events"
 access = C.PAGES_ACCESS_PUBLIC
-template = u"event/overview.html"
+template = "event/overview.html"
 
 
 @defer.inlineCallbacks
 def prepare_render(self, request):
     profile = self.getProfile(request)
     template_data = request.template_data
-    template_data[u"url_event_new"] = self.getSubPageURL(request, "event_new")
+    template_data["url_event_new"] = self.getSubPageURL(request, "event_new")
     if profile is not None:
         try:
             events = yield self.host.bridgeCall("eventsList", "", "", profile)
         except Exception as e:
-            log.warning(_(u"Can't get events list for {profile}: {reason}").format(
+            log.warning(_("Can't get events list for {profile}: {reason}").format(
                 profile=profile, reason=e))
         else:
             own_events = []
@@ -33,7 +33,7 @@
                     own_events.append(event)
                     event["url"] = self.getSubPageURL(
                         request,
-                        u"event_admin",
+                        "event_admin",
                         event.get("service", ""),
                         event.get("node", ""),
                         event.get("item"),
@@ -42,12 +42,12 @@
                     other_events.append(event)
                     event["url"] = self.getSubPageURL(
                         request,
-                        u"event_rsvp",
+                        "event_rsvp",
                         event.get("service", ""),
                         event.get("node", ""),
                         event.get("item"),
                     )
-                if u"thumb_url" not in event and u"image" in event:
-                    event[u"thumb_url"] = event[u"image"]
+                if "thumb_url" not in event and "image" in event:
+                    event["thumb_url"] = event["image"]
 
-            template_data[u"events"] = own_events + other_events
+            template_data["events"] = own_events + other_events