|
1 | | -#!/usr/bin/env python |
2 | 1 | # -*- encoding: utf-8 -*- |
3 | 2 |
|
4 | | -from .base import Resource |
5 | | -from .users import User |
6 | | -from .repos import Repo |
7 | | -from .orgs import Org |
| 3 | +from pygithub3.resources.base import Resource |
| 4 | +from pygithub3.resources import users, repos, orgs |
8 | 5 |
|
9 | 6 |
|
10 | 7 | class Event(Resource): |
11 | 8 |
|
12 | 9 | _dates = ('created_at', ) |
13 | | - _maps = {'actor': User, 'repo': Repo, 'org': Org} |
| 10 | + _maps = {'actor': users.User, 'repo': repos.Repo, 'org': orgs.Org} |
14 | 11 |
|
15 | 12 | def __str__(self): |
16 | | - return '<Event (%s)>' % getattr(self, 'type', '') |
| 13 | + return '<(%s)>' % getattr(self, 'type', '') |
17 | 14 |
|
18 | 15 |
|
19 | | -class RepoEvent(Resource): |
| 16 | +class Repo(Resource): |
20 | 17 |
|
21 | 18 | _dates = ('created_at', ) |
22 | | - _maps = {'actor': User, 'repo': Repo, 'org': Org} |
| 19 | + _maps = {'actor': users.User, 'repo': repos.Repo, 'org': orgs.Org} |
23 | 20 |
|
24 | 21 | def __str__(self): |
25 | | - return '<Event (%s)>' % getattr(self, 'type', '') |
| 22 | + return '<(%s)>' % getattr(self, 'type', '') |
26 | 23 |
|
27 | 24 |
|
28 | | -class NetworkEvent(Resource): |
| 25 | +class Network(Resource): |
29 | 26 |
|
30 | 27 | _dates = ('created_at', ) |
31 | | - _maps = {'actor': User, 'repo': Repo, 'org': Org} |
| 28 | + _maps = {'actor': users.User, 'repo': repos.Repo, 'org': orgs.Org} |
32 | 29 |
|
33 | 30 | def __str__(self): |
34 | | - return '<Event (%s)>' % getattr(self, 'type', '') |
| 31 | + return '<(%s)>' % getattr(self, 'type', '') |
35 | 32 |
|
36 | 33 |
|
37 | | -class OrgEvent(Resource): |
| 34 | +class Org(Resource): |
38 | 35 |
|
39 | 36 | _dates = ('created_at', ) |
40 | | - _maps = {'actor': User, 'repo': Repo, 'org': Org} |
| 37 | + _maps = {'actor': users.User, 'repo': repos.Repo, 'org': orgs.Org} |
41 | 38 |
|
42 | 39 | def __str__(self): |
43 | | - return '<Event (%s)>' % getattr(self, 'type', '') |
| 40 | + return '<(%s)>' % getattr(self, 'type', '') |
44 | 41 |
|
45 | 42 |
|
46 | | -class UserEvent(Resource): |
| 43 | +class User(Resource): |
47 | 44 |
|
48 | 45 | _dates = ('created_at', ) |
49 | | - _maps = {'actor': User, 'repo': Repo, 'org': Org} |
| 46 | + _maps = {'actor': users.User, 'repo': repos.Repo, 'org': orgs.Org} |
50 | 47 |
|
51 | 48 | def __str__(self): |
52 | | - return '<Event (%s)>' % getattr(self, 'type', '') |
| 49 | + return '<(%s)>' % getattr(self, 'type', '') |
0 commit comments