Jump to content

xilopaint

Member
  • Content Count

    546
  • Joined

  • Last visited

  • Days Won

    19

Posts posted by xilopaint


  1. 2 hours ago, deanishe said:

    The background API also runs background.py as a script, which is why you're getting the error. Have you tried not changing the import path?

     

    If I keep `from workflow import Workflow` in background.py I get this:

    21:25:53 workflow.py:2061 DEBUG    ---------- Alfred PDF Tools (2.16.0) ----------
    21:25:53 workflow.py:1468 DEBUG    reading settings from /Users/****/Library/Application Support/Alfred/Workflow Data/com.xilopaint.alfredapp.pdftools/settings.json
    21:25:53 workflow.py:2338 INFO     checking for update ...
    21:25:53 background.py:233 DEBUG    [__workflow_update_check] command cached: /Users/****/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.xilopaint.alfredapp.pdftools/__workflow_update_check.argcache
    21:25:53 background.py:237 DEBUG    [__workflow_update_check] passing job to background runner: ['/usr/bin/python', '/Users/****/Developer/Alfred Workflows/Alfred PDF Tools/alfred-pdf-tools/src/workflow/background.py', '__workflow_update_check']
    Traceback (most recent call last):
      File "/Users/****/Developer/Alfred Workflows/Alfred PDF Tools/alfred-pdf-tools/src/workflow/background.py", line 28, in <module>
        from workflow import Workflow
      File "/Users/****/Developer/Alfred Workflows/Alfred PDF Tools/alfred-pdf-tools/src/workflow/workflow.py", line 47, in <module>
        from .util import AcquisitionError  # noqa: F401
    ValueError: Attempted relative import in non-package
    21:25:53 background.py:241 ERROR    [__workflow_update_check] background runner failed with 1
    21:25:53 workflow.py:2103 DEBUG    ---------- finished in 0.353s ----------

     


  2. Hey @deanishe, after fixing a lot of issues in the attempt of adapting the library for Python 3 I came across this:

     

    10:01:18 workflow.py:2061 DEBUG    ---------- Alfred PDF Tools (2.16.0) ----------
    10:01:18 workflow.py:1468 DEBUG    reading settings from /Users/xxxx/Library/Application Support/Alfred/Workflow Data/com.xilopaint.alfredapp.pdftools/settings.json
    10:01:18 workflow.py:2338 INFO     checking for update ...
    10:01:18 background.py:233 DEBUG    [__workflow_update_check] command cached: /Users/xxxx/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.xilopaint.alfredapp.pdftools/__workflow_update_check.argcache
    10:01:18 background.py:237 DEBUG    [__workflow_update_check] passing job to background runner: ['/usr/bin/python', '/Users/xxxx/Developer/Alfred Workflows/Alfred PDF Tools/alfred-pdf-tools/src/workflow/background.py', '__workflow_update_check']
    Traceback (most recent call last):
      File "/Users/xxxx/Developer/Alfred Workflows/Alfred PDF Tools/alfred-pdf-tools/src/workflow/background.py", line 28, in <module>
        from .workflow import Workflow
    ValueError: Attempted relative import in non-package
    10:01:18 background.py:241 ERROR    [__workflow_update_check] background runner failed with 1
    10:01:18 workflow.py:2103 DEBUG    ---------- finished in 0.071s ----------

     

    As you can see I changed `from workflow import Workflow` in background.py to `from .workflow import Workflow` but it doesn't work. What's the problem?


  3. 16 minutes ago, deanishe said:


    Don’t know, tbh. The library is Unicode-only, so there’s a lot of encoding/deciding code that’d need removing or rewriting.

     

    If I were you, I’d probably just reimplement those bits. They’re not very complicated, but the current implementation is quite heavily tied to the rest of the API.

     

    Well, at the moment I'm getting `ModuleNotFoundError: No module named 'util'`. I should be missing something very basic. I have no clue why I'm getting this error.


  4. @deanishe I need something like `Wofklow3.cache_data()` and `Workflow3.cached_data()` in a Python 3 workflow. Would it be easy to adapt alfred-workflow to work with Python 3 for those methods or you recommend me to simply write and read the cache files using Python 3?


  5. 24 minutes ago, vitor said:

    @xilopaint Are you on Catalina? I’m not and won’t be for a long while (likely ever, considering how buggy and problematic it is), so I won’t be able to debug it for now.

     

    Yes. I guess Catalina is frowned upon because of the hard Beta program which was surrounded by a lot of criticism. Yet I haven't  been facing issues since the release of the first stable version, it's been really pretty stable for me.


  6. I should add that I followed this procedure with no success.

     

    On 1/11/2018 at 8:43 PM, vitor said:

    @_atanas Try this in a terminal:

    
    mv '/Users/atanasjanackovski/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.C2D7D30E-F51F-489C-AB45-C098803A3AD0/_licensed/Redcarpet' "${HOME}/.Trash"
    
    /usr/bin/gem install --install-dir '/Users/atanasjanackovski/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.C2D7D30E-F51F-489C-AB45-C098803A3AD0/_licensed/Redcarpet' --no-document redcarpet

    The same caveat as before applies.

     

    Since redcarpet seems to require rebuilding depending on the macOS version, I should integrate the fix into the Workflow.

     


  7. Hey Vitor, I'm getting this:

     

    [03:47:25.544] MarkdownTransform[Hotkey] Processing complete
    [03:47:25.547] MarkdownTransform[Hotkey] Passing output 'ksfklsdjfklsdjfl[ksd]jfl' to Run Script
    [03:47:32.491] STDERR: MarkdownTransform[Run Script] /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- redcarpet (LoadError)
    	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    	from /Users/***/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.87D997CD-0A30-4355-96DB-A45BBAE573A6/ipboard_bbcode_renderer.rb:1:in `<top (required)>'
    	from ./bbcode:4:in `require_relative'
    	from ./bbcode:4:in `<main>'
    [03:47:32.498] MarkdownTransform[Run Script] Processing complete
    [03:47:32.499] MarkdownTransform[Run Script] Passing output '' to Copy to Clipboard
    [03:47:32.500] MarkdownTransform[Copy to Clipboard] Processing complete
    [03:47:32.502] MarkdownTransform[Copy to Clipboard] Passing output '' to Run Script

     


  8. On 12/22/2019 at 5:16 AM, Roman52 said:

     

    Hello @xilopaint , @deanishe and thank you for your answers.

    I made this change - http://snpy.in/8NlGMK - but it didn't help - I still have this "problem downloading" issue. http://snpy.in/VUI4Tr

    I imported the tinyPNG workflow and made only one change in tinypng.sh file as you told me. 

     

    You have to make the same change in the Run Script object connected to the tiny_png_config keyword on Alfred Editor.

     

    740556971_ScreenShot2019-12-23at10_33_24.png.2ea5818b2b0a89fd1680dff811cd4102.png


  9. 13 hours ago, Roman52 said:

    Hello and thank you for the great workflow.

    I am trying to configure it.
    Is this workflow supporting Alfred 4?

    For me, the workflow works sometimes, sometimes not - http://joxi.net/eAO6y1pF974Z92

    I get this error - "Problem downloading feature-location-3.jpg"

    I replaced this path:
    PREFS="$HOME/Library/Application Support/Alfred 4/Workflow Data/carlosnz.tinypng" from Alfred 2 to Alfred 4 - but it didn't help. (Before (when the path was $HOME/Library/Application Support/Alfred 2/...) it worked the same way 50/50 - sometimes correct, sometimes error)
    I am using Mojave 10.14.6

    I am using my own API key for ЕнтнЗТПю

    I will be glad to any help. Maybe I am doing something wrong.

     

    Try this:

     

    On 9/25/2017 at 10:34 AM, xilopaint said:

     

    Hey, this is not related to the HS issue but once you look into it remember to change the location of the data folder by adopting the environment variable instead of hard coding the path, since Alfred 2 and 3 have different locations for persistent data. So you can use this:

     

    
    #Storage directory for API key
    PREFS="$alfred_workflow_data"

     


  10. 5 hours ago, biati said:

     

    The workflow includes a list of currencies, just Open Alfred and type calculate select "list available units and currencies" then you can type your country name to get the currency code (press enter to copy the currency code) or if you prefer here is a list online https://www.iban.com/currency-codes

     

    For dates, you can find here the available options to format the date the way you want. If you do not understand what you have to do in that page then go to this other page you can visually create the date in the format you want. In the section "Build your own" you can  for example select how you want to display the day (24 or Sun or Sunday, etc) do the same with the rest of options and at the top you'll see the generated code for example: date('F l Y'); the part you need is inside the quotes so just copy F l Y if you need more help just let me know.

     

    I know my currency code but if I enter it via `Set base currency` and `Set currency locale` I don't get my currency properly formatted.

     

    5 hours ago, biati said:

    For dates, you can find here the available options to format the date the way you want. If you do not understand what you have to do in that page then go to this other page you can visually create the date in the format you want. In the section "Build your own" you can  for example select how you want to display the day (24 or Sun or Sunday, etc) do the same with the rest of options and at the top you'll see the generated code for example: date('F l Y'); the part you need is inside the quotes so just copy F l Y if you need more help just let me know.

     

    It seems your workflow is not accepting capital letters, so "Y" is being converted to "y" which gives different results for a date format.

×
×
  • Create New...