/usr/share/gEcrit/yapsy/PluginInfo.py is in gecrit 2.8.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | #!/usr/bin/python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*-
"""
Role
====
Encapsulate a plugin instance as well as some metadata.
API
===
"""
class PluginInfo(object):
"""
Representation of the most basic set of information related to a
given plugin such as its name, author, description...
"""
def __init__(self, plugin_name, plugin_path):
"""
Set the name and path of the plugin as well as the default
values for other usefull variables.
.. warning:: The ``path`` attribute is the full path to the
plugin if it is organised as a directory or the full path
to a file without the ``.py`` extension if the plugin is
defined by a simple file. In the later case, the actual
plugin is reached via ``plugin_info.path+'.py'``.
"""
self.name = plugin_name
self.path = plugin_path
self.author = "Unknown"
self.version = "?.?"
self.website = "None"
self.copyright = "Unknown"
self.description = ""
self.plugin_object = None
self.category = None
def _getIsActivated(self):
"""
Return the activated state of the plugin object.
Makes it possible to define a property.
"""
return self.plugin_object.is_activated
is_activated = property(fget=_getIsActivated)
def setVersion(self, vstring):
"""
Set the version of the plugin.
Used by subclasses to provide different handling of the
version number.
"""
self.version = vstring
|