Jump to content

Pandoctor: An Alfred GUI for Pandoc


Recommended Posts

  • 3 weeks later...
On 26/09/2016 at 11:53 PM, dfay said:

I don't have it installed to test but it's probably a matter of changing refs to Alfred-2 in the paths above to Alfred-3 

It doesn't work

 

 

I have same problems as you can find in log below. I would be great to get solution for that. 

[2016-10-16 01:02:00][ERROR: action.script] 01:02:00 pandoctor.py:1206 DEBUG    {u'<argument>': None,
 u'<flag>': None,
 u'config': True,
 u'help': False,
 u'launch': False,
 u'run': False,
 u'search': False,
 u'store': False}
01:02:00 workflow.py:940 DEBUG    Loading cached data from : /Users/uvaroff/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.pandoctor/runner.cache
01:02:00 workflow.py:1275 ERROR    'NoneType' object has no attribute 'read'
Traceback (most recent call last):
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/workflow.py", line 1273, in run
    func(self)
  File "pandoctor.py", line 1208, in main
    res = pd.run(args)
  File "pandoctor.py", line 355, in run
    return method()
  File "pandoctor.py", line 429, in config_codepath
    self.pandoc.config()
  File "pandoctor.py", line 121, in config
    self.store('pandoc', 'outputs', self._formats('output'))
  File "pandoctor.py", line 226, in _formats
    lines = req.text.splitlines()
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/web.py", line 220, in text
    return self.content
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/web.py", line 205, in content
    self._content = self.raw.read()
AttributeError: 'NoneType' object has no attribute 'read'
[2016-10-16 01:02:25][ERROR: action.script] 01:02:24 pandoctor.py:1206 DEBUG    {u'<argument>': None,
 u'<flag>': None,
 u'config': True,
 u'help': False,
 u'launch': False,
 u'run': False,
 u'search': False,
 u'store': False}
01:02:25 workflow.py:1275 ERROR    'NoneType' object has no attribute 'read'
Traceback (most recent call last):
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/workflow.py", line 1273, in run
    func(self)
  File "pandoctor.py", line 1208, in main
    res = pd.run(args)
  File "pandoctor.py", line 355, in run
    return method()
  File "pandoctor.py", line 429, in config_codepath
    self.pandoc.config()
  File "pandoctor.py", line 121, in config
    self.store('pandoc', 'outputs', self._formats('output'))
  File "pandoctor.py", line 226, in _formats
    lines = req.text.splitlines()
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/web.py", line 220, in text
    return self.content
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/web.py", line 205, in content
    self._content = self.raw.read()
AttributeError: 'NoneType' object has no attribute 'read'
  

 

Link to comment
13 hours ago, deanishe said:

 

Isn't this the same error you had one year ago, which I posted the fix for?

 

Nope, It is not. 

 

I have changed the url on 225 line, but still it gives me

 

Starting debug for 'Pandoctor'

[2016-10-16 22:03:25][ERROR: action.script] 22:03:12 pandoctor.py:1206 DEBUG    {u'<argument>': None,
 u'<flag>': None,
 u'config': True,
 u'help': False,
 u'launch': False,
 u'run': False,
 u'search': False,
 u'store': False}
22:03:12 workflow.py:940 DEBUG    Loading cached data from : /Users/uvaroff/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.pandoctor/runner.cache
22:03:25 workflow.py:1275 ERROR    'NoneType' object has no attribute 'read'
Traceback (most recent call last):
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/workflow.py", line 1273, in run
    func(self)
  File "pandoctor.py", line 1208, in main
    res = pd.run(args)
  File "pandoctor.py", line 355, in run
    return method()
  File "pandoctor.py", line 429, in config_codepath
    self.pandoc.config()
  File "pandoctor.py", line 121, in config
    self.store('pandoc', 'outputs', self._formats('output'))
  File "pandoctor.py", line 226, in _formats
    lines = req.text.splitlines()
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/web.py", line 220, in text
    return self.content
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/web.py", line 205, in content
    self._content = self.raw.read()
AttributeError: 'NoneType' object has no attribute 'read'
[2016-10-16 22:03:41][ERROR: action.script] 22:03:25 pandoctor.py:1206 DEBUG    {u'<argument>': None,
 u'<flag>': None,
 u'config': True,
 u'help': False,
 u'launch': False,
 u'run': False,
 u'search': False,
 u'store': False}
22:03:25 workflow.py:940 DEBUG    Loading cached data from : /Users/uvaroff/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.pandoctor/runner.cache
22:03:41 workflow.py:1275 ERROR    'NoneType' object has no attribute 'read'
Traceback (most recent call last):
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/workflow.py", line 1273, in run
    func(self)
  File "pandoctor.py", line 1208, in main
    res = pd.run(args)
  File "pandoctor.py", line 355, in run
    return method()
  File "pandoctor.py", line 429, in config_codepath
    self.pandoc.config()
  File "pandoctor.py", line 121, in config
    self.store('pandoc', 'outputs', self._formats('output'))
  File "pandoctor.py", line 226, in _formats
    lines = req.text.splitlines()
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/web.py", line 220, in text
    return self.content
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/web.py", line 205, in content
    self._content = self.raw.read()
AttributeError: 'NoneType' object has no attribute 'read'

 

2016-10-16_22-04-33.png

Link to comment

Right, sorry. It was smargh I told how to fix this. 

 

If if you check the URL in a browser, you'll see it's moved again. You need to update the URL to the new one. 

 

Better yet, change request('GET', …) to get(...)

 

That way it won't break next time the page moves. 

 

Of course, the page contents may have changed as well as the URL, which may not be so easy to fix. 

Edited by deanishe
Link to comment
1 hour ago, deanishe said:

Tell a lie. I did post it here, just in another thread. Follow the instructions there (they're a bit clearer):

 

http://www.alfredforum.com/topic/5463-pandoctor-not-putting-but-no-error-messages/?do=findComment&comment=40217

 

 

I tried and now I get this:

 

[2016-10-16 23:37:50][ERROR: action.script] 23:35:49 pandoctor.py:1206 DEBUG    {u'<argument>': None,
 u'<flag>': None,
 u'config': True,
 u'help': False,
 u'launch': False,
 u'run': False,
 u'search': False,
 u'store': False}
23:35:49 workflow.py:940 DEBUG    Loading cached data from : /Users/uvaroff/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.pandoctor/runner.cache
23:35:49 workflow.py:940 DEBUG    Loading cached data from : /Users/uvaroff/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.pandoctor/pandoc.cache
23:37:50 workflow.py:1275 ERROR    timed out
Traceback (most recent call last):
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/workflow.py", line 1273, in run
    func(self)
  File "pandoctor.py", line 1208, in main
    res = pd.run(args)
  File "pandoctor.py", line 355, in run
    return method()
  File "pandoctor.py", line 429, in config_codepath
    self.pandoc.config()
  File "pandoctor.py", line 121, in config
    self.store('pandoc', 'outputs', self._formats('output'))
  File "pandoctor.py", line 225, in _formats
    req = web.get('http://pandoc.org/README.html')
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/web.py", line 383, in get
    auth=auth, timeout=timeout, allow_redirects=allow_redirects)
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/web.py", line 371, in request
    return Response(req)
  File "/Users/uvaroff/Documents/Dropbox/Alfred/alfres setting 10-2015/Alfred.alfredpreferences/workflows/user.workflow.8A0AAEDC-F3BC-4556-A21C-8191BA53B16A/workflow/web.py", line 162, 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 1227, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1200, in do_open
    r = h.getresponse(buffering=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1132, in getresponse
    response.begin()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 453, in begin
    version, status, reason = self._read_status()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 409, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 480, in readline
    data = self._sock.recv(self._rbufsize)
timeout: timed out

 

Link to comment
3 minutes ago, 40-02 said:

My bad. I'm stupid. I'm sorry for that. I will do my best to not make such mistakes in future. Thanks for your feedback. 

 

We all have our dumb moments. The main thing is, spending a few minutes trying to figure it out for yourself is always the best first step because you'll often have to wait for a few hours to get an answer on the forum.

Link to comment
  • 2 years later...

Are you guys still using this workflow? I tried the suggested fixes, but to no avail. Considering how Pandoc is such an important tool for those writing in plain text, I find it a shame that this should remain broken (considering it is the case). I went as far as creating an Keyboard Maestro macro for using Pandoc with input for parameters, but it is rather rudimentary compared to what this workflow could do. If I can't get this to work, I will try to recreate some of its functions (in Alfred) using Applescript, as that is the best I can do (I am rather clueless in python).

Link to comment
22 minutes ago, Bernardo_V said:

I tried the suggested fixes, but to no avail.

 

The author no longer develops workflows.

 

The workflow probably isn't that broken. It would certainly be easier to fix it than try to re-implement it in Keyboard Maestro and AppleScript.

Link to comment
21 minutes ago, deanishe said:

 

The author no longer develops workflows.

 

 

I know. My question was directed to you and others in order to know if you were still using it and if so by means of which fix. It might be the case that someone took the trouble of fixing it, but perhaps not to post it here or elsewhere.

Link to comment

I gave it a few more runs and here is what I am getting:

[14:27:48.838] Logging Started...
[14:27:56.053] Pandoctor[Keyword] Processing complete
[14:27:56.054] Pandoctor[Keyword] Passing output '' to Run Script
[14:27:59.285] ERROR: Pandoctor[Run Script] .
14:27:56 workflow.py:2063 DEBUG    ---------- Pandoctor ----------
14:27:56 pandoctor.py:1206 DEBUG    {u'<argument>': None,
 u'<flag>': None,
 u'config': True,
 u'help': False,
 u'launch': False,
 u'run': False,
 u'search': False,
 u'store': False}
14:27:56 workflow.py:1695 DEBUG    loading cached data: /Users/PATH/Workflow Data/com.hackademic.pandoctor/runner.cpickle
14:27:59 workflow.py:2080 ERROR    local variable 'outputs' referenced before assignment
Traceback (most recent call last):
  File "/Users/PATH/workflows/user.workflow.6B66C5E8-4C90-42A7-9B89-CF227389ECF5/workflow/workflow.py", line 2073, in run
    func(self)
  File "pandoctor.py", line 1208, in main
    res = pd.run(args)
  File "pandoctor.py", line 355, in run
    return method()
  File "pandoctor.py", line 429, in config_codepath
    self.pandoc.config()
  File "pandoctor.py", line 121, in config
    self.store('pandoc', 'outputs', self._formats('output'))
  File "pandoctor.py", line 234, in _formats
    for out in outputs:
UnboundLocalError: local variable 'outputs' referenced before assignment
14:27:59 workflow.py:2103 DEBUG    ---------- finished in 2.938s ----------
[14:27:59.300] Pandoctor[Run Script] Processing complete
[14:27:59.301] Pandoctor[Run Script] Passing output '<?xml version="1.0" encoding="utf-8"?>
<items><item valid="no"><title>Error in workflow 'Pandoctor'</title><subtitle>local variable 'outputs' referenced before assignment</subtitle><icon>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns</icon></item></items>' to Post Notification

Considering that the previous issue had to do with the get function, and that the Pandoc website probably changed the content of the page, it might have to do with that. I checked those lines in the scripts to see if they would make any sense to me, but I don't really know enough python to understand what's wrong. Any insight is much appreciated.

Link to comment
4 hours ago, Bernardo_V said:

Considering that the previous issue had to do with the get function, and that the Pandoc website probably changed the content of the page,

 

Yeah, that was broken from day one, tbh, but your error doesn't look like the previous ones.

Link to comment
  • 3 months later...

To everyone who still has interest in this workflow:

 

I am sorry that it no longer works. I no longer need or use the workflow. I developed it when I was in graduate school and writing all the time. I have since left academia and haven't really needed this (or my other workflows) in years. However, I do still love this little workflow and would love to get it healthy again, but it has been years since I've fiddled with Alfred workflows. If anyone wants to become the new maintainer, I would be happy to spend a weekend afternoon or an evening pairing with someone to get it updated and fixed and then hand over the Github repo. Let me know if you are interested.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...