2016-03-16 17:26:25 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Author: Volkan Şahin <volkansah.in> <bm.volkansahin@gmail.com>
|
|
|
|
import json
|
|
|
|
|
2016-03-23 17:15:27 +02:00
|
|
|
|
2016-03-16 17:26:25 +02:00
|
|
|
class Plugin(object):
|
|
|
|
"""docstring for Plugin"""
|
2016-03-23 17:15:27 +02:00
|
|
|
|
|
|
|
def __init__(self, message):
|
2016-04-11 19:26:49 +03:00
|
|
|
self.plugin = message['plugin']
|
2016-03-16 17:26:25 +02:00
|
|
|
|
|
|
|
@property
|
|
|
|
def id(self):
|
|
|
|
return self.plugin['id']
|
|
|
|
|
|
|
|
@property
|
|
|
|
def name(self):
|
|
|
|
return self.plugin['name']
|
|
|
|
|
|
|
|
@property
|
|
|
|
def version(self):
|
|
|
|
return self.plugin['version']
|
|
|
|
|
|
|
|
@property
|
|
|
|
def description(self):
|
|
|
|
return self.plugin['description']
|
2016-03-21 12:00:45 +02:00
|
|
|
|
|
|
|
def to_string(self):
|
|
|
|
return str(self.plugin)
|
|
|
|
|
|
|
|
def to_json(self):
|
|
|
|
return json.load(self.plugin)
|