Exemplo n.º 1
0
    def _findUiResource(self, resource):
        r = os.path.join(ResourcesConfiguration.getStaticResources(), "ui", resource)
        if os.path.isfile(r):
            return r

        r = os.path.join(ResourcesConfiguration.getPluginsStaticResources(), "ui", resource)
        if os.path.isfile(r):
            return r

        raise NetzobAbstractViewException(_("Requested file ({0}) was not found.").format(resource))
Exemplo n.º 2
0
    def _findUiResource(self, resource):
        r = os.path.join(ResourcesConfiguration.getStaticResources(), "ui",
                         resource)
        if os.path.isfile(r):
            return r

        r = os.path.join(ResourcesConfiguration.getPluginsStaticResources(),
                         "ui", resource)
        if os.path.isfile(r):
            return r

        raise NetzobAbstractViewException(
            _("Requested file ({0}) was not found.").format(resource))
Exemplo n.º 3
0
    def getPluginStaticResourcesPath(self):
        """Computes and returns the path to the static
        resources associated with the current plugin"""

        try:
            pluginPath = os.path.join(ResourcesConfiguration.getPluginsStaticResources(),
                                      self.getName())

            logging.debug("The computed path for plugins' static resources is: {0}.".format(pluginPath))
            return pluginPath

        except ResourcesConfigurationException, e:
            raise NetzobPluginException(str(e))
Exemplo n.º 4
0
    def getPluginStaticResourcesPath(self):
        """Computes and returns the path to the static
        resources associated with the current plugin"""

        try:
            pluginPath = os.path.join(
                ResourcesConfiguration.getPluginsStaticResources(),
                self.getName())

            logging.debug(
                "The computed path for plugins' static resources is: {0}.".
                format(pluginPath))
            return pluginPath

        except ResourcesConfigurationException, e:
            raise NetzobPluginException(str(e))