~mapperr/trl

7e7e0099442b89d24c8ddff270067f93561c0c97 — mapperr 1 year, 7 months ago 2f3f73d
Readme little revision and other little things
4 files changed, 15 insertions(+), 16 deletions(-)

M README.md
M trl
M trullo.py
M trullo/usecases.py
M README.md => README.md +8 -11
@@ 7,7 7,7 @@ A dumb trello cli with shortcuts.

Get the repo and run `pipenv install` in it.

You don't have pipenv installed? Shame on you.\
You don't have pipenv installed? \
([Here](https://pipenv.readthedocs.io/en/latest/install/#pragmatic-installation-of-pipenv)
is how you can get it, but usually is a `pip install --user pipenv`)



@@ 37,7 37,7 @@ Here is the usage (check `trl -h` too):
        shows the boards you can access
        with board_shortcut you can select the board you want to work with

    trl l [<list_shortcut>]
    trl l [<list_shortcut> [<list_shortcut>]]
        shows lists and cards in the board you have currently selected
        with list_shortcut you can show cards of a single list



@@ 48,10 48,10 @@ Here is the usage (check `trl -h` too):
        shows the card infos
        with o it opens the card shortUrl with your default browser
        with m and a target list you can move the card to that list
        with e you can edit the card title and description in your editor
        with e you can edit the card title and description in your $EDITOR

    trl c n <list_shortcut>
        create a new card in the list specified by list_shortcut
        pops your $EDITOR to create a new card in the list specified by list_shortcut

    trl g <api_path>
        make a direct api call adding auth params automatically (for debugging/hacking purpose)


@@ 66,15 66,12 @@ you get something like this:

    trl c arch m done

Oh, everything is kept lowercase, holding shift is a pain in the ass.
Everything is kept lowercase, holding shift is a pain in the ass.


## Notes

I know, It's nothing fancy, I just started it to check some trello stuff
directly in the terminal, and eventually edit them.
I know, It's nothing fancy, I just started because I have to use Trello
and I wanted to check some stuff directly from the terminal, and eventually
edit them or open them in the browser.


### Development board

- https://trello.com/b/fuK3ff2z

M trl => trl +1 -0
@@ 10,5 10,6 @@ done
SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"

cd $SCRIPT_DIR >/dev/null

pipenv run python trullo.py $@


M trullo.py => trullo.py +1 -1
@@ 77,7 77,7 @@ if __name__ == '__main__':
    tclient = TClient()

    tmpdir = tempfile.gettempdir()
    selected_board_filepath = f'{tmpdir}/.trl-selected-board'
    selected_board_filepath = f'{tmpdir}/trl-selected-board'

    usecases = Usecases(TConfig(selected_board_filepath),
                        TClient(),

M trullo/usecases.py => trullo/usecases.py +5 -4
@@ 28,7 28,7 @@ class Usecases:
        if os.path.exists(self.tconfig.selected_board_filepath):
            with open(self.tconfig.selected_board_filepath, 'r') as fh:
                selected_board_id, selected_board_name = \
                    fh.readline().split(' ', 1)
                    fh.readline().split(',', 1)
                self.selected_board_id = selected_board_id
                self.selected_board_name = selected_board_name
                return selected_board_id, selected_board_name


@@ 62,11 62,12 @@ class Usecases:
            print(
                f'shortcut [{board_shortcut}] matches more than one board: '
                f'{matching_names}')
            exit(1)
            return
        board = matching_boards[0]
        print(f'selected board {board.raw_data["name"]}')

        # file
        with open(self.tconfig.selected_board_filepath, 'w') as fh:
            fh.write(f'{board.id} {board.raw_data["name"]}')
            fh.write(f'{board.id},{board.raw_data["name"]}')

    def print_board_lists(self):
        board = self.tclient.get_board(self.selected_board_id)