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

Re-organized code and a lot of other stuff. #342

Merged
merged 25 commits into from May 22, 2012

Conversation

Projects
None yet
6 participants
@FiloSottile
Collaborator

FiloSottile commented May 1, 2012

Here is my recent work on youtube-dl. I've been really bold, but I tried to keep it elegant, in line with the philosophy of this project and tested.
Let's enumerate the changes:

  • [ #193 ] I've split the code in a python package, that is a bunch of files inside the youtube_dl directory. The package gets compiled by make compile into an executable zipfile. The zipfile is prepended with a shebang so that it remains executable on Linux.
    • This is a really stable and portable way to distribute the code: it is a single file; it behaves exactly as a script (supported on Python >= 2.6); the tracebacks are readable; it is compatible with all the platforms I was able to test on.
    • Please read that StackOverflow discussion and the relevant Python bug as a reference.
  • [ #153 ] I've written build_exe.py and wine-py2exe.sh that creates a Windows EXE automatically using WINE that is able to update itself.
    • When executed, wine-py2exe.sh creates a WINEPREFIX in wine-py2exe/, installs Python and py2exe inside it and the creates the exe using the setup.py passed as argument (build_exe.py).
    • That required a lot of hacks: the WINE support is achieved patching the PE headers of the template executables of py2exe; the -U writes a bat file and executes it before dying.
  • I dropped Python 2.5 support. Because:
  • [ #296 ] Moved increment_downloads and process_info calls from IEs to FD.download; a small step towards importability (#217)

That pull request includes the following branches, so refer to them for what the changes are:

This is a fast-forward ready merge from the current upstream.

@FiloSottile

This comment has been minimized.

Owner

FiloSottile commented on d77c3df Mar 30, 2012

@FiloSottile

This comment has been minimized.

Owner

FiloSottile commented on 770234a Mar 30, 2012

phihag added a commit that referenced this pull request May 22, 2012

Merge pull request #342 from FiloSottile/master
Re-organized code and a lot of other stuff.

@phihag phihag merged commit 1b91a2e into rg3:master May 22, 2012

@phihag

This comment has been minimized.

Collaborator

phihag commented May 22, 2012

These changes are too good to be left out. Merged all of them. I might change some details though before releasing a new version.

@mirabilos

This comment has been minimized.

mirabilos commented on d77c3df Oct 31, 2012

Excuse me, but, what?!

This breaks my Python, which chokes on the zip binary junk.

This comment has been minimized.

Contributor

Tailszefox replied Oct 31, 2012

Which version of Python are you using? This new format works perfectly with Python >=2.6 but is unsupported by other versions. If you have a lower version and can't upgrade, try giving a look at the FAQ which outlines a way to make it work with lower versions.

This comment has been minimized.

Collaborator

FiloSottile replied Oct 31, 2012

If you are using cPython 2.5, well, you have a bigger problem than this. Otherwise, it will work fine. Also, this is the common way to ship Python packages, the zipfile is only a commodity, you can grab the package folder and run that.

This comment has been minimized.

mirabilos replied Oct 31, 2012

Ah okay. Ouch. Looks like I’m going to have to port a newer Python then… the latest of 2.7 would be best I suppose.

This comment has been minimized.

Collaborator

FiloSottile replied Oct 31, 2012

This comment has been minimized.

mirabilos replied Oct 31, 2012

Okay, thanks anyway. It used to work well. I wonder how much I have to fix BitTorrent 3.4 to work with Python 2.7 though… bumping it from 2.3 to 2.5 was “fun” already. But that’s not your construction site. Thanks for the heads-up (I thought I had received a garbage file until I found this after some discussion on Debian) and your work on this program.

@remitamine

This comment has been minimized.

Collaborator

remitamine commented on 9e6dd23 Apr 7, 2016

why the html unescape that came with python http://stackoverflow.com/a/2360639 is not used it can handle two cases that the unescapeHTML can't(' and the ones that start with &#X) and it was improved in the last version(handle HTML5 named character references).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment