Ignore:
Timestamp:
12/07/11 11:58:44 (12 years ago)
Author:
madie
Message:

[ipk] update crossepg

Location:
ipk/source/epg_crossepg
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • ipk/source/epg_crossepg/usr/lib/enigma2/python/Plugins/SystemPlugins/CrossEPG/crossepg_setup.py

    r7451 r12090  
    44from Screens.MessageBox import MessageBox
    55
    6 from Components.config import KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, ConfigYesNo, ConfigSelection, ConfigClock
     6from Components.config import KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, ConfigYesNo, ConfigSelection, ConfigClock, config, configfile
    77from Components.ConfigList import ConfigList
    88from Components.Button import Button
     
    2121
    2222from time import *
     23
     24import os
    2325
    2426class CrossEPG_Setup(Screen):
     
    5355                self.show_extension = self.config.show_extension
    5456                self.show_plugin = self.config.show_plugin
     57                self.show_force_reload_as_plugin = self.config.show_force_reload_as_plugin
    5558
    5659                # make devices entries
     
    6063
    6164                for partition in harddiskmanager.getMountedPartitions():
    62                         if (partition.mountpoint != '/') and (partition.mountpoint != ''): # and self.isMountedInRW(partition.mountpoint):
     65                        if (partition.mountpoint != '/') and (partition.mountpoint != '') and self.isMountedInRW(partition.mountpoint):
    6366                                self.mountpoint.append(partition.mountpoint + "/crossepg")
    6467
     
    114117                self.makeList()
    115118
     119        def isMountedInRW(self, path):
     120                testfile = path + "/tmp-rw-test"
     121                os.system("touch " + testfile)
     122                if os.path.exists(testfile):
     123                        os.system("rm -f " + testfile)
     124                        return True
     125                return False
     126               
    116127        def showWarning(self): 
    117128                self.session.open(MessageBox, _("PLEASE READ!\nNo disk found. An hard drive or an usb pen is HARDLY SUGGESTED. If you still want use your internal flash pay attention to:\n(1) If you don't have enough free space your box may completely block and you need to flash it again\n(2) Many write operations on your internal flash may damage your flash memory"), type = MessageBox.TYPE_ERROR)
     
    188199                self.list.append((_("Show as plugin"), ConfigYesNo(self.config.show_plugin > 0)))
    189200                self.list.append((_("Show as extension"), ConfigYesNo(self.config.show_extension > 0)))
     201                self.list.append((_("Show 'Force reload' as plugin"), ConfigYesNo(self.config.show_force_reload_as_plugin > 0)))
    190202
    191203                self["config"].setList(self.list)
     
    233245                self.config.show_plugin = int(self.list[i][1].getValue())
    234246                self.config.show_extension = int(self.list[i+1][1].getValue())
     247                self.config.show_force_reload_as_plugin = int(self.list[i+2][1].getValue())
    235248
    236249                if redraw:
     
    247260
    248261                if index == 0:
    249                         self["information"].setText(_("Drive where you save data.\nThe drive MUST be mounted in rw"))
     262                        self["information"].setText(_("Drive where you save data.\nThe drive MUST be mounted in rw. If you can't see your device here probably is mounted as read only or autofs handle it only in read only mode. In case of mount it manually and try again"))
    250263                elif index == 1:
    251264                        self["information"].setText(_("Lamedb used for epg.dat conversion.\nThis option doesn't work with crossepg patch v2"))
     
    279292                self.config.configured = 1
    280293                self.config.save()
     294                try:
     295                        if self.config.db_root[-8:] == "crossepg":
     296                                config.misc.epgcache_filename.setValue(self.config.db_root[:-9] + "/epg.dat")
     297                        else:
     298                                config.misc.epgcache_filename.setValue(self.config.db_root + "/epg.dat")
     299                        config.misc.epgcache_filename.callNotifiersOnSaveAndCancel = True
     300                        config.misc.epgcache_filename.save()
     301                        configfile.save()
     302                except Exception, e:
     303                        print "custom epgcache filename not supported by current enigma2 version"
     304                       
     305                if getEPGPatchType() == -1:
     306                        # exec crossepg_prepare_pre_start for unpatched images
     307                        os.system(self.config.home_directory + "/crossepg_prepare_pre_start.sh")
     308                       
    281309                if self.show_extension != self.config.show_extension or self.show_plugin != self.config.show_plugin:
    282310                        for plugin in plugins.getPlugins(PluginDescriptor.WHERE_PLUGINMENU):
Note: See TracChangeset for help on using the changeset viewer.