LINE icon indicating copy to clipboard operation
LINE copied to clipboard

Typo in the findAndAddContactByXXX functions

Open ivan98 opened this issue 9 years ago • 0 comments

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 "<stdin>", line 1, in <module>
  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()

ivan98 avatar Sep 07 '16 04:09 ivan98