Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement user/channel objects #15

Open
19 tasks
ghost opened this issue Feb 15, 2014 · 3 comments
Open
19 tasks

Implement user/channel objects #15

ghost opened this issue Feb 15, 2014 · 3 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Feb 15, 2014

TODO list:

Channels

Data members

Base implementation

  • users: List[str]
  • name: str

rfc 1459

  • modes: Set
  • topic: str
  • topic_by: str
  • created: ???
  • password: str
  • ban_list: List[???]
  • public: bool

Isupport (optionals)

  • exceptionlist : List[???]
  • inviteexceptlist: List[???]

Methods

TBD

Users

data members

Base

  • nickname: str
  • username: str
  • realname: str
  • hostname: str

RFC 1459

  • away: bool
  • away_message: Optional[str]

Account support

  • account: Optional[str]
  • identified: bool

methods

TBD

Original message is as follows:


Currently, users and channels are dicts – they would be better off and less gross as objects.

@ghost ghost added the enhancement label Feb 15, 2014
@ghost ghost assigned shizmob Feb 15, 2014
@shizmob shizmob added this to the v0.9 milestone Feb 21, 2014
ghost pushed a commit that referenced this issue Apr 18, 2015
This is extremely backwards-incompatible with v0.8 as it changes many
interfaces for interacting with user and channel information, namely:

 - All previous dictionary fields have been converted to attributes,
   e.g. user['username'] is now user.username (BREAKING).

 - Instead of nicknames and channel names, User and Channel models are
   now passed to on_* hooks (BREAKING).

 - _sync_user has been completely removed and replaced with
   _parse_and_sync_user (and, to some extent, _get_or_create_user).
   Everything that made use of _parse_user now also synchronizes with
   the user database for consistency (may be breaking).

 - A new metaclass, ClientMeta, has been introduced to allow dynamic
   composition of the User and Channel classes on the feature classes
   (internal only).

 - User/Channel objects have the message() method when RFC1459 support
   is active (feature).
ghost pushed a commit that referenced this issue Apr 18, 2015
This is extremely backwards-incompatible with v0.8 as it changes many
interfaces for interacting with user and channel information, namely:

 - All previous dictionary fields have been converted to attributes,
   e.g. user['username'] is now user.username. This extends to results
   from WHOIS (WhoisInfo) and WHOWAS (WhowasInfo).

 - Instead of nicknames and channel names, User and Channel models are
   now passed to on_* hooks (BREAKING).

 - _sync_user has been completely removed and replaced with
   _parse_and_sync_user (and, to some extent, _get_or_create_user).
   Everything that made use of _parse_user now also synchronizes with
   the user database for consistency (may be breaking).

 - A new metaclass, ClientMeta, has been introduced to allow dynamic
   composition of the User and Channel classes on the feature classes
   (internal only).

 - User/Channel objects have the message() method when RFC1459 support
   is active (feature).
ghost pushed a commit that referenced this issue Apr 18, 2015
This is extremely backwards-incompatible with v0.8 as it changes many
interfaces for interacting with user and channel information, namely:

 - All previous dictionary fields have been converted to attributes,
   e.g. user['username'] is now user.username. This extends to results
   from WHOIS (WhoisInfo) and WHOWAS (WhowasInfo).

 - Instead of nicknames and channel names, User and Channel models are
   now passed to on_* hooks (BREAKING).

 - _sync_user has been completely removed and replaced with
   _parse_and_sync_user (and, to some extent, _get_or_create_user).
   Everything that made use of _parse_user now also synchronizes with
   the user database for consistency (may be breaking).

 - A new metaclass, ClientMeta, has been introduced to allow dynamic
   composition of the User and Channel classes on the feature classes
   (internal only).

 - User/Channel objects have the message() method when RFC1459 support
   is active (feature).
ghost pushed a commit that referenced this issue Apr 18, 2015
This is extremely backwards-incompatible with v0.8 as it changes many
interfaces for interacting with user and channel information, namely:

 - All previous dictionary fields have been converted to attributes,
   e.g. user['username'] is now user.username. This extends to results
   from WHOIS (WhoisInfo) and WHOWAS (WhowasInfo).

 - Instead of nicknames and channel names, User and Channel models are
   now passed to on_* hooks (BREAKING).

 - _sync_user has been completely removed and replaced with
   _parse_and_sync_user (and, to some extent, _get_or_create_user).
   Everything that made use of _parse_user now also synchronizes with
   the user database for consistency (may be breaking).

 - A new metaclass, ClientMeta, has been introduced to allow dynamic
   composition of the User and Channel classes on the feature classes
   (internal only).

 - User/Channel objects have the message() method when RFC1459 support
   is active (feature).
ghost pushed a commit that referenced this issue Apr 18, 2015
This is extremely backwards-incompatible with v0.8 as it changes many
interfaces for interacting with user and channel information, namely:

 - All previous dictionary fields have been converted to attributes,
   e.g. user['username'] is now user.username. This extends to results
   from WHOIS (WhoisInfo) and WHOWAS (WhowasInfo).

 - Instead of nicknames and channel names, User and Channel models are
   now passed to on_* hooks (BREAKING).

 - _sync_user has been completely removed and replaced with
   _parse_and_sync_user (and, to some extent, _get_or_create_user).
   Everything that made use of _parse_user now also synchronizes with
   the user database for consistency (may be breaking).

 - A new metaclass, ClientMeta, has been introduced to allow dynamic
   composition of the User and Channel classes on the feature classes
   (internal only).

 - User/Channel objects have the message() method when RFC1459 support
   is active (feature).
ghost pushed a commit that referenced this issue Apr 18, 2015
This is extremely backwards-incompatible with v0.8 as it changes many
interfaces for interacting with user and channel information, namely:

 - All previous dictionary fields have been converted to attributes,
   e.g. user['username'] is now user.username. This extends to results
   from WHOIS (WhoisInfo) and WHOWAS (WhowasInfo).

 - Instead of nicknames and channel names, User and Channel models are
   now passed to on_* hooks (BREAKING).

 - _sync_user has been completely removed and replaced with
   _parse_and_sync_user (and, to some extent, _get_or_create_user).
   Everything that made use of _parse_user now also synchronizes with
   the user database for consistency (may be breaking).

 - A new metaclass, ClientMeta, has been introduced to allow dynamic
   composition of the User and Channel classes on the feature classes
   (internal only).

 - User/Channel objects have the message() method when RFC1459 support
   is active (feature).
ghost pushed a commit that referenced this issue Apr 18, 2015
This is extremely backwards-incompatible with v0.8 as it changes many
interfaces for interacting with user and channel information, namely:

 - All previous dictionary fields have been converted to attributes,
   e.g. user['username'] is now user.username. This extends to results
   from WHOIS (WhoisInfo) and WHOWAS (WhowasInfo).

 - Instead of nicknames and channel names, User and Channel models are
   now passed to on_* hooks (BREAKING).

 - _sync_user has been completely removed and replaced with
   _parse_and_sync_user (and, to some extent, _get_or_create_user).
   Everything that made use of _parse_user now also synchronizes with
   the user database for consistency (may be breaking).

 - A new metaclass, ClientMeta, has been introduced to allow dynamic
   composition of the User and Channel classes on the feature classes
   (internal only).

 - User/Channel objects have the message() method when RFC1459 support
   is active (feature).
ghost pushed a commit that referenced this issue Apr 18, 2015
This is extremely backwards-incompatible with v0.8 as it changes many
interfaces for interacting with user and channel information, namely:

 - All previous dictionary fields have been converted to attributes,
   e.g. user['username'] is now user.username. This extends to results
   from WHOIS (WhoisInfo) and WHOWAS (WhowasInfo).

 - Instead of nicknames and channel names, User and Channel models are
   now passed to on_* hooks (BREAKING).

 - _sync_user has been completely removed and replaced with
   _parse_and_sync_user (and, to some extent, _get_or_create_user).
   Everything that made use of _parse_user now also synchronizes with
   the user database for consistency (may be breaking).

 - A new metaclass, ClientMeta, has been introduced to allow dynamic
   composition of the User and Channel classes on the feature classes
   (internal only).

 - User/Channel objects have the message() method when RFC1459 support
   is active (feature).
ghost pushed a commit that referenced this issue Apr 18, 2015
This is extremely backwards-incompatible with v0.8 as it changes many
interfaces for interacting with user and channel information, namely:

 - All previous dictionary fields have been converted to attributes,
   e.g. user['username'] is now user.username. This extends to results
   from WHOIS (WhoisInfo) and WHOWAS (WhowasInfo).

 - Instead of nicknames and channel names, User and Channel models are
   now passed to on_* hooks (BREAKING).

 - _sync_user has been completely removed and replaced with
   _parse_and_sync_user (and, to some extent, _get_or_create_user).
   Everything that made use of _parse_user now also synchronizes with
   the user database for consistency (may be breaking).

 - A new metaclass, ClientMeta, has been introduced to allow dynamic
   composition of the User and Channel classes on the feature classes
   (internal only).

 - User/Channel objects have the message() method when RFC1459 support
   is active (feature).

Oh, and now the contents parameter of ctcp() actually does something.
ghost pushed a commit that referenced this issue Jun 8, 2015
This is extremely backwards-incompatible with v0.8 as it changes many
interfaces for interacting with user and channel information, namely:

 - All previous dictionary fields have been converted to attributes,
   e.g. user['username'] is now user.username. This extends to results
   from WHOIS (WhoisInfo) and WHOWAS (WhowasInfo).

 - Instead of nicknames and channel names, User and Channel models are
   now passed to on_* hooks (BREAKING).

 - _sync_user has been completely removed and replaced with
   _parse_and_sync_user (and, to some extent, _get_or_create_user).
   Everything that made use of _parse_user now also synchronizes with
   the user database for consistency (may be breaking).

 - A new metaclass, ClientMeta, has been introduced to allow dynamic
   composition of the User and Channel classes on the feature classes
   (internal only).

 - User/Channel objects have the message() method when RFC1459 support
   is active (feature).

Oh, and now the contents parameter of ctcp() actually does something.
ghost pushed a commit that referenced this issue Jun 8, 2015
This is a somewhat backwards-incompatible with v0.8 as it changes many interfaces for interacting with user and channel information, namely:

 - All previous dictionary fields have been converted to attributes, e.g. user['username'] is now user.username. This extends to results from WHOIS (WHOISInfo) and WHOWAS (WHOWASInfo).

   __getitem__ and __setitem__ are implemented, for the time being, to maintain backwards compatibility.

 - Instead of nicknames and channel names, User and Channel models are now passed to on_* hooks (BREAKING).

 - _sync_user has been completely removed and replaced with _parse_and_process_user (and, to some extent, _get_user). Everything that made use of _parse_user now also synchronizes with the user database for consistency (may be breaking).

 - A new metaclass, ClientType, has been introduced to allow dynamic composition of the User and Channel classes on the feature classes (internal only).

 - User/Channel objects have the message() method when RFC1459 support is active (feature).

Oh, and now the contents parameter of ctcp() actually does something.
ghost pushed a commit that referenced this issue Jun 8, 2015
This is a somewhat backwards-incompatible with v0.8 as it changes many interfaces for interacting with user and channel information, namely:

 - Instead of nicknames and channel names, User and Channel models are now passed to on_* hooks (BREAKING). Additionally, on_nick_change has been changed to take the arguments (user, original_nick).

 - All previous dictionary fields have been converted to attributes, e.g. user['username'] is now user.username. This extends to results from WHOIS (WHOISInfo) and WHOWAS (WHOWASInfo).

   __getitem__ and __setitem__ are implemented, for the time being, to maintain backwards compatibility.

 - _sync_user has been completely removed and replaced with _parse_and_process_user (and, to some extent, _get_user). Everything that made use of _parse_user now also synchronizes with the user database for consistency (may be breaking).

 - A new metaclass, ClientType, has been introduced to allow dynamic composition of the User and Channel classes on the feature classes (internal only).

 - User/Channel objects have the message() method when RFC1459 support is active (feature).

Oh, and now the contents parameter of ctcp() actually does something.
@FrozenPigs
Copy link

If you wanted to have fun, but also kill support for anything not Python 3.7, dataclasses would be nice for this.

@theunkn0wn1 theunkn0wn1 assigned theunkn0wn1 and unassigned shizmob Dec 27, 2018
@theunkn0wn1
Copy link
Collaborator

theunkn0wn1 commented Dec 27, 2018

I believe there is a backport for dataclasses, but would require adding an additional dependency to the project for python versions <3.7.

For the time being, i plan to support Python versions 3.5 or newer, as to give downstream users a bit more leeway on their target python versions.

Also, I will be exploring re-implementing soon.

@theunkn0wn1
Copy link
Collaborator

Given that Pydle suports Python >=3.5 the standard library dataclasses isn't an option, since it depends on >=3.6 language syntax.

To prevent re-inventing the wheel and thus a LOT of boilerplate, the best course forward for this is probably to use the attrs package; which retains compatability for older python versions.
I have started work towards this end on my fork, will update if anything substantial comes out of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants