예제 #1
0
 def showMyInfo(self):
     loggedIn = tfctv.isLoggedIn()
     message = control.lang(57002)
     if loggedIn == True:
         try:
             user = tfctv.getUserInfo()
             message = 'First name: %s\nLast name: %s\nEmail: %s\nState: %s\nCountry: %s\nMember since: %s\n\n' % (
                 user.get('firstName', ''), user.get('lastName', ''),
                 user.get('email', ''), user.get('state', ''),
                 user.get('country', ''), user.get('memberSince', ''))
         except:
             pass
     control.showMessage(message, control.lang(56001))
예제 #2
0
    def showMainMenu(self):
        self.addDirectoryItem(control.lang(50204),
                              '/',
                              config.SEARCHMENU,
                              control.addonFolderIcon(control.lang(50204)),
                              isFolder=True,
                              **self.formatMenu())

        # if not logged in, ask to log in
        if control.setting('emailAddress') != '':
            tfctv.checkAccountChange()
            if tfctv.isLoggedIn() == False:
                if (control.confirm(control.lang(57007),
                                    line1=control.lang(57008) %
                                    control.setting('emailAddress'))):
                    (account, logged) = tfctv.checkAccountChange(True)
            elif control.setting('displayMyList') == 'true':
                self.addDirectoryItem(control.lang(50200),
                                      '/',
                                      config.MYLIST,
                                      control.addonFolderIcon(
                                          control.lang(50200)),
                                      isFolder=True,
                                      **self.formatMenu())

        if control.setting('displayWebsiteSections') == 'true':
            self.addDirectoryItem(control.lang(50201),
                                  '/',
                                  config.CATEGORIES,
                                  control.addonFolderIcon(control.lang(50201)),
                                  isFolder=True,
                                  **self.formatMenu())
        else:
            self.showCategories()

        if control.setting('displayWebsiteSections') == 'true':
            control.showNotification(control.lang(57020), control.lang(50008))
            sections = tfctv.getWebsiteHomeSections()
            for s in sections:
                self.addDirectoryItem(s['name'].title(),
                                      str(s['id']),
                                      config.SECTIONCONTENT,
                                      control.addonFolderIcon(
                                          s['name'].title()),
                                      isFolder=True,
                                      **self.formatMenu())

        if control.setting(
                'displayMyAccountMenu'
        ) == 'true' and control.setting('emailAddress') != '':
            self.addDirectoryItem(control.lang(50202),
                                  '/',
                                  config.MYACCOUNT,
                                  control.addonFolderIcon(control.lang(50202)),
                                  isFolder=True,
                                  **self.formatMenu())

        if control.setting('exportToLibrary') == 'true':
            self.addDirectoryItem(control.lang(56023),
                                  '/',
                                  config.EXPORTEDSHOWS,
                                  control.addonFolderIcon(control.lang(56023)),
                                  isFolder=True,
                                  **self.formatMenu())

        if control.setting('displayTools') == 'true':
            self.addDirectoryItem(control.lang(50203), '/', config.TOOLS,
                                  control.addonFolderIcon(control.lang(50203)))

        self.endDirectory()

        if tfctv.isLoggedIn() == False:
            control.infoDialog(control.lang(57017),
                               control.lang(50002),
                               time=8000)