Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package palaura for openSUSE:Factory checked in at 2021-05-18 18:27:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/palaura (Old) and /work/SRC/openSUSE:Factory/.palaura.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "palaura" Tue May 18 18:27:09 2021 rev:10 rq:893997 version:1.5.1 Changes: -------- --- /work/SRC/openSUSE:Factory/palaura/palaura.changes 2020-05-08 23:07:12.246089296 +0200 +++ /work/SRC/openSUSE:Factory/.palaura.new.2988/palaura.changes 2021-05-18 18:27:37.630654324 +0200 @@ -1,0 +2,6 @@ +Mon May 17 22:58:06 UTC 2021 - Ferdinand Thiessen <r...@fthiessen.de> + +- Update to version 1.5.1 + * New API based on Google Dictionary, should be more stable + +------------------------------------------------------------------- Old: ---- palaura-1.2.2.tar.gz New: ---- palaura-1.5.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ palaura.spec ++++++ --- /var/tmp/diff_new_pack.qpeYWY/_old 2021-05-18 18:27:38.054652486 +0200 +++ /var/tmp/diff_new_pack.qpeYWY/_new 2021-05-18 18:27:38.054652486 +0200 @@ -17,7 +17,7 @@ Name: palaura -Version: 1.2.2 +Version: 1.5.1 Release: 0 Summary: A dictionary with word definitions License: GPL-3.0-or-later ++++++ palaura-1.2.2.tar.gz -> palaura-1.5.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.2/data/com.github.lainsce.palaura.appdata.xml.in new/palaura-1.5.1/data/com.github.lainsce.palaura.appdata.xml.in --- old/palaura-1.2.2/data/com.github.lainsce.palaura.appdata.xml.in 2020-04-19 00:15:09.000000000 +0200 +++ new/palaura-1.5.1/data/com.github.lainsce.palaura.appdata.xml.in 2020-11-30 19:18:41.000000000 +0100 @@ -53,6 +53,22 @@ </screenshot> </screenshots> <releases> + <release version="1.5.1" date="2020-11-30"> + <description> + <p>Release: Change of APIs</p> + <ul> + <li>Changes: New API based on Google Dictionary, should be more stable.</li> + </ul> + </description> + </release> + <release version="1.5.0" date="2020-11-27"> + <description> + <p>Release: Change of APIs</p> + <ul> + <li>Changes: New API based on Google Dictionary, should be more stable.</li> + </ul> + </description> + </release> <release version="1.2.1" date="2020-04-24"> <description> <p>Release: Dark Space</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.2/data/com.github.lainsce.palaura.gschema.xml new/palaura-1.5.1/data/com.github.lainsce.palaura.gschema.xml --- old/palaura-1.2.2/data/com.github.lainsce.palaura.gschema.xml 2020-04-19 00:15:09.000000000 +0200 +++ new/palaura-1.5.1/data/com.github.lainsce.palaura.gschema.xml 2020-11-30 19:18:41.000000000 +0100 @@ -16,7 +16,7 @@ <description>Whether dark mode is enabled or not</description> </key> <key name="dict-lang" type="s"> - <default>'en-us'</default> + <default>'en'</default> <summary>Dictionary language</summary> <description>The language used to query words from its dictionary</description> </key> Binary files old/palaura-1.2.2/data/shot.png and new/palaura-1.5.1/data/shot.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.2/data/stylesheet.css new/palaura-1.5.1/data/stylesheet.css --- old/palaura-1.2.2/data/stylesheet.css 2020-04-19 00:15:09.000000000 +0200 +++ new/palaura-1.5.1/data/stylesheet.css 2020-11-30 19:18:41.000000000 +0100 @@ -3,12 +3,21 @@ @define-color textColorPrimary #f5f5f5; .palaura-window { - background-color: @colorPrimary; + background-color: #FDF6E3; +} + +.palaura-window, +.palaura-window decoration { + border-radius: 6px; } .palaura-window-dark { - background-color: shade(@colorPrimary, 1.2); - color: #333; + background-color: #002B36; +} + +.palaura-window-dark, +.palaura-window-dark decoration { + border-radius: 6px; } .palaura-view { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.2/meson.build new/palaura-1.5.1/meson.build --- old/palaura-1.2.2/meson.build 2020-04-19 00:15:09.000000000 +0200 +++ new/palaura-1.5.1/meson.build 2020-11-30 19:18:41.000000000 +0100 @@ -1,6 +1,6 @@ # Name our project project('com.github.lainsce.palaura', ['vala', 'c'], - version: '1.2.1' + version: '1.5.1' ) # Import main lib files diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.2/src/Core/Definition.vala new/palaura-1.5.1/src/Core/Definition.vala --- old/palaura-1.2.2/src/Core/Definition.vala 2020-04-19 00:15:09.000000000 +0200 +++ new/palaura-1.5.1/src/Core/Definition.vala 2020-11-30 19:18:41.000000000 +0100 @@ -1,100 +1,91 @@ public class Palaura.Core.Definition : Object { - public string text; - public string lexical_category; + public string word; + Pronunciation[] phonetics = {}; + Pos[] pos = {}; Sense[] senses = {}; - Pronunciation[] pronunciations = {}; public static Core.Definition parse_json (Json.Object root) { Core.Definition obj = new Core.Definition (); - if (root.has_member ("text")) - obj.text = root.get_string_member ("text"); + if (root.has_member ("word")) + obj.word = root.get_string_member ("word"); - if (root.has_member ("lexicalCategory")) { - Json.Object category = root.get_object_member ("lexicalCategory"); - if (category.has_member ("text")) - obj.lexical_category = category.get_string_member ("text"); - } - - if (root.has_member ("pronunciations")) { - Json.Array pronunciations = root.get_array_member ("pronunciations"); - foreach (var pronunciation in pronunciations.get_elements()) - obj.pronunciations += Pronunciation.parse_json (pronunciation.get_object ()); - } - - if (root.has_member ("entries")) { - Json.Array entries = root.get_array_member ("entries"); - var obj_entries = entries.get_object_element(0); - Json.Array senses = obj_entries.get_array_member("senses"); - foreach (var sense in senses.get_elements()) - obj.senses += Sense.parse_json (sense.get_object ()); + if (root.has_member ("meanings")) { + Json.Array meanings = root.get_array_member ("meanings"); + foreach (var pos in meanings.get_elements()) { + obj.pos += Pos.parse_json (pos.get_object ()); + obj.senses += Sense.parse_json (pos.get_object ()); + } + } + + if (root.has_member ("phonetics")) { + Json.Array phonetics = root.get_array_member ("phonetics"); + foreach (var pronunciation in phonetics.get_elements()) + obj.phonetics += Pronunciation.parse_json (pronunciation.get_object ()); } return obj; } - public class Sense { - string[] definitions = {}; - Example[] examples = {}; + public class Pronunciation { + public string text; - public string[] get_definitions () { - return definitions; - } + public static Pronunciation parse_json(Json.Object root) { + Pronunciation obj = new Pronunciation(); - public Example[] get_examples () { - return examples; + obj.text = root.get_string_member("text"); + + return obj; } + } - public class Example { - public string text; + public class Pos { + public string text; - public static Example parse_json (Json.Object root) { - Example obj = new Example (); + public static Pos parse_json(Json.Object root) { + Pos obj = new Pos(); - if (root.has_member ("text")) - obj.text = root.get_string_member ("text"); + obj.text = root.get_string_member("partOfSpeech"); - return obj; - } + return obj; + } + } + + public class Sense { + string[] definition = {}; + string[] examples = {}; + + public string[] get_definitions () { + return definition; + } + + public string[] get_examples () { + return examples; } public static Sense parse_json (Json.Object root) { Sense obj = new Sense(); - if (root.has_member ("definitions")) { - Json.Array definitions = root.get_array_member ("definitions"); - foreach (var definition in definitions.get_elements ()) - obj.definitions += definition.get_string (); - } - - if (root.has_member ("examples")) { - Json.Array examples = root.get_array_member ("examples"); - foreach (var example in examples.get_elements ()) - obj.examples += Example.parse_json (example.get_object ()); + Json.Array definitions = root.get_array_member ("definitions"); + foreach (var def in definitions.get_elements()) { + var def_obj = def.get_object (); + obj.definition += def_obj.get_string_member ("definition"); + obj.examples += def_obj.get_string_member ("example"); } return obj; } } - public class Pronunciation { - public string phonetic_spelling; - - public static Pronunciation parse_json(Json.Object root) { - Pronunciation obj = new Pronunciation(); - - if (root.has_member ("phoneticSpelling")) - obj.phonetic_spelling = root.get_string_member("phoneticSpelling"); - - return obj; - } + public Pronunciation[] get_phonetics () { + return phonetics; } - public Pronunciation[] get_pronunciations () { - return pronunciations; + public Pos[] get_pos () { + return pos; } public Sense[] get_senses () { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.2/src/Core/DictCore.vala new/palaura-1.5.1/src/Core/DictCore.vala --- old/palaura-1.2.2/src/Core/DictCore.vala 2020-04-19 00:15:09.000000000 +0200 +++ new/palaura-1.5.1/src/Core/DictCore.vala 2020-11-30 19:18:41.000000000 +0100 @@ -2,24 +2,19 @@ public async string get_entries (string text) throws GLib.Error { string dict = Palaura.Application.gsettings.get_string("dict-lang"); Palaura.Application.gsettings.changed.connect (() => { - if (Palaura.Application.gsettings.get_string("dict-lang") == "en-us") { - dict = "en-us"; + if (Palaura.Application.gsettings.get_string("dict-lang") == "en") { + dict = "en"; } else if (Palaura.Application.gsettings.get_string("dict-lang") == "es") { dict = "es"; } }); - string low_text = text.down (); - string uri = @"https://od-api.oxforddictionaries.com/api/v2/entries/$dict/$low_text?strictMatch=false"; - + string ltext = text.down (); + string uri = @"https://api.dictionaryapi.dev/api/v2/entries/$dict/$ltext"; string response = ""; var session = new Soup.Session (); var message = new Soup.Message ("GET", uri); - Soup.MessageHeaders headers = message.request_headers; - headers.append ("Accept","application/json"); - headers.append ("app_id","db749a02"); - headers.append ("app_key","080738b4b5778a35498f2036c126c9e2"); session.queue_message (message, (sess, mess) => { response = (string) mess.response_body.data; @@ -38,12 +33,10 @@ var parser = new Json.Parser(); parser.load_from_data (yield get_entries (word)); - var root_object = parser.get_root().get_object (); - var results = root_object.get_array_member("results"); - var obj_results = results.get_object_element(0); - var lexentry = obj_results.get_array_member("lexicalEntries"); + var root_object = parser.get_root (); + var results = root_object.get_array (); - foreach (var w in lexentry.get_elements()) + foreach (var w in results.get_elements ()) definitions += Core.Definition.parse_json (w.get_object ()); } catch (Error e) { warning (e.message); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.2/src/MainWindow.vala new/palaura-1.5.1/src/MainWindow.vala --- old/palaura-1.2.2/src/MainWindow.vala 2020-04-19 00:15:09.000000000 +0200 +++ new/palaura-1.5.1/src/MainWindow.vala 2020-11-30 19:18:41.000000000 +0100 @@ -164,6 +164,7 @@ normal_view = new Palaura.NormalView(); definition_view = new Palaura.DefinitionView(); stack = new Gtk.Stack (); + stack.margin_bottom = 6; stack.transition_type = Gtk.StackTransitionType.SLIDE_LEFT_RIGHT; stack.add (normal_view); stack.add (search_view); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.2/src/Views/DefinitionView.vala new/palaura-1.5.1/src/Views/DefinitionView.vala --- old/palaura-1.2.2/src/Views/DefinitionView.vala 2020-04-19 00:15:09.000000000 +0200 +++ new/palaura-1.5.1/src/Views/DefinitionView.vala 2020-11-30 19:18:41.000000000 +0100 @@ -5,7 +5,7 @@ Gtk.SourceBuffer buffer; Gtk.TextTag tag_word; Gtk.TextTag tag_pronunciation; - Gtk.TextTag tag_lexical_category; + Gtk.TextTag tag_pos; Gtk.TextTag tag_sense_numbering; Gtk.TextTag tag_sense_definition; Gtk.TextTag tag_sense_examples; @@ -59,7 +59,7 @@ tag_word = buffer.create_tag (null, "weight", Pango.Weight.BOLD, "font", "serif 18"); tag_pronunciation = buffer.create_tag (null, "font", "serif 12"); - tag_lexical_category = buffer.create_tag (null, "font", "serif 12", "pixels-above-lines", 8, "pixels-inside-wrap", 8); + tag_pos = buffer.create_tag (null, "font", "serif 12", "pixels-above-lines", 8, "pixels-inside-wrap", 8); tag_sense_numbering = buffer.create_tag (null, "font", "sans 12", "weight", Pango.Weight.HEAVY, "left-margin", 10, "pixels-above-lines", 8, "pixels-inside-wrap", 8); tag_sense_definition = buffer.create_tag (null, "font", "serif 12", "left-margin", 10); tag_sense_examples = buffer.create_tag (null, "font", "serif 12", "left-margin", 40, "pixels-above-lines", 8, "pixels-inside-wrap", 8); @@ -75,25 +75,19 @@ Gtk.TextIter iter; buffer.text = ""; buffer.get_end_iter (out iter); - if(definition.text != null) { - buffer.insert_with_tags (ref iter, @"??? $(definition.text) ", -1, tag_word); + if(definition.word != null) { + buffer.insert_with_tags (ref iter, @"??? $(definition.word) ", -1, tag_word); } - var pronunciations = definition.get_pronunciations (); + var pronunciations = definition.get_phonetics (); string pronunciation_str = ""; for (int i = 0; i < pronunciations.length; i++) { if (pronunciations.length > 0) { if (i == 0) { - pronunciation_str += "/"; } else { pronunciation_str += "; "; } - - pronunciation_str += pronunciations[i].phonetic_spelling; - - if (i == pronunciations.length - 1) { - pronunciation_str += "/"; - } + pronunciation_str += pronunciations[i].text; } } if(pronunciation_str != null) { @@ -102,16 +96,18 @@ buffer.insert(ref iter, "\n", -1); - if(definition.lexical_category != null) { + Core.Definition.Pos pos = definition.get_pos()[0]; + if (pos != null) { + string pos_text = pos.text; buffer.insert_with_tags (ref iter, @"??? ", -1, tag_sense_lexicon); - buffer.insert_with_tags (ref iter, @"$(definition.lexical_category)", -1, tag_lexical_category); + buffer.insert_with_tags (ref iter, @"$(pos_text)", -1, tag_pos); } buffer.insert(ref iter, "\n", -1); if(definition.get_senses() != null) { var senses = definition.get_senses(); - for (int i = 0; i < senses.length; i++) { + for (int i = 0; i < senses.length +1; i++) { var definitions = senses[i].get_definitions (); if (definitions.length > 0) { buffer.insert_with_tags (ref iter, @"$(i + 1). ", -1, tag_sense_numbering); @@ -121,7 +117,7 @@ var examples = senses[i].get_examples (); if (examples.length > 0) { buffer.insert_with_tags (ref iter, @"??? ", -1, tag_sense_explaining); - buffer.insert_with_tags (ref iter, @"$(examples[0].text)\n", -1, tag_sense_examples); + buffer.insert_with_tags (ref iter, @"$(examples[0])\n", -1, tag_sense_examples); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.2/src/Widgets/WordContainerGrid.vala new/palaura-1.5.1/src/Widgets/WordContainerGrid.vala --- old/palaura-1.2.2/src/Widgets/WordContainerGrid.vala 2020-04-19 00:15:09.000000000 +0200 +++ new/palaura-1.5.1/src/Widgets/WordContainerGrid.vala 2020-11-30 19:18:41.000000000 +0100 @@ -21,19 +21,23 @@ public WordContainerGrid(Core.Definition definition) { this.definition = definition; - markup = "<span weight=\"bold\" font_family=\"serif\" size=\"large\">"+definition.text+"</span>"; + markup = "<span weight=\"bold\" font_family=\"serif\" size=\"large\">"+definition.word+" </span>"; - Core.Definition.Pronunciation pronunciation = definition.get_pronunciations()[0]; + Core.Definition.Pronunciation pronunciation = definition.get_phonetics()[0]; if (pronunciation != null) { - string phonetic_spelling = pronunciation.phonetic_spelling; - markup += @"<span font_family=\"serif\" size=\"large\"> /"+phonetic_spelling+"/ </span>"; + string phonetic_spelling = pronunciation.text; + markup += @"<span font_family=\"serif\" size=\"large\">"+phonetic_spelling+"</span>"; } - markup += @"<span style=\"italic\" font_family=\"serif\" size=\"large\"> "+definition.lexical_category+" </span>"; + Core.Definition.Pos pos = definition.get_pos()[0]; + if (pos != null) { + string pos_text = pos.text; + markup += @"<span style=\"italic\" font_family=\"serif\" size=\"large\"> "+pos_text+" </span>"; + } if(definition.get_senses ().length > 0) markup += @"\n<span font_family=\"serif\" size=\"large\"> "+definition.get_senses ()[0].get_definitions ()[0]+" </span>"; - + text.set_markup (markup); } }