コード例 #1
0
ファイル: create.py プロジェクト: liudger/dpa-pipe
    def _create_representation(self):

        existing = ProductRepresentation.list(
            product_version=self._product_version.spec,
            resolution=self._resolution,
            representation_type=self._file_type,
        )

        if len(existing) == 1:
            self._product_repr = existing.pop()
            if self.interactive:
                print "\nProduct representation exists: " + \
                    Style.bright + self._product_repr.spec + Style.reset
        else:
            try:
                self._product_repr = ProductRepresentation.create(
                     product_version=self._product_version.spec,
                     resolution=self._resolution,
                     representation_type=self._file_type,
                     creation_location=current_location_code(),
                     creator=current_username(),
                )
            except ProductRepresentationError as e:
                raise ActionError(
                    "Unable to create product representation: " + str(e))
            else:
                if self.interactive:
                    print "\nCreated product representation: " + \
                        Style.bright + self._product_repr.spec + Style.reset
コード例 #2
0
ファイル: __init__.py プロジェクト: chippey/dpa-pipe
    def has_representation(self, rep_type, resolution='none'):
        from dpa.product.representation import ProductRepresentation
        
        prod_rep = ProductRepresentation.list(product_version=self.spec,
            representation_type=rep_type, resolution=resolution)

        if len(prod_rep) == 1:
            return True
        else:
            return False
コード例 #3
0
ファイル: __init__.py プロジェクト: liudger/dpa-pipe
    def has_representation(self, rep_type, resolution='none'):
        from dpa.product.representation import ProductRepresentation

        prod_rep = ProductRepresentation.list(product_version=self.spec,
                                              representation_type=rep_type,
                                              resolution=resolution)

        if len(prod_rep) == 1:
            return True
        else:
            return False
コード例 #4
0
ファイル: importref.py プロジェクト: liudger/dpa-pipe
    def populateSubs(self):

        ptask = self.ses.ptask

        for sub in ptask.latest_version.subscriptions:
            product = sub.product_version.product
            product_ver = sub.product_version

            product_rep_list = ProductRepresentation.list(
                product_version=product_ver.spec, type="ma", resolution="none"
            )

            if len(product_rep_list) == 1:
                product_rep = product_rep_list[0]

                choose = sub.product_version.product.name
                path = "%s/%s.%s" % (product_rep.directory, product.name, product_rep.type)

                self.choices[choose] = path
                self.ses.cmds.menuItem(label="%s" % choose)
コード例 #5
0
ファイル: importref.py プロジェクト: liudger/dpa-pipe
    def populateSubs(self):

        ptask = self.ses.ptask

        for sub in ptask.latest_version.subscriptions:
            product = sub.product_version.product
            product_ver = sub.product_version

            product_rep_list = ProductRepresentation.list(
                product_version=product_ver.spec, type='ma', resolution='none')

            if (len(product_rep_list) == 1):
                product_rep = product_rep_list[0]

                choose = sub.product_version.product.name
                path = '%s/%s.%s' % (product_rep.directory, product.name,
                                     product_rep.type)

                self.choices[choose] = path
                self.ses.cmds.menuItem(label="%s" % choose)
コード例 #6
0
ファイル: status.py プロジェクト: liudger/dpa-pipe
 def product_representation(self):
     from dpa.product.representation import ProductRepresentation
     return ProductRepresentation.get(self.product_representation_spec)
コード例 #7
0
ファイル: __init__.py プロジェクト: liudger/dpa-pipe
 def representations(self):
     from dpa.product.representation import ProductRepresentation
     return ProductRepresentation.list(product_version=self.spec)
コード例 #8
0
ファイル: __init__.py プロジェクト: chippey/dpa-pipe
 def representations(self):
     from dpa.product.representation import ProductRepresentation
     return ProductRepresentation.list(product_version=self.spec)
コード例 #9
0
ファイル: status.py プロジェクト: liudger/dpa-pipe
    def product_representation(self):
        from dpa.product.representation import ProductRepresentation

        return ProductRepresentation.get(self.product_representation_spec)