Commit e3681414 authored by ViolanteCodes's avatar ViolanteCodes
Browse files

cleaned up the gitlabdown.py file and added doc_strings

parent f99ddec5
import requests """Dummy GitLab Objects to use if the GitLab call times out."""
import urllib
import socket
import gitlab
# import urllib3
# from urllib3.exceptions import ConnectionError, TimeoutError
from requests.exceptions import ConnectTimeout
class GitlabDownObject: class GitlabDownObject:
"""A mocked version of the Gitlab Object for when Gitlab is down.""" """A mocked version of the Gitlab Object for when Gitlab is down."""
...@@ -17,22 +10,22 @@ class GitlabDownProject: ...@@ -17,22 +10,22 @@ class GitlabDownProject:
def __init__(self): def __init__(self):
self.name = 'Gitlab Timed Out' self.name = 'Gitlab Timed Out'
self.attributes = { self.attributes = {
'created_at': '2020-12-01T17:19:24.061Z', 'created_at': '',
'description': 'A mock project that displays when GitLab calls time out.', 'description': 'A mock project that displays when GitLab calls time out.',
'id': 'NA', 'id': 'NA',
'last_activity_at': '2020-12-15T21:45:42.934Z', 'last_activity_at': '',
'name': 'GitLab Timed Out', 'name': 'GitLab Timed Out',
'name_with_namespace': 'The Tor Project / Anon-Ticket', 'name_with_namespace': '',
'namespace': { 'avatar_url': None, 'namespace': { 'avatar_url': None,
'full_path': 'tpo/tpa', 'full_path': 'tpo/tpa',
'id': 480, 'id': NA,
'kind': 'group', 'kind': 'group',
'name': 'TPA', 'name': 'TPA',
'parent_id': 268, 'parent_id': NA,
'path': 'tpa', 'path': 'tpa',
'web_url': 'https://gitlab.torproject.org/groups/tpo/tpa'}, 'web_url': 'https://gitlab.torproject.org/groups/tpo/tpa'},
'tag_list': [], 'tag_list': [],
'web_url': 'https://gitlab.torproject.org/tpo/tpa/anon-ticket', 'web_url': '',
} }
self.issues = GitlabDownIssue() self.issues = GitlabDownIssue()
...@@ -143,3 +136,6 @@ class GitlabDownNote: ...@@ -143,3 +136,6 @@ class GitlabDownNote:
notes_list = [] notes_list = []
notes_list.append(self) notes_list.append(self)
return notes_list return notes_list
def __str__(self):
return self.name
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment