Jump to content
idea4IT

Homebrew and Cask for Alfred

Recommended Posts

Hi! I've got error, I think the problem in path with name in cyrillic symbols.

>/Users/pavel/Dropbox/Приложения/

 

there are a debug messages from homebrew-for-alfred.alfredworkflow:

 

 

Starting debug for 'Homebrew for Alfred'

[ERROR: alfred.workflow.input.scriptfilter] Code 1: Traceback (most recent call last):

  File "brew.py", line 148, in <module>

    wf = Workflow()

  File "/Users/pavel/Dropbox/Приложения/Alfred/Alfred.alfredpreferences/workflows/user.workflow.08964E06-AFFB-45F2-AA38-CFEC96D9534C/workflow/workflow.py", line 825, in __init__

    self._info_plist = self.workflowfile('info.plist')

  File "/Users/pavel/Dropbox/Приложения/Alfred/Alfred.alfredpreferences/workflows/user.workflow.08964E06-AFFB-45F2-AA38-CFEC96D9534C/workflow/workflow.py", line 1125, in workflowfile

    return os.path.join(self.workflowdir, filename)

  File "/Users/pavel/Dropbox/Приложения/Alfred/Alfred.alfredpreferences/workflows/user.workflow.08964E06-AFFB-45F2-AA38-CFEC96D9534C/workflow/workflow.py", line 1081, in workflowdir

    if os.path.exists(os.path.join(dirpath, 'info.plist')):

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 80, in join

    path += '/' + b

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 21: ordinal not in range(128)

Edited by facetheheat

Share this post


Link to post

This is a bug in the underlying library. See here for details/progress.

 

I'm afraid I had to move the updater to a different branch while I get this fixed, Fabio. Sorry :(

Share this post


Link to post

@jayphen: I could add cask support if you want everything in one workflow...

 

@deanishe: no worries. I'll update the workflow as soon as this is fixed!

 

Not so sure about a beer-related icon though. I think this one looks good  :P

Share this post


Link to post
There appears to be a file missing. I get this error when running the cask command:

 


[ERROR: alfred.workflow.input.scriptfilter] Code 1: Traceback (most recent call last):
  File "cask.py", line 10, in <module>
import cask_refresh
  File "/Users/smargheim/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.A69C6FCF-7BC0-402E-8931-A7344624C51C/cask_refresh.py", line 5, in <module>
from cask_helpers import execute_cask_command
ImportError: No module named cask_helpers

Share this post


Link to post

Thanks for reporting this!

I just pushed v2.1 which should resolve the problem.

 

This is what happens if you delete a .py file but not the compiled .pyc file...my bad!

Share this post


Link to post
Unfortunately I'm still having trouble with the cask filter (using version 2.2 from GitHub). When I type cask, I get all the options, but if I select any of the options, Alfred immediately kicks to the default search (this happens with any options, i.e. cask search, cask install, cask list, etc). 

 

Here is the log for two attempts:



[ERROR: alfred.workflow.input.scriptfilter] Code 0: 20:59:16 workflow.py:2053 DEBUG    Update check not due
20:59:16 workflow.py:1544 DEBUG    Loading cached data from : /Users/smargheim/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.homebrew/__workflow_update_status.cpickle
20:59:16 background.py:180 DEBUG    Command arguments cached to [font=courier new,courier,monospace]/Users/smargheim/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.homebrew/cask_refresh.argcache[/font]
20:59:16 background.py:184 DEBUG    Calling [u'/usr/bin/python', '/Users/smargheim/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.A69C6FCF-7BC0-402E-8931-A7344624C51C/workflow/background.pyc', 'cask_refresh'] ...
20:59:16 workflow.py:1907 DEBUG    Workflow finished in 0.002 seconds.
20:59:16 workflow.py:1907 DEBUG    Workflow finished in 0.004 seconds.
20:59:16 background.py:189 DEBUG    Executing task [font=courier new,courier,monospace]cask_refresh[/font] in background...
[ERROR: alfred.workflow.input.scriptfilter] Code 0: 20:59:39 workflow.py:2053 DEBUG    Update check not due
20:59:39 workflow.py:1544 DEBUG    Loading cached data from : /Users/smargheim/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.homebrew/__workflow_update_status.cpickle
20:59:39 workflow.py:1544 DEBUG    Loading cached data from : /Users/smargheim/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.homebrew/cask_installed.cpickle
20:59:39 background.py:180 DEBUG    Command arguments cached to [font=courier new,courier,monospace]/Users/smargheim/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.homebrew/cask_refresh.argcache[/font]
20:59:39 background.py:184 DEBUG    Calling [u'/usr/bin/python', '/Users/smargheim/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.A69C6FCF-7BC0-402E-8931-A7344624C51C/workflow/background.pyc', 'cask_refresh'] ...
20:59:39 workflow.py:1907 DEBUG    Workflow finished in 0.002 seconds.
20:59:39 workflow.py:1907 DEBUG    Workflow finished in 0.004 seconds.
20:59:39 background.py:189 DEBUG    Executing task [font=courier new,courier,monospace]cask_refresh[/font] in background...

Edited by smarg19

Share this post


Link to post

 

Unfortunately I'm still having trouble with the cask filter (using version 2.2 from GitHub). When I type cask, I get all the options, but if I select any of the options, Alfred immediately kicks to the default search (this happens with any options, i.e. cask search, cask install, cask list, etc). 

 

 

Hi smarg19,

 

that's pretty weird and I can't reproduce the problem.

You're supposed to be able to see all casks available when using search, home and install.

And you should only see all installed casks when using list and uninstall.

Edited by fniephaus

Share this post


Link to post

Hi smarg19,

 

that's pretty weird and I can't reproduce the problem.

You're supposed to be able to see all casks available when using search, home and install.

And you should only see all installed casks when using list and uninstall.

Woops. I recently reset my Air and `cask` isn't installed yet. So that's on me, tho having a check for installation up front would probably provide better debugging.

Share this post


Link to post

:D

 

True, though. Always a good idea to check the program you need is installed if it isn't standard. Something like this always happens.

 

I remember spending two hours trying to figure out why my iBook wouldn't recognise my new printer when it had already worked perfectly. Finally I remembered I'd installed the drivers on a friend's identical iBook, not my own…

Share this post


Link to post

Yeah, one of the downsides to fiddling with my computer so much is that I often loose track of what I've changed and how. That's one of the reasons I like to package things in Alfred workflows. It's all synced thru Dropbox and I know to go to one place for functionality. 

Share this post


Link to post

Hello,

 

thank you for this Workflow. But I can't get "brew list" to work. It shows the fall back "search with google" instead. Thank you.

Share this post


Link to post

Hey guys,

I'm really sorry about that! And it really is bad practice!

I should've thought about this when I decided to make the workflow public.

 

Version 2.4 now checks if brew & cask are installed and should resolve issues with brew uninstall/list as mentioned by ired:

https://github.com/fniephaus/alfred-homebrew/releases/tag/v2.4

 

Hey, you mean to tell me the workflow doesn't support automatic updates after all that time we spent on it???

Share this post


Link to post

Hey, you mean to tell me the workflow doesn't support automatic updates after all that time we spent on it???

 

No, automatic updates work just fine!

It's bad practice to just assume that a requirement is installed.

Share this post


Link to post

This has stopped working for me recently, after working just fine for a long time. The debugger doesn't really produce much, but Alfred 3 stops responding when I try e.g. Cask Install Firefox.

 

Edit: I updated this workflow recently, which may be the reason for the problems.

Edited by TheDonk
extra info

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...