Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to specify a notebook stack when creating a new notebook #309

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion geeknote/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
"arguments": {
"--title": {"altName": "-t",
"help": "Set the title of new notebook."},
"--stack": {"help": "Specify notebook stack container."},
}
},
"notebook-edit": {
Expand Down Expand Up @@ -438,4 +439,4 @@ def printHelp(self):
out.printLine("Available flags:")
for flag in self.CMD_FLAGS:
out.printLine("%s : %s" % (flag.rjust(tab, " "),
self.CMD_FLAGS[flag]['help']))
self.CMD_FLAGS[flag]['help']))
8 changes: 5 additions & 3 deletions geeknote/geeknote.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,11 @@ def findNotebooks(self):
return self.getNoteStore().listNotebooks(self.authToken)

@EdamException
def createNotebook(self, name):
def createNotebook(self, name, stack):
notebook = Types.Notebook()
notebook.name = name
if stack:
notebook.stack = stack

logging.debug("New notebook : %s", notebook)

Expand Down Expand Up @@ -515,10 +517,10 @@ def list(self):
result = self.getEvernote().findNotebooks()
out.printList(result)

def create(self, title):
def create(self, title, stack=None):
self.connectToEvertone()
out.preloader.setMessage("Creating notebook...")
result = self.getEvernote().createNotebook(name=title)
result = self.getEvernote().createNotebook(name=title, stack=stack)

if result:
out.successMessage("Notebook has been successfully created.")
Expand Down