Jump to content

Bernardo_V

Member
  • Posts

    17
  • Joined

  • Last visited

Posts posted by Bernardo_V

  1. I am getting a weird error trying to install Python 2. Due to Homebrew's readline and openssl, perhaps? Just wondering if someone could lend me a hand on figuring this out.

     


     

    Quote

     

    bin git:(master) pyenv install 2.7.18
    zsh: correct 'install' to 'ginstall' [nyae]? n
    python-build: use openssl from homebrew
    python-build: use readline from homebrew
    Installing Python-2.7.18...
    python-build: use readline from homebrew
    python-build: use zlib from xcode sdk

    BUILD FAILED (OS X 12.3 using python-build 2.0.4-8-gd209e061)

    Inspect or clean up the working tree at /var/folders/6t/1n80sgz14bjfz32z52hxrq6m0000gn/T/python-build.20220330115345.23858
    Results logged to /var/folders/6t/1n80sgz14bjfz32z52hxrq6m0000gn/T/python-build.20220330115345.23858.log

    Last 10 log lines:
    checking for uintptr_t... yes
    checking size of uintptr_t... 8
    checking size of off_t... 8
    checking whether to enable large file support... no
    checking size of time_t... 8
    checking for pthread_t... yes
    checking size of pthread_t... 8
    checking for --enable-toolbox-glue... yes
    configure: error: Unexpected output of 'arch' on OSX
    make: *** No targets specified and no makefile found.  Stop.

     

     

  2. On 4/17/2021 at 11:36 AM, deanishe said:

    The fact that Alfred accepts Mr Pennyworth's 10x bigger file suggests that size isn't the issue. Especially as you say you're using AppleScript, which is notoriously poor at generating JSON.

    Indeed and that proved to be the case.

     

    For future reference, the JSON str will get truncated if it is too long, but this only happens in the debugger window. The problem was actually being caused by linefeeds present inside the some of the fields (despite having rules in place to fix this in my script).

     

    Thank you @deanishe and @Mr Pennyworth for your willingness to help.

     

  3. 28 minutes ago, deanishe said:

    Might be an encoding issue, then? @Bernardo_V Have you tried saving the JSON as ASCII (i.e. escaping all non-ASCII characters).

     

    I did. The content doesn't seem to matter. Alfred truncates it at the precise same location every time (that is, after 200.094 characters).

     

    6 hours ago, deanishe said:

    In terms of immediate solutions, you could do the filtering in your Script Filter instead of letting Alfred do it, so you aren't returning as many items to Alfred.

    Can you think of any workflow that I could look into to adapt for my situation? I was also thinking that it would be a good idea to build a cache so that the search is not performed every time.

     

    3 hours ago, Mr Pennyworth said:

    Alfred loads it correctly without truncation.

     Thanks, I will look into it to se if there is an applicable solution for me there.

  4. This is a workflow for filtering notes in Tinderbox. I have an applescript that will collect all the notes in the file with the URL and assemble it in a JSON format that Alfred can ingest. 

     

    Example:

     

    { "items" : [{
    					        "title": "Tinderbox-Acadêmico",
    					        "subtitle": "",
    					        "arg":  "tinderbox://Tinderbox-Acade%CC%82mico?view=outline+select=1618577108;",
    					        },
    {
    					        "title": "TbxConfig",
    					        "subtitle": "",
    					        "arg":  "tinderbox://Tinderbox-Acade%CC%82mico?view=outline+select=1617846680;",
    					        },
    {
    					        "title": "Hints",
    					        "subtitle": "",
    					        "arg":  "tinderbox://Tinderbox-Acade%CC%82mico?view=outline+select=1616867062;",
    					        }
                ]}

     

    I am using a script filter and the problem is that the whole string is 270.000 characters long, but Alfred truncates it at approx. 200.000 and never displays any result.

     

    Is there any way to get this to work and still use Alfred to filter the results?

  5. 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.

  6. 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.

  7. 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).

×
×
  • Create New...