From: acid-burn Date: Wed, 31 Mar 2010 08:43:00 +0000 (+0200) Subject: Merge commit 'origin/bug_448_fix_wlanscan' X-Git-Tag: 2.8.0~20 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/dcaeeda79416cf9a2f41da09bcfca84de127605d?hp=e87c31487053cf0273a1bc82867c58bce99ed5f3 Merge commit 'origin/bug_448_fix_wlanscan' --- diff --git a/Navigation.py b/Navigation.py index 2437bbf5..a905da19 100644 --- a/Navigation.py +++ b/Navigation.py @@ -53,7 +53,7 @@ class Navigation: def playService(self, ref, checkParentalControl = True, forceRestart = False): oldref = self.currentlyPlayingServiceReference if ref and oldref and ref == oldref and not forceRestart: - print "ignore request to play already running service" + print "ignore request to play already running service(1)" return 0 print "playing", ref and ref.toString() if ref is None: @@ -64,6 +64,10 @@ class Navigation: if not oldref: oldref = eServiceReference() playref = getBestPlayableServiceReference(ref, oldref) + print "playref", playref + if playref and oldref and playref == oldref and not forceRestart: + print "ignore request to play already running service(2)" + return 0 if not playref or (checkParentalControl and not parentalControl.isServicePlayable(playref, boundFunction(self.playService, checkParentalControl = False))): self.stopService() return 0 diff --git a/configure.ac b/configure.ac index aa2fa3e3..d1b1d279 100755 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,8 @@ data/fonts/Makefile data/countries/Makefile data/defaults/Makefile data/defaults/Dream/Makefile +data/defaults/Dream/hdbouquets/Makefile +data/defaults/Dream/sdbouquets/Makefile data/extensions/Makefile data/skin_default/Makefile data/skin_default/menu/Makefile diff --git a/data/defaults/Dream/Makefile.am b/data/defaults/Dream/Makefile.am index 113442c0..31ba1c69 100644 --- a/data/defaults/Dream/Makefile.am +++ b/data/defaults/Dream/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = hdbouquets sdbouquets + installdir = $(pkgdatadir)/defaults/Dream dist_install_DATA = \ @@ -9,5 +11,4 @@ dist_install_DATA = \ settings.500hd \ settings.7025 \ settings.800 \ - settings.8000 \ - userbouquet.favourites.tv + settings.8000 diff --git a/data/defaults/Dream/dm500hd.info b/data/defaults/Dream/dm500hd.info index fbf7888e..b1b4d53d 100644 --- a/data/defaults/Dream/dm500hd.info +++ b/data/defaults/Dream/dm500hd.info @@ -20,7 +20,7 @@ - + diff --git a/data/defaults/Dream/dm7025.info b/data/defaults/Dream/dm7025.info index 0461b686..a1585cfe 100644 --- a/data/defaults/Dream/dm7025.info +++ b/data/defaults/Dream/dm7025.info @@ -20,7 +20,7 @@ - + diff --git a/data/defaults/Dream/dm800.info b/data/defaults/Dream/dm800.info index 8c68349f..4793bd85 100644 --- a/data/defaults/Dream/dm800.info +++ b/data/defaults/Dream/dm800.info @@ -20,7 +20,7 @@ - + diff --git a/data/defaults/Dream/dm8000.info b/data/defaults/Dream/dm8000.info index 8b11946f..2ef2013a 100644 --- a/data/defaults/Dream/dm8000.info +++ b/data/defaults/Dream/dm8000.info @@ -20,7 +20,7 @@ - + diff --git a/data/defaults/Dream/hdbouquets/Makefile.am b/data/defaults/Dream/hdbouquets/Makefile.am new file mode 100644 index 00000000..843a07d6 --- /dev/null +++ b/data/defaults/Dream/hdbouquets/Makefile.am @@ -0,0 +1,4 @@ +installdir = $(pkgdatadir)/defaults/Dream/hdbouquets + +dist_install_DATA = \ + userbouquet.favourites.tv diff --git a/data/defaults/Dream/hdbouquets/userbouquet.favourites.tv b/data/defaults/Dream/hdbouquets/userbouquet.favourites.tv new file mode 100644 index 00000000..91536b10 --- /dev/null +++ b/data/defaults/Dream/hdbouquets/userbouquet.favourites.tv @@ -0,0 +1,129 @@ +#NAME Favourites (TV) +#SERVICE 1:0:19:2B5C:3F3:1:C00000:0:0:0: +#SERVICE 1:0:19:2B66:3F3:1:C00000:0:0:0: +#SERVICE 1:0:1:6DCC:44D:1:C00000:0:0:0: +#SERVICE 1:0:1:2EE3:441:1:C00000:0:0:0: +#SERVICE 1:0:1:445C:453:1:C00000:0:0:0: +#SERVICE 1:0:1:2EF4:441:1:C00000:0:0:0: +#SERVICE 1:0:1:445D:453:1:C00000:0:0:0: +#SERVICE 1:0:1:445E:453:1:C00000:0:0:0: +#SERVICE 1:0:1:33:21:85:C00000:0:0:0: +#SERVICE 1:0:1:701:5:85:C00000:0:0:0: +#SERVICE 1:0:1:2F1C:441:1:C00000:0:0:0: +#SERVICE 1:0:1:6D6E:437:1:C00000:0:0:0: +#SERVICE 1:0:1:2FC:5:85:C00000:0:0:0: +#SERVICE 1:0:1:F98:454:1:C00000:0:0:0: +#SERVICE 1:0:19:2B70:3F3:1:C00000:0:0:0: +#SERVICE 1:0:1:6D67:437:1:C00000:0:0:0: +#SERVICE 1:0:1:7031:41B:1:C00000:0:0:0: +#SERVICE 1:0:1:7032:41B:1:C00000:0:0:0: +#SERVICE 1:0:1:7033:41B:1:C00000:0:0:0: +#SERVICE 1:0:1:6E46:431:1:C00000:0:0:0: +#SERVICE 1:0:1:6DCE:44D:1:C00000:0:0:0: +#SERVICE 1:0:1:6DD1:44D:1:C00000:0:0:0: +#SERVICE 1:0:1:6DCF:44D:1:C00000:0:0:0: +#SERVICE 1:0:1:6E42:431:1:C00000:0:0:0: +#SERVICE 1:64:B:0:0:0:0:0:0:0::Doku/Wissen/Themen +#DESCRIPTION Doku/Wissen/Themen +#SERVICE 1:0:1:6DD0:44D:1:C00000:0:0:0: +#SERVICE 1:0:1:6D6B:437:1:C00000:0:0:0: +#SERVICE 1:0:1:2775:444:1:C00000:0:0:0: +#SERVICE 1:0:1:293:5:85:C00000:0:0:0: +#SERVICE 1:0:1:6D70:437:1:C00000:0:0:0: +#SERVICE 1:0:1:277B:444:1:C00000:0:0:0: +#SERVICE 1:0:1:332D:45B:1:C00000:0:0:0: +#SERVICE 1:0:1:3139:459:1:C00000:0:0:0: +#SERVICE 1:0:1:2F5A:454:1:C00000:0:0:0: +#SERVICE 1:64:A:0:0:0:0:0:0:0::Sport +#DESCRIPTION Sport +#SERVICE 1:0:1:384:21:85:C00000:0:0:0: +#SERVICE 1:0:1:79E0:443:1:C00000:0:0:0: +#SERVICE 1:64:1:0:0:0:0:0:0:0::Kinder +#DESCRIPTION Kinder +#SERVICE 1:0:1:2F08:441:1:C00000:0:0:0: +#SERVICE 1:0:1:6D68:437:1:C00000:0:0:0: +#SERVICE 1:0:1:7008:436:1:C00000:0:0:0: +#SERVICE 1:0:1:6FE0:443:1:C00000:0:0:0: +#SERVICE 1:64:2:0:0:0:0:0:0:0::Nachrichten +#DESCRIPTION Nachrichten +#SERVICE 1:0:1:2F3A:441:1:C00000:0:0:0: +#SERVICE 1:0:1:445F:453:1:C00000:0:0:0: +#SERVICE 1:0:1:79F4:443:1:C00000:0:0:0: +#SERVICE 1:0:1:2753:402:1:C00000:0:0:0: +#SERVICE 1:0:1:7035:41B:1:C00000:0:0:0: +#SERVICE 1:64:3:0:0:0:0:0:0:0::Regional +#DESCRIPTION Regional +#SERVICE 1:0:1:3146:459:1:C00000:0:0:0: +#SERVICE 1:0:1:300:7:85:C00000:0:0:0: +#SERVICE 1:0:1:2778:444:1:C00000:0:0:0: +#SERVICE 1:0:1:277A:444:1:C00000:0:0:0: +#SERVICE 1:0:1:2779:444:1:C00000:0:0:0: +#SERVICE 1:0:1:2777:444:1:C00000:0:0:0: +#SERVICE 1:0:1:32D6:45D:1:C00000:0:0:0: +#SERVICE 1:0:1:277D:444:1:C00000:0:0:0: +#SERVICE 1:64:4:0:0:0:0:0:0:0::Musik +#DESCRIPTION Musik +#SERVICE 1:0:1:2774:444:1:C00000:0:0:0: +#SERVICE 1:0:1:7004:436:1:C00000:0:0:0: +#SERVICE 1:0:1:7001:436:1:C00000:0:0:0: +#SERVICE 1:0:1:6FE1:443:1:C00000:0:0:0: +#SERVICE 1:0:1:2FD:7:85:C00000:0:0:0: +#SERVICE 1:0:1:32D5:45D:1:C00000:0:0:0: +#SERVICE 1:0:1:332E:45B:1:C00000:0:0:0: +#SERVICE 1:0:1:304:5:85:C00000:0:0:0: +#SERVICE 1:0:1:702:5:85:C00000:0:0:0: +#SERVICE 1:64:5:0:0:0:0:0:0:0::Reisen +#DESCRIPTION Reisen +#SERVICE 1:0:1:20:21:85:C00000:0:0:0: +#SERVICE 1:64:9:0:0:0:0:0:0:0::Beratung +#DESCRIPTION Beratung +#SERVICE 1:0:1:295:21:85:C00000:0:0:0: +#SERVICE 1:64:6:0:0:0:0:0:0:0::Einkaufen +#DESCRIPTION Einkaufen +#SERVICE 1:0:1:301:7:85:C00000:0:0:0: +#SERVICE 1:0:1:28:21:85:C00000:0:0:0: +#SERVICE 1:0:1:79EA:443:1:C00000:0:0:0: +#SERVICE 1:0:1:2F44:454:1:C00000:0:0:0: +#SERVICE 1:0:1:3148:459:1:C00000:0:0:0: +#SERVICE 1:0:1:36:7:85:C00000:0:0:0: +#SERVICE 1:0:1:307:7:85:C00000:0:0:0: +#SERVICE 1:0:1:296:5:85:C00000:0:0:0: +#SERVICE 1:0:1:383:21:85:C00000:0:0:0: +#SERVICE 1:0:1:313C:459:1:C00000:0:0:0: +#SERVICE 1:0:1:3159:459:1:C00000:0:0:0: +#SERVICE 1:0:1:2E:21:85:C00000:0:0:0: +#SERVICE 1:0:1:381:21:85:C00000:0:0:0: +#SERVICE 1:64:7:0:0:0:0:0:0:0::High Definition +#DESCRIPTION High Definition +#SERVICE 1:0:19:6EEC:4B1:1:C00000:0:0:0: +#SERVICE 1:0:19:EF12:421:1:C00000:0:0:0: +#SERVICE 1:0:19:EF13:421:1:C00000:0:0:0: +#SERVICE 1:64:0:0:0:0:0:0:0:0::Alternativen +#DESCRIPTION Alternativen +#SERVICE 1:0:1:6DCB:44D:1:C00000:0:0:0: +#SERVICE 1:0:1:6E44:431:1:C00000:0:0:0: +#SERVICE 1:0:1:6E45:431:1:C00000:0:0:0: +#SERVICE 1:0:1:6E41:431:1:C00000:0:0:0: +#SERVICE 1:0:1:6E40:431:1:C00000:0:0:0: +#SERVICE 1:0:1:6E43:431:1:C00000:0:0:0: +#SERVICE 1:0:1:6EE1:4B1:1:C00000:0:0:0: +#SERVICE 1:0:1:6E2D:431:1:C00000:0:0:0: +#SERVICE 1:0:1:6E2E:431:1:C00000:0:0:0: +#SERVICE 1:0:1:6F46:445:1:C00000:0:0:0: +#SERVICE 1:0:1:6E47:431:1:C00000:0:0:0: +#SERVICE 1:0:1:6F76:457:1:C00000:0:0:0: +#SERVICE 1:0:1:6E92:4B1:1:C00000:0:0:0: +#SERVICE 1:0:1:6E93:4B1:1:C00000:0:0:0: +#SERVICE 1:0:1:6F78:457:1:C00000:0:0:0: +#SERVICE 1:0:1:6F79:457:1:C00000:0:0:0: +#SERVICE 1:0:1:6E94:4B1:1:C00000:0:0:0: +#SERVICE 1:0:1:6F77:457:1:C00000:0:0:0: +#SERVICE 1:0:1:6EEB:4B1:1:C00000:0:0:0: +#SERVICE 1:0:1:6E97:4B1:1:C00000:0:0:0: +#SERVICE 1:0:1:6E96:4B1:1:C00000:0:0:0: +#SERVICE 1:0:1:6E95:4B1:1:C00000:0:0:0: +#SERVICE 1:64:8:0:0:0:0:0:0:0::Alternative SD services +#DESCRIPTION Alternative SD services +#SERVICE 1:0:1:6DCA:44D:1:C00000:0:0:0: +#SERVICE 1:0:1:6D66:437:1:C00000:0:0:0: +#SERVICE 1:0:1:7034:41B:1:C00000:0:0:0: diff --git a/data/defaults/Dream/sdbouquets/Makefile.am b/data/defaults/Dream/sdbouquets/Makefile.am new file mode 100644 index 00000000..50328e55 --- /dev/null +++ b/data/defaults/Dream/sdbouquets/Makefile.am @@ -0,0 +1,4 @@ +installdir = $(pkgdatadir)/defaults/Dream/sdbouquets + +dist_install_DATA = \ + userbouquet.favourites.tv diff --git a/data/defaults/Dream/userbouquet.favourites.tv b/data/defaults/Dream/sdbouquets/userbouquet.favourites.tv similarity index 95% rename from data/defaults/Dream/userbouquet.favourites.tv rename to data/defaults/Dream/sdbouquets/userbouquet.favourites.tv index cc5e9fe9..5f89c48a 100644 --- a/data/defaults/Dream/userbouquet.favourites.tv +++ b/data/defaults/Dream/sdbouquets/userbouquet.favourites.tv @@ -29,7 +29,6 @@ #SERVICE 1:0:1:6D6B:437:1:C00000:0:0:0: #SERVICE 1:0:1:2775:444:1:C00000:0:0:0: #SERVICE 1:0:1:293:5:85:C00000:0:0:0: -#SERVICE 1:0:1:3138:459:1:C00000:0:0:0: #SERVICE 1:0:1:6D70:437:1:C00000:0:0:0: #SERVICE 1:0:1:277B:444:1:C00000:0:0:0: #SERVICE 1:0:1:332D:45B:1:C00000:0:0:0: @@ -101,7 +100,6 @@ #SERVICE 1:0:19:2B70:3F3:1:C00000:0:0:0: #SERVICE 1:0:19:6EEC:4B1:1:C00000:0:0:0: #SERVICE 1:0:19:EF12:421:1:C00000:0:0:0: -#SERVICE 1:0:19:2B84:3F3:1:C00000:0:0:0: #SERVICE 1:0:19:EF13:421:1:C00000:0:0:0: #SERVICE 1:64:0:0:0:0:0:0:0:0::Alternativen #DESCRIPTION Alternativen diff --git a/data/encoding.conf b/data/encoding.conf index 3f09b564..a3cefe6e 100644 --- a/data/encoding.conf +++ b/data/encoding.conf @@ -6,6 +6,10 @@ gre ISO8859-7 pol ISO8859-2 rus ISO8859-5 bul ISO8859-5 +cze ISO6397 +ces ISO6397 +slo ISO6397 +slk ISO6397 #Sorry for that.. in DVB Spec this is the default behavior #when no other encoding is given in dvb-texts.. #but this breaks too much providers yet.. diff --git a/data/skin_default.xml b/data/skin_default.xml index 56d53dc3..0114349b 100755 --- a/data/skin_default.xml +++ b/data/skin_default.xml @@ -626,14 +626,14 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y())) - + {"template": [ MultiContentEntryText(pos = (10, 5), size = (360, 30), flags = RT_HALIGN_LEFT, text = 1), # index 1 is the nim name, - MultiContentEntryText(pos = (50, 30), size = (320, 30), font = 1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is a description of the nim settings, + MultiContentEntryText(pos = (50, 30), size = (320, 50), font = 1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is a description of the nim settings, ], "fonts": [gFont("Regular", 20), gFont("Regular", 15)], - "itemHeight": 70 + "itemHeight": 80 } diff --git a/data/skin_default/Makefile.am b/data/skin_default/Makefile.am index 9e9b7cd4..85bb800d 100755 --- a/data/skin_default/Makefile.am +++ b/data/skin_default/Makefile.am @@ -32,6 +32,8 @@ dist_install_DATA = \ expanded-plugins.png \ info-bg_mp.png \ info-bg.png \ + lock.png \ + lockBouquet.png \ mediaplayer_bg.png \ mute.png \ nim_active.png \ @@ -52,6 +54,8 @@ dist_install_DATA = \ timeline-now.png \ timeline.png \ unhandled-key.png \ + unlock.png \ + unlockBouquet.png \ verticalline-plugins.png \ vkey_backspace.png \ vkey_bg.png \ diff --git a/data/skin_default/lock.png b/data/skin_default/lock.png new file mode 100644 index 00000000..d0ae7f64 Binary files /dev/null and b/data/skin_default/lock.png differ diff --git a/data/skin_default/lockBouquet.png b/data/skin_default/lockBouquet.png new file mode 100644 index 00000000..d503dd2b Binary files /dev/null and b/data/skin_default/lockBouquet.png differ diff --git a/data/skin_default/unlock.png b/data/skin_default/unlock.png new file mode 100644 index 00000000..bd4486e9 Binary files /dev/null and b/data/skin_default/unlock.png differ diff --git a/data/skin_default/unlockBouquet.png b/data/skin_default/unlockBouquet.png new file mode 100644 index 00000000..c5d146d7 Binary files /dev/null and b/data/skin_default/unlockBouquet.png differ diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index c0263fb4..f85a37fe 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -455,7 +455,7 @@ int eDVBFrontend::PriorityOrder=0; eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate) :m_simulate(simulate), m_enabled(false), m_type(-1), m_dvbid(fe), m_slotid(fe) - ,m_fd(-1), m_need_rotor_workaround(false), m_can_handle_dvbs2(false) + ,m_fd(-1), m_rotor_mode(false), m_need_rotor_workaround(false), m_can_handle_dvbs2(false) ,m_state(stateClosed), m_timeout(0), m_tuneTimer(0) #if HAVE_DVB_API_VERSION < 3 ,m_secfd(-1) @@ -692,7 +692,8 @@ void eDVBFrontend::feEvent(int w) { eDebug("stateLostLock"); state = stateLostLock; - sec_fe->m_data[CSW] = sec_fe->m_data[UCSW] = sec_fe->m_data[TONEBURST] = -1; // reset diseqc + if (!m_rotor_mode) + sec_fe->m_data[CSW] = sec_fe->m_data[UCSW] = sec_fe->m_data[TONEBURST] = -1; // reset diseqc } } if (m_state != state) @@ -2343,6 +2344,20 @@ RESULT eDVBFrontend::tune(const iDVBFrontendParameters &where) res = -EINVAL; goto tune_error; } + if (m_rotor_mode != feparm.no_rotor_command_on_tune && !feparm.no_rotor_command_on_tune) + { + eDVBFrontend *sec_fe = this; + long tmp = m_data[LINKED_PREV_PTR]; + while (tmp != -1) + { + eDVBRegisteredFrontend *linked_fe = (eDVBRegisteredFrontend*)tmp; + sec_fe = linked_fe->m_frontend; + sec_fe->getData(LINKED_NEXT_PTR, tmp); + } + eDebug("(fe%d) reset diseqc after leave rotor mode!", m_dvbid); + sec_fe->m_data[CSW] = sec_fe->m_data[UCSW] = sec_fe->m_data[TONEBURST] = sec_fe->m_data[ROTOR_CMD] = sec_fe->m_data[ROTOR_POS] = -1; // reset diseqc + } + m_rotor_mode = feparm.no_rotor_command_on_tune; if (!m_simulate) m_sec->setRotorMoving(m_slotid, false); res=prepare_sat(feparm, timeout); diff --git a/lib/dvb/frontend.h b/lib/dvb/frontend.h index bac27539..4cf05081 100644 --- a/lib/dvb/frontend.h +++ b/lib/dvb/frontend.h @@ -75,6 +75,7 @@ private: int m_dvbid; int m_slotid; int m_fd; + bool m_rotor_mode; bool m_need_rotor_workaround; bool m_can_handle_dvbs2; char m_filename[128]; diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index 91246889..0e3e7e0a 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -156,6 +156,11 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite ret = 15000; } + if (sat.no_rotor_command_on_tune && !rotor) { + eSecDebugNoSimulate("no rotor but no_rotor_command_on_tune is set.. ignore lnb %d", idx); + continue; + } + eSecDebugNoSimulate("ret1 %d", ret); if (linked_in_use) @@ -170,21 +175,6 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite else ret += 15; eSecDebugNoSimulate("ret2 %d", ret); - if (ret) // special case when this tuner is linked to a satpos dependent tuner - { - fe->getData(eDVBFrontend::SATPOS_DEPENDS_PTR, satpos_depends_ptr); - if (satpos_depends_ptr != -1) - { - eDVBRegisteredFrontend *satpos_depends_to_fe = (eDVBRegisteredFrontend*) satpos_depends_ptr; - satpos_depends_to_fe->m_frontend->getData(eDVBFrontend::ROTOR_POS, rotor_pos); - if (!rotor || rotor_pos == -1 /* we dont know the rotor position yet */ - || rotor_pos != sat.orbital_position ) // not the same orbital position? - { - ret = 0; - } - } - } - eSecDebugNoSimulate("ret3 %d", ret); } else if (satpos_depends_ptr != -1) { @@ -199,6 +189,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite else ret += 10; } + eSecDebugNoSimulate("ret3 %d", ret); } else // current fe is dependent of another tuner ... (so this fe can't turn the rotor!) { diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py index 03f574f3..e8e612a4 100755 --- a/lib/python/Components/Harddisk.py +++ b/lib/python/Components/Harddisk.py @@ -166,7 +166,7 @@ class Harddisk: lines = mounts.readlines() mounts.close() - cmd = "/bin/umount" + cmd = "umount" for line in lines: parts = line.strip().split(" ") @@ -177,12 +177,12 @@ class Harddisk: return (res >> 8) def createPartition(self): - cmd = 'printf "0,\n;\n;\n;\ny\n" | /sbin/sfdisk -f ' + self.disk_path + cmd = 'printf "0,\n;\n;\n;\ny\n" | sfdisk -f ' + self.disk_path res = system(cmd) return (res >> 8) def mkfs(self): - cmd = "/sbin/mkfs.ext3 " + cmd = "mkfs.ext3 " if self.diskSize() > 4 * 1024: cmd += "-T largefile " cmd += "-m0 -O dir_index " + self.partitionPath("1") @@ -202,7 +202,7 @@ class Harddisk: for line in lines: parts = line.strip().split(" ") if path.realpath(parts[0]) == self.partitionPath("1"): - cmd = "/bin/mount -t ext3 " + parts[0] + cmd = "mount -t ext3 " + parts[0] res = system(cmd) break @@ -218,7 +218,7 @@ class Harddisk: def fsck(self): # We autocorrect any failures # TODO: we could check if the fs is actually ext3 - cmd = "/sbin/fsck.ext3 -f -p " + self.partitionPath("1") + cmd = "fsck.ext3 -f -p " + self.partitionPath("1") res = system(cmd) return (res >> 8) @@ -226,7 +226,7 @@ class Harddisk: part = self.partitionPath(n) if access(part, 0): - cmd = '/bin/dd bs=512 count=3 if=/dev/zero of=' + part + cmd = 'dd bs=512 count=3 if=/dev/zero of=' + part res = system(cmd) else: res = 0 diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index 4b0213d4..b9da48d8 100755 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -14,7 +14,7 @@ class Network: self.NetworkState = 0 self.DnsState = 0 self.nameservers = [] - self.ethtool_bin = "/usr/sbin/ethtool" + self.ethtool_bin = "ethtool" self.container = eConsoleAppContainer() self.Console = Console() self.LinkConsole = Console() @@ -580,11 +580,11 @@ class Network: self.wlanmodule = 'madwifi' if os_path.exists(rt73_dir): rtfiles = listdir(rt73_dir) - if len(rtfiles) == 2: + if len(rtfiles) == 2 or len(rtfiles) == 5: self.wlanmodule = 'ralink' if os_path.exists(zd1211b_dir): zdfiles = listdir(zd1211b_dir) - if len(zdfiles) == 1: + if len(zdfiles) == 1 or len(zdfiles) == 5: self.wlanmodule = 'zydas' return self.wlanmodule diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 00d06095..745cc730 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -444,7 +444,7 @@ class SecConfigure: self.update() class NIM(object): - def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None): + def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}): self.slot = slot if type not in ("DVB-S", "DVB-C", "DVB-T", "DVB-S2", None): @@ -455,6 +455,7 @@ class NIM(object): self.description = description self.has_outputs = has_outputs self.internally_connectable = internally_connectable + self.multi_type = multi_type def isCompatible(self, what): compatible = { @@ -466,6 +467,9 @@ class NIM(object): } return what in compatible[self.type] + def getType(self): + return self.type + def connectableTo(self): connectable = { "DVB-S": ("DVB-S", "DVB-S2"), @@ -491,6 +495,13 @@ class NIM(object): def internallyConnectableTo(self): return self.internally_connectable + + def isMultiType(self): + return (len(self.multi_type) > 0) + + # returns dict {: } + def getMultiTypeList(self): + return self.multi_type slot_id = property(getSlotID) @@ -636,7 +647,15 @@ class NimManager: entries[current_slot]["has_outputs"] = (input == "yes") elif line.strip().startswith("Internally_Connectable:"): input = int(line.strip()[len("Internally_Connectable:") + 1:]) - entries[current_slot]["internally_connectable"] = input + entries[current_slot]["internally_connectable"] = input + elif line.strip().startswith("Mode"): + # "Mode 0: DVB-T" -> ["Mode 0", " DVB-T"] + split = line.strip().split(":") + # "Mode 0" -> ["Mode, "0"] + split2 = split[0].split(" ") + modes = entries[current_slot].get("multi_type", {}) + modes[split2[1]] = split[1].strip() + entries[current_slot]["multi_type"] = modes elif line.strip().startswith("empty"): entries[current_slot]["type"] = None entries[current_slot]["name"] = _("N/A") @@ -650,12 +669,17 @@ class NimManager: entry["has_outputs"] = True if not (entry.has_key("internally_connectable")): entry["internally_connectable"] = None - self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"])) + if not (entry.has_key("multi_type")): + entry["multi_type"] = {} + self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"], multi_type = entry["multi_type"])) def hasNimType(self, chktype): for slot in self.nim_slots: if slot.isCompatible(chktype): return True + for type in slot.getMultiTypeList().values(): + if chktype == type: + return True return False def getNimType(self, slotid): @@ -1218,11 +1242,28 @@ def InitNimManager(nimmgr): slot_id = configElement.slot_id if nimmgr.nim_slots[slot_id].description == 'Alps BSBE2': open("/proc/stb/frontend/%d/tone_amplitude" %(fe_id), "w").write(configElement.value) + + def tunerTypeChanged(configElement): + fe_id = configElement.fe_id + open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value) empty_slots = 0 for slot in nimmgr.nim_slots: x = slot.slot nim = config.Nims[x] + if slot.isMultiType(): + typeList = [] + value = None + for id in slot.getMultiTypeList().keys(): + type = slot.getMultiTypeList()[id] + typeList.append((id, type)) + if type == slot.getType(): + value = id + nim.multiType = ConfigSelection(typeList, "0") + nim.multiType.value = value + nim.multiType.fe_id = x - empty_slots + nim.multiType.addNotifier(tunerTypeChanged) + if slot.isCompatible("DVB-S"): nim.toneAmplitude = ConfigSelection([("9", "600mV"), ("8", "700mV"), ("7", "800mV"), ("6", "900mV"), ("5", "1100mV")], "7") nim.toneAmplitude.fe_id = x - empty_slots diff --git a/lib/python/Components/ParentalControl.py b/lib/python/Components/ParentalControl.py old mode 100755 new mode 100644 index d68e01ff..9942bca7 --- a/lib/python/Components/ParentalControl.py +++ b/lib/python/Components/ParentalControl.py @@ -1,19 +1,34 @@ -from Components.config import config, ConfigSubsection, ConfigSelection, ConfigPIN, ConfigYesNo, ConfigSubList, ConfigInteger +from Components.config import config, ConfigSubsection, ConfigSelection, ConfigPIN, ConfigText, ConfigYesNo, ConfigSubList, ConfigInteger +#from Screens.ChannelSelection import service_types_tv from Screens.InputBox import PinInput from Screens.MessageBox import MessageBox from Tools.BoundFunction import boundFunction from ServiceReference import ServiceReference from Tools import Notifications from Tools.Directories import resolveFilename, SCOPE_CONFIG +from enigma import eTimer +import time + +TYPE_SERVICE = "SERVICE" +TYPE_BOUQUETSERVICE = "BOUQUETSERVICE" +TYPE_BOUQUET = "BOUQUET" +LIST_BLACKLIST = "blacklist" +LIST_WHITELIST = "whitelist" + +IMG_WHITESERVICE = LIST_WHITELIST + "-" + TYPE_SERVICE +IMG_WHITEBOUQUET = LIST_WHITELIST + "-" + TYPE_BOUQUET +IMG_BLACKSERVICE = LIST_BLACKLIST + "-" + TYPE_SERVICE +IMG_BLACKBOUQUET = LIST_BLACKLIST + "-" + TYPE_BOUQUET def InitParentalControl(): config.ParentalControl = ConfigSubsection() config.ParentalControl.configured = ConfigYesNo(default = False) config.ParentalControl.mode = ConfigSelection(default = "simple", choices = [("simple", _("simple")), ("complex", _("complex"))]) - config.ParentalControl.storeservicepin = ConfigSelection(default = "never", choices = [("never", _("never")), ("5_minutes", _("5 minutes")), ("30_minutes", _("30 minutes")), ("60_minutes", _("60 minutes")), ("restart", _("until restart"))]) + config.ParentalControl.storeservicepin = ConfigSelection(default = "never", choices = [("never", _("never")), ("5", _("5 minutes")), ("30", _("30 minutes")), ("60", _("60 minutes")), ("standby", _("until standby/restart"))]) + config.ParentalControl.storeservicepincancel = ConfigSelection(default = "never", choices = [("never", _("never")), ("5", _("5 minutes")), ("30", _("30 minutes")), ("60", _("60 minutes")), ("standby", _("until standby/restart"))]) config.ParentalControl.servicepinactive = ConfigYesNo(default = False) config.ParentalControl.setuppinactive = ConfigYesNo(default = False) - config.ParentalControl.type = ConfigSelection(default = "blacklist", choices = [("whitelist", _("whitelist")), ("blacklist", _("blacklist"))]) + config.ParentalControl.type = ConfigSelection(default = "blacklist", choices = [(LIST_WHITELIST, _("whitelist")), (LIST_BLACKLIST, _("blacklist"))]) config.ParentalControl.setuppin = ConfigPIN(default = -1) config.ParentalControl.retries = ConfigSubsection() @@ -39,40 +54,58 @@ def InitParentalControl(): class ParentalControl: def __init__(self): - self.open() + #Do not call open on init, because bouquets are not ready at that moment +# self.open() self.serviceLevel = {} - - def addWhitelistService(self, service): - self.whitelist.append(service) + #Instead: Use Flags to see, if we already initialized config and called open + self.configInitialized = False + self.filesOpened = False + #This is the timer that is used to see, if the time for caching the pin is over + #Of course we could also work without a timer and compare the times every + #time we call isServicePlayable. But this might probably slow down zapping, + #That's why I decided to use a timer + self.sessionPinTimer = eTimer() + self.sessionPinTimer.callback.append(self.resetSessionPin) - def addBlacklistService(self, service): - self.blacklist.append(service) - - def setServiceLevel(self, service, level): - self.serviceLevel[service] = level - - def deleteWhitelistService(self, service): - self.whitelist.remove(service) - if self.serviceLevel.has_key(service): - self.serviceLevel.remove(service) + def serviceMethodWrapper(self, service, method, *args): + #This method is used to call all functions that need a service as Parameter: + #It takes either a Service- Reference or a Bouquet- Reference and passes + #Either the service or all services contained in the bouquet to the method given + #That way all other functions do not need to distinguish between service and bouquet. + if "FROM BOUQUET" in service: + method( service , TYPE_BOUQUET , *args ) + servicelist = self.readServicesFromBouquet(service,"C") + for ref in servicelist: + sRef = str(ref[0]) + method( sRef , TYPE_BOUQUETSERVICE , *args ) + else: + ref = ServiceReference(service) + sRef = str(ref) + method( sRef , TYPE_SERVICE , *args ) - def deleteBlacklistService(self, service): - self.blacklist.remove(service) - if self.serviceLevel.has_key(service): - self.serviceLevel.remove(service) + def setServiceLevel(self, service, type, level): + self.serviceLevel[service] = level def isServicePlayable(self, ref, callback): if not config.ParentalControl.configured.value or not config.ParentalControl.servicepinactive.value: return True - #print "whitelist:", self.whitelist - #print "blacklist:", self.blacklist - #print "config.ParentalControl.type.value:", config.ParentalControl.type.value - #print "not in whitelist:", (service not in self.whitelist) - #print "checking parental control for service:", ref.toString() + #Check if we already read the whitelists and blacklists. If not: call open + if self.filesOpened == False: + self.open() + #Check if configuration has already been read or if the significant values have changed. + #If true: read the configuration + if self.configInitialized == False or self.storeServicePin != config.ParentalControl.storeservicepin.value or self.storeServicePinCancel != config.ParentalControl.storeservicepincancel.value: + self.getConfigValues() service = ref.toCompareString() - if (config.ParentalControl.type.value == "whitelist" and service not in self.whitelist) or (config.ParentalControl.type.value == "blacklist" and service in self.blacklist): + if (config.ParentalControl.type.value == LIST_WHITELIST and not self.whitelist.has_key(service)) or (config.ParentalControl.type.value == LIST_BLACKLIST and self.blacklist.has_key(service)): + #Check if the session pin is cached and return the cached value, if it is. + if self.sessionPinCached == True: + #As we can cache successful pin- entries as well as canceled pin- entries, + #We give back the last action + return self.sessionPinCachedValue self.callback = callback - #print "service:", ServiceReference(service).getServiceName() + #Someone started to implement different levels of protection. Seems they were never completed + #I did not throw out this code, although it is of no use at the moment levelNeeded = 0 if self.serviceLevel.has_key(service): levelNeeded = self.serviceLevel[service] @@ -83,103 +116,217 @@ class ParentalControl: return True def protectService(self, service): - #print "protect" - #print "config.ParentalControl.type.value:", config.ParentalControl.type.value - if config.ParentalControl.type.value == "whitelist": - if service in self.whitelist: - self.deleteWhitelistService(service) + if config.ParentalControl.type.value == LIST_WHITELIST: + if self.whitelist.has_key(service): + self.serviceMethodWrapper(service, self.removeServiceFromList, self.whitelist) + #self.deleteWhitelistService(service) else: # blacklist - if service not in self.blacklist: - self.addBlacklistService(service) + if not self.blacklist.has_key(service): + self.serviceMethodWrapper(service, self.addServiceToList, self.blacklist) + #self.addBlacklistService(service) #print "whitelist:", self.whitelist #print "blacklist:", self.blacklist - def unProtectService(self, service): #print "unprotect" #print "config.ParentalControl.type.value:", config.ParentalControl.type.value - if config.ParentalControl.type.value == "whitelist": - if service not in self.whitelist: - self.addWhitelistService(service) + if config.ParentalControl.type.value == LIST_WHITELIST: + if not self.whitelist.has_key(service): + self.serviceMethodWrapper(service, self.addServiceToList, self.whitelist) + #self.addWhitelistService(service) else: # blacklist - if service in self.blacklist: - self.deleteBlacklistService(service) + if self.blacklist.has_key(service): + self.serviceMethodWrapper(service, self.removeServiceFromList, self.blacklist) + #self.deleteBlacklistService(service) #print "whitelist:", self.whitelist #print "blacklist:", self.blacklist def getProtectionLevel(self, service): - if (config.ParentalControl.type.value == "whitelist" and service not in self.whitelist) or (config.ParentalControl.type.value == "blacklist" and service in self.blacklist): + if (config.ParentalControl.type.value == LIST_WHITELIST and not self.whitelist.has_key(service)) or (config.ParentalControl.type.value == LIST_BLACKLIST and self.blacklist.has_key(service)): if self.serviceLevel.has_key(service): return self.serviceLevel[service] else: return 0 else: return -1 + + def getProtectionType(self, service): + #New method used in ParentalControlList: This method does not only return + #if a service is protected or not, it also returns, why (whitelist or blacklist, service or bouquet) + if self.filesOpened == False: + self.open() + sImage = "" + if (config.ParentalControl.type.value == LIST_WHITELIST): + if self.whitelist.has_key(service): + if TYPE_SERVICE in self.whitelist[service]: + sImage = IMG_WHITESERVICE + else: + sImage = IMG_WHITEBOUQUET + elif (config.ParentalControl.type.value == LIST_BLACKLIST): + if self.blacklist.has_key(service): + if TYPE_SERVICE in self.blacklist[service]: + sImage = IMG_BLACKSERVICE + else: + sImage = IMG_BLACKBOUQUET + bLocked = self.getProtectionLevel(service) != -1 + return (bLocked,sImage) + + def getConfigValues(self): + #Read all values from configuration + self.checkPinInterval = False + self.checkPinIntervalCancel = False + self.checkSessionPin = False + self.checkSessionPinCancel = False + + self.sessionPinCached = False + self.pinIntervalSeconds = 0 + self.pinIntervalSecondsCancel = 0 + + self.storeServicePin = config.ParentalControl.storeservicepin.value + self.storeServicePinCancel = config.ParentalControl.storeservicepincancel.value + + if self.storeServicePin == "never": + pass + elif self.storeServicePin == "standby": + self.checkSessionPin = True + else: + self.checkPinInterval = True + iMinutes = float(self.storeServicePin) + iSeconds = iMinutes*60 + self.pinIntervalSeconds = iSeconds + + if self.storeServicePinCancel == "never": + pass + elif self.storeServicePinCancel == "standby": + self.checkSessionPinCancel = True + else: + self.checkPinIntervalCancel = True + iMinutes = float(self.storeServicePinCancel) + iSeconds = iMinutes*60 + self.pinIntervalSecondsCancel = iSeconds + self.configInitialized = True + # Reset PIN cache on standby: Use StandbyCounter- Config- Callback + config.misc.standbyCounter.addNotifier(self.standbyCounterCallback, initial_call = False) + + def standbyCounterCallback(self, configElement): + self.resetSessionPin() + + def resetSessionPin(self): + #Reset the session pin, stop the timer + self.sessionPinCached = False + self.sessionPinTimer.stop() + + def getCurrentTimeStamp(self): + return time.time() + def getPinList(self): return [ x.value for x in config.ParentalControl.servicepin ] - + def servicePinEntered(self, service, result): -# levelNeeded = 0 - #if self.serviceLevel.has_key(service): - #levelNeeded = self.serviceLevel[service] -# - #print "getPinList():", self.getPinList() - #pinList = self.getPinList()[:levelNeeded + 1] - #print "pinList:", pinList -# -# print "pin entered for service", service, "and pin was", pin - #if pin is not None and int(pin) in pinList: + if result is not None and result: - #print "pin ok, playing service" + #This is the new function of caching the service pin + #save last session and time of last entered pin... + if self.checkSessionPin == True: + self.sessionPinCached = True + self.sessionPinCachedValue = True + if self.checkPinInterval == True: + self.sessionPinCached = True + self.sessionPinCachedValue = True + self.sessionPinTimer.start(self.pinIntervalSeconds*1000,1) self.callback(ref = service) else: + #This is the new function of caching cancelling of service pin if result is not None: Notifications.AddNotification(MessageBox, _("The pin code you entered is wrong."), MessageBox.TYPE_ERROR) - #print "wrong pin entered" + else: + if self.checkSessionPinCancel == True: + self.sessionPinCached = True + self.sessionPinCachedValue = False + if self.checkPinIntervalCancel == True: + self.sessionPinCached = True + self.sessionPinCachedValue = False + self.sessionPinTimer.start(self.pinIntervalSecondsCancel*1000,1) - def saveWhitelist(self): - file = open(resolveFilename(SCOPE_CONFIG, "whitelist"), 'w') - for x in self.whitelist: - file.write(x + "\n") - file.close - - def openWhitelist(self): - self.whitelist = [] - try: - file = open(resolveFilename(SCOPE_CONFIG, "whitelist"), 'r') - lines = file.readlines() - for x in lines: - ref = ServiceReference(x.strip()) - self.whitelist.append(str(ref)) - file.close - except: - pass - - def saveBlacklist(self): - file = open(resolveFilename(SCOPE_CONFIG, "blacklist"), 'w') - for x in self.blacklist: - file.write(x + "\n") + def saveListToFile(self,sWhichList): + #Replaces saveWhiteList and saveBlackList: + #I don't like to have two functions with identical code... + if sWhichList == LIST_BLACKLIST: + vList = self.blacklist + else: + vList = self.whitelist + file = open(resolveFilename(SCOPE_CONFIG, sWhichList), 'w') + for sService,sType in vList.iteritems(): + #Only Services that are selected directly and Bouqets are saved. + #Services that are added by a bouquet are not saved. + #This is the reason for the change in self.whitelist and self.blacklist + if TYPE_SERVICE in sType or TYPE_BOUQUET in sType: + file.write(str(sService) + "\n") file.close - def openBlacklist(self): - self.blacklist = [] + def openListFromFile(self,sWhichList): + #Replaces openWhiteList and openBlackList: + #I don't like to have two functions with identical code... + if sWhichList == LIST_BLACKLIST: + self.blacklist = {} + vList = self.blacklist + else: + self.whitelist = {} + vList = self.whitelist try: - file = open(resolveFilename(SCOPE_CONFIG, "blacklist"), 'r') + file = open(resolveFilename(SCOPE_CONFIG, sWhichList ), 'r') lines = file.readlines() for x in lines: - ref = ServiceReference(x.strip()) - self.blacklist.append(str(ref)) + sPlain = x.strip() + self.serviceMethodWrapper(sPlain, self.addServiceToList, vList) file.close except: pass + + def addServiceToList(self, service, type, vList): + #Replaces addWhitelistService and addBlacklistService + #The lists are not only lists of service references any more. + #They are named lists with the service as key and an array of types as value: + + if vList.has_key(service): + if not type in vList[service]: + vList[service].append(type) + else: + vList[service] = [type] + + def removeServiceFromList(self, service, type, vList): + #Replaces deleteWhitelistService and deleteBlacklistService + if vList.has_key(service): + if type in vList[service]: + vList[service].remove(type) + if not vList[service]: + del vList[service] + if self.serviceLevel.has_key(service): + self.serviceLevel.remove(service) + + def readServicesFromBouquet(self,sBouquetSelection,formatstring): + #This method gives back a list of services for a given bouquet + from enigma import eServiceCenter, eServiceReference + from Screens.ChannelSelection import service_types_tv + serviceHandler = eServiceCenter.getInstance() + refstr = sBouquetSelection + root = eServiceReference(refstr) + list = serviceHandler.list(root) + if list is not None: + services = list.getContent("CN", True) #(servicecomparestring, name) + return services def save(self): - self.saveBlacklist() - self.saveWhitelist() + # we need to open the files in case we havent's read them yet + if not self.filesOpened: + self.open() + self.saveListToFile(LIST_BLACKLIST) + self.saveListToFile(LIST_WHITELIST) def open(self): - self.openBlacklist() - self.openWhitelist() + self.openListFromFile(LIST_BLACKLIST) + self.openListFromFile(LIST_WHITELIST) + self.filesOpened = True parentalControl = ParentalControl() diff --git a/lib/python/Components/ParentalControlList.py b/lib/python/Components/ParentalControlList.py index 128e6d3e..797ea391 100644 --- a/lib/python/Components/ParentalControlList.py +++ b/lib/python/Components/ParentalControlList.py @@ -1,19 +1,28 @@ from MenuList import MenuList -from Components.ParentalControl import parentalControl +from Components.ParentalControl import parentalControl, IMG_WHITESERVICE, IMG_WHITEBOUQUET, IMG_BLACKSERVICE, IMG_BLACKBOUQUET from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT from Tools.LoadPixmap import LoadPixmap -lockPicture = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/lock.png")) +#Now there is a list of pictures instead of one... +entryPicture = {} -def ParentalControlEntryComponent(service, name, locked = True): +entryPicture[IMG_BLACKSERVICE] = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/lock.png")) +entryPicture[IMG_BLACKBOUQUET] = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/lockBouquet.png")) +entryPicture[IMG_WHITESERVICE] = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/unlock.png")) +entryPicture[IMG_WHITEBOUQUET] = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/unlockBouquet.png")) + +def ParentalControlEntryComponent(service, name, protectionType): + locked = protectionType[0] + sImage = protectionType[1] res = [ (service, name, locked), (eListboxPythonMultiContent.TYPE_TEXT, 80, 5, 300, 50, 0, RT_HALIGN_LEFT, name) ] - if locked: - res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 0, 32, 32, lockPicture)) + #Changed logic: The image is defined by sImage, not by locked anymore + if sImage != "": + res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 0, 32, 32, entryPicture[sImage])) return res class ParentalControlList(MenuList): @@ -25,9 +34,11 @@ class ParentalControlList(MenuList): def toggleSelectedLock(self): print "self.l.getCurrentSelection():", self.l.getCurrentSelection() print "self.l.getCurrentSelectionIndex():", self.l.getCurrentSelectionIndex() - self.list[self.l.getCurrentSelectionIndex()] = ParentalControlEntryComponent(self.l.getCurrentSelection()[0][0], self.l.getCurrentSelection()[0][1], not self.l.getCurrentSelection()[0][2]); - if self.l.getCurrentSelection()[0][2]: - parentalControl.protectService(self.l.getCurrentSelection()[0][0]) + curSel = self.l.getCurrentSelection() + if curSel[0][2]: + parentalControl.unProtectService(self.l.getCurrentSelection()[0][0]) else: - parentalControl.unProtectService(self.l.getCurrentSelection()[0][0]) + parentalControl.protectService(self.l.getCurrentSelection()[0][0]) + #Instead of just negating the locked- flag, now I call the getProtectionType every time... + self.list[self.l.getCurrentSelectionIndex()] = ParentalControlEntryComponent(curSel[0][0], curSel[0][1], parentalControl.getProtectionType(curSel[0][0])) self.l.setList(self.list) diff --git a/lib/python/Components/Task.py b/lib/python/Components/Task.py index df94f8a6..a1e04bce 100644 --- a/lib/python/Components/Task.py +++ b/lib/python/Components/Task.py @@ -370,12 +370,20 @@ class DiskspacePrecondition(Condition): class ToolExistsPrecondition(Condition): def check(self, task): import os + if task.cmd[0]=='/': - realpath = task.cmd + self.realpath = task.cmd + print "[Task.py][ToolExistsPrecondition] WARNING: usage of absolute paths for tasks should be avoided!" + return os.access(self.realpath, os.X_OK) else: - realpath = task.cwd + '/' + task.cmd - self.realpath = realpath - return os.access(realpath, os.X_OK) + self.realpath = task.cmd + path = os.environ.get('PATH', '').split(os.pathsep) + path.append(task.cwd + '/') + absolutes = filter(lambda file: os.access(file, os.X_OK), map(lambda directory, file = task.cmd: os.path.join(directory, file), path)) + if len(absolutes) > 0: + self.realpath = task.cmd[0] + return True + return False def getErrorMessage(self, task): return _("A required tool (%s) was not found.") % (self.realpath) diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py index 2a7405df..30097c96 100755 --- a/lib/python/Components/TimerList.py +++ b/lib/python/Components/TimerList.py @@ -33,12 +33,18 @@ class TimerList(HTMLComponent, GUIComponent, object): count += 1 flags = flags >> 1 if timer.justplay: - res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + ((" %s "+ _("(ZAP)")) % (FuzzyTime(timer.begin)[1])))) + if timer.end - timer.begin < 4: # rounding differences + res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + ((" %s "+ _("(ZAP)")) % (FuzzyTime(timer.begin)[1])))) + else: + res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + ((" %s ... %s (%d " + _("mins") + ") ") % (FuzzyTime(timer.begin)[1], FuzzyTime(timer.end)[1], (timer.end - timer.begin) / 60)) + _("(ZAP)"))) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + ((" %s ... %s (%d " + _("mins") + ")") % (FuzzyTime(timer.begin)[1], FuzzyTime(timer.end)[1], (timer.end - timer.begin) / 60)))) else: if timer.justplay: - res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + (("%s, %s " + _("(ZAP)")) % (FuzzyTime(timer.begin))))) + if timer.end - timer.begin < 4: + res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + (("%s, %s " + _("(ZAP)")) % (FuzzyTime(timer.begin))))) + else: + res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + (("%s, %s ... %s (%d " + _("mins") + ") ") % (FuzzyTime(timer.begin) + FuzzyTime(timer.end)[1:] + ((timer.end - timer.begin) / 60,))) + _("(ZAP)"))) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + (("%s, %s ... %s (%d " + _("mins") + ")") % (FuzzyTime(timer.begin) + FuzzyTime(timer.end)[1:] + ((timer.end - timer.begin) / 60,))))) diff --git a/lib/python/Components/TuneTest.py b/lib/python/Components/TuneTest.py index f9ab3edb..44b19091 100644 --- a/lib/python/Components/TuneTest.py +++ b/lib/python/Components/TuneTest.py @@ -1,8 +1,9 @@ from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParameters, eDVBResourceManager, eTimer class Tuner: - def __init__(self, frontend): + def __init__(self, frontend, ignore_rotor=False): self.frontend = frontend + self.ignore_rotor = ignore_rotor # transponder = (frequency, symbolrate, polarisation, fec, inversion, orbpos, system, modulation, rolloff, pilot, tsid, onid) # 0 1 2 3 4 5 6 7 8 9 10 11 @@ -21,7 +22,7 @@ class Tuner: parm.rolloff = transponder[8] parm.pilot = transponder[9] feparm = eDVBFrontendParameters() - feparm.setDVBS(parm) + feparm.setDVBS(parm, self.ignore_rotor) self.lastparm = feparm self.frontend.tune(feparm) diff --git a/lib/python/Plugins/Extensions/DVDBurn/Process.py b/lib/python/Plugins/Extensions/DVDBurn/Process.py index 642a898d..b64541b6 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/Process.py +++ b/lib/python/Plugins/Extensions/DVDBurn/Process.py @@ -5,7 +5,7 @@ from Screens.MessageBox import MessageBox class png2yuvTask(Task): def __init__(self, job, inputfile, outputfile): Task.__init__(self, job, "Creating menu video") - self.setTool("/usr/bin/png2yuv") + self.setTool("png2yuv") self.args += ["-n1", "-Ip", "-f25", "-j", inputfile] self.dumpFile = outputfile self.weighting = 15 @@ -21,7 +21,7 @@ class png2yuvTask(Task): class mpeg2encTask(Task): def __init__(self, job, inputfile, outputfile): Task.__init__(self, job, "Encoding menu video") - self.setTool("/usr/bin/mpeg2enc") + self.setTool("mpeg2enc") self.args += ["-f8", "-np", "-a2", "-o", outputfile] self.inputFile = inputfile self.weighting = 25 @@ -36,7 +36,7 @@ class mpeg2encTask(Task): class spumuxTask(Task): def __init__(self, job, xmlfile, inputfile, outputfile): Task.__init__(self, job, "Muxing buttons into menu") - self.setTool("/usr/bin/spumux") + self.setTool("spumux") self.args += [xmlfile] self.inputFile = inputfile self.dumpFile = outputfile @@ -54,7 +54,7 @@ class spumuxTask(Task): class MakeFifoNode(Task): def __init__(self, job, number): Task.__init__(self, job, "Make FIFO nodes") - self.setTool("/bin/mknod") + self.setTool("mknod") nodename = self.job.workspace + "/dvd_title_%d" % number + ".mpg" self.args += [nodename, "p"] self.weighting = 10 @@ -62,14 +62,14 @@ class MakeFifoNode(Task): class LinkTS(Task): def __init__(self, job, sourcefile, link_name): Task.__init__(self, job, "Creating symlink for source titles") - self.setTool("/bin/ln") + self.setTool("ln") self.args += ["-s", sourcefile, link_name] self.weighting = 10 class CopyMeta(Task): def __init__(self, job, sourcefile): Task.__init__(self, job, "Copy title meta files") - self.setTool("/bin/cp") + self.setTool("cp") from os import listdir path, filename = sourcefile.rstrip("/").rsplit("/",1) tsfiles = listdir(path) @@ -84,7 +84,7 @@ class DemuxTask(Task): Task.__init__(self, job, "Demux video into ES") title = job.project.titles[job.i] self.global_preconditions.append(DiskspacePrecondition(title.estimatedDiskspace)) - self.setTool("/usr/bin/projectx") + self.setTool("projectx") self.args += [inputfile, "-demux", "-out", self.job.workspace ] self.end = 300 self.prog_state = 0 @@ -194,7 +194,7 @@ class MplexTask(Task): self.weighting = weighting self.demux_task = demux_task self.postconditions.append(MplexTaskPostcondition()) - self.setTool("/usr/bin/mplex") + self.setTool("mplex") self.args += ["-f8", "-o", outputfile, "-v1"] if inputfiles: self.args += inputfiles @@ -222,7 +222,7 @@ class RemoveESFiles(Task): def __init__(self, job, demux_task): Task.__init__(self, job, "Remove temp. files") self.demux_task = demux_task - self.setTool("/bin/rm") + self.setTool("rm") self.weighting = 10 def prepare(self): @@ -234,7 +234,7 @@ class DVDAuthorTask(Task): def __init__(self, job): Task.__init__(self, job, "Authoring DVD") self.weighting = 20 - self.setTool("/usr/bin/dvdauthor") + self.setTool("dvdauthor") self.CWD = self.job.workspace self.args += ["-x", self.job.workspace+"/dvdauthor.xml"] self.menupreview = job.menupreview @@ -255,7 +255,7 @@ class DVDAuthorTask(Task): class DVDAuthorFinalTask(Task): def __init__(self, job): Task.__init__(self, job, "dvdauthor finalize") - self.setTool("/usr/bin/dvdauthor") + self.setTool("dvdauthor") self.args += ["-T", "-o", self.job.workspace + "/dvd"] class WaitForResidentTasks(Task): @@ -292,7 +292,7 @@ class BurnTaskPostcondition(Condition): class BurnTask(Task): ERROR_NOTWRITEABLE, ERROR_LOAD, ERROR_SIZE, ERROR_WRITE_FAILED, ERROR_DVDROM, ERROR_ISOFS, ERROR_FILETOOLARGE, ERROR_ISOTOOLARGE, ERROR_MINUSRWBUG, ERROR_UNKNOWN = range(10) - def __init__(self, job, extra_args=[], tool="/bin/growisofs"): + def __init__(self, job, extra_args=[], tool="growisofs"): Task.__init__(self, job, job.name) self.weighting = 500 self.end = 120 # 100 for writing, 10 for buffer flush, 10 for closing disc @@ -357,7 +357,7 @@ class BurnTask(Task): class RemoveDVDFolder(Task): def __init__(self, job): Task.__init__(self, job, "Remove temp. files") - self.setTool("/bin/rm") + self.setTool("rm") self.args += ["-rf", self.job.workspace] self.weighting = 10 @@ -882,13 +882,13 @@ class DVDJob(Job): volName = self.project.settings.name.getValue() if output == "dvd": self.name = _("Burn DVD") - tool = "/bin/growisofs" + tool = "growisofs" burnargs = [ "-Z", "/dev/" + harddiskmanager.getCD(), "-dvd-compat" ] if self.project.size/(1024*1024) > self.project.MAX_SL: burnargs += [ "-use-the-force-luke=4gms", "-speed=1", "-R" ] elif output == "iso": self.name = _("Create DVD-ISO") - tool = "/usr/bin/mkisofs" + tool = "genisoimage" isopathfile = getISOfilename(self.project.settings.isopath.getValue(), volName) burnargs = [ "-o", isopathfile ] burnargs += [ "-dvd-video", "-publisher", "Dreambox", "-V", volName, self.workspace + "/dvd" ] @@ -920,14 +920,14 @@ class DVDdataJob(Job): output = self.project.settings.output.getValue() volName = self.project.settings.name.getValue() - tool = "/bin/growisofs" + tool = "growisofs" if output == "dvd": self.name = _("Burn DVD") burnargs = [ "-Z", "/dev/" + harddiskmanager.getCD(), "-dvd-compat" ] if self.project.size/(1024*1024) > self.project.MAX_SL: burnargs += [ "-use-the-force-luke=4gms", "-speed=1", "-R" ] elif output == "iso": - tool = "/usr/bin/mkisofs" + tool = "genisoimage" self.name = _("Create DVD-ISO") isopathfile = getISOfilename(self.project.settings.isopath.getValue(), volName) burnargs = [ "-o", isopathfile ] @@ -959,5 +959,5 @@ class DVDisoJob(Job): if getSize(imagepath)/(1024*1024) > self.project.MAX_SL: burnargs += [ "-use-the-force-luke=4gms", "-speed=1", "-R" ] burnargs += [ "-dvd-video", "-publisher", "Dreambox", "-V", volName, imagepath ] - tool = "/bin/growisofs" + tool = "growisofs" BurnTask(self, burnargs, tool) diff --git a/lib/python/Plugins/Extensions/DVDPlayer/Makefile.am b/lib/python/Plugins/Extensions/DVDPlayer/Makefile.am index d1a995ca..71ea7142 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/Makefile.am +++ b/lib/python/Plugins/Extensions/DVDPlayer/Makefile.am @@ -4,7 +4,6 @@ SUBDIRS = src meta installdir = $(pkglibdir)/python/Plugins/Extensions/DVDPlayer install_PYTHON = \ - src/servicedvd.so \ __init__.py \ plugin.py \ keymap.xml \ diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py index 6e4d9cc6..e092e82f 100755 --- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py @@ -93,7 +93,7 @@ class DVDSummary(Screen): Name - + Position diff --git a/lib/python/Plugins/Extensions/DVDPlayer/src/Makefile.am b/lib/python/Plugins/Extensions/DVDPlayer/src/Makefile.am index 774871e8..27c751cf 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/src/Makefile.am +++ b/lib/python/Plugins/Extensions/DVDPlayer/src/Makefile.am @@ -2,6 +2,11 @@ OBJS := servicedvd.cpp -include $(OBJS:.cpp=.d) +installdir = $(pkglibdir)/python/Plugins/Extensions/DVDPlayer + +install_PYTHON = \ + servicedvd.so + servicedvd.so: $(CXX) $(CPPFLAGS) -MD $(CXXFLAGS) $(DEFS) -I$(top_srcdir)/include \ -Wall -W $(OBJS) -shared -fPIC -Wl,-soname,servicedvd.so -o servicedvd.so \ diff --git a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp index 0372c497..2ba53927 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp +++ b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp @@ -85,12 +85,9 @@ RESULT eServiceFactoryDVD::offlineOperations(const eServiceReference &, ePtr 0: @@ -76,6 +76,7 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen): print "Creating setup" self.list = [ ] + self.multiType = None self.configMode = None self.diseqcModeEntry = None self.advancedSatsEntry = None @@ -94,6 +95,11 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen): self.advancedType = None self.advancedManufacturer = None self.advancedSCR = None + + if self.nim.isMultiType(): + multiType = self.nimConfig.multiType + self.multiType = getConfigListEntry(_("Tuner type"), multiType) + self.list.append(self.multiType) if self.nim.isCompatible("DVB-S"): self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode) @@ -200,10 +206,17 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen): self.advancedLnbsEntry, self.advancedDiseqcMode, self.advancedUsalsEntry, \ self.advancedLof, self.advancedPowerMeasurement, self.turningSpeed, \ self.advancedType, self.advancedSCR, self.advancedManufacturer, self.advancedUnicable, \ - self.uncommittedDiseqcCommand, self.cableScanType) + self.uncommittedDiseqcCommand, self.cableScanType, self.multiType) + if self["config"].getCurrent() == self.multiType: + nimmanager.enumerateNIMs() + from Components.NimManager import InitNimManager + InitNimManager(nimmanager) + self.nim = nimmanager.nim_slots[self.slotid] + self.nimConfig = self.nim.config for x in checkList: if self["config"].getCurrent() == x: self.createSetup() + break def run(self): if self.have_advanced and self.nim.config_mode == "advanced": @@ -482,20 +495,28 @@ class NimSelection(Screen): "satposdepends": _("second cable of motorized LNB") } [nimConfig.configMode.value] text += " " + _("Tuner") + " " + ["A", "B", "C", "D"][int(nimConfig.connectedTo.value)] elif nimConfig.configMode.value == "nothing": - text = _("nothing connected") + text = _("not configured") elif nimConfig.configMode.value == "simple": if nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"): - text = _("Sats") + ": " + text = {"single": _("Single"), "toneburst_a_b": _("Toneburst A/B"), "diseqc_a_b": _("DiSEqC A/B"), "diseqc_a_b_c_d": _("DiSEqC A/B/C/D")}[nimConfig.diseqcMode.value] + "\n" + text += _("Sats") + ": " + satnames = [] if nimConfig.diseqcA.orbital_position != 3601: - text += nimmanager.getSatName(int(nimConfig.diseqcA.value)) + satnames.append(nimmanager.getSatName(int(nimConfig.diseqcA.value))) if nimConfig.diseqcMode.value in ("toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"): if nimConfig.diseqcB.orbital_position != 3601: - text += "," + nimmanager.getSatName(int(nimConfig.diseqcB.value)) + satnames.append(nimmanager.getSatName(int(nimConfig.diseqcB.value))) if nimConfig.diseqcMode.value == "diseqc_a_b_c_d": if nimConfig.diseqcC.orbital_position != 3601: - text += "," + nimmanager.getSatName(int(nimConfig.diseqcC.value)) + satnames.append(nimmanager.getSatName(int(nimConfig.diseqcC.value))) if nimConfig.diseqcD.orbital_position != 3601: - text += "," + nimmanager.getSatName(int(nimConfig.diseqcD.value)) + satnames.append(nimmanager.getSatName(int(nimConfig.diseqcD.value))) + if len(satnames) <= 2: + text += ", ".join(satnames) + elif len(satnames) > 2: + # we need a newline here, since multi content lists don't support automtic line wrapping + text += ", ".join(satnames[:2]) + ",\n" + text += " " + ", ".join(satnames[2:]) elif nimConfig.diseqcMode.value == "positioner": text = _("Positioner") + ":" if nimConfig.positionerMode.value == "usals": @@ -511,6 +532,8 @@ class NimSelection(Screen): text = _("nothing connected") elif nimConfig.configMode.value == "enabled": text = _("enabled") + if x.isMultiType(): + text = _("Switchable tuner types:") + "(" + ','.join(x.getMultiTypeList().values()) + ")" + "\n" + text self.list.append((slotid, x.friendly_full_description, text, x)) self["nimlist"].setList(self.list) diff --git a/lib/python/Screens/ScanSetup.py b/lib/python/Screens/ScanSetup.py index fa787a70..1dbc1505 100644 --- a/lib/python/Screens/ScanSetup.py +++ b/lib/python/Screens/ScanSetup.py @@ -138,7 +138,8 @@ class CableTransponderSearchSupport: "QAM128" : parm.Modulation_QAM128, "QAM256" : parm.Modulation_QAM256 } inv = { "INVERSION_OFF" : parm.Inversion_Off, - "INVERSION_ON" : parm.Inversion_On } + "INVERSION_ON" : parm.Inversion_On, + "INVERSION_AUTO" : parm.Inversion_Unknown } fec = { "FEC_AUTO" : parm.FEC_Auto, "FEC_1_2" : parm.FEC_1_2, "FEC_2_3" : parm.FEC_2_3, diff --git a/lib/python/Screens/TimerEntry.py b/lib/python/Screens/TimerEntry.py index b231b568..64fa9f19 100644 --- a/lib/python/Screens/TimerEntry.py +++ b/lib/python/Screens/TimerEntry.py @@ -106,10 +106,11 @@ class TimerEntry(Screen, ConfigListScreen): self.timerentry_tagsset = ConfigSelection(choices = [not self.timerentry_tags and "None" or " ".join(self.timerentry_tags)]) self.timerentry_repeated = ConfigSelection(default = repeated, choices = [("daily", _("daily")), ("weekly", _("weekly")), ("weekdays", _("Mon-Fri")), ("user", _("user defined"))]) - + self.timerentry_date = ConfigDateTime(default = self.timer.begin, formatstring = _("%d.%B %Y"), increment = 86400) self.timerentry_starttime = ConfigClock(default = self.timer.begin) self.timerentry_endtime = ConfigClock(default = self.timer.end) + self.timerentry_showendtime = ConfigSelection(default = ((self.timer.end - self.timer.begin) > 4), choices = [(True, _("yes")), (False, _("no"))]) default = self.timer.dirname or defaultMoviePath() tmp = config.movielist.videodirs.value @@ -172,11 +173,14 @@ class TimerEntry(Screen, ConfigListScreen): self.entryStartTime = getConfigListEntry(_("StartTime"), self.timerentry_starttime) self.list.append(self.entryStartTime) - if self.timerentry_justplay.value != "zap": - self.entryEndTime = getConfigListEntry(_("EndTime"), self.timerentry_endtime) + + self.entryShowEndTime = getConfigListEntry(_("Set End Time"), self.timerentry_showendtime) + if self.timerentry_justplay.value == "zap": + self.list.append(self.entryShowEndTime) + self.entryEndTime = getConfigListEntry(_("EndTime"), self.timerentry_endtime) + if self.timerentry_justplay.value != "zap" or self.timerentry_showendtime.value: self.list.append(self.entryEndTime) - else: - self.entryEndTime = None + self.channelEntry = getConfigListEntry(_("Channel"), self.timerentry_service) self.list.append(self.channelEntry) @@ -194,11 +198,7 @@ class TimerEntry(Screen, ConfigListScreen): def newConfig(self): print "newConfig", self["config"].getCurrent() - if self["config"].getCurrent() == self.timerTypeEntry: - self.createSetup("config") - if self["config"].getCurrent() == self.timerJustplayEntry: - self.createSetup("config") - if self["config"].getCurrent() == self.frequencyEntry: + if self["config"].getCurrent() in (self.timerTypeEntry, self.timerJustplayEntry, self.frequencyEntry, self.entryShowEndTime): self.createSetup("config") def keyLeft(self): @@ -268,6 +268,9 @@ class TimerEntry(Screen, ConfigListScreen): self.timer.name = self.timerentry_name.value self.timer.description = self.timerentry_description.value self.timer.justplay = self.timerentry_justplay.value == "zap" + if self.timerentry_justplay.value == "zap": + if not self.timerentry_showendtime.value: + self.timerentry_endtime.value = self.timerentry_starttime.value self.timer.resetRepeated() self.timer.afterEvent = { "nothing": AFTEREVENT.NONE, diff --git a/po/Makefile.am b/po/Makefile.am index 9ca79016..ba044409 100755 --- a/po/Makefile.am +++ b/po/Makefile.am @@ -9,11 +9,13 @@ LANGS := $(shell cat $(srcdir)/LINGUAS) LANGPO := $(foreach LANG, $(LANGS),$(LANG).po) LANGMO := $(foreach LANG, $(LANGS),$(LANG).mo) -default: enigma2.pot $(LANGPO) merge $(LANGMO) +default: enigma2.pot $(LANGMO) for lang in $(LANGS); do \ mkdir -p $$lang/LC_MESSAGES; \ cp $$lang.mo $$lang/LC_MESSAGES/enigma2.mo; \ done + +rebuild: clean cleanall enigma2.pot $(LANGPO) merge default merge: for lang in $(LANGS); do \ @@ -37,9 +39,6 @@ enigma2.pot: $(RM) enigma2.pot mv enigma2uniq.pot enigma2.pot -.PHONY: enigma2.pot - - %.mo: %.po $(MSGFMT) -o $@ $< @@ -48,6 +47,9 @@ enigma2.pot: CLEANFILES = $(foreach LANG, $(LANGS),$(LANG).mo) +cleanall: + $(RM) enigma2.pot + clean-local: $(RM) -r $(LANGS)