Skip to content
Snippets Groups Projects
Commit dd2d020f authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Fix pylint too-many-instance-attributes

parent 4e9c7290
No related branches found
No related tags found
No related merge requests found
...@@ -8,3 +8,5 @@ disable = ["invalid-name", "import-error", "logging-fstring-interpolation", "unu ...@@ -8,3 +8,5 @@ disable = ["invalid-name", "import-error", "logging-fstring-interpolation", "unu
max-line-length = 79 max-line-length = 79
[tool.pylint.TYPECHECK] [tool.pylint.TYPECHECK]
generated-members = "sh" generated-members = "sh"
[tool.pylint.DESIGN]
max-attributes = 12
...@@ -11,11 +11,6 @@ class RCRMQ: ...@@ -11,11 +11,6 @@ class RCRMQ:
Main RC rabbitmq class that handles connection Main RC rabbitmq class that handles connection
""" """
USER = "guest"
PASSWORD = "guest"
HOST = "localhost"
PORT = 5672
VHOST = "/"
EXCHANGE = "" EXCHANGE = ""
EXCHANGE_TYPE = "direct" EXCHANGE_TYPE = "direct"
DEBUG = False DEBUG = False
...@@ -29,11 +24,11 @@ class RCRMQ: ...@@ -29,11 +24,11 @@ class RCRMQ:
hostname = socket.gethostname().split(".", 1)[0] hostname = socket.gethostname().split(".", 1)[0]
self.HOST = rcfg.Server if hostname != rcfg.Server else "localhost" host = rcfg.Server if hostname != rcfg.Server else "localhost"
self.USER = rcfg.User user = rcfg.User
self.PASSWORD = rcfg.Password password = rcfg.Password
self.VHOST = rcfg.VHost vhost = rcfg.VHost
self.PORT = rcfg.Port port = rcfg.Port
self.DEBUG = debug self.DEBUG = debug
if self.DEBUG: if self.DEBUG:
...@@ -42,10 +37,10 @@ class RCRMQ: ...@@ -42,10 +37,10 @@ class RCRMQ:
Created RabbitMQ instance with: Created RabbitMQ instance with:
Exchange name: {self.EXCHANGE}, Exchange name: {self.EXCHANGE},
Exchange type: {self.EXCHANGE_TYPE}, Exchange type: {self.EXCHANGE_TYPE},
Host: {self.HOST}, Host: {host},
User: {self.USER}, User: {user},
VHost: {self.VHOST}, VHost: {vhost},
Port: {self.PORT} Port: {port}
""" """
) )
...@@ -54,10 +49,10 @@ class RCRMQ: ...@@ -54,10 +49,10 @@ class RCRMQ:
self._consuming = False self._consuming = False
self._channel = None self._channel = None
self._parameters = pika.ConnectionParameters( self._parameters = pika.ConnectionParameters(
self.HOST, host,
self.PORT, port,
self.VHOST, vhost,
pika.PlainCredentials(self.USER, self.PASSWORD), pika.PlainCredentials(user, password),
) )
def connect(self): def connect(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment