def test_check(self): self.assertFalse(check_version( 'Test', 'http://example.net', '1.0', '1.0' )) self.assertFalse(check_version( 'Test', 'http://example.net', '1.1', '1.0' )) self.assertTrue(check_version( 'Test', 'http://example.net', '0.9', '1.0' )) self.assertFalse(check_version( 'Test', 'http://example.net', '1.0', None ))
def test_check(self): self.assertFalse( check_version('Test', 'http://example.net', '1.0', '1.0')) self.assertFalse( check_version('Test', 'http://example.net', '1.1', '1.0')) self.assertTrue( check_version('Test', 'http://example.net', '0.9', '1.0')) self.assertFalse( check_version('Test', 'http://example.net', '1.0', None))
def check_versions(sender, app, **kwargs): ''' Check required versions. ''' if (app == 'trans' or getattr(app, '__name__', '') == 'weblate.trans.models'): from weblate.trans.requirements import get_versions, check_version versions = get_versions() failure = False for version in versions: failure |= check_version(*version) if failure: raise Exception('Some of required modules are missing or too old! ' 'Check above output for details.')
def check_versions(sender, app, **kwargs): ''' Check required versions. ''' if (app == 'trans' or getattr(app, '__name__', '') == 'weblate.trans.models'): from weblate.trans.requirements import get_versions, check_version versions = get_versions() failure = False for version in versions: failure |= check_version(*version) if failure: raise Exception( 'Some of required modules are missing or too old! ' 'Check above output for details.' )