Skip to content

Commit

Permalink
PEP8 double aggressive E301 ~ E306
Browse files Browse the repository at this point in the history
  • Loading branch information
persianpros committed Apr 14, 2021
1 parent 5dc89a0 commit a619491
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@
PluginLanguageDomain = "ShootYourScreen"
PluginLanguagePath = "Extensions/ShootYourScreen/locale"


def localeInit():
lang = language.getLanguage()[:2]
os.environ["LANGUAGE"] = lang
print "[ShootYourScreen] set language to ", lang
gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath))


def _(txt):
t = gettext.dgettext(PluginLanguageDomain, txt)
if t == txt:
print "[ShootYourScreen] fallback to default Enigma2 Translation for", txt
t = gettext.gettext(txt)
return t


localeInit()
language.addCallback(localeInit)
6 changes: 6 additions & 0 deletions plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
config.plugins.shootyourscreen.picturesize = ConfigSelection(default="default", choices=[("default", _("Skin resolution")), ("-r 480", "480"), ("-r 576", "576"), ("-r 720", "720"), ("-r 1280", "1280"), ("-r 1920", "1920")])
config.plugins.shootyourscreen.timeout = ConfigSelection(default="3", choices=[("1", "1 sec"), ("3", "3 sec"), ("5", "5 sec"), ("10", "10 sec"), ("off", _("no message")), ("0", _("no timeout"))])


def getPicturePath():
picturepath = config.plugins.shootyourscreen.path.value
if picturepath.endswith('/'):
Expand All @@ -55,6 +56,7 @@ def getPicturePath():
self.session.open(MessageBox, _("Sorry, your device for screenshots is not writeable.\n\nPlease choose another one."), MessageBox.TYPE_INFO, timeout=10)
return picturepath


class getScreenshot:
def __init__(self):
self.ScreenshotConsole = Console()
Expand Down Expand Up @@ -153,6 +155,7 @@ def getFilename(self):
screenshotfile = picturepath + '/' + screenshottime + fileextension
return screenshotfile


class ShootYourScreenConfig(Screen, ConfigListScreen):
skin = """
<screen position="center,center" size="650,400" title="ShootYourScreen for VU+" >
Expand Down Expand Up @@ -251,15 +254,18 @@ def keyYellowConfirm(self, confirmed):
config.plugins.shootyourscreen.timeout.setValue("3")
self.save()


def autostart(reason, **kwargs):
if kwargs.has_key("session") and reason == 0:
print "[ShootYourScreen] start...."
getScreenshot()


def startSetup(session, **kwargs):
print "[ShootYourScreen] start configuration"
session.open(ShootYourScreenConfig)


def Plugins(**kwargs):
return [PluginDescriptor(where=PluginDescriptor.WHERE_SESSIONSTART, fnc=autostart),
PluginDescriptor(name="ShootYourScreen Setup", description=_("make Screenshots with your VU+"), where=[PluginDescriptor.WHERE_PLUGINMENU, PluginDescriptor.WHERE_EXTENSIONSMENU], icon="shootyourscreen.png", fnc=startSetup)]
5 changes: 5 additions & 0 deletions setup_translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import glob
import os


class build_trans(cmd.Command):
description = 'Compile .po files into .mo files'

def initialize_options(self):
pass

Expand All @@ -33,11 +35,14 @@ def run(self):
else:
print "we got no domain -> no translation was compiled"


class build(_build):
sub_commands = _build.sub_commands + [('build_trans', None)]

def run(self):
_build.run(self)


cmdclass = {
'build': build,
'build_trans': build_trans,
Expand Down

0 comments on commit a619491

Please sign in to comment.