Package coprs :: Module models :: Class Build
[hide private]
[frames] | no frames]

Class Build

source code


Representation of one build in one copr

Nested Classes [hide private]

Inherited from flask_sqlalchemy.Model: query_class

Instance Methods [hide private]
 
get_chroots_by_status(self, statuses=None)
Get build chroots with states which present in `states` list If states == None, function returns build_chroots
source code
 
to_dict(self, options=None, with_chroot_states=False)
Usage:
source code
 
__init__(self, **kwargs)
A simple constructor that allows initialization from kwargs.
source code

Inherited from unreachable.Model: query

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __table_args__ = (Index('build_canceled', Column('canceled', B...
  id = db.Column(db.Integer, primary_key= True)
  pkgs = db.Column(db.Text)
  built_packages = db.Column(db.Text)
  pkg_version = db.Column(db.Text)
  canceled = db.Column(db.Boolean, default= False)
  repos = db.Column(db.Text)
  submitted_on = db.Column(db.Integer, nullable= False)
  results = db.Column(db.Text)
  memory_reqs = db.Column(db.Integer, default= constants.DEFAULT...
  timeout = db.Column(db.Integer, default= constants.DEFAULT_BUI...
  enable_net = db.Column(db.Boolean, default= False, server_defa...
  source_type = db.Column(db.Integer, default= helpers.BuildSour...
  source_json = db.Column(db.Text)
  fail_type = db.Column(db.Integer, default= helpers.FailTypeEnu...
  is_background = db.Column(db.Boolean, default= False, server_d...
  user_id = db.Column(db.Integer, db.ForeignKey("user.id"))
  user = db.relationship("User", backref= db.backref("builds"))
  copr_id = db.Column(db.Integer, db.ForeignKey("copr.id"))
  copr = db.relationship("Copr", backref= db.backref("builds"))
  package_id = db.Column(db.Integer, db.ForeignKey("package.id"))
  package = db.relationship("Package")
  chroots = association_proxy("build_chroots", "mock_chroot")
  __mapper__ = <Mapper at 0x7fee48ee3110; Build>
  __table__ = Table('build', MetaData(bind=None), Column('id', I...
  __tablename__ = 'build'
  _sa_class_manager = <ClassManager of <class 'coprs.models.Buil...

Inherited from unreachable.Model: metadata

Inherited from unreachable.Model (private): _decl_class_registry

Properties [hide private]
  user_name
  group_name
  copr_name
  fail_type_text
  is_older_results_naming_used
  repos_list
  result_dir_name
  source_json_dict
  started_on
  min_started_on
  ended_on
  max_ended_on
  chroots_started_on
  chroots_ended_on
  source_type_text
  source_metadata
  chroot_states
  chroots_dict_by_name
  has_pending_chroot
  has_unfinished_chroot
  has_importing_chroot
  status
Return build status according to build status of its chroots
  state
Return text representation of status of this build
  cancelable
Find out if this build is cancelable.
  repeatable
Find out if this build is repeatable.
  finished
Find out if this build is in finished state.
  persistent
Find out if this build is persistent.
  src_pkg_name
Extract source package name from source name or url todo: obsolete
  package_name

Inherited from helpers.Serializer: serializable_attributes

Inherited from object: __class__

Method Details [hide private]

to_dict(self, options=None, with_chroot_states=False)

source code 

Usage:

SQLAlchObject.to_dict() => returns a flat dict of the object
SQLAlchObject.to_dict({"foo": {}}) => returns a dict of the object
    and will include a flat dict of object foo inside of that
SQLAlchObject.to_dict({"foo": {"bar": {}}, "spam": {}}) => returns
    a dict of the object, which will include dict of foo
    (which will include dict of bar) and dict of spam.

Options can also contain two special values: __columns_only__
and __columns_except__

If present, the first makes only specified fiels appear,
the second removes specified fields. Both of these fields
must be either strings (only works for one field) or lists
(for one and more fields).

SQLAlchObject.to_dict({"foo": {"__columns_except__": ["id"]},
    "__columns_only__": "name"}) =>

The SQLAlchObject will only put its "name" into the resulting dict,
while "foo" all of its fields except "id".

Options can also specify whether to include foo_id when displaying
related foo object (__included_ids__, defaults to True).
This doesn"t apply when __columns_only__ is specified.

Overrides: helpers.Serializer.to_dict
(inherited documentation)

__init__(self, **kwargs)
(Constructor)

source code 

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in ``kwargs``.

Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships.

Overrides: object.__init__

Class Variable Details [hide private]

__table_args__

Value:
(Index('build_canceled', Column('canceled', Boolean(), table=<build>, \
default=ColumnDefault(False))))

memory_reqs

Value:
db.Column(db.Integer, default= constants.DEFAULT_BUILD_MEMORY)

timeout

Value:
db.Column(db.Integer, default= constants.DEFAULT_BUILD_TIMEOUT)

enable_net

Value:
db.Column(db.Boolean, default= False, server_default= "0", nullable= F\
alse)

source_type

Value:
db.Column(db.Integer, default= helpers.BuildSourceEnum("unset"))

fail_type

Value:
db.Column(db.Integer, default= helpers.FailTypeEnum("unset"))

is_background

Value:
db.Column(db.Boolean, default= False, server_default= "0", nullable= F\
alse)

__table__

Value:
Table('build', MetaData(bind=None), Column('id', Integer(), table=<bui\
ld>, primary_key=True, nullable=False), Column('pkgs', Text(), table=<\
build>), Column('built_packages', Text(), table=<build>), Column('pkg_\
version', Text(), table=<build>), Column('canceled', Boolean(), table=\
<build>, default=ColumnDefault(False)), Column('repos', Text(), table=\
<build>), Column('submitted_on', Integer(), table=<build>, nullable=Fa\
lse), Column('results', Text(), table=<build>), Column('memory_reqs', \
Integer(), table=<build>, default=ColumnDefault(2048)), Column('timeou\
...

_sa_class_manager

Value:
<ClassManager of <class 'coprs.models.Build'> at 7fee48ed5740>

Property Details [hide private]

user_name

Get Method:
unreachable.user_name(self)

group_name

Get Method:
unreachable.group_name(self)

copr_name

Get Method:
unreachable.copr_name(self)

fail_type_text

Get Method:
unreachable.fail_type_text(self)

is_older_results_naming_used

Get Method:
unreachable.is_older_results_naming_used(self)

repos_list

Get Method:
unreachable.repos_list(self)

result_dir_name

Get Method:
unreachable.result_dir_name(self)

source_json_dict

Get Method:
unreachable.source_json_dict(self)

started_on

Get Method:
unreachable.started_on(self)

min_started_on

Get Method:
unreachable.min_started_on(self)

ended_on

Get Method:
unreachable.ended_on(self)

max_ended_on

Get Method:
unreachable.max_ended_on(self)

chroots_started_on

Get Method:
unreachable.chroots_started_on(self)

chroots_ended_on

Get Method:
unreachable.chroots_ended_on(self)

source_type_text

Get Method:
unreachable.source_type_text(self)

source_metadata

Get Method:
unreachable.source_metadata(self)

chroot_states

Get Method:
unreachable.chroot_states(self)

chroots_dict_by_name

Get Method:
unreachable.chroots_dict_by_name(self)

has_pending_chroot

Get Method:
unreachable.has_pending_chroot(self)

has_unfinished_chroot

Get Method:
unreachable.has_unfinished_chroot(self)

has_importing_chroot

Get Method:
unreachable.has_importing_chroot(self)

status

Return build status according to build status of its chroots

Get Method:
unreachable.status(self) - Return build status according to build status of its chroots

state

Return text representation of status of this build

Get Method:
unreachable.state(self) - Return text representation of status of this build

cancelable

Find out if this build is cancelable.

Build is cancelabel only when it's pending (not started)

Get Method:
unreachable.cancelable(self) - Find out if this build is cancelable.

repeatable

Find out if this build is repeatable.

Build is repeatable only if it's not pending, starting or running

Get Method:
unreachable.repeatable(self) - Find out if this build is repeatable.

finished

Find out if this build is in finished state.

Build is finished only if all its build_chroots are in finished state.

Get Method:
unreachable.finished(self) - Find out if this build is in finished state.

persistent

Find out if this build is persistent.

This property is inherited from the project.

Get Method:
unreachable.persistent(self) - Find out if this build is persistent.

src_pkg_name

Extract source package name from source name or url todo: obsolete

Get Method:
unreachable.src_pkg_name(self) - Extract source package name from source name or url todo: obsolete

package_name

Get Method:
unreachable.package_name(self)