21 lines
558 B
Python
21 lines
558 B
Python
class Categories:
|
|
"""Category mappings"""
|
|
def __init__(self):
|
|
|
|
self.categories = {
|
|
15: "Politics OK",
|
|
16: "No Politics",
|
|
23: "Forum Stuff"
|
|
}
|
|
|
|
def get_category_name(self, category_id):
|
|
return self.categories.get(category_id, "Unknown")
|
|
|
|
def get_category_id(self, category_name):
|
|
for category_id, category_name in self.categories.items():
|
|
if category_name == category_name:
|
|
return category_id
|
|
|
|
def get_all(self):
|
|
return self.categories
|