MuppetGate / Alfred-Workflows-DateCalculator

Date Calculator workflow for Alfred
42 stars 6 forks source link

error in workflow - when trying to use the workflow #2

Closed saqebakhter closed 9 years ago

saqebakhter commented 9 years ago

Whenever i try to do a date calc i.e) dcalc today - 6w i get this error :

Error in workflow 'muppet.gate.net.DateCalculator' u 'ampersand'

Any idea ?

MuppetGate commented 9 years ago

Mmm. Not seeing this on mine.

I tend to just use the repo here to store the files; it's probably not a good idea to build the workflow yourself from here (I've never tried it myself). Could you try downloading from here to see if it gives you the same result?

http://www.packal.org/workflow/date-calculator

And are you using the latest version of Alfred?

saqebakhter commented 9 years ago

Yup. I got it from packal not from github. Just reporting the issue here

On Tue, Jan 13, 2015, 1:05 AM MuppetGate notifications@github.com wrote:

Mmm. Not seeing this on mine.

I tend to just use the repo here to store the files; it's probably not a good idea to build the workflow yourself from here (I've never tried it myself). Could you try downloading from here to see if it gives you the same result?

(http://www.packal.org/workflow/date-calculator)

— Reply to this email directly or view it on GitHub https://github.com/MuppetGate/Alfred-Workflows-DateCalculator/issues/2#issuecomment-69699682 .

MuppetGate commented 9 years ago

Most odd. Can you switch on debug from Alfred's preferences and post the full output for the workflow.

I'm thinking that it could be an incompatibility with the version of Python it is finding. Are you using the one installed with OSX?

MuppetGate commented 9 years ago

Yeah, send the debug output

MuppetGate commented 9 years ago

Ah, something has occurred to me. I'll take a look.

MuppetGate commented 9 years ago

Dammit! Found the problem! I'll sort out a fix later. Thanks for reporting.

MuppetGate commented 9 years ago

Heh heh ... Good one.

saqebakhter commented 9 years ago

Cool thanks let me know when you update packal and I'll try it again!

On Tue, Jan 13, 2015, 7:14 AM MuppetGate notifications@github.com wrote:

Heh heh ... Good one.

— Reply to this email directly or view it on GitHub https://github.com/MuppetGate/Alfred-Workflows-DateCalculator/issues/2#issuecomment-69735987 .

MuppetGate commented 9 years ago

Hi. I've put an update on Packal. Could you give it a try?

saqebakhter commented 9 years ago

Nope still getting an error here is the debug log : 

Starting debug for 'Date Calculator'

[ERROR: alfred.workflow.input.scriptfilter] Code 1: 22:34:12 workflow.py:1830 ERROR    u'ampersand' Traceback (most recent call last):   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/workflow/workflow.py", line 1828, in run     func(self)   File "date_calculator.py", line 300, in main     command_parser = DateParser(wf.settings)   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/date_parser.py", line 15, in init     self.full_date_time_expression = get_full_format_regex(settings)   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/date_functions.py", line 54, in get_full_format_regex     return DATE_TIME_MAPPINGS[settings['date-time-format']]['date-time-format'](KeyError: u'ampersand' [ERROR: alfred.workflow.input.scriptfilter] Code 1: 22:34:12 workflow.py:1830 ERROR    u'ampersand' Traceback %28most recent call last%29:   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/workflow/workflow.py", line 1828, in run     func%28self)   File "date_calculator.py", line 300, in main     command_parser = DateParser(wf.settings)   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/date_parser.py", line 15, in init     self.full_date_time_expression = get_full_format_regex(settings)   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/date_functions.py", line 54, in get_full_format_regex     return DATE_TIME_MAPPINGS[settings['date-time-format']]['date-time-format'](KeyError: u'ampersand' [ERROR: alfred.workflow.input.scriptfilter] Code 1: 22:34:13 workflow.py:1830 ERROR    u'ampersand' Traceback %28most recent call last%29:   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/workflow/workflow.py", line 1828, in run     func%28self)   File "date_calculator.py", line 300, in main     command_parser = DateParser(wf.settings)   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/date_parser.py", line 15, in init     self.full_date_time_expression = get_full_format_regex(settings)   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/date_functions.py", line 54, in get_full_format_regex     return DATE_TIME_MAPPINGS[settings['date-time-format']]['date-time-format'](KeyError: u'ampersand' [ERROR: alfred.workflow.input.scriptfilter] Code 1: 22:34:13 workflow.py:1830 ERROR    u'ampersand' Traceback %28most recent call last%29:   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/workflow/workflow.py", line 1828, in run     func%28self)   File "date_calculator.py", line 300, in main     command_parser = DateParser(wf.settings)   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/date_parser.py", line 15, in init     self.full_date_time_expression = get_full_format_regex(settings)   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/date_functions.py", line 54, in get_full_format_regex     return DATE_TIME_MAPPINGS[settings['date-time-format']]['date-time-format'](KeyError: u'ampersand' [ERROR: alfred.workflow.input.scriptfilter] Code 1: 22:34:13 workflow.py:1830 ERROR    u'ampersand' Traceback %28most recent call last%29:   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/workflow/workflow.py", line 1828, in run     func%28self)   File "date_calculator.py", line 300, in main     command_parser = DateParser(wf.settings)   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/date_parser.py", line 15, in init     self.full_date_time_expression = get_full_format_regex(settings)   File "/Users/saqakhte/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.99520EA9-3FAC-4E22-A132-5E5907042955/date_functions.py", line 54, in get_full_format_regex     return DATE_TIME_MAPPINGS[settings['date-time-format']]['date-time-format']( KeyError: u'ampersand'

--  Saqeb Akhter

On January 13, 2015 at 7:35:32 PM, MuppetGate (notifications@github.com) wrote:

Hi. I've put an update on Packal. Could you give it a try?

— Reply to this email directly or view it on GitHub.

MuppetGate commented 9 years ago

Bugger. I thought that might happen. It appear that the incorrect key has been saved in your settings file.

You have two options:

Option 1: The easy one. delete your settings file and then the workflow will rebuild it using the correct one. To do this just execute the following command in Alfred:

dcalc workflow:del settings

The problem is that if you have saved any anniversaries then they will get wiped too.

Option 2: Alter the offending entry from the settings file. This is the trickier one, but will allow you to keep your anniversary list. To do this, execute the following command in Alfred:

dcalc workflow:open data

This will open the folder where the workflow's settings file is stored. You should find a file here called settings.json. Edit the file and replace the line

"date-time-format": "ampersand",

with

"date-time-format": "@",

Save the file.

I would recommend Option 1.

Anyway, try one of those and let me know what happens.

saqebakhter commented 9 years ago

Actually both options don’t work - since it rquires using the ‘dcalc’ - it ends up giving the same error so i can del the settings or open data.

Is there a way to delete the settings via terminal ? Or some other way that doesn’t need the dcalc workflow to run ? 

--  Saqeb Akhter

On January 14, 2015 at 12:51:01 AM, MuppetGate (notifications@github.com) wrote:

Bugger. I thought that might happen. It appear that the incorrect key has been saved in your settings file.

You have two options:

Option 1: The easy one. delete your settings file and then the workflow will rebuild it using the correct one. To do this just execute the following command in Alfred:

dcalc workflow:del settings

The problem is that if you have saved any anniversaries then they will get wiped too.

Option 2: Alter the offending entry from the settings file. This is the trickier one, but will allow you to keep your anniversary list. To do this, execute the following command in Alfred:

dcalc workflow:open data

This will open the folder where the workflow's settings file is stored. You should find a file here called settings.json. Edit the file and replace the line

"date-time-format": "ampersand",

with

"date-time-format": "@",

Save the file.

I would recommend Option 1.

Anyway, try one of those and let me know what happens.

— Reply to this email directly or view it on GitHub.

saqebakhter commented 9 years ago

Scratch that i found the settings.json file - deleted it , and now everything is good!!

Thanks!

--  Saqeb Akhter

On January 14, 2015 at 1:56:45 AM, Saqeb Akhter (saqeb.akhter@gmail.com) wrote:

Actually both options don’t work - since it rquires using the ‘dcalc’ - it ends up giving the same error so i can del the settings or open data.

Is there a way to delete the settings via terminal ? Or some other way that doesn’t need the dcalc workflow to run ? 

--  Saqeb Akhter

On January 14, 2015 at 12:51:01 AM, MuppetGate (notifications@github.com) wrote:

Bugger. I thought that might happen. It appear that the incorrect key has been saved in your settings file.

You have two options:

Option 1: The easy one. delete your settings file and then the workflow will rebuild it using the correct one. To do this just execute the following command in Alfred:

dcalc workflow:del settings

The problem is that if you have saved any anniversaries then they will get wiped too.

Option 2: Alter the offending entry from the settings file. This is the trickier one, but will allow you to keep your anniversary list. To do this, execute the following command in Alfred:

dcalc workflow:open data

This will open the folder where the workflow's settings file is stored. You should find a file here called settings.json. Edit the file and replace the line

"date-time-format": "ampersand",

with

"date-time-format": "@",

Save the file.

I would recommend Option 1.

Anyway, try one of those and let me know what happens.

— Reply to this email directly or view it on GitHub.

MuppetGate commented 9 years ago

Mm. Okay thanks for letting me know. I might have to adjust the code so that settings can always be deleted.