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
|
import logging
import uuid
from far2l.plugin import PluginBase
log = logging.getLogger(__name__)
class Plugin(PluginBase):
label = "Python uuuidgen"
openFrom = ["PLUGINSMENU", "EDITOR"]
@staticmethod
def HandleCommandLine(line):
return line in ("uuidgen",)
def CommandLine(self, line):
if line != "uuidgen":
return
self.uuidgen()
def uuidgen(self):
s = '{%s}'%uuid.uuid4()
log.debug('uuidgen: {}'.format(s))
self.info.FSF.CopyToClipboard(self.s2f(s))
def OpenPlugin(self, OpenFrom):
self.uuidgen()
return -1
|