Exemple #1
0
        def topic(self):
            return Package.load_from_json_string("""{
    "metaVersion": "1.0",
    "name": "test1",
    "version": "1.1",

    "weights": {

    }
}""")
Exemple #2
0
    def load(self):
        if not exists(self.path):
            raise InvalidPackageError(
                1, 'Path "invalid-path" is not valid. No openfont package could be loaded.', self.path
            )

        pkg_file_path = join(self.path, "package.json")

        if not exists(pkg_file_path):
            msg = 'Path "%s" does not contain a package.json file. No openfont package could be loaded.' % self.path
            raise InvalidPackageError(2, msg, self.path)

        with open(pkg_file_path) as pkg_file:
            pkg = Package.load_from_json_string(pkg_file.read())

        self.package = pkg

        self.validate_package()
Exemple #3
0
        def topic(self):
            return Package.load_from_json_string("""{
    "metaVersion": "1.0",
    "name": "SourceSansPro",
    "version": "1.1",

    "weights": {
        "Black": "SourceSansPro-Black-webfont",
        "Black It": "SourceSansPro-BlackIt-webfont",
        "Bold": "SourceSansPro-Bold-webfont",
        "Bold It": "SourceSansPro-BoldIt-webfont",
        "Extra Light": "SourceSansPro-ExtraLight-webfont",
        "Extra Light It": "SourceSansPro-ExtraLightIt-webfont",
        "Regular": "SourceSansPro-Regular-webfont",
        "Regular It": "SourceSansPro-It-webfont",
        "Light": "SourceSansPro-Light-webfont",
        "Light It": "SourceSansPro-LightIt-webfont",
        "Semibold": "SourceSansPro-Semibold-webfont",
        "Semibold It": "SourceSansPro-SemiboldIt-webfont"
    }
}""")