Git Product home page Git Product logo

alfred-powerthesaurus's People

Contributors

clarencecastillo avatar jessestuart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

alfred-powerthesaurus's Issues

Workflow is not working anymore.

The given have stopped working since today.
I am not sure for the exact reason but I suspect its probably because there is some API change from powerthesaurus?

Can someone help to fix the bug.
Below you can find the output when running the workflow in debug mode while searching for word "another"

[2018-03-15 14:10:43][STDERR: input.scriptfilter] 14:10:42 workflow.py:2189 DEBUG Workflow version : 1.0.0
14:10:42 powerthesaurus.py:87 DEBUG query : u'another' u'syn'
14:10:42 powerthesaurus.py:42 DEBUG Cache key : u'another' ['synonyms'] -> u'another_synonyms'
14:10:43 powerthesaurus.py:77 DEBUG [200] https://www.powerthesaurus.org/another/synonyms
14:10:43 workflow.py:1862 DEBUG Cached data saved at : /home/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/me.clarencecastillo.alfred-powerthesaurus/another_synonyms.cpickle
14:10:43 powerthesaurus.py:104 DEBUG 0 words for u'another'
14:10:43 workflow.py:1596 DEBUG Reading settings from /home/Library/Application Support/Alfred 3/Workflow Data/me.clarencecastillo.alfred-powerthesaurus/settings.json ...
14:10:43 workflow.py:2387 DEBUG Set last run version : 1.0.0
14:10:43 workflow.py:2231 DEBUG Workflow finished in 1.248 seconds.

alfred 5 - cannot type in arguments

Just upgraded to Alfred 5. I can type in the "pows" command, but as soon as I try to enter an argument (i.e., a word that I want a synonym for), Alfred suddenly switches to the default web search workflow. Not sure what is going on. Thanks!

SSL: CERTIFICATE_VERIFY_FAILED

started getting this error today

[10:20:46.781] Powerthesaurus[Script Filter] Queuing argument 'mandatory' [10:20:47.261] Powerthesaurus[Script Filter] Script with argv '(null)' finished [10:20:47.267] ERROR: Powerthesaurus[Script Filter] Code 1: . 10:20:46 workflow.py:2061 DEBUG ---------- Powerthesaurus (1.1.0) ---------- 10:20:46 powerthesaurus.py:87 DEBUG query : u'mandatory' u'syn' 10:20:46 powerthesaurus.py:42 DEBUG Cache key : u'mandatory' ['synonyms'] -> u'mandatory_synonyms' 10:20:47 workflow.py:2080 ERROR <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)> Traceback (most recent call last): File "/X/Alfred.alfredpreferences/workflows/user.workflow.E54F6BDA-2690-43D9-B913-30D45506A7BF/workflow/workflow.py", line 2073, in run func(self) File "powerthesaurus.py", line 103, in main max_age=CACHE_MAX_AGE) File "/X/Alfred.alfredpreferences/workflows/user.workflow.E54F6BDA-2690-43D9-B913-30D45506A7BF/workflow/workflow.py", line 1701, in cached_data data = data_func() File "powerthesaurus.py", line 76, in get_words r = web.get(API_URL + query.replace(" ", "_") + "/" + query_type) File "/X/Alfred.alfredpreferences/workflows/user.workflow.E54F6BDA-2690-43D9-B913-30D45506A7BF/workflow/web.py", line 591, in get stream=stream) File "/X/Alfred.alfredpreferences/workflows/user.workflow.E54F6BDA-2690-43D9-B913-30D45506A7BF/workflow/web.py", line 579, in request return Response(req, stream) File "/X/Alfred.alfredpreferences/workflows/user.workflow.E54F6BDA-2690-43D9-B913-30D45506A7BF/workflow/web.py", line 223, in __init__ self.raw = urllib2.urlopen(request) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open response = self._open(req, data) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open '_open', req) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(*args) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1241, in https_open context=self._context) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1198, in do_open raise URLError(err) URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)> 10:20:47 workflow.py:2082 INFO for assistance, see: https://github.com/clarencecastillo/alfred-powerthesaurus 10:20:47 workflow.py:2103 DEBUG ---------- finished in 0.287s ---------- [10:20:47.270] Powerthesaurus[Script Filter] <?xml version="1.0" encoding="utf-8"?> <items><item valid="no"><title>Error in workflow 'Powerthesaurus'</title><subtitle>&lt;urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)&gt;</subtitle><icon>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns</icon></item></items>

Add synonyms according to the language used by the user

First of all, a big thank you for the creation of this package that simplifies the life of many writers.

In order to make this package more accessible to a wider audience, I was wondering if you intended to take into account the language used by the user for the choice of synonyms.

For example, if I am writing a document in French and I cannot find synonyms for my language. I think it would be interesting to add other languages, even if it would require work.

For the detection of the language used in the buffer, maybe you could use guess-language to avoid recreating the wheel.

SSL connection fails (not sure if local python issue)

Disabling SSL verification didn't impact this. Checked the Cert status which was green.

UG Starting new HTTPS connection (1): api.powerthesaurus.org:443 From cffi callback <function _verify_callback at 0x1069129b0>: Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL/SSL.py", line 309, in wrapper _lib.X509_up_ref(x509) AttributeError: 'module' object has no attribute 'X509_up_ref' 08:18:10 workflow.py:2080 ERROR HTTPSConnectionPool(host='api.powerthesaurus.org', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),)) Traceback (most recent call last): File "/Users/ali-work/OneDrive - Telstra/Alfred Workflows/Alfred.alfredpreferences/workflows/user.workflow.B5FD5BEB-A9D5-4C41-8397-804617378D4A/workflow/workflow.py", line 2073, in run func(self) File "powerthesaurus.py", line 88, in main term = pt.search_query_match(query) File "/Users/ali-work/OneDrive - Telstra/Alfred Workflows/Alfred.alfredpreferences/workflows/user.workflow.B5FD5BEB-A9D5-4C41-8397-804617378D4A/api.py", line 118, in search_query_match terms = self.search_query(query) File "/Users/ali-work/OneDrive - Telstra/Alfred Workflows/Alfred.alfredpreferences/workflows/user.workflow.B5FD5BEB-A9D5-4C41-8397-804617378D4A/api.py", line 112, in search_query r = requests.post(self.api_url, json=params, headers=self.request_headers, verify=PowerThesaurus.VERIFY_SSL) File "./lib/requests/api.py", line 119, in post return request('post', url, data=data, json=json, **kwargs) File "./lib/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "./lib/requests/sessions.py", line 530, in request resp = self.send(prep, **send_kwargs) File "./lib/requests/sessions.py", line 643, in send r = adapter.send(request, **kwargs) File "./lib/requests/adapters.py", line 514, in send raise SSLError(e, request=request) SSLError: HTTPSConnectionPool(host='api.powerthesaurus.org', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),)) 08:18:10 workflow.py:2082 INFO for assistance, see: https://github.com/clarencecastillo/alfred-powerthesaurus 08:18:10 workflow.py:2103 DEBUG ---------- finished in 0.873s ---------- [08:18:10.890] Power Thesaurus[Script Filter] {"items": [{"valid": false, "subtitle": "HTTPSConnectionPool(host='api.powerthesaurus.org', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(\"bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)\",),))", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"}, "title": "Error in workflow 'Power Thesaurus'"}]}

Make compatible with Alfred 3

As discussed in issue #6, the latest version on this plugin no longer works with Alfred 3 though (as has been mentioned) this version doesn't use any alfred 4-specific features so should be easily ported to v3.

Happy to make a PR but will need a little guidance about where to start.
Thanks :)

ModuleNotFoundError: No module named 'cPickle'

Can't seem to get pows or powa to get any results.

The first debugging showed that it cannot use python, so I changed it to python3 for both powa and pows, now the following shows in Alfred's debugger when trying to get a synonym for 'hello'

ModuleNotFoundError: No module named 'cPickle'

Error Code 127

On Alfred 5, when querying, Debugger gives a :
ERROR: Power Thesaurus[Script Filter] Code 127: /bin/bash: /usr/bin/python: No such file or directory

Not working since the update to MacOS 12.3

The update to MacOS 12.3 beta has removed Python 2.7 and this excellent Workflow has stopped working for me. As it's recommended to install and use Python 3 I have tried to make it work, but run into multiple errors. I also tried re-installing Python 2.7 but that also hasn't worked. My coding skills are fairly basic.

Is there a simple way to make it work with Python 3 for someone who doesn't know much code? I used the Workflow many times a day for my copywriting and I'd love to see it working again.

UPDATE: I've just found your updated Workflow, please ignore / delete this issue and many thanks for the updated Workflow.

SSL Verification as an Option

As kindly suggested by @rooted-admin here and @deanishe here, it would be a better idea to let this SSL verification be a workflow option so as to make it easier to be toggled on/off since SSL certificate issues are external in nature and can only be rectified by Power Thesaurus (or one that can't really be fixed without resolving to monkey patches like 84c1547).

Will be using this issue to track my own progress/findings until it becomes available in the next version.

urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION]

I just installed this workflow, trying to use it for the first time but I get this error:

image

I went debug mode in Alfred:

[2018-12-22 20:09:57][input.scriptfilter] Queuing argument 'door'
[2018-12-22 20:09:58][input.scriptfilter] Script with argument '(null)' finished
[2018-12-22 20:09:58][ERROR: input.scriptfilter] Code 1: 20:09:57 workflow.py:2247 DEBUG    ---------- Powerthesaurus (1.1.0) ----------
20:09:57 powerthesaurus.py:87 DEBUG    query : u'door' u'syn'
20:09:57 powerthesaurus.py:42 DEBUG    Cache key : u'door' ['synonyms'] -> u'door_synonyms'
20:09:58 workflow.py:2266 ERROR    <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)>
Traceback (most recent call last):
  File "/Users/merl/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.E949D33D-97C7-4A21-84EB-36E531BA9433/workflow/workflow.py", line 2259, in run
    func(self)
  File "powerthesaurus.py", line 103, in main
    max_age=CACHE_MAX_AGE)
  File "/Users/merl/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.E949D33D-97C7-4A21-84EB-36E531BA9433/workflow/workflow.py", line 1890, in cached_data
    data = data_func()
  File "powerthesaurus.py", line 76, in get_words
    r = web.get(API_URL + query.replace(" ", "_") + "/" + query_type)
  File "/Users/merl/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.E949D33D-97C7-4A21-84EB-36E531BA9433/workflow/web.py", line 583, in get
    stream=stream)
  File "/Users/merl/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.E949D33D-97C7-4A21-84EB-36E531BA9433/workflow/web.py", line 571, in request
    return Response(req, stream)
  File "/Users/merl/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.E949D33D-97C7-4A21-84EB-36E531BA9433/workflow/web.py", line 214, in __init__
    self.raw = urllib2.urlopen(request)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 469, in error
    result = self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 656, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1240, in https_open
    context=self._context)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open
    raise URLError(err)
URLError: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)>
20:09:58 workflow.py:2268 INFO     for assistance, see: https://github.com/clarencecastillo/alfred-powerthesaurus
20:09:58 workflow.py:2289 DEBUG    ---------- finished in 0.999s ----------
[2018-12-22 20:09:58][input.scriptfilter] <?xml version="1.0" encoding="utf-8"?>
<items><item valid="no"><title>Error in workflow 'Powerthesaurus'</title><subtitle>&lt;urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)&gt;</subtitle><icon>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns</icon></item></items>

Sys info

  • macOS Sierra 10.12.6
  • Python 3.7.1
  • pip 18.1 from /miniconda3/lib/python3.7/site-packages/pip (python 3.7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.