Skip to content

Commit

Permalink
Remove api documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Kundert authored and Ken Kundert committed Jan 12, 2025
1 parent f35e75b commit c04554f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 206 deletions.
14 changes: 11 additions & 3 deletions assimilate/assimilate.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
BORG_SETTINGS,
convert_name_to_option,
get_available_configs,
get_config_dir,
set_config_dir,
read_settings,
report_setting_error
)
Expand Down Expand Up @@ -228,9 +228,18 @@ class Assimilate:
A list of Assimilate options chosen from “verbose”, “narrate”,
“dry-run”, “no-log”, “config” (config may either be given directly or in
assimilate_opts, whichever is most convenient.
config_dir (path)
A path to the directory that contains the configuration files. This
allows you to override the normal configuration directory, which is
typically ~/.config/assimilate.
"""
# Constructor {{{2
def __init__(self, config=None, assimilate_opts=None, shared_settings=None, **kwargs):
def __init__(
self, config=None, assimilate_opts=None, config_dir=None,
shared_settings=None, **kwargs
):
self.config_dir = set_config_dir(config_dir)

# assimilate options
self.assimilate_opts = assimilate_opts
if assimilate_opts is None:
Expand All @@ -252,7 +261,6 @@ def __init__(self, config=None, assimilate_opts=None, shared_settings=None, **kw
# reset the logfile so anything logged after this is placed in the
# logfile for this config
get_informer().set_logfile(LoggingCache())
self.config_dir = get_config_dir()
self.read_config(config, shared_settings, **kwargs)
self.check()
set_shlib_prefs(encoding=self.encoding if self.encoding else DEFAULT_ENCODING)
Expand Down
9 changes: 4 additions & 5 deletions assimilate/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,21 +674,20 @@ def build_validator():


# CODE {{{1
# get_config_dir() {{{2
# set_config_dir() {{{2
config_dir = to_path(CONFIG_DIR)
def get_config_dir():
return config_dir

def set_config_dir(dir):
global config_dir
if dir:
config_dir = to_path(dir)
return config_dir


# get_available_configs() {{{2
available_configs = {}
def get_available_configs(keep_shared=False):
if not available_configs:
config_files = lsf(get_config_dir(), select="*.conf.nt")
config_files = lsf(config_dir, select="*.conf.nt")
configs = {p.name[:-8]: p for p in config_files}

# warn about non-compliant config names
Expand Down
2 changes: 1 addition & 1 deletion assimilate/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def main():
queue = ConfigQueue(cmd)
while queue:
with Assimilate(
cmdline["--config"], options, shared_settings,
cmdline["--config"], options, shared_settings=shared_settings,
queue=queue, cmd_name=cmd_name, run_name=cmdline["--name"]
) as settings:
try:
Expand Down
194 changes: 0 additions & 194 deletions doc/api.rst

This file was deleted.

1 change: 0 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@ Contents
monitoring
accessories
examples
api
releases
* :ref:`genindex`
4 changes: 2 additions & 2 deletions tests/assimilate.nt
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ assimilate:
> oldest+range
> -e, --include-external list all archives in repository, not just
> those associated with chosen configuration
> -d, --deleted only archives archives marked for deletion
> -d, --deleted only consider archives marked for deletion
>
> By default all archives will listed, however you can limit the
> number shown using various command line options.
Expand Down Expand Up @@ -1651,7 +1651,7 @@ assimilate:
> oldest+range
> -e, --include-external list all archives in repository, not just
> those associated with chosen configuration
> -d, --deleted only archives archives marked for deletion
> -d, --deleted only consider archives marked for deletion
>
> By default all archives will listed, however you can limit the
> number shown using various command line options.
Expand Down

0 comments on commit c04554f

Please sign in to comment.