Exemple #1
0
 def Description(self, value):
     chars = len(value)
     if chars > 512:
         return ValidatorError(LANG.APPINFO.DETAILS_DESCRIPTION_TOO_LONG)
     elif chars > 150:
         return ValidatorWarning(LANG.APPINFO.DETAILS_DESCRIPTION_LONG %
                                 dict(chars=chars))
Exemple #2
0
 def Start(self, value):
     if '/' in value or '\\' in value:
         return ValidatorWarning(LANG.APPINFO.CONTROL_START_NO_SUBDIRS %
                                 dict(section='Control', key='Start'))
     elif not os.path.isfile(self.package.path(value)):
         return ValidatorError(LANG.APPINFO.CONTROL_FILE_NOT_EXIST %
                               dict(section='Control', key='Start'))
Exemple #3
0
 def ExtractIcon(self, value):
     if not os.path.isfile(self.package.path(value)):
         return ValidatorError(LANG.APPINFO.CONTROL_FILE_NOT_EXIST %
                               dict(section='Control', key='ExtractIcon'))
     else:
         return ValidatorWarning(
             LANG.APPINFO.CONTROL_EXTRACTICON_OMIT_UNLESS_REQUIRED)
Exemple #4
0
 def Icons(self, value):
     try:
         value = int(value)
         if value < 1:
             raise ValueError()
     except ValueError:
         return ValidatorError(LANG.APPINFO.CONTROL_ICONS_BAD)
 def CompressionFileSizeCutOff(self, value):
     try:
         value = int(value)
         if value < 0:
             raise ValueError()
     except ValueError:
         return ValidatorError("must be a positive integer")
Exemple #6
0
 def Plugins(self, value):
     if value == 'NONE':
         return ValidatorWarning(LANG.INIVALIDATOR.OMIT_DEFAULT %
                                 dict(filename=self.validator.path(),
                                      section='SpecialPaths',
                                      key='Plugins',
                                      default='NONE'))
     elif not os.path.isdir(self.package.path(value)):
         return ValidatorError(LANG.APPINFO.SPECIALPATHS_PLUGINS_BAD)
Exemple #7
0
    def EULAVersion(self, value):
        if not self.package.eula:
            if self.package.plugin:
                eula = os.path.join('Other', 'Source', 'PluginEULA')
            else:
                eula = os.path.join('Other', 'Source', 'EULA')

            return ValidatorError(LANG.APPINFO.LICENSE_EULAVERSION_NO_EULA %
                                  dict(eula=eula))
Exemple #8
0
 def Version(self, value):
     if value != FORMAT_VERSION:
         if value < FORMAT_VERSION:
             return ValidatorWarning(
                 LANG.APPINFO.OLD_FORMAT_VERSION %
                 dict(old_version=value, current_version=FORMAT_VERSION))
         else:
             return ValidatorError(LANG.APPINFO.BAD_FORMAT_VERSION %
                                   dict(version=FORMAT_VERSION))
Exemple #9
0
 def UsesDotNetVersion(self, value):
     if value not in ('1.1', '2.0', '3.0', '3.5', '4.0'):
         return ValidatorWarning(
             LANG.APPINFO.DEPENDENCIES_USESDOTNETVERSION_PROBABLY_BAD)
     else:
         try:
             map(int, value.split('.'))
         except ValueError:
             return ValidatorError(
                 LANG.APPINFO.DEPENDENCIES_USESDOTNETVERSION_BAD)
Exemple #10
0
 def UsesGhostscript(self, value):
     if value == 'no':
         return ValidatorWarning(LANG.INIVALIDATOR.OMIT_DEFAULT %
                                 dict(filename=self.validator.path(),
                                      section='Dependencies',
                                      key='UsesGhostscript',
                                      default='no'))
     elif value not in ('yes', 'optional'):
         return ValidatorError(
             LANG.APPINFO.DEPENDENCIES_USESGHOSTSCRIPT_BAD)
Exemple #11
0
 def UsesJava(self, value):
     if value == 'no':
         return ValidatorWarning(LANG.INIVALIDATOR.OMIT_DEFAULT %
                                 dict(filename=self.validator.path(),
                                      section='Dependencies',
                                      key='UsesJava',
                                      default='no'))
     elif value in ('true', 'false'):
         if value == 'true':
             new_value = 'yes'
         elif value == 'false':
             new_value = 'no'
         return ValidatorError(LANG.INIVALIDATOR.VALUE_DEPRECATED %
                               dict(filename=self.validator.path(),
                                    section='Dependencies',
                                    key='UsesJava',
                                    old_value=value,
                                    new_value=new_value))
     elif value not in ('yes', 'optional'):
         return ValidatorError(LANG.APPINFO.DEPENDENCIES_USESJAVA_BAD)
 def IncludeInstallerSource(self, value):
     if value not in ('true', 'false'):
         return ValidatorError(LANG.INIVALIDATOR.BOOL_BAD %
                               dict(filename=self.validator.path(),
                                    section='Source',
                                    key='IncludeInstallerSource'))
     elif value == 'false':
         return ValidatorWarning(LANG.INIVALIDATOR.OMIT_DEFAULT %
                                 dict(filename=self.validator.path(),
                                      section='Source',
                                      key='IncludeInstallerSource',
                                      default='false'))
     else:
         return ValidatorWarning(LANG.INSTALLER.INCLUDEINSTALLERSOURCE %
                                 dict(filename=self.validator.path()))
Exemple #13
0
 def PackageVersion(self, value):
     try:
         if len(map(int, value.split('.'))) != 4:
             raise ValueError()
     except ValueError:
         return ValidatorError(LANG.APPINFO.VERSION_PACKAGEVERSION_BAD)
Exemple #14
0
 def AppID(self, value):
     if OrderedSet(
             value
     ) - '0123456789.-+_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz':
         return ValidatorError(LANG.APPINFO.DETAILS_APPID_BAD)
Exemple #15
0
 def Category(self, value):
     if value not in CATEGORIES:
         return ValidatorError(LANG.APPINFO.DETAILS_CATEGORY_BAD)
Exemple #16
0
 def Language(self, value):
     if value not in LANGUAGES:
         return ValidatorError(LANG.APPINFO.DETAILS_LANGUAGE_BAD)
Exemple #17
0
 def PluginType(self, value):
     # Only applicable for package.plugin == True
     if not self.package.plugin:
         return ValidatorError(LANG.APPINFO.DETAILS_PLUGINTYPE_NOT_PLUGIN)
     elif value != 'CommonFiles':
         return ValidatorError(LANG.APPINFO.DETAILS_PLUGINTYPE_BAD)
Exemple #18
0
 def Type(self, value):
     if value != 'PortableApps.comFormat':
         return ValidatorError(LANG.APPINFO.BAD_FORMAT_TYPE)