diff --git a/plugin.json b/plugin.json index 281c8eb..68c1122 100644 --- a/plugin.json +++ b/plugin.json @@ -4,7 +4,7 @@ "Name": "General Converter", "Description": "General weights and measures converter", "Author": "deefrawley", - "Version": "1.1.2", + "Version": "1.1.3", "Language": "python", "Website": "https://github.com/deefrawley/Flow.Launcher.Plugin.GenConvert", "IcoPath": "assets/favicon.ico", diff --git a/plugin/units.py b/plugin/units.py index b926357..9c9a29c 100644 --- a/plugin/units.py +++ b/plugin/units.py @@ -36,7 +36,7 @@ # Base ["ml", _("millilitre"), _("millilitres"), "x * 1", "x * 1"], # All below convert to/from base - ["gm", _("gram"), _("grams"), "x * 1", "x * 1"], + ["g", _("gram"), _("grams"), "x * 1", "x * 1"], ["l", _("litre"), _("litres"), "x / 0.001", "x * 0.001"], ["pt", _("pint US"), _("pints US"), "x / 0.002113383", "x * 0.002113383"], [ @@ -157,7 +157,7 @@ ], "Weight": [ # Base - ["gm", _("gram"), _("grams"), "x * 1", "x * 1"], + ["g", _("gram"), _("grams"), "x * 1", "x * 1"], # All below convert to/from base ["kg", _("kilogram"), _("kilograms"), "x / 0.001", "x * 0.001"], ["lb", _("pound"), _("pounds"), "x / 0.002205", "x * 0.002205"], diff --git a/plugin/utils.py b/plugin/utils.py index 6f87094..fb871ce 100644 --- a/plugin/utils.py +++ b/plugin/utils.py @@ -20,13 +20,10 @@ def get_hints_for_category(from_unit: str): for u2 in gc_units.units[u]: if u2[0] == from_unit: category = str(u) + for uu in gc_units.units[category]: + if uu[0] != from_unit: + c.append(uu[0]) if category: - # Go back and iterate over the category again and get all the units that are not the from unit - for uu in gc_units.units[category]: - if uu[0] != from_unit: - c.append(uu[0]) - if not c: - return ["no valid units"] return c else: return ["no valid units"]