Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Commit

Permalink
fix --authorise filepath and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
hughrun committed Dec 19, 2019
1 parent 93ddc35 commit 58d27ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,25 @@ pocketsnack -s && pocketsnack -d

The automation of `pocketsnack refresh` has _also_ been removed. This didn't really work very consistently, and was causing a lot of maintenance headaches. I'm looking at how to bring it back in a different way, but for now it's been removed.

## Getting started
## Getting started (tl;dr)

1. make sure you have installed Python 3
1. make sure you have installed Python version 3.x (preferably 3.7 or higher)
2. download `pocketsnack` using git or the download link in [releases](releases)
3. move into the top `pocketsnack` directory
3. move into the top `pocketsnack` directory (i.e. `cd pocketsnack`)
4. `pip3 install .` or if pip points to Python3, `pip install .`
5. Edit `settings/settings.py`
5. Add Pocket consumer key to `settings/settings.py`
6. `pocketsnack --authorise`
7. You are now ready to enjoy using pocketsnack

### Installing Python 3

You will need Python 3.x installed. On MacOS the easiest thing to do is to [install Python 3 using Homebrew](https://docs.brew.sh/Homebrew-and-Python): `brew install python`.

### Settings

You will need to copy `settings/settings-example.py` to a new file - `settings/settings.py` before you start. You can do this however you like, but from the command line you could use `cp settings/settings-example.py settings/settings.py`, and then edit it with a text editor like `nano` or VS Code, but any text editor will do the job.
You will need to copy `settings/settings-example.py` to a new file - `settings/settings.py` before you start. You can do this however you like, but from the command line you could use:
`cp settings/settings-example.py settings/settings.py`,
and then edit it with a text editor like `nano` or VS Code, but any text editor will do the job - you could even use TextEdit or Notepad.

You can adjust most settings, but the defaults in `settings-example.py` should be ok for most users. Check the comments in `settings.example.py` for an explanation of each setting.

Expand Down
3 changes: 1 addition & 2 deletions lib/toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ def authorise(consumer_key, redirect_uri): # With an 's'. Deal with it.
# Assign the access token to a parameter called access_token
access_token = res['access_token']
# replace the pocket_access_token line rather than just adding an extra at the end
# TODO: change this file path
settings_file = fileinput.FileInput("pocketsnack/settings.py", inplace=True)
settings_file = fileinput.FileInput("settings/settings.py", inplace=True)
repl = "pocket_access_token = " + "'" + access_token + "'"
for line in settings_file:
line = re.sub('(pocket_access_token)+.*', repl, line)
Expand Down

0 comments on commit 58d27ef

Please sign in to comment.