def start(twitterhash=None):
	if twitterhash == None:
		if os.path.exists(tweet_file):
			twitter_data = json.loads(ssutils.read_file(tweet_file))
			twitterhash = twitter_data["hash"]
			twitter_mediafile = twitter_data["file"]
			if twitter_mediafile == xbmc.getInfoLabel('Player.Filenameandpath'):
				userInput = False
				main = detailsDialog('script-matchcenter-Twitter.xml', addon_path, getskinfolder(), '', hash=twitterhash)
				main.doModal()
				del main
			else:
				userInput = True
		else:
			userInput = True

		if userInput:
			dialog = xbmcgui.Dialog()
			twitterhash = dialog.input(translate(32046), type=xbmcgui.INPUT_ALPHANUM)
			if len(twitterhash) != 0:
				main = detailsDialog('script-matchcenter-Twitter.xml', addon_path, getskinfolder(), '', hash=twitterhash.replace("#",""))
				if xbmc.getCondVisibility("Player.HasMedia") and save_hashes_during_playback == 'true':
					main.savecurrenthash()
				main.doModal()
				del main
			else:
				xbmcgui.Dialog().ok(translate(32000), translate(32047))
				mainmenu.start()
	else:
		main = detailsDialog('script-matchcenter-Twitter.xml', addon_path, getskinfolder(), '', hash=twitterhash)
		main.doModal()
		del main	
Exemple #2
0
def start(twitterhash=None, standalone=False):
    if not twitterhash:
        userInput = True
        if os.path.exists(tweet_file):
            twitter_data = json.loads(FileIO.fileread(tweet_file))
            twitterhash = twitter_data["hash"]
            twitter_mediafile = twitter_data["file"]
            if twitter_mediafile == xbmc.getInfoLabel('Player.Filenameandpath'):
                userInput = False
    else:
        userInput = False

    if userInput:
        dialog = xbmcgui.Dialog()
        twitterhash = dialog.input(translate(32046), type=xbmcgui.INPUT_ALPHANUM)
        if len(twitterhash) != 0:
            twitterhash = twitterhash.replace("#", "")
        else:
            xbmcgui.Dialog().ok(translate(32000), translate(32047))
            mainmenu.start()

    if twitterhash:
        # Save twitter hashtag
        if twitter_history_enabled == 'true':
            tweet.add_hashtag_to_twitter_history(twitterhash)
        if xbmc.getCondVisibility("Player.HasMedia") and save_history_during_playback == 'true':
            tweet.savecurrenthash(twitterhash)

        main = TwitterDialog('script-sinaweibo-Twitter.xml', addon_path, getskinfolder(), '', hash=twitterhash,
                             standalone=standalone)
        main.doModal()
        del main
Exemple #3
0
def start(twitterhash=None, standalone=False):
	if not twitterhash:
		userInput = True
		if os.path.exists(tweet_file):
			twitter_data = json.loads(FileIO.fileread(tweet_file))
			twitterhash = twitter_data["hash"]
			twitter_mediafile = twitter_data["file"]
			if twitter_mediafile == xbmc.getInfoLabel('Player.Filenameandpath'):
				userInput = False
	else:
		userInput = False

	if userInput:
		dialog = xbmcgui.Dialog()
		twitterhash = dialog.input(translate(32046), type=xbmcgui.INPUT_ALPHANUM)
		if len(twitterhash) != 0:
			twitterhash = twitterhash.replace("#","")
		else:
			xbmcgui.Dialog().ok(translate(32000), translate(32047))
			mainmenu.start()

	if twitterhash:
		#Save twitter hashtag
		if twitter_history_enabled == 'true':
			tweet.add_hashtag_to_twitter_history(twitterhash)
		if xbmc.getCondVisibility("Player.HasMedia") and save_hashes_during_playback == 'true':
			tweet.savecurrenthash(twitterhash)
		
		main = TwitterDialog('script-matchcenter-Twitter.xml', addon_path, getskinfolder(), '', hash=twitterhash, standalone=standalone)
		main.doModal()
		del main
Exemple #4
0
def start(twitterhash=None):
    if twitterhash == None:
        if os.path.exists(tweet_file):
            twitter_data = json.loads(ssutils.read_file(tweet_file))
            twitterhash = twitter_data["hash"]
            twitter_mediafile = twitter_data["file"]
            if twitter_mediafile == xbmc.getInfoLabel(
                    'Player.Filenameandpath'):
                userInput = False
                main = detailsDialog('script-matchcenter-Twitter.xml',
                                     addon_path,
                                     'default',
                                     '',
                                     hash=twitterhash)
                main.doModal()
                del main
            else:
                userInput = True
        else:
            userInput = True

        if userInput:
            dialog = xbmcgui.Dialog()
            twitterhash = dialog.input(translate(32046),
                                       type=xbmcgui.INPUT_ALPHANUM)
            if len(twitterhash) != 0:
                main = detailsDialog('script-matchcenter-Twitter.xml',
                                     addon_path,
                                     'default',
                                     '',
                                     hash=twitterhash.replace("#", ""))
                if xbmc.getCondVisibility(
                        "Player.HasMedia"
                ) and save_hashes_during_playback == 'true':
                    main.savecurrenthash()
                main.doModal()
                del main
            else:
                xbmcgui.Dialog().ok(translate(32000), translate(32047))
                mainmenu.start()
    else:
        main = detailsDialog('script-matchcenter-Twitter.xml',
                             addon_path,
                             'default',
                             '',
                             hash=twitterhash)
        main.doModal()
        del main
def menu():
    print("**WELCOME**")
    print()

    choice = input("""
                      A: Start Playing Game
                      B: Instructions
                      C: Quit
                      please enter your choice:""")
    if choice == "A" or choice == "a":
        import mainmenu
        mainmenu.start()
    elif choice == "B" or choice == "b":
        import instruction
        instruction.help()
    elif choice == "c" or choice == "C":
        sys.exit
    else:
        print("You must enter A or B")
        print("Please try again")
Exemple #6
0
	def onAction(self,action):
		if action.getId() == 10 or action.getId() == 92:
			self.close()
			mainmenu.start()
Exemple #7
0
 def stopRunning(self):
     self.isRunning = False
     self.close()
     mainmenu.start()
	def stopRunning(self):
		self.isRunning = False
		self.close()
		mainmenu.start()
 def stopRunning(self):
     self.isRunning = False
     self.close()
     if not self.standalone:
         mainmenu.start()
Exemple #10
0
	def onAction(self,action):
		if action.getId() == 10 or action.getId() == 92:
			self.close()
			mainmenu.start()
	def onAction(self,action):
		if action.getId() == 10 or action.getId() == 92:
			self.close()
			if not self.standalone:
				mainmenu.start()
Exemple #12
0
	def stopRunning(self):
		self.isRunning = False
		self.close()
		if not self.standalone:
			mainmenu.start()
Exemple #13
0
 def onAction(self, action):
     if action.getId() == 10 or action.getId() == 92:
         self.close()
         if not self.standalone:
             mainmenu.start()