This repository has been archived on 2025-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
Files
fbchat/fbchat/_plan.py
Mads Marquart 8ae8435940 Use attrs, to remove verbose __init__ and __repr__ methods
Backwards compatibility is strictly preserved in `__init__`, including parameter names, defaults and position. Whenever that's difficult using `attrs`, the custom `__init__` is kept instead (for the time being).

`__repr__` methods have changed to the format `attrs` use, but people don't rely on this for anything other than debug output, so it shouldn't be a problem.
2019-02-24 20:18:07 +01:00

29 lines
912 B
Python

# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
import attr
@attr.s(cmp=False)
class Plan(object):
"""Represents a plan"""
#: ID of the plan
uid = attr.ib(None, init=False)
#: Plan time (unix time stamp), only precise down to the minute
time = attr.ib(converter=int)
#: Plan title
title = attr.ib()
#: Plan location name
location = attr.ib(None, converter=lambda x: x or "")
#: Plan location ID
location_id = attr.ib(None, converter=lambda x: x or "")
#: ID of the plan creator
author_id = attr.ib(None, init=False)
#: List of the people IDs who will take part in the plan
going = attr.ib(factory=list, init=False)
#: List of the people IDs who won't take part in the plan
declined = attr.ib(factory=list, init=False)
#: List of the people IDs who are invited to the plan
invited = attr.ib(factory=list, init=False)