mirror of
				https://github.com/MCV-Software/TWBlue.git
				synced 2025-11-03 21:37:05 +00:00 
			
		
		
		
	Removed output, time tests.
This commit is contained in:
		@@ -13,7 +13,6 @@ import output
 | 
				
			|||||||
system = platform.system()
 | 
					system = platform.system()
 | 
				
			||||||
from mysc.repeating_timer import RepeatingTimer
 | 
					from mysc.repeating_timer import RepeatingTimer
 | 
				
			||||||
import application
 | 
					import application
 | 
				
			||||||
import time
 | 
					 | 
				
			||||||
URLPlayer = None
 | 
					URLPlayer = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def setup():
 | 
					def setup():
 | 
				
			||||||
@@ -136,22 +135,16 @@ class URLStream(object):
 | 
				
			|||||||
    log.debug("played")
 | 
					    log.debug("played")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 def is_playable(self, url,play=False,volume=1.0):
 | 
					 def is_playable(self, url,play=False,volume=1.0):
 | 
				
			||||||
  print "Playability test invoked."
 | 
					 | 
				
			||||||
  start=time.time()
 | 
					 | 
				
			||||||
  try:
 | 
					  try:
 | 
				
			||||||
   log.debug("Checking URL playability...")
 | 
					   log.debug("Checking URL playability...")
 | 
				
			||||||
   self.prepare(url)
 | 
					   self.prepare(url)
 | 
				
			||||||
   if self.prepared == True:
 | 
					   if self.prepared == True:
 | 
				
			||||||
    stream=sound_lib.stream.URLStream(url=self.url)
 | 
					    stream=sound_lib.stream.URLStream(url=self.url)
 | 
				
			||||||
    end=time.time()
 | 
					 | 
				
			||||||
    print "is_playable algo took",end-start,"seconds."
 | 
					 | 
				
			||||||
    if play:
 | 
					    if play:
 | 
				
			||||||
     return self.play(stream=stream,volume=volume)
 | 
					     return self.play(stream=stream,volume=volume)
 | 
				
			||||||
    return True
 | 
					    return True
 | 
				
			||||||
  except:
 | 
					  except:
 | 
				
			||||||
   log.exception("Exception.")
 | 
					   log.exception("Exception.")
 | 
				
			||||||
   end=time.time()
 | 
					 | 
				
			||||||
   print "is_playable algo took",end-start,"seconds."
 | 
					 | 
				
			||||||
   return False
 | 
					   return False
 | 
				
			||||||
 def stop_audio(self):
 | 
					 def stop_audio(self):
 | 
				
			||||||
  if hasattr(self, "stream") and self.stream.is_playing == True:
 | 
					  if hasattr(self, "stream") and self.stream.is_playing == True:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,7 +45,6 @@ def find_next_reply(id, listItem):
 | 
				
			|||||||
 return None
 | 
					 return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def is_audio(tweet,force=False):
 | 
					def is_audio(tweet,force=False):
 | 
				
			||||||
 start=time.time()
 | 
					 | 
				
			||||||
 if force == False and 'is_audio' in tweet:
 | 
					 if force == False and 'is_audio' in tweet:
 | 
				
			||||||
  return tweet['is_audio']
 | 
					  return tweet['is_audio']
 | 
				
			||||||
 try:
 | 
					 try:
 | 
				
			||||||
@@ -64,14 +63,10 @@ def is_audio(tweet,force=False):
 | 
				
			|||||||
  if config.app["app-settings"]["use_modern_audio_algo"]:
 | 
					  if config.app["app-settings"]["use_modern_audio_algo"]:
 | 
				
			||||||
   for u in find_urls(tweet):
 | 
					   for u in find_urls(tweet):
 | 
				
			||||||
    if url_is_audio(u):
 | 
					    if url_is_audio(u):
 | 
				
			||||||
     end=time.time()
 | 
					 | 
				
			||||||
     print "Codeofdusk algo took",end-start,"seconds."
 | 
					 | 
				
			||||||
     tweet['is_audio']=True
 | 
					     tweet['is_audio']=True
 | 
				
			||||||
     return True
 | 
					     return True
 | 
				
			||||||
 except:
 | 
					 except:
 | 
				
			||||||
  log.exception("Exception while executing is_audio Codeofdusk algorithm.")
 | 
					  log.exception("Exception while executing is_audio Codeofdusk algorithm.")
 | 
				
			||||||
 end=time.time()
 | 
					 | 
				
			||||||
 print "Codeofdusk algo took",end-start,"seconds."
 | 
					 | 
				
			||||||
 tweet['is_audio']=False
 | 
					 tweet['is_audio']=False
 | 
				
			||||||
 if len(tweet["entities"]["hashtags"]) > 0:
 | 
					 if len(tweet["entities"]["hashtags"]) > 0:
 | 
				
			||||||
  for i in tweet["entities"]["hashtags"]:
 | 
					  for i in tweet["entities"]["hashtags"]:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user