Skip to content

Commit

Permalink
Merge pull request #138 from zcutlip/development
Browse files Browse the repository at this point in the history
Merge development into main for issue #136
  • Loading branch information
zcutlip committed Jun 26, 2023
2 parents fcf2539 + 2f2c74a commit 3ced5ac
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

All notable changes to this project will be documented in this file.

## [3.12.1] 2023-06-26

### Fixed

- `OP.item_create()` broken due to subcommand args not added to arugment list (gh-136)

### Miscellaneous

- Fixed `scripts/batch_create.py` not setting tags properly
- Enable console debug logging in `scripts/batch_create.py`


## [3.12.0] 2023-06-22

### Added
Expand Down
1 change: 1 addition & 0 deletions dev-reqs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ colored-traceback
flake8
ipython
pycodestyle
twine
-e .
-r test-reqs.txt
-r requirements.txt
2 changes: 1 addition & 1 deletion pyonepassword/__about__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = "pyonepassword"
__version__ = "3.12.0"
__version__ = "3.12.1"
__summary__ = "A python API to query a 1Password account using the 'op' command-line tool"

"""
Expand Down
3 changes: 2 additions & 1 deletion pyonepassword/_op_cli_argv.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ def item_create_argv(cls,
item_create_args.append(f"--generate-password={password_recipe}")
if vault:
item_create_args.extend(["--vault", vault])
argv = cls.item_generic_argv(op_exe, "create")
argv = cls.item_generic_argv(
op_exe, "create", sub_cmd_args=item_create_args)
return argv

@classmethod
Expand Down
7 changes: 4 additions & 3 deletions scripts/batch_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from argparse import ArgumentParser, Namespace
from typing import List, Optional

from pyonepassword import OP
from pyonepassword import OP, logging
from pyonepassword.api.constants import LETTERS_DIGITS_SYMBOLS_20
from pyonepassword.api.object_types import (
OPItemField,
Expand Down Expand Up @@ -59,7 +59,8 @@ def batch_create_parse_args():

def create_items(options: Namespace):
# 1password will prompt for auth, either biometric or on the console
op = OP()
logger = logging.console_logger("batch_create", level=logging.DEBUG)
op = OP(logger=logger)
count = options.count
vault = options.vault
item_name_base = options.name
Expand All @@ -83,7 +84,7 @@ def create_items(options: Namespace):
password = LETTERS_DIGITS_SYMBOLS_20
if category == "login":
username = f"{username_base}{i:02d}"
item_template = OPLoginItemTemplate(title, username, tags=tags)
item_template = OPLoginItemTemplate(title, username, tags=_tags)
elif category == "password":
item_template = OPPasswordItemTemplate(title, tags=_tags)
else:
Expand Down

0 comments on commit 3ced5ac

Please sign in to comment.