-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
don't work plugin #5
Comments
Hmm, Trello responds with HTTPError: 401 (Unauthorized) when the token isn't correct. Maybe the token is missing some character? If you're using the default app, try removing your token from the settings ( {
"token": ""
} and running the plugin again. That will prompt the token URL so you can copy it in your browser and get the token again. If you're using a custom app, make sure your key and secret are present, like this (the values are not real): {
"key" : "4035637bf0cc1afe60cd62795839999",
"secret": "22da22634e63c6b73dfe126f1b177e1e03e73d74f93980dc4cb650c9a899999",
"token": "e5d85f0aa6cad0a8141696ab865bff73ba0f09568c0ef50cf79aac9b72899999"
}
Another option is that the app isn't authorized, to check this, go to: https://trello.com/{YOURUSERNAME}/account. If you scroll down to Applications you should see (I'll add a nicer message to this error when I have the time :), thanks for the report) |
I managed to fix the issue by switching the priority of user settings to override default settings. self.key = user_settings.get("key") or default_settings.get("key")
self.secret = user_settings.get("secret") or default_settings.get("secret") The default settings has a default key & secret which are invalid.
class CardOperation(BaseOperation):
def after_init(self):
self.custom_actions.remove("Open in Browser")
self.custom_actions.rename("Create Card", "Quick create card")
self.custom_actions.add("Create card with description", self.create_with_description)
def trello_element_property(self):
return "cards"
def next_operation_class(self):
return CardOptions
def create_with_description(self):
message = "Replace this with the card name\n\nReplace this with the card description (the card will be saved when this tab is closed, leave empty to cancel)"
self.command.output_editable(message, self)
def full_add(self, content):
for card in self.split_cards(content):
name, description = self.split_card_contents(card)
self.add(name, description)
self.restart()
def add(self, text, description = None):
self.trello_element.add_card(text, description)
def split_cards(self, content):
return content.split("##\n")
def split_card_contents(self, content):
splitted = content.split("\n\n", 1)
return (splitted[0], splitted[1] if len(splitted) > 1 else None) |
Thanks a lot for checking out the settings bug, sorry if I wasn't very helpful. I'll take a look to the batch creation in a little while :), if you want to fork the project to submit a pull request, you're more than welcome. Thanks again. |
No worries Nico. I'm still rather new to Git & Github, haven't had the time to learn the Git API yet. I will fork the project when time permits but no guarantee ;P Keep up the good work, i like what you've done so far. |
Thanks :) I didn't get a chance to look at your code today, I'll close this issue and add another one for the batch of cards. |
CrunchBang, sublimetext 3
Traceback (most recent call last):
File "/home/alex/.config/sublime-text-3/Packages/Trello/trello.py", line 100, in
sublime.set_timeout_async(lambda: self.call(fn, progress), delay)
File "/home/alex/.config/sublime-text-3/Packages/Trello/trello.py", line 103, in call
fn()
File "/home/alex/.config/sublime-text-3/Packages/Trello/trello.py", line 26, in
self.defer(lambda: self.work(trello_connection))
File "/home/alex/.config/sublime-text-3/Packages/Trello/trello_navigate.py", line 10, in work
BoardOperation(connection.me).execute(self)
File "/home/alex/.config/sublime-text-3/Packages/Trello/executable.py", line 6, in execute
self.command.display(self.items(), self.callback)
File "/home/alex/.config/sublime-text-3/Packages/Trello/operations.py", line 23, in items
self.set_collection()
File "/home/alex/.config/sublime-text-3/Packages/Trello/operations.py", line 27, in set_collection
self.collection = TrelloCollection(self.trello_element, self.trello_element_property())
File "/home/alex/.config/sublime-text-3/Packages/Trello/trello_collection.py", line 3, in init
if hasattr(trello_element, attr):
File "/home/alex/.config/sublime-text-3/Packages/Trello/lib/trollop/lib.py", line 207, in get
data = json.loads(instance._conn.get(path))
File "/home/alex/.config/sublime-text-3/Packages/Trello/lib/trollop/lib.py", line 44, in get
return self.request('GET', path, params)
File "/home/alex/.config/sublime-text-3/Packages/Trello/lib/trollop/lib.py", line 40, in request
response.raise_for_status()
File "/home/alex/.config/sublime-text-3/Packages/Trello/lib/requests/models.py", line 686, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: None
The text was updated successfully, but these errors were encountered: