Exemple #1
0
    def test_pair_02(self):
        appInfoList = []

        requirements_1 = RequirementsInfo(Version(1, 2, 3, 199),
                                          [u'Linux', u'Windows'])
        appInfo_1 = AppInfo(u'Плагин 1',
                            None,
                            description=u'Описание плагина 1.',
                            appwebsite=u'http://example.com/plugin_1/',
                            requirements=requirements_1)

        requirements_2 = RequirementsInfo(Version(3, 4, 5, 255),
                                          [u'Linux', u'Windows'])
        appInfo_2 = AppInfo(u'Плагин 2',
                            None,
                            description=u'Описание плагина 2.',
                            appwebsite=u'http://example.com/plugin_2/',
                            requirements=requirements_2)

        appInfoList.append(appInfo_2)
        appInfoList.append(appInfo_1)
        generator = SitePluginsTableGenerator(appInfoList)
        text = generator.make()

        self.assertEqual(text, u'''||[[Плагин 1 -> http://example.com/plugin_1/]] ||Описание плагина 1. || Windows, Linux || 1.2.3 ||
||[[Плагин 2 -> http://example.com/plugin_2/]] ||Описание плагина 2. || Windows, Linux || 3.4.5 ||''')
Exemple #2
0
def plugins_list(lang):
    appinfo_list = []
    for plugin_name in PLUGINS_LIST:
        path_to_xml = os.path.join(PLUGINS_DIR,
                                   plugin_name,
                                   plugin_name,
                                   PLUGIN_VERSIONS_FILENAME)
        xml_content = readTextFile(path_to_xml)
        parser = XmlVersionParser([lang])
        appinfo = parser.parse(xml_content)
        appinfo_list.append(appinfo)

    generator = SitePluginsTableGenerator(appinfo_list)
    text = generator.make()
    print(text)
Exemple #3
0
def plugins_list(lang=None):
    '''
    Print plugins list for th site
    '''
    if lang is None:
        print_error(u'Error. No language specified')
        sys.exit(1)

    appinfo_list = []
    for plugin_name in PLUGINS_LIST:
        path_to_xml = os.path.join(PLUGINS_DIR, plugin_name, plugin_name,
                                   PLUGIN_VERSIONS_FILENAME)
        xml_content = readTextFile(path_to_xml)
        parser = XmlVersionParser([lang])
        appinfo = parser.parse(xml_content)
        appinfo_list.append(appinfo)

    generator = SitePluginsTableGenerator(appinfo_list)
    text = generator.make()
    print(text)
Exemple #4
0
    def test_empty(self):
        appInfoList = []
        generator = SitePluginsTableGenerator(appInfoList)
        text = generator.make()

        self.assertEqual(text, u'')