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

Python implementation cannot be imported as a module #23

Closed
GoogleCodeExporter opened this issue Mar 13, 2016 · 2 comments
Closed

Python implementation cannot be imported as a module #23

GoogleCodeExporter opened this issue Mar 13, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Please provide any additional information below.

First of all, thank you for your great work on this library.

I would like to be able to import the Python implementation as a module so
that I can keep a checkout of the python folder in our common directory
(which is on every system's Python path). If it functioned as a module,
then I wouldn't have to modify all Python paths and treat diff_match_patch
as an edge-case (it could just be checked out directly in the common, or
any folder on the path, and it will Just Work). This will also work for
anyone else who has a common directory already on their path and wants to
use diff_match_patch without modification of their path or creation of
symlinks.

Fix:

Create __init__.py in the python directory, with this inside:

from .diff_match_patch import diff_match_patch, patch_obj

As I understand it (via http://www.python.org/dev/peps/pep-0328/), this
relative import syntax should be compatible with 2.4 or greater. Thanks!

Original issue reported on code.google.com by mike.fot...@gmail.com on 28 Aug 2009 at 4:29

@GoogleCodeExporter
Copy link
Author

Done.  Thanks!

Original comment by neil.fra...@gmail.com on 4 Sep 2009 at 11:44

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Thanks, Neil!

Original comment by mike.fot...@gmail.com on 5 Sep 2009 at 12:02

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

No branches or pull requests

1 participant