Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from struct import pack
- from enigma import *
- from Screens.Screen import Screen
- from Screens.MessageBox import MessageBox
- from Screens.InputBox import InputBox
- from Screens.ChoiceBox import ChoiceBox
- from Components.ActionMap import ActionMap, NumberActionMap
- from Components.ScrollLabel import ScrollLabel
- from Components.Label import Label, MultiColorLabel
- from Components.GUIComponent import *
- from Components.MenuList import MenuList
- from Components.Input import Input
- from Components.Pixmap import Pixmap
- from Components.ConfigList import ConfigList
- from Screens.Console import Console
- from Plugins.Plugin import PluginDescriptor
- from Screens.ServiceInfo import *
- from Plugins.Plugin import PluginDescriptor
- from Tools import Notifications
- from Components.config import *
- from Tools.Directories import fileExists
- ######################################################################################################
- plugin_path = '/usr/lib/enigma2/python/Plugins/Extensions/FreeServer/fonts'
- skin_path = '/usr/lib/enigma2/python/Plugins/Extensions/FreeServer/Skin/'
- p_path = '/usr/lib/enigma2/python/Plugins/Extensions/FreeServer'
- from enigma import addFont
- try:
- #addFont('%s/Raleway-Black.ttf' % plugin_path, 'Rale', 100, 1)
- addFont('%s/bpmono.ttf' % plugin_path, 'Play', 100, 1)
- #addFont('%s/slyk-medium.ttf' % plugin_path, 'slyk', 100, 1)
- except Exception as ex:
- print ex
- #########################################################################################################
- global info_lines
- info_lines=15
- global info_bottomline
- info_bottomline=0
- global info_topline
- info_topline=0
- global infofile
- #########################################################################################################
- class Showinfo(Screen):
- skin = """
- <screen position="center,center" size="956,400">
- <widget name="Showinfo" position="0,0" size="620,500" font="bpmo;22" valign="left" halign="left">
- <widget name="myText" position="70,956" size="256,40" font="bpmo;28" foregroundColor="#FEFDF8" transparent="1" zPosition="2" />
- <widget name="icon" render="Pixmap" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/FreeServer/Cimages/images.jpg" zPosition="5" position="150,200" size="320,157" alphatest="blend" borderWidth="2" borderColor="white" backgroundColor="black" />
- </widget>
- </screen>"""
- def __init__(self, session):
- Screen.__init__(self, session)
- self.skin = Showinfo.skin
- self.text=""
- self.text="VPN Gate This list of servers is permanently updated"
- self["myText"] = Label()
- self['icon'] = Pixmap()
- global infofile
- global info_topline
- info_topline=0
- global info_bottomline
- infofile = "/tmp/freeservre79"
- f = open(infofile,"r")
- info_bottomline=1
- line=f.readline()
- print line
- while (line):
- if len(line) > 1:
- info_bottomline=info_bottomline+1
- line=f.readline()
- print line
- f.close()
- if info_bottomline < info_lines:
- info_topline=0
- info_bottomline=info_lines
- self["Showinfo"] = MultiColorLabel("\n")
- self.ShowinfoPage()
- self.pagebackward
- self["setupActions"] = ActionMap([ "ColorActions", "SetupActions", "InfobarMovieListActions" ],
- {
- "red": self.cancel,
- "cancel": self.cancel,
- "ok": self.cancel,
- "left": self.pagebackward,
- "right": self.pageforward,
- "up": self.backward,
- "down": self.forward,
- })
- def setWindowTitle(self):
- self.setTitle(_("Display info logfile %s") % infofile)
- def ShowinfoPage(self):
- global info_topline
- global info_bottomline
- global info_lines
- global infofile
- f = open(infofile,"r")
- infotext = ""
- i=0
- while i<(info_topline+info_lines):
- if i>(info_topline-1):
- text=f.readline()
- if len(text) > 1:
- infotext = infotext+text
- else:
- text=f.readline()
- i=i+1
- f.close
- self["Showinfo"].setText(infotext)
- def cancel(self):
- self.close(False)
- def backward(self):
- global info_topline
- global info_lines
- info_topline=info_topline-1
- if info_topline<0:
- info_topline=0
- self.ShowinfoPage()
- def forward(self):
- global info_topline
- info_topline=info_topline+1
- if info_topline>info_bottomline-info_lines:
- info_topline=info_bottomline-info_lines
- self.ShowinfoPage()
- def pagebackward(self):
- global info_topline
- global info_lines
- info_topline=info_topline-info_lines
- if info_topline<0:
- info_topline=0
- self.ShowinfoPage()
- def pageforward(self):
- global info_topline
- global info_bottomline
- global info_lines
- info_topline=info_topline+info_lines
- if info_topline>info_bottomline-info_lines:
- info_topline=info_bottomline-info_lines
- self.ShowinfoPage()
- class Showinfo1(Screen):
- skin = """
- <screen position="center,center" size="756,600"" alphatest="blend" borderWidth="2" borderColor="white" backgroundColor="black" />
- <widget name="Showinfo" position="0,0" size="756,600" font="Play;22" flags="wfNoBorder" backgroundColor="#00000000" valign="left" halign="left">
- </widget>
- </screen>"""
- def __init__(self, session):
- Screen.__init__(self, session)
- self.skin = Showinfo.skin
- global infofile
- global info_topline
- info_topline=0
- global info_bottomline
- infofile = "/tmp/ncam.log"
- f = open(infofile,"r")
- info_bottomline=1
- line=f.readline()
- print line
- while (line):
- if len(line) > 1:
- info_bottomline=info_bottomline+1
- line=f.readline()
- print line
- f.close()
- if info_bottomline < info_lines:
- info_topline=0
- info_bottomline=info_lines
- self["Showinfo"] = MultiColorLabel("\n")
- self.ShowinfoPage()
- self.pagebackward
- self["setupActions"] = ActionMap([ "ColorActions", "SetupActions", "InfobarMovieListActions" ],
- {
- "red": self.cancel,
- "cancel": self.cancel,
- "ok": self.cancel,
- "left": self.pagebackward,
- "right": self.pageforward,
- "up": self.backward,
- "down": self.forward,
- })
- def setWindowTitle(self):
- self.setTitle(_("Display info logfile %s") % infofile)
- def ShowinfoPage(self):
- global info_topline
- global info_bottomline
- global info_lines
- global infofile
- f = open(infofile,"r")
- infotext = ""
- i=0
- while i<(info_topline+info_lines):
- if i>(info_topline-1):
- text=f.readline()
- if len(text) > 1:
- infotext = infotext+text
- else:
- text=f.readline()
- i=i+1
- f.close
- self["Showinfo"].setText(infotext)
- def cancel(self):
- self.close(False)
- def backward(self):
- global info_topline
- global info_lines
- info_topline=info_topline-1
- if info_topline<0:
- info_topline=0
- self.ShowinfoPage()
- def forward(self):
- global info_topline
- info_topline=info_topline+1
- if info_topline>info_bottomline-info_lines:
- info_topline=info_bottomline-info_lines
- self.ShowinfoPage()
- def pagebackward(self):
- global info_topline
- global info_lines
- info_topline=info_topline-info_lines
- if info_topline<0:
- info_topline=0
- self.ShowinfoPage()
- def pageforward(self):
- global info_topline
- global info_bottomline
- global info_lines
- info_topline=info_topline+info_lines
- if info_topline>info_bottomline-info_lines:
- info_topline=info_bottomline-info_lines
- self.ShowinfoPage()
- class Showinfo2(Screen):
- skin = """
- <screen position="center,center" size="756,600"" alphatest="blend" borderWidth="2" borderColor="white" backgroundColor="black" />
- <widget name="Showinfo" position="0,0" size="756,600" font="Play;22" flags="wfNoBorder" backgroundColor="#00000000" valign="left" halign="left">
- </widget>
- </screen>"""
- def __init__(self, session):
- Screen.__init__(self, session)
- self.skin = Showinfo.skin
- global infofile
- global info_topline
- info_topline=0
- global info_bottomline
- infofile = "/tmp/freeservre80"
- f = open(infofile,"r")
- info_bottomline=1
- line=f.readline()
- print line
- while (line):
- if len(line) > 1:
- info_bottomline=info_bottomline+1
- line=f.readline()
- print line
- f.close()
- if info_bottomline < info_lines:
- info_topline=0
- info_bottomline=info_lines
- self["Showinfo"] = MultiColorLabel("\n")
- self.ShowinfoPage()
- self.pagebackward
- self["setupActions"] = ActionMap([ "ColorActions", "SetupActions", "InfobarMovieListActions" ],
- {
- "red": self.cancel,
- "cancel": self.cancel,
- "ok": self.cancel,
- "left": self.pagebackward,
- "right": self.pageforward,
- "up": self.backward,
- "down": self.forward,
- })
- def setWindowTitle(self):
- self.setTitle(_("Display info logfile %s") % infofile)
- def ShowinfoPage(self):
- global info_topline
- global info_bottomline
- global info_lines
- global infofile
- f = open(infofile,"r")
- infotext = ""
- i=0
- while i<(info_topline+info_lines):
- if i>(info_topline-1):
- text=f.readline()
- if len(text) > 1:
- infotext = infotext+text
- else:
- text=f.readline()
- i=i+1
- f.close
- self["Showinfo"].setText(infotext)
- def cancel(self):
- self.close(False)
- def backward(self):
- global info_topline
- global info_lines
- info_topline=info_topline-1
- if info_topline<0:
- info_topline=0
- self.ShowinfoPage()
- def forward(self):
- global info_topline
- info_topline=info_topline+1
- if info_topline>info_bottomline-info_lines:
- info_topline=info_bottomline-info_lines
- self.ShowinfoPage()
- def pagebackward(self):
- global info_topline
- global info_lines
- info_topline=info_topline-info_lines
- if info_topline<0:
- info_topline=0
- self.ShowinfoPage()
- def pageforward(self):
- global info_topline
- global info_bottomline
- global info_lines
- info_topline=info_topline+info_lines
- if info_topline>info_bottomline-info_lines:
- info_topline=info_bottomline-info_lines
- self.ShowinfoPage()
- class Showinfo3(Screen):
- skin = """
- <screen position="center,center" size="756,600"" alphatest="blend" borderWidth="2" borderColor="white" backgroundColor="black" />
- <widget name="Showinfo" position="0,0" size="756,600" font="Play;22" flags="wfNoBorder" backgroundColor="#00000000" valign="left" halign="left">
- </widget>
- </screen>"""
- def __init__(self, session):
- Screen.__init__(self, session)
- self.skin = Showinfo3.skin
- global infofile
- global info_topline
- info_topline=0
- global info_bottomline
- infofile = "/tmp/freeservre78"
- f = open(infofile,"r")
- info_bottomline=1
- line=f.readline()
- print line
- while (line):
- if len(line) > 1:
- info_bottomline=info_bottomline+1
- line=f.readline()
- print line
- f.close()
- if info_bottomline < info_lines:
- info_topline=0
- info_bottomline=info_lines
- self["Showinfo"] = MultiColorLabel("\n")
- self.ShowinfoPage()
- self.pagebackward
- self["setupActions"] = ActionMap([ "ColorActions", "SetupActions", "InfobarMovieListActions" ],
- {
- "red": self.cancel,
- "cancel": self.cancel,
- "ok": self.cancel,
- "left": self.pagebackward,
- "right": self.pageforward,
- "up": self.backward,
- "down": self.forward,
- })
- def setWindowTitle(self):
- self.setTitle(_("Display info logfile %s") % infofile)
- def ShowinfoPage(self):
- global info_topline
- global info_bottomline
- global info_lines
- global infofile
- f = open(infofile,"r")
- infotext = ""
- i=0
- while i<(info_topline+info_lines):
- if i>(info_topline-1):
- text=f.readline()
- if len(text) > 1:
- infotext = infotext+text
- else:
- text=f.readline()
- i=i+1
- f.close
- self["Showinfo"].setText(infotext)
- def cancel(self):
- self.close(False)
- def backward(self):
- global info_topline
- global info_lines
- info_topline=info_topline-1
- if info_topline<0:
- info_topline=0
- self.ShowinfoPage()
- def forward(self):
- global info_topline
- info_topline=info_topline+1
- if info_topline>info_bottomline-info_lines:
- info_topline=info_bottomline-info_lines
- self.ShowinfoPage()
- def pagebackward(self):
- global info_topline
- global info_lines
- info_topline=info_topline-info_lines
- if info_topline<0:
- info_topline=0
- self.ShowinfoPage()
- def pageforward(self):
- global info_topline
- global info_bottomline
- global info_lines
- info_topline=info_topline+info_lines
- if info_topline>info_bottomline-info_lines:
- info_topline=info_bottomline-info_lines
- self.ShowinfoPage()
- class Showinfo4(Screen):
- skin = """
- <screen position="center,center" size="756,600"" alphatest="blend" borderWidth="2" borderColor="white" backgroundColor="black" />
- <widget name="Showinfo" position="0,0" size="756,600" font="Play;22" flags="wfNoBorder" backgroundColor="#00000000" valign="left" halign="left">
- </widget>
- </screen>"""
- def __init__(self, session):
- Screen.__init__(self, session)
- self.skin = Showinfo.skin
- global infofile
- global info_topline
- info_topline=0
- global info_bottomline
- infofile = "/tmp/oscam.log"
- f = open(infofile,"r")
- info_bottomline=1
- line=f.readline()
- print line
- while (line):
- if len(line) > 1:
- info_bottomline=info_bottomline+1
- line=f.readline()
- print line
- f.close()
- if info_bottomline < info_lines:
- info_topline=0
- info_bottomline=info_lines
- self["Showinfo"] = MultiColorLabel("\n")
- self.ShowinfoPage()
- self.pagebackward
- self["setupActions"] = ActionMap([ "ColorActions", "SetupActions", "InfobarMovieListActions" ],
- {
- "red": self.cancel,
- "cancel": self.cancel,
- "ok": self.cancel,
- "left": self.pagebackward,
- "right": self.pageforward,
- "up": self.backward,
- "down": self.forward,
- })
- def setWindowTitle(self):
- self.setTitle(_("Display info logfile %s") % infofile)
- def ShowinfoPage(self):
- global info_topline
- global info_bottomline
- global info_lines
- global infofile
- f = open(infofile,"r")
- infotext = ""
- i=0
- while i<(info_topline+info_lines):
- if i>(info_topline-1):
- text=f.readline()
- if len(text) > 1:
- infotext = infotext+text
- else:
- text=f.readline()
- i=i+1
- f.close
- self["Showinfo"].setText(infotext)
- def cancel(self):
- self.close(False)
- def backward(self):
- global info_topline
- global info_lines
- info_topline=info_topline-1
- if info_topline<0:
- info_topline=0
- self.ShowinfoPage()
- def forward(self):
- global info_topline
- info_topline=info_topline+1
- if info_topline>info_bottomline-info_lines:
- info_topline=info_bottomline-info_lines
- self.ShowinfoPage()
- def pagebackward(self):
- global info_topline
- global info_lines
- info_topline=info_topline-info_lines
- if info_topline<0:
- info_topline=0
- self.ShowinfoPage()
- def pageforward(self):
- global info_topline
- global info_bottomline
- global info_lines
- info_topline=info_topline+info_lines
- if info_topline>info_bottomline-info_lines:
- info_topline=info_bottomline-info_lines
- self.ShowinfoPage()
- class Showinfo5(Screen):
- skin = """
- <screen position="center,center" size="756,600"" alphatest="blend" borderWidth="2" borderColor="white" backgroundColor="black" />
- <widget name="Showinfo" position="0,0" size="756,600" font="Play;22" flags="wfNoBorder" backgroundColor="#00000000" valign="left" halign="left">
- </widget>
- </screen>"""
- def __init__(self, session):
- Screen.__init__(self, session)
- self.skin = Showinfo.skin
- global infofile
- global info_topline
- info_topline=0
- global info_bottomline
- infofile = "/tmp/freeservre88"
- f = open(infofile,"r")
- info_bottomline=1
- line=f.readline()
- print line
- while (line):
- if len(line) > 1:
- info_bottomline=info_bottomline+1
- line=f.readline()
- print line
- f.close()
- if info_bottomline < info_lines:
- info_topline=0
- info_bottomline=info_lines
- self["Showinfo"] = MultiColorLabel("\n")
- self.ShowinfoPage()
- self.pagebackward
- self["setupActions"] = ActionMap([ "ColorActions", "SetupActions", "InfobarMovieListActions" ],
- {
- "red": self.cancel,
- "cancel": self.cancel,
- "ok": self.cancel,
- "left": self.pagebackward,
- "right": self.pageforward,
- "up": self.backward,
- "down": self.forward,
- })
- def setWindowTitle(self):
- self.setTitle(_("Display info logfile %s") % infofile)
- def ShowinfoPage(self):
- global info_topline
- global info_bottomline
- global info_lines
- global infofile
- f = open(infofile,"r")
- infotext = ""
- i=0
- while i<(info_topline+info_lines):
- if i>(info_topline-1):
- text=f.readline()
- if len(text) > 1:
- infotext = infotext+text
- else:
- text=f.readline()
- i=i+1
- f.close
- self["Showinfo"].setText(infotext)
- def cancel(self):
- self.close(False)
- def backward(self):
- global info_topline
- global info_lines
- info_topline=info_topline-1
- if info_topline<0:
- info_topline=0
- self.ShowinfoPage()
- def forward(self):
- global info_topline
- info_topline=info_topline+1
- if info_topline>info_bottomline-info_lines:
- info_topline=info_bottomline-info_lines
- self.ShowinfoPage()
- def pagebackward(self):
- global info_topline
- global info_lines
- info_topline=info_topline-info_lines
- if info_topline<0:
- info_topline=0
- self.ShowinfoPage()
- def pageforward(self):
- global info_topline
- global info_bottomline
- global info_lines
- info_topline=info_topline+info_lines
- if info_topline>info_bottomline-info_lines:
- info_topline=info_bottomline-info_lines
- self.ShowinfoPage()
- def setMyText(self):
- self["myText"].setText(self.text)
Advertisement
Add Comment
Please, Sign In to add comment