Pobek/restonic

Command-wide functions issue

Closed this issue · 1 comments

Pobek commented

Context

While trying to write the 'filestore_commands.py' command-set, I noticed that I write a lot of similar code that can be summed up with a single function.

Idea

While trying to come-up with a solution, I came up with a couple of ideas:

  • Create a python file that contains command-wide functions and have each command-set import said file
  • Create a python file that contains command-wide functions and pass it as a context variable to each command-set
Pobek commented

Solution

The chosen solution was to create a python file and have each command-set import said file