carpedm20 / carpedm20/LINE

Typo in the findAndAddContactByXXX functions

Open
#81 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
827
Forks
189
PR merge metrics
No merged PRs in 30d

Description

There seems to be a typo in findAndAddContactByXXX

```
Python 2.7.10 (default, Jan 10 2016, 14:48:07)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
__> from line import LineClient
__> client = LineClient(authToken="xxxx")
__> client.findAndAddContactByUserid('yyyy')
Traceback (most recent call last):
File "", line 1, in
File "line/client.py", line 27, in wrapper_check_auth
return func(*args, **kwargs)
File "line/client.py", line 192, in findAndAddContactByUserid
c = LineContact(self, contact.values()[0])
AttributeError: 'Contact' object has no attribute 'values'
```

The fix seems to be

```
$ diff -Naur line2/client.py line/client.py
--- line2/client.py 2016-09-07 11:47:38.729857006 +0800
+++ line/client.py 2016-09-04 21:52:29.243941119 +0800
@@ -189,7 +189,7 @@
self.raise_error("%s already exists" % contact.displayName)
return

- c = LineContact(self, contact.values()[0])
+ c = LineContact(self, contact)
self.contacts.append(c)

self.contacts.sort()
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.