Skip to content

Commit

Permalink
Replace windows docs with cygwin instructions/path
Browse files Browse the repository at this point in the history
  • Loading branch information
ahupp committed Jan 4, 2014
1 parent 4081eb6 commit fc73c30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ Other sources:

### Dependencies

On Windows, you need to download and save the following libraries under
`C:\Windows\System32`:

- `regex2.dll` from [sourceforge.net/projects/gnuwin32/files/regex/](http://sourceforge.net/projects/gnuwin32/files/regex/)
- `zlib1.dll` from [sourceforge.net/projects/gnuwin32/files/zlib/](http://sourceforge.net/projects/gnuwin32/files/zlib/)
- `magic1.dll` from [sourceforge.net/projects/gnuwin32/files/file/](http://sourceforge.net/projects/gnuwin32/files/file/)
On Windows, install Cygwin (http://cygwin.com/install.html). To find
the libraries, either add <your-cygwin-install>/bin to the $PATH or
copy cygwin1.dll, cygz.dll, and cygmagic-1.dll to C:\Windows\System32

On OSX:

Expand Down
6 changes: 3 additions & 3 deletions magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ def from_buffer(buffer, mime=False):
import sys
platform_to_lib = {'darwin': ['/opt/local/lib/libmagic.dylib',
'/usr/local/lib/libmagic.dylib'] +
# Assumes there will only be one version installed
glob.glob('/usr/local/Cellar/libmagic/*/lib/libmagic.dylib'),
'win32': ['magic1.dll']}
# Assumes there will only be one version installed
glob.glob('/usr/local/Cellar/libmagic/*/lib/libmagic.dylib'),
'win32': ['magic1.dll','cygmagic-1.dll']}
for dll in platform_to_lib.get(sys.platform, []):
try:
libmagic = ctypes.CDLL(dll)
Expand Down

0 comments on commit fc73c30

Please sign in to comment.