+
+
+ def getPageWebClient(self, url, contextFactory=None, *args, **kwargs):
+ """
+ Download a web page as a string.
+
+ COPY OF twisted.web.client.getPage to store the factory
+
+ Download a page. Return a deferred, which will callback with a
+ page (as a string) or errback with a description of the error.
+
+ See L{HTTPClientFactory} to see what extra arguments can be passed.
+ """
+ self.httpGetterFactory = _makeGetterFactory(
+ url,
+ HTTPClientFactory,
+ contextFactory=contextFactory,
+ *args, **kwargs)
+ return self.httpGetterFactory.deferred
+
+ def loadStaticConfig(self):
+ """
+ Always try to load the static config file from
+ /etc/enigma2/curlytx-pagefeed.xml
+ """
+ staticFeedPath = Directories.resolveFilename(Directories.SCOPE_CONFIG, self.staticPageFeedFile)
+ if not os.path.exists(staticFeedPath):
+ return
+
+ from AtomFeed import AtomFeed
+ AtomFeed(
+ 'file://' + staticFeedPath,
+ self.saveStaticConfig, self.loadStaticConfigFail
+ )
+
+ def loadStaticConfigFail(self, errorMessage):
+ """ Loading the page url feed failed somehow """
+ from Screens.MessageBox import MessageBox
+ self.session.open(
+ MessageBox,
+ _("Error loading page feed:") + "\n\n" + str(errorMessage),
+ type = MessageBox.TYPE_ERROR
+ )
+
+ def saveStaticConfig(self, pages, settings):
+ feedPagesToConfig(pages)
+ feedSettingsToConfig(settings)
+ savePageConfig()
+ self.loadButtons()