How to use the pybit.models.Model function in pybit

To help you get started, we’ve selected a few pybit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nicholasdavidson / pybit / pybit / models.py View on Github external
def __init__(self,suite_id,name):
        self.id = suite_id
        self.name = name

class BuildD(Model):
    def __init__(self,buildd_id,name):
        self.id = buildd_id
        self.name = name

class Package(Model):
    def __init__(self,package_id,version,name):
        self.id = package_id
        self.version = version
        self.name = name

class Transport(Model) :
    def __init__(self,transport_id,method,uri,vcs_id):
        self.id = transport_id
        self.method = method
        self.uri = uri
        self.vcs_id = vcs_id

class PackageInstance(Model):
    def __init__(self, packageinstance_id, package, arch, build_env, suite, distribution, pkg_format, master) :
        self.id = packageinstance_id
        self.package = package
        self.arch = arch
        self.build_env = build_env
        self.suite = suite
        self.distribution = distribution
        self.format = pkg_format
        self.master = master
github nicholasdavidson / pybit / pybit / models.py View on Github external
class StatusRequest(CommandRequest):
    def  __init__(self,job,web_host):
        CommandRequest.__init__(self, job, web_host)

class TaskComplete(Model):
    def __init__(self, message, success = True):
        self.success = success
        self.message = message

def checkValue(value,container):
    if value in container and container[value] is not None and container[value] is not "":
        return True
    else:
        return False

class Blacklist(Model):
    def __init__(self,blacklist_id,field,regex):
        self.id = blacklist_id
        self.field = field
        self.regex = regex
github nicholasdavidson / pybit / pybit / models.py View on Github external
class JobHistory(Model):
    def __init__(self,job_id,status,buildclient,time):
        self.job_id = job_id
        self.status = status
        self.buildclient = buildclient
        self.time = str(time) #????

class ClientMessage:
    failed = "Failed"
    building = "Building"
    done = "Done"
    blocked = "Blocked"
    waiting = "Waiting"
    cancelled = "Cancelled"

class Arch(Model):
    def __init__(self,arch_id,name):
        self.id = arch_id
        self.name = name

class BuildEnv(Model):
    def __init__(self,build_env_id,name):
        self.id = build_env_id
        self.name = name

class Dist(Model):
    def __init__(self,dist_id,name):
        self.id = dist_id
        self.name = name

class Format(Model):
    def __init__(self,format_id,name):
github nicholasdavidson / pybit / pybit / models.py View on Github external
class Format(Model):
    def __init__(self,format_id,name):
        self.id = format_id
        self.name = name

class Status(Model):
    def __init__(self,status_id,name):
        self.id = status_id
        self.name = name

class Suite(Model):
    def __init__(self,suite_id,name):
        self.id = suite_id
        self.name = name

class BuildD(Model):
    def __init__(self,buildd_id,name):
        self.id = buildd_id
        self.name = name

class Package(Model):
    def __init__(self,package_id,version,name):
        self.id = package_id
        self.version = version
        self.name = name

class Transport(Model) :
    def __init__(self,transport_id,method,uri,vcs_id):
        self.id = transport_id
        self.method = method
        self.uri = uri
        self.vcs_id = vcs_id
github nicholasdavidson / pybit / pybit / models.py View on Github external
self.time = str(time) #????

class ClientMessage:
    failed = "Failed"
    building = "Building"
    done = "Done"
    blocked = "Blocked"
    waiting = "Waiting"
    cancelled = "Cancelled"

class Arch(Model):
    def __init__(self,arch_id,name):
        self.id = arch_id
        self.name = name

class BuildEnv(Model):
    def __init__(self,build_env_id,name):
        self.id = build_env_id
        self.name = name

class Dist(Model):
    def __init__(self,dist_id,name):
        self.id = dist_id
        self.name = name

class Format(Model):
    def __init__(self,format_id,name):
        self.id = format_id
        self.name = name

class Status(Model):
    def __init__(self,status_id,name):
github nicholasdavidson / pybit / pybit / models.py View on Github external
class Status(Model):
    def __init__(self,status_id,name):
        self.id = status_id
        self.name = name

class Suite(Model):
    def __init__(self,suite_id,name):
        self.id = suite_id
        self.name = name

class BuildD(Model):
    def __init__(self,buildd_id,name):
        self.id = buildd_id
        self.name = name

class Package(Model):
    def __init__(self,package_id,version,name):
        self.id = package_id
        self.version = version
        self.name = name

class Transport(Model) :
    def __init__(self,transport_id,method,uri,vcs_id):
        self.id = transport_id
        self.method = method
        self.uri = uri
        self.vcs_id = vcs_id

class PackageInstance(Model):
    def __init__(self, packageinstance_id, package, arch, build_env, suite, distribution, pkg_format, master) :
        self.id = packageinstance_id
        self.package = package
github nicholasdavidson / pybit / pybit / models.py View on Github external
def get_buildenv_name(self):
        if self.build_env is None:
            return None
        return self.build_env.name

    def get_suite_name(self):
        return self.suite.name
    
    def get_distribution_name(self):
        return self.distribution.name
    
    def get_format_name(self):
        return self.format.name


class Job(Model):
    def __init__(self,job_id,packageinstance,buildclient):
        self.id = job_id
        self.packageinstance = packageinstance
        self.buildclient = buildclient


class SuiteArch(Model):
    def __init__(self,suitearch_id,suite,arch,master_weight=0):
        self.id = suitearch_id
        self.suite = suite
        self.arch = arch
        self.master_weight = master_weight

class BuildEnvSuiteArch(Model):
    def __init__(self,buildenv_suitearch_id,buildenv,suitearch):
        self.id = buildenv_suitearch_id
github nicholasdavidson / pybit / pybit / models.py View on Github external
class Model(object):
    def toJson(self):
        try:
            return jsonpickle.encode(self)
        except Exception as e:
            raise Exception('Error in toJson(): ' + str(e))
            return None
    def fromJson(self,jsonstring):
        try:
            self = jsonpickle.decode(jsonstring)
            return self
        except Exception as e:
            raise Exception('Error in fromJson(): ' + str(e))
            return None

class JobHistory(Model):
    def __init__(self,job_id,status,buildclient,time):
        self.job_id = job_id
        self.status = status
        self.buildclient = buildclient
        self.time = str(time) #????

class ClientMessage:
    failed = "Failed"
    building = "Building"
    done = "Done"
    blocked = "Blocked"
    waiting = "Waiting"
    cancelled = "Cancelled"

class Arch(Model):
    def __init__(self,arch_id,name):
github nicholasdavidson / pybit / pybit / models.py View on Github external
done = "Done"
    blocked = "Blocked"
    waiting = "Waiting"
    cancelled = "Cancelled"

class Arch(Model):
    def __init__(self,arch_id,name):
        self.id = arch_id
        self.name = name

class BuildEnv(Model):
    def __init__(self,build_env_id,name):
        self.id = build_env_id
        self.name = name

class Dist(Model):
    def __init__(self,dist_id,name):
        self.id = dist_id
        self.name = name

class Format(Model):
    def __init__(self,format_id,name):
        self.id = format_id
        self.name = name

class Status(Model):
    def __init__(self,status_id,name):
        self.id = status_id
        self.name = name

class Suite(Model):
    def __init__(self,suite_id,name):
github nicholasdavidson / pybit / pybit / models.py View on Github external
class BuildEnv(Model):
    def __init__(self,build_env_id,name):
        self.id = build_env_id
        self.name = name

class Dist(Model):
    def __init__(self,dist_id,name):
        self.id = dist_id
        self.name = name

class Format(Model):
    def __init__(self,format_id,name):
        self.id = format_id
        self.name = name

class Status(Model):
    def __init__(self,status_id,name):
        self.id = status_id
        self.name = name

class Suite(Model):
    def __init__(self,suite_id,name):
        self.id = suite_id
        self.name = name

class BuildD(Model):
    def __init__(self,buildd_id,name):
        self.id = buildd_id
        self.name = name

class Package(Model):
    def __init__(self,package_id,version,name):