Exemple #1
0
  def to_manifest(self, smart_only=False, as_string=True):
      """ Produce a SMART-style manifest for the app.
      
      see :doc:`app-registration` for details on the manifest format.
      
      If *smart_only* is True, only SMART-manifest compatible fields will be included in the output.

      """
      from indivo.views import _get_smart_version
      smart_version = _get_smart_version(self.indivo_version)
      output = {
          "name": self.name,
          "description": self.description,
          "author": self.author,
          "id": self.email,
          "version": self.version,
          "smart_version": smart_version,
          }
      if not smart_only:
          output.update({
                  "ui_app": self.app_type == 'chrome',
                  "indivo_version": self.indivo_version,
                  })
      if as_string:
          return simplejson.dumps(output)
      else:
          return output
Exemple #2
0
  def to_manifest(self, smart_only=False, as_string=True):
      """ Produce a SMART-style manifest for the app.
      
      see :doc:`app-registration` for details on the manifest format.

      If *smart_only* is True, only SMART-manifest compatible fields will be included in the output.

      """
      from indivo.views import _get_smart_version
      smart_version = _get_smart_version(self.indivo_version)

      output = {
          "name": self.name,
          "description": self.description,
          "author": self.author,
          "id": self.email,
          "version": self.version,
          "mode": "background" if self.is_autonomous else "ui",
          "scope": "record",
          "icon": self.icon_url,
          "index": self.start_url_template,          
          "requires": simplejson.loads(self.requirements),
          }
      if smart_version:
          output["smart_version"] = smart_version

      if not smart_only:
          output.update({
                  "has_ui": self.has_ui,
                  "frameable": self.frameable,
                  "oauth_callback_url": self.callback_url,
                  "indivo_version": self.indivo_version,
                  })
          if self.is_autonomous:
              output['autonomous_reason'] = self.autonomous_reason
      if as_string:
          return simplejson.dumps(output)
      else:
          return output