conf: Complete ordering functions for ConfigOption class

laforge/swu
Tobias Brunner 3 years ago
parent 1147973661
commit 48017a2740
  1. 6
      conf/format-options.py

@ -68,8 +68,9 @@ import sys
import re
from textwrap import TextWrapper
from argparse import ArgumentParser
from functools import cmp_to_key
from functools import cmp_to_key, total_ordering
@total_ordering
class ConfigOption:
"""Representing a configuration option or described section in strongswan.conf"""
def __init__(self, path, default = None, section = False, commented = False, include = False):
@ -83,6 +84,9 @@ class ConfigOption:
self.desc = []
self.options = []
def __eq__(self, other):
return self.name == other.name
def __lt__(self, other):
return self.name < other.name

Loading…
Cancel
Save