Skip to content

Commit

Permalink
v0.2.1: Also show “no passwords” error message if only dotfiles exist (
Browse files Browse the repository at this point in the history
…fix #19)

Signed-off-by: Chris Warrick <[email protected]>
  • Loading branch information
Kwpolska committed Dec 24, 2017
1 parent 98921ee commit 5a8d6b6
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 110 deletions.
15 changes: 9 additions & 6 deletions .pypt/AURvm/aurvm_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# AURvm client script
# Usage: ./aurvm_client.py $PROJECT $PROJECTLC $version use_git[true|false]
# Usage: ./aurvm_client.py $PROJECT $AUR_PKGNAME $AUR_PKGNAME_GIT $version use_git[true|false]
# Part of the Python Project Template.
# Copyright © 2013-2017, Chris Warrick.
# All rights reserved.
Expand Down Expand Up @@ -40,9 +41,9 @@
import sys

try:
_, project, projectlc, version, use_git = sys.argv
_, project, aur_pkgname, aur_pkgname_git, version, use_git = sys.argv
except ValueError:
print("Usage: ./aurvm_client.py $PROJECT $PROJECTLC $version use_git[true|false]")
print("Usage: ./aurvm_client.py $PROJECT $AUR_PKGANME $AUR_PKGNAME_GIT $version use_git[true|false]")

use_git = True if use_git == 'true' else False
if use_git:
Expand All @@ -56,11 +57,13 @@

data = json.dumps({
'project': project,
'projectlc': projectlc,
'aur_pkgname': aur_pkgname,
'aur_pkgname_git': aur_pkgname_git,
'version': version,
'use_git': use_git,
'gitver': gitver,
'pkgbuild': pkgbuild
'pkgbuild': pkgbuild,
'_api': '2'
}, ensure_ascii=True, sort_keys=True).encode('utf-8')

print(base64.b64encode(data).decode('utf-8'))
2 changes: 0 additions & 2 deletions .pypt/AURvm/aurvm_heartbeat.sh

This file was deleted.

77 changes: 0 additions & 77 deletions .pypt/AURvm/aurvm_host.py

This file was deleted.

7 changes: 5 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Appendix C. Changelog
:Author: Chris Warrick <[email protected]>
:Copyright: © 2015-2017, Chris Warrick.
:License: BSD (see /LICENSE or :doc:`Appendix B <LICENSE>`.)
:Date: 2017-06-10
:Version: 0.2.0
:Date: 2017-12-24
:Version: 0.2.1

.. index:: CHANGELOG

Expand All @@ -19,6 +19,9 @@ More information can be found on GitHub in the `releases section
Version History
===============

0.2.1
* Also show “no passwords” error message if only dotfiles exist (fix #19)

0.2.0
More granular copying features: users can now choose between copying the first line (old default), copying the entire text, or copying specific fields that are separated with ``: `` (colon, space).
Expand Down
2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Chris Warrick <[email protected]>
pkgname=upass
_pyname=upass
pkgver=0.2.0
pkgver=0.2.1
pkgrel=1
pkgdesc='Console UI for pass'
arch=('any')
Expand Down
2 changes: 1 addition & 1 deletion PKGBUILD-git
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pkgname=upass-git
_pyname=upass
_gitname=upass
pkgver=0.2.0
pkgver=0.2.1
pkgrel=1
pkgdesc='Console UI for pass (git version)'
arch=('any')
Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ upass. Console UI for pass.
:Info: This is the README file for upass.
:Author: Chris Warrick <[email protected]>
:Copyright: © 2015-2017, Chris Warrick.
:Date: 2017-06-10
:Version: 0.2.0
:Date: 2017-12-24
:Version: 0.2.1

.. image:: https://chriswarrick.com/galleries/upass/directory-listing.png

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ upass. Console UI for pass.
:Info: This is the README file for upass.
:Author: Chris Warrick <[email protected]>
:Copyright: © 2015-2017, Chris Warrick.
:Date: 2017-06-10
:Version: 0.2.0
:Date: 2017-12-24
:Version: 0.2.1

.. image:: https://chriswarrick.com/galleries/upass/directory-listing.png

Expand Down
7 changes: 5 additions & 2 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Appendix C. Changelog
:Author: Chris Warrick <[email protected]>
:Copyright: © 2015-2017, Chris Warrick.
:License: BSD (see /LICENSE or :doc:`Appendix B <LICENSE>`.)
:Date: 2017-06-10
:Version: 0.2.0
:Date: 2017-12-24
:Version: 0.2.1

.. index:: CHANGELOG

Expand All @@ -19,6 +19,9 @@ More information can be found on GitHub in the `releases section
Version History
===============

0.2.1
* Also show “no passwords” error message if only dotfiles exist (fix #19)

0.2.0
More granular copying features: users can now choose between copying the first line (old default), copying the entire text, or copying specific fields that are separated with ``: `` (colon, space).
Expand Down
4 changes: 2 additions & 2 deletions docs/LICENSE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Appendix B. License for upass
:Author: Chris Warrick <[email protected]>
:Copyright: © 2015-2017, Chris Warrick.
:License: BSD (see /LICENSE or :doc:`Appendix B <LICENSE>`.)
:Date: 2017-06-10
:Version: 0.2.0
:Date: 2017-12-24
:Version: 0.2.1

.. index:: LICENSE

Expand Down
4 changes: 2 additions & 2 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ upass. Console UI for pass.
:Info: This is the README file for upass.
:Author: Chris Warrick <[email protected]>
:Copyright: © 2015-2017, Chris Warrick.
:Date: 2017-06-10
:Version: 0.2.0
:Date: 2017-12-24
:Version: 0.2.1

.. image:: https://chriswarrick.com/galleries/upass/directory-listing.png

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = '0.2.0'
version = '0.2.1'
# The full version, including alpha/beta/rc tags.
release = '0.2.0'
release = '0.2.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
dependencies = [l.strip() for l in fh]

setup(name='upass',
version='0.2.0',
version='0.2.1',
description='Console UI for pass.',
keywords='upass',
author='Chris Warrick',
Expand Down
4 changes: 2 additions & 2 deletions upass/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- encoding: utf-8 -*-
# upass v0.2.0
# upass v0.2.1
# Console UI for pass.
# Copyright © 2015-2017, Chris Warrick.
# All rights reserved.
Expand Down Expand Up @@ -44,7 +44,7 @@
import configparser

__title__ = 'upass'
__version__ = '0.2.0'
__version__ = '0.2.1'
__author__ = 'Chris Warrick'
__license__ = '3-clause BSD'
__docformat__ = 'restructuredtext en'
Expand Down
18 changes: 12 additions & 6 deletions upass/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- encoding: utf-8 -*-
# upass v0.2.0
# upass v0.2.1
# Console UI for pass.
# Copyright © 2015-2017, Chris Warrick.
# See /LICENSE for licensing information.
Expand Down Expand Up @@ -177,11 +177,7 @@ def __init__(self):
self.current = '.'
self.dir_load(None, self.current)
else:
self._clear_box()
self.box.body.extend([
urwid.Text(("error", 'Your Password Store is empty.')),
urwid.Text('Please use the `pass` command to create passwords. upass is a read-only browser.'),
urwid.Text('Press q to exit.')])
self.show_empty_error()

column_data = [
urwid.Button('DiSplay', self.display_selected),
Expand Down Expand Up @@ -366,6 +362,8 @@ def dir_load(self, originator, dirname):
self.box.body.append(BackButton('..', self.dir_load, prevdir,
self))
else:
if not new_directories and not new_passwords:
self.show_empty_error()
self.back_callback = None
self._make_directory_buttons(new_directories)
self._make_password_buttons(new_passwords)
Expand Down Expand Up @@ -467,6 +465,14 @@ def downlevel(self, event=None):
b = self.box.get_focus()[0]
b._emit('click')

def show_empty_error(self):
"""Show an error when the store is empty."""
self._clear_box()
self.box.body.extend([
urwid.Text(("error", 'Your Password Store is empty.')),
urwid.Text('Please use the `pass` command to create passwords. upass is a read-only browser.'),
urwid.Text('Press q to exit.')])

def _make_directory_buttons(self, new_directories):
"""Add directory buttons to the box."""
for i in new_directories:
Expand Down

0 comments on commit 5a8d6b6

Please sign in to comment.