Beispiel #1
0
	def activate(self, leaf):
		# Send in UTF-8 encoding
		lang_code = __kupfer_settings__["lang"]
		search_url="http://%s.wikipedia.org/w/index.php?title=Special:Search&go=Go" % lang_code
		# will encode search=text, where `text` is escaped
		query_url = search_url + "&" + urllib.urlencode({"search": leaf.object})
		utils.show_url(query_url)
Beispiel #2
0
 def activate(self, leaf):
     """Called when item is selected via Enter/click"""
     entry = id2data[leaf.id2key]
     if _settings_key(leaf.id2key) in __kupfer_settings__:
         url_prefix = __kupfer_settings__[_settings_key(leaf.id2key)]
     else:
         url_prefix = entry["url"]
     utils.show_url(url_prefix + entry["part"])
Beispiel #3
0
 def activate(self, leaf):
     # Send in UTF-8 encoding
     lang_code = __kupfer_settings__["lang"]
     search_url = "http://%s.wikipedia.org/w/index.php?title=Special:Search&go=Go" % lang_code
     # will encode search=text, where `text` is escaped
     query_url = search_url + "&" + urllib.urlencode(
         {"search": leaf.object})
     utils.show_url(query_url)
Beispiel #4
0
    def activate(self, leaf):
        # Send in UTF-8 encoding
        lang_code = __kupfer_settings__["lang"]

        search_url = "http://www.google.se/#hl=%s&tbs=dfn:1" % lang_code
        # will encode search=text, where `text` is escaped
        query_url = search_url + "&" + urllib.urlencode({"q": leaf.object})
        utils.show_url(query_url)
def run_command(typ, action_data, leaf_data):
	"""Run command. Called from actions"""
	if typ == 'command':
		cmd = substitute(action_data['cmd'], leaf_data)
		env = action_data['env']
		utils.launch_commandline(cmd)
	elif typ == 'uri':
		uri = substitute(action_data['uri'], leaf_data)
		utils.show_url(uri)
Beispiel #6
0
 def activate(self, item):
     url = None
     if is_issue(item):
         i = get_issue(item, self.jira)
         url = i.permalink()
     else:
         p = get_project(item, self.jira)
         url = __kupfer_settings__['jira_url'] + \
             '/projects/' + p.key + '/summary'
     show_url(url)
Beispiel #7
0
 def activate(self, obj, ctx=None):
     utils.show_url(obj.object)
Beispiel #8
0
 def activate(self, leaf):
     language = __kupfer_settings__["language"]
     query_url = "https://www.youtube.com/results?search_query=" + leaf.object + "+trailer+" + language
     utils.show_url(query_url)
Beispiel #9
0
 def activate(self, leaf):
     engine = __kupfer_settings__["search_engine"]
     query_url = URLS[engine] + "?" + urllib.parse.urlencode(
         {"q": leaf.object})
     utils.show_url(query_url)
Beispiel #10
0
	def activate(self, leaf):
		email = email_from_leaf(leaf)
		utils.show_url("mailto:%s" % email)
Beispiel #11
0
	def activate_multiple(self, objects):
		recipients = ",".join(email_from_leaf(L) for L in objects)
		url = "mailto:" + recipients
		utils.show_url(url)
Beispiel #12
0
 def activate(self, obj, ctx=None):
     utils.show_url(obj.object)
 def activate(self, leaf):
     url = LINK.format(leaf.currier, leaf.code)
     show_url(url)
Beispiel #14
0
	def __call__(self, *args):
		from kupfer import utils, version
		utils.show_url(version.WEBSITE)
		raise IgnoreResultException
Beispiel #15
0
 def activate(self, leaf):
     url = LINK.format(leaf.currier, leaf.code)
     show_url(url)
Beispiel #16
0
	def activate(self, leaf):
		url = is_url(leaf.object)
		utils.show_url(url)
Beispiel #17
0
 def activate(self, leaf, email_leaf=None):
     if email_leaf:
         email = email_leaf.object
         utils.show_url("mailto:%s" % email)
Beispiel #18
0
def show_help(ctxenv=None):
    """
    Show Kupfer help pages, if possible
    """
    if not utils.show_help_url("ghelp:%s" % version.PACKAGE_NAME):
        utils.show_url(version.HELP_WEBSITE)
Beispiel #19
0
def show_help(ctxenv=None):
	"""
	Show Kupfer help pages, if possible
	"""
	if not utils.show_help_url("ghelp:%s" % version.PACKAGE_NAME):
		utils.show_url(version.HELP_WEBSITE)
Beispiel #20
0
def show_help():
	"""
	Show Kupfer help pages, if possible
	"""
	utils.show_url(version.WEBSITE)
Beispiel #21
0
def _do_search_engine(terms, search_url, encoding="UTF-8"):
    """Show an url searching for @search_url with @terms"""
    utils.show_url(_query_url(terms, search_url))
Beispiel #22
0
	def open_url(self, url):
		utils.show_url(url)
Beispiel #23
0
 def open_url(self, url):
     utils.show_url(url)
Beispiel #24
0
	def activate(self, obj):
		url = GMAIL_EDIT_CONTACT_URL % dict(contact=obj.google_contact_id)
		utils.show_url(url)
Beispiel #25
0
 def activate(self, leaf):
     show_url(to_correios_url(leaf))
Beispiel #26
0
 def activate_multiple(self, objects):
     recipients = ",".join(
         urllib.quote(email_from_leaf(L)) for L in objects)
     url = GMAIL_NEW_MAIL_URL % dict(emails=recipients)
     utils.show_url(url)
Beispiel #27
0
 def activate(self, leaf, email_leaf=None):
     if email_leaf:
         email = email_leaf.object
         utils.show_url("mailto:%s" % email)
Beispiel #28
0
 def activate(self, leaf):
     url = is_url(leaf.object)
     utils.show_url(url)
Beispiel #29
0
	def activate(self, leaf):
		search_url = "https://duckduckgo.com/"
		query_url = search_url + "?" + urllib.urlencode({"q" : leaf.object})
		utils.show_url(query_url)
Beispiel #30
0
 def activate(self, leaf):
     query_url = "http://" + leaf.object
     utils.show_url(query_url)
Beispiel #31
0
def _do_search_engine(terms, search_url, encoding="UTF-8"):
    """Show an url searching for @search_url with @terms"""
    query_url = search_url.replace("{searchTerms}", _urlencode(terms))
    utils.show_url(query_url)
Beispiel #32
0
	def activate(self, obj, iobj):
		filepath = obj.object
		email = email_from_leaf(iobj)
		# FIXME: revisit for unicode email addresses
		url = "mailto:%s?attach=%s" % (email, filepath)
		utils.show_url(url)
Beispiel #33
0
 def activate(self, obj):
     url = GMAIL_EDIT_CONTACT_URL % dict(contact=obj.google_contact_id)
     utils.show_url(url)
Beispiel #34
0
def _do_search_engine(terms, search_url, encoding="UTF-8"):
    """Show an url searching for @search_url with @terms"""
    #search_url = search_url.encode(encoding, "ignore")
    #terms_enc = terms.encode(encoding, "ignore")
    query_url = search_url.replace("%s", quote(terms))
    utils.show_url(query_url)
Beispiel #35
0
 def activate(self, leaf, iobj):
     dest_lang = iobj.object
     params = urllib.urlencode(dict(u=leaf.object, sl='auto', tl=dest_lang))
     url = 'http://translate.google.com/translate?' + params
     utils.show_url(url)
Beispiel #36
0
 def activate(self, leaf, iobj):
     text = urllib.quote(unicode(leaf.object).encode('utf-8'))
     dest_lang = iobj.object
     url = 'http://' + _GOOGLE_TRANSLATE_HOST + _GOOGLE_TRANS_LANG_PATH + \
       "#auto|" + dest_lang + "|" + text
     utils.show_url(url)
Beispiel #37
0
 def __call__(self, *args):
     from kupfer import utils, version
     utils.show_url(version.WEBSITE)
     raise IgnoreResultException
def show_help():
	"""
	Show Kupfer help pages, if possible
	"""
	if not utils.show_url("ghelp:%s" % version.PACKAGE_NAME):
		utils.show_url(version.WEBSITE)
Beispiel #39
0
	def activate(self, leaf, iobj):
		dest_lang = iobj.object
		params = urllib.urlencode(dict(u=leaf.object, sl='auto', tl=dest_lang ))
		url = 'http://translate.google.com/translate?' + params
		utils.show_url(url)
Beispiel #40
0
 def activate(self, leaf):
     email = email_from_leaf(leaf)
     utils.show_url("mailto:%s" % email)
Beispiel #41
0
	def activate_multiple(self, objects, iobjects):
		# FIXME: revisit for unicode email addresses
		recipients = ",".join(email_from_leaf(I) for I in iobjects)
		attachlist = "?attach=" + "&attach=".join(L.object for L in objects)
		url = "mailto:" + recipients + attachlist
		utils.show_url(url)
Beispiel #42
0
def _do_search_engine(terms, search_url, encoding="UTF-8"):
	"""Show an url searching for @search_url with @terms"""
	search_url = search_url.encode(encoding, "ignore")
	terms_enc = terms.encode(encoding, "ignore")
	query_url = search_url.replace("{searchTerms}", _urlencode(terms_enc))
	utils.show_url(query_url)
Beispiel #43
0
 def activate_multiple(self, objects):
     recipients = ",".join(email_from_leaf(L) for L in objects)
     url = "mailto:" + recipients
     utils.show_url(url)
Beispiel #44
0
	def activate(self, leaf, iobj):
		text = urllib.quote(unicode(leaf.object).encode('utf-8'))
		dest_lang = iobj.object
		url = 'http://' + _GOOGLE_TRANSLATE_HOST + _GOOGLE_TRANS_LANG_PATH + \
				"#auto|" + dest_lang + "|" + text
		utils.show_url(url)
Beispiel #45
0
 def activate_multiple(self, objects, iobjects):
     # FIXME: revisit for unicode email addresses
     recipients = ",".join(email_from_leaf(I) for I in iobjects)
     attachlist = "?attach=" + "&attach=".join(L.object for L in objects)
     url = "mailto:" + recipients + attachlist
     utils.show_url(url)
Beispiel #46
0
def _do_search_engine(terms, search_url, encoding="UTF-8"):
    """Show an url searching for @search_url with @terms"""
    search_url = search_url.encode(encoding, "ignore")
    terms_enc = terms.encode(encoding, "ignore")
    query_url = search_url.replace("{searchTerms}", _urlencode(terms_enc))
    utils.show_url(query_url)
Beispiel #47
0
 def activate(self, leaf):
     utils.show_url("https://www.instapaper.com/edit?url=%s" % leaf.object)
Beispiel #48
0
def _do_search_engine(terms, search_url, encoding="UTF-8"):
    """Show an url searching for @search_url with @terms"""
    utils.show_url(_query_url(terms, search_url))
Beispiel #49
0
 def activate(self, leaf):
     search_url = "https://www.dict.cc/"
     query_url = search_url + "?" + urllib.parse.urlencode(
         {"s": leaf.object})
     utils.show_url(query_url)
Beispiel #50
0
	def activate_multiple(self, objects):
		recipients = ",".join(urllib.quote(contacts.email_from_leaf(L))
				for L in objects)
		url = GMAIL_NEW_MAIL_URL % dict(emails=recipients)
		utils.show_url(url)
Beispiel #51
0
 def activate(self, leaf):
     url_w = "https://web.whatsapp.com/send?phone="
     url_number = url_w + leaf.object
     utils.show_url(url_number)