コード例 #1
0
ファイル: new_message.py プロジェクト: RN3ARA/TheQube
 def update_url_buttons (self):
  if hasattr(self, 'shorten') and hasattr(self,'unshorten'):
   if misc.find_urls(self.message.GetValue()):
    self.shorten.Enable()
    self.unshorten.Enable()
   else:
    self.shorten.Disable()
    self.unshorten.Disable()
コード例 #2
0
ファイル: new_message.py プロジェクト: wafiqtaher/TheQube
 def update_url_buttons(self):
     if hasattr(self, 'shorten') and hasattr(self, 'unshorten'):
         if misc.find_urls(self.message.GetValue()):
             self.shorten.Enable()
             self.unshorten.Enable()
         else:
             self.shorten.Disable()
             self.unshorten.Disable()
コード例 #3
0
ファイル: new_message.py プロジェクト: RN3ARA/TheQube
 def GetURLList(self):
  urls = []
  tweet = self.message.GetValue()
  # If there is a reasonable selection of no more than 1 word, add it to the urls list.
  # selecting sometimes includes prior or subsequent spaces; remove.
  sel = self.message.GetStringSelection().strip()
  logging.debug("len sel: %s, len tweet: %s, sel: %s, tweet: %s" % (len(sel), len(tweet), sel, tweet))
  # useful selection, not multi-word, not bit.ly
  if len(sel) > 3 and " " not in sel and "bit.ly" not in sel:
   logging.debug("Adding selection as URL: %s" % (sel))
   urls.append(sel)
  # Find URLs from tweet.
  urls.extend(misc.find_urls(tweet))
  return urls
コード例 #4
0
ファイル: new_message.py プロジェクト: wafiqtaher/TheQube
 def GetURLList(self):
     urls = []
     tweet = self.message.GetValue()
     # If there is a reasonable selection of no more than 1 word, add it to the urls list.
     # selecting sometimes includes prior or subsequent spaces; remove.
     sel = self.message.GetStringSelection().strip()
     logging.debug("len sel: %s, len tweet: %s, sel: %s, tweet: %s" %
                   (len(sel), len(tweet), sel, tweet))
     # useful selection, not multi-word
     if len(sel) > 3 and " " not in sel:
         logging.debug("Adding selection as URL: %s" % (sel))
         urls.append(sel)
     # Find URLs from tweet.
     urls.extend(misc.find_urls(tweet))
     return urls
コード例 #5
0
ファイル: messages.py プロジェクト: Piciok/TheQube
 def get_urls(self, index=None, item=None):
  try:
   urls = misc.find_urls(self.get_text(index, item))
  except:
   urls = []
  return urls