2
# -*- coding: utf-8 -*-
4
# Copyright © 2017 marmuta <marmvta@gmail.com>
6
# This file is part of Onboard.
8
# Onboard is free software; you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
13
# Onboard is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
from Onboard.emoji_data import emoji_data
26
Singleton class providing emoji data and general Unicode information.
30
["α", "αβγδεζηθικλμνξοπρςστυφχψω" # Greek
31
"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"],
33
["ℝ", "ℝℂℕℙℚℤ" # math & physics
42
["€", "$₠₡₢₣₤₥₦₧₨₩₪₫€₭₮₯₰₱₲₳₴₵₶₷₸₹₺₻₼₽₾" # currency
45
["²₂", "⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾" # super- and subscript
52
def __new__(cls, *args, **kwargs):
56
if not hasattr(cls, "self"):
57
cls.self = object.__new__(cls, *args, **kwargs)
63
Called multiple times, don't use this.
69
Singleton constructor, runs only once.
76
def get_emoji_categories(self):
77
return [label for label, data in self._get_emoji_data()]
79
def get_emoji(self, category):
81
for sequence, data in self._get_emoji_data()[category][1])
83
def _get_emoji_data(self):
86
def get_symbol_categories(self):
87
return [label for label, data in self._get_symbol_data()]
89
def get_symbols(self, category):
90
return tuple(self._get_symbol_data()[category][1])
92
def _get_symbol_data(self):
93
return self._symbol_data