Skip to content

Commit

Permalink
setup modifications to copy script to home
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek-anand committed Sep 13, 2016
1 parent 0717ca7 commit 84d2b04
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Automatically save python interpreter code to a file or secret Gist. You can tur

``` bash
pip install pysession
echo 'export PYTHONSTARTUP=~/.pysession/pysession.py' >> ~/.bashrc
echo 'export PYTHONSTARTUP=$HOME/.pysession/pysession.py' >> ~/.bashrc
```

If you are using zsh replace `.bashrc` in the above line with `.zshrc` and similarly for any other shell.
Expand Down
2 changes: 1 addition & 1 deletion pysession.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def load_history_urls(cls):
PySession.previous_sessions = pickle.load(
io.open(SESSIONS_STORAGE, 'rb'))
stdout.write(LAST_GISTS)
for session_url in previous_sessions:
for session_url in PySession.previous_sessions:
stdout.write('\t' + session_url + '\n')

@classmethod
Expand Down
13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
from __future__ import print_function
from setuptools import setup
import os
from os.path import exists, expanduser
from shutil import copyfile

ROOT = os.path.abspath(os.path.dirname(__file__))

print(ROOT)

if not os.path.exists(expanduser('~') + '/.pysession'):
os.makedirs(expanduser('~') + '/.pysession')

copyfile(ROOT + '/pysession.py', expanduser('~') + '/.pysession/pysession.py')


setup(
Expand Down

0 comments on commit 84d2b04

Please sign in to comment.