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

Ticket/18934 #10

Merged
merged 8 commits into from
Apr 19, 2012
Merged

Ticket/18934 #10

merged 8 commits into from
Apr 19, 2012

Conversation

melinath
Copy link
Contributor

This pull request resolves the following tickets:

The actual work involved is a refactor of SuiteMethods into VideoLoaders; it further decouples video data loading from suites.

Travis doesn't seem to be building vidscraper atm, but all tests are passing locally.

This decouples videos from suites, which makes sense. It also allows for more subtle distinctions of handling vs. not handling video urls.
Also includes some corrections to the core API caught during testing.
Plays nicer with PathMixins, which seem to be a nice way of getting path parsing to multiple loaders. Set up the mixin to layer the endpoint formatting on top of the normal formatting, since it makes things work more "as expected".
@paulswartz
Copy link
Contributor

Looks like Travis did run the build, and it failed: http://travis-ci.org/#!/pculture/vidscraper/builds/1086383

I haven't looked at the code yet, but it's in my queue.

Update: the tests are passing locally for me; not sure what's up with Travis.

return {}


class OEmbedMixin(object):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems strange that this is a mixin, rather than a subclass of VideoLoader. Is this functionality useful other than when mixed with VideoLoader?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it originally was a subclass of VideoLoader; I switched it to a mixin to make it easier to combine with other mixins (specifically, the path mixins used by a couple of suites.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I noticed that you made a commit about that. It's not obvious from the code, however; can you add a comment, or a docstring, about why it's implemented this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a note.

@paulswartz
Copy link
Contributor

Updated update: tests are failing, looks like a Vimeo problem:

======================================================================
ERROR: test_video (vidscraper.tests.integration.test_vimeo.VimeoIntegrationTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/vagrant/src/vidscraper/vidscraper/tests/integration/test_vimeo.py", line 40, in test_video
    video.load()
  File "/vagrant/src/vidscraper/vidscraper/videos.py", line 153, in load                                                                                                                                                                
    data = self.run_loaders()
  File "/vagrant/src/vidscraper/vidscraper/videos.py", line 223, in run_loaders
    data.update(loader.get_video_data(response))
  File "/vagrant/src/vidscraper/vidscraper/suites/vimeo.py", line 102, in get_video_data
    doc = minidom.parseString(response.text)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 1928, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python2.6/xml/dom/expatbuilder.py", line 940, in parseString
    return builder.parseString(string)
  File "/usr/lib/python2.6/xml/dom/expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
ExpatError: mismatched tag: line 33, column 2
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): vimeo.com
requests.packages.urllib3.connectionpool: DEBUG: "GET /api/v2/video/7981161.json HTTP/1.1" 200 487
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): www.vimeo.com
requests.packages.urllib3.connectionpool: DEBUG: "GET /moogaloop/load/clip:7981161 HTTP/1.1" 301 249
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): vimeo.com
requests.packages.urllib3.connectionpool: DEBUG: "GET /moogaloop/load/clip:7981161 HTTP/1.1" 404 6078
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 82 tests in 15.227s

@melinath
Copy link
Contributor Author

Travis did run the branch, but it hasn't run the branch since 7cd225f (the first commit in this branch) which is why it failed. The vimeo test does fail, but sporadically - and I'm pretty sure it does the same on the develop branch.

@melinath
Copy link
Contributor Author

I think all of the current notes have been addressed; let me know if there's anything else you'd like to see.

@paulswartz
Copy link
Contributor

The changes look good.

paulswartz added a commit that referenced this pull request Apr 19, 2012
@paulswartz paulswartz merged commit b9a2058 into develop Apr 19, 2012
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

Successfully merging this pull request may close these issues.

2 participants