Przeglądaj źródła

Cheat to make the bot import correctly without PyYAML installed.

tags/v0.1^2
Ben Kurtovic 14 lat temu
rodzic
commit
c2396d3410
1 zmienionych plików z 4 dodań i 3 usunięć
  1. +4
    -3
      earwigbot/config/ordered_yaml.py

+ 4
- 3
earwigbot/config/ordered_yaml.py Wyświetl plik

@@ -31,12 +31,13 @@ from collections import OrderedDict


try: try:
import yaml import yaml
from yaml import Loader, SafeDumper
except ImportError: except ImportError:
yaml = None
yaml = Loader = SafeDumper = None


__all__ = ["OrderedLoader", "OrderedDumper"] __all__ = ["OrderedLoader", "OrderedDumper"]


class OrderedLoader(yaml.Loader):
class OrderedLoader(Loader):
"""A YAML loader that loads mappings into ordered dictionaries.""" """A YAML loader that loads mappings into ordered dictionaries."""


def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
@@ -74,7 +75,7 @@ class OrderedLoader(yaml.Loader):
return mapping return mapping




class OrderedDumper(yaml.SafeDumper):
class OrderedDumper(SafeDumper):
"""A YAML dumper that dumps ordered dictionaries into mappings.""" """A YAML dumper that dumps ordered dictionaries into mappings."""


def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):


Ładowanie…
Anuluj
Zapisz