LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File skills-skill-reminder.patch of Package mycroft-core (Project home:alarrosa:packages)

From d3d8e87e6b8b33814ec9d3499452b862a6a3e714 Mon Sep 17 00:00:00 2001
From: Antonio Larrosa <antonio.larrosa@gmail.com>
Date: Sat, 3 Mar 2018 19:23:33 +0100
Subject: [PATCH] Fix python2 exclusive code to work also with python3

This allows the skill to run under python2 and python3
---
 __init__.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git skill-reminder/__init__.py skill-reminder.new/__init__.py
index 5b9f4c4..cc254a6 100644
--- skill-reminder/__init__.py
+++ skill-reminder.new/__init__.py
@@ -24,6 +24,7 @@
 import yaml
 from adapt.intent import IntentBuilder
 from os.path import dirname
+from future.utils import iteritems
 
 from mycroft.skills.scheduled_skills import ScheduledCRUDSkill
 
@@ -110,7 +111,7 @@ def add(self, date, message):
 
     def __fix_pronouns(self, utterance):
         msg = utterance.strip()
-        for key, val in self.PRONOUNS.iteritems():
+        for key, val in iteritems(self.PRONOUNS):
             k = key.lower()
             v = val.lower()
             msg = msg.replace(' ' + k + ' ', ' ' + v + ' ')