# mini_buildd.changes module

class mini_buildd.changes.Base(initial_value)

  Bases: `Changes`

  file_name()
  dir_path()
  dsc_file_path()
  get_files(key=None)
  add_file(file_name)
  upload_file_path()
  uploaded()
  upload(endpoint, force=False)
  tar()
  untar(dir_path)
  save_as(file_path, gnupg=None)

    Write to file (optionally signed)

  move_to(path)
  copy_to(path)

class mini_buildd.changes.Changes(initial_value)

  Bases: `Base`

  FILE_APX = ''
  MANDATORY = {'Architecture': '', 'Distribution': '', 'Source': '', 'Version': ''}

    <key>: <public_hint>

  classmethod match(file_path)
  key

    Key to identify if a ‘Package’ (Upload, Buildrequest, Buildresult).

  bkey

    Key to identify a ‘Build’ (Buildrequest, Buildresult).

  get_events_path(*args)
  property timecode
  cget(field, default=None)
  cset(field, value)
  fields()
  to_event_json()
  save_to(dir_path, tar=None)

class mini_buildd.changes.Upload(initial_value, **kwargs)

  Bases: `Changes`

  class Options(upload_changes)

    Bases: `object`

    Uploader options in changes

        >>> config.ROUTES = config.Routes("./test-data/home")   # We need ROUTES setup

        >>> f"{Upload.Options(Base('test-data/changes.options'))}"
        "auto-ports=['jessie-test-unstable', 'squeeze-test-snasphot'], autopkgtest-mode=errfail, internal-apt-priority=543, lintian-mode=errfail, piuparts-mode=errfail"

        >>> f"{Upload.Options(Base('test-data/changes.options_1.0'))}"
        "auto-ports=['jessie-test-unstable', 'squeeze-test-snasphot'], internal-apt-priority=543, lintian-mode=errfail, lintian-mode[i386]=disabled"

        >>> f"{Upload.Options(Base('test-data/changes.options_0.8'))}"
        "auto-ports=['jessie-test-unstable', 'squeeze-test-snasphot'], lintian-mode=ignore"

    class Bool(raw_value)

      Bases: `object`

    class Int(raw_value)

      Bases: `object`

    class Str(raw_value)

      Bases: `object`

    class CSV(raw_value)

      Bases: `object`

    KEYWORD = 'MINI_BUILDD_OPTION'
    classmethod usage()
    get(key, alt=None, default=None)

      Get first existing option value in this order: key[a], key, default

  MANDATORY = {'Architecture': '', 'Changed-By': 'Maybe the changelog entry was not finalised?', 'Distribution': '', 'Source': '', 'Version': ''}

    <key>: <public_hint>

  check_mode(checker, alt, fallback_mode_int)

    Get check mode from upload options, with fallback

  request_builds(repository, distribution, suite_option)

    Build buildrequest files for all architectures

class mini_buildd.changes.Buildrequest(initial_value, **kwargs)

  Bases: `Changes`

  FILE_APX = 'mini-buildd-buildrequest'
  check_mode(checker)

    Get check mode from checker (lintian, piuparts, autopkgtest)

  check_extra_options(checker)

    Get check mode from checker (lintian, piuparts, autopkgtest)

  gen_buildresult()
  schroot_name()

    Schroot name w/o namespace (see `schroot --list`)

    Must produce same as `mbd_schroot_name()`.

class mini_buildd.changes.Buildresult(initial_value)

  Bases: `Changes`

  FILE_APX = 'mini-buildd-buildresult'
  success(upload, distribution, ignore_checks)

mini_buildd.changes.incoming2queue(file_path)