Skip to content
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

Attribute Error #9

Closed
jaxgeller opened this issue Sep 25, 2013 · 3 comments
Closed

Attribute Error #9

jaxgeller opened this issue Sep 25, 2013 · 3 comments

Comments

@jaxgeller
Copy link

I'm trying the basic example to upload a picture to imgur, but whenever I get to the attributes like data, url, link, i get AttributeError: Image instance has no attribute 'date'.

Here is the code I have

import pyimgur
CLIENT_ID = ""
PATH = "/Users/jacksongeller/Desktop/imgur/sample.png"




im = pyimgur.Imgur(CLIENT_ID)
uploaded_image = im.upload_image(PATH, title="Uploaded with PyImgur")
print(uploaded_image.title)
print(uploaded_image.date)
print(uploaded_image.url)
print(uploaded_image.link)

here is the error

$ python main.py
Uploaded with PyImgur
Traceback (most recent call last):
  File "main.py", line 11, in <module>
    print(uploaded_image.date)
  File "/Library/Python/2.7/site-packages/pyimgur/__init__.py", line 70, in __getattr__
    (type(self).__name__, attribute))
AttributeError: Image instance has no attribute 'date'

Am I missing something basic? or a syntax error? I cannot seem to figure it out. Thanks in advance. great module by the way

@Damgaard
Copy link
Owner

It's my mistake. I've updated the library but forgotten to update the documenation. Really sorry about that.

import pyimgur
CLIENT_ID = ""
PATH = "/Users/jacksongeller/Desktop/imgur/sample.png"

im = pyimgur.Imgur(CLIENT_ID)
uploaded_image = im.upload_image(PATH, title="Uploaded with PyImgur")
print(uploaded_image.title)
print(uploaded_image.datetime)
print(uploaded_image.link)

I have a page on readthedocs with an overview over what attributes are available for what classes.

Glad to hear that you like the library!

@jaxgeller
Copy link
Author

Works great thanks!

@Damgaard
Copy link
Owner

Super!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants