| Conditions | 2 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | #!/usr/bin/env python3 |
||
| 37 | def check_updates(): |
||
| 38 | """ |
||
| 39 | Check for updates of the db_sync_tool |
||
| 40 | :return: |
||
| 41 | """ |
||
| 42 | try: |
||
| 43 | response = requests.get(f'{info.__pypi_package_url__}/json') |
||
| 44 | latest_version = response.json()['info']['version'] |
||
| 45 | if semantic_version.Version(info.__version__) < semantic_version.Version(latest_version): |
||
| 46 | output.message( |
||
| 47 | output.Subject.WARNING, |
||
| 48 | f'A new version {output.CliFormat.BOLD}v{latest_version}{output.CliFormat.ENDC} is ' |
||
| 49 | f'available for the db-sync-tool: {info.__pypi_package_url__}', |
||
| 50 | True |
||
| 51 | ) |
||
| 52 | finally: |
||
| 53 | return |
||
| 54 | |||
| 78 |