karan / joe

:running: A .gitignore magician in your command line
http://karan.github.io/joe/
MIT License
2.88k stars 210 forks source link

Make joe.py play better with Python 3.x #19

Closed keph closed 9 years ago

keph commented 9 years ago

Imported print_function from __future__ so that print(somestr) is used rather than print somestr, which makes the whole thing compatible with 3.x, without breaking 2.x.

karan commented 9 years ago

Needs to be fixed.

$ joe
Traceback (most recent call last):
  File "/Users/karan/Dropbox/Codebase/General/envs/joe-test/bin/joe", line 9, in <module>
    load_entry_point('joe==0.0.5', 'console_scripts', 'joe')()
  File "/Users/karan/Dropbox/Codebase/General/envs/joe-test/lib/python3.4/site-packages/pkg_resources/__init__.py", line 474, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/karan/Dropbox/Codebase/General/envs/joe-test/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2582, in load_entry_point
    return ep.load()
  File "/Users/karan/Dropbox/Codebase/General/envs/joe-test/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2265, in load
    return self._load()
  File "/Users/karan/Dropbox/Codebase/General/envs/joe-test/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2268, in _load
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2222, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 2164, in _find_spec
  File "<frozen importlib._bootstrap>", line 1940, in find_spec
  File "<frozen importlib._bootstrap>", line 1916, in _get_spec
  File "<frozen importlib._bootstrap>", line 1897, in _legacy_get_spec
  File "<frozen importlib._bootstrap>", line 863, in spec_from_loader
  File "<frozen importlib._bootstrap>", line 904, in spec_from_file_location
  File "/Users/karan/Dropbox/Codebase/General/envs/joe-test/lib/python3.4/site-packages/joe-0.0.5-py3.4.egg/joe/joe.py", line 28
SyntaxError: from __future__ imports must occur at the beginning of the file
keph commented 9 years ago

Fixed. Sorry about that!

karan commented 9 years ago

Can you squash all these commits into one? The changes are small but 4 commits for them will make the history messy.

karan commented 9 years ago

We are adding stderr to make the output better. So closing this now.