def __init__(self, dialog): Ui_MainWindow.__init__(self) # try: # requests.get('https://www.google.com') # print('google') # except: # self.DisplayMessagebox(title='Cant Connect',text='please check your internet connection') # exit() self.setupUi(dialog) # Article scroll area init self.articleList = [] self.articleGBox, self.articleGLayout = self.InitArticleScrollarea() # Sources scroll area init self.sourceList = [] self.sourceGBox, self.sourceGLayout = self.InitSourceScrollarea() self.currentSourceId = "" # Following scroll area init self.followingList = [] self.followingGBox, self.followingGLayout = self.InitFollowScrollarea() self.LoadFollowed() # Get the all avaliable sources self.InsertSources(jsonRes=self.LoadSources( sourcesUrl="https://newsapi.org/v1/sources?language=en").json()) # Get apikey self.apiKey = self.GetApiKey('api.txt') # Event handler init self.MainPage() self.InputManager()
def __init__(self, dialog): Ui_MainWindow.__init__(self) self.setupUi(dialog) # Article scroll area init self.articleList = [] self.articleGBox, self.articleGLayout = self.InitArticleScrollarea() # Sources scroll area init self.sourceList = [] self.sourceGBox, self.sourceGLayout = self.InitSourceScrollarea() self.currentSourceId = "" # Following scroll area init self.followingList = [] self.followingGBox, self.followingGLayout = self.InitFollowScrollarea() self.LoadFollowed() # Get the all avaliable sources self.InsertSources(jsonRes=self.LoadSources( sourcesUrl="https://newsapi.org/v1/sources?language=en").json()) # Get apikey self.apiKey = self.GetApiKey('api.txt') # Event handler init self.MainPage() self.InputManager()