| 29 | |
| 30 | |
| 31 | def print_remote_info(remote: Remote, extended=False): |
| 32 | try: |
| 33 | if not remote.is_connected: |
| 34 | remote.connect() |
| 35 | except: |
| 36 | pass |
| 37 | if extended: |
| 38 | print(f"Name: {remote.name}\n" |
| 39 | f"Address: {remote.address}" |
| 40 | ) |
| 41 | if remote.is_connected: |
| 42 | print(f"Id: {remote.unique_id}\n" |
| 43 | f"Is Enterprise: {remote.is_enterprise}\n" |
| 44 | f"Connected username: {remote.username}\n" |
| 45 | f"Is administrator: {remote.is_admin}\n" |
| 46 | f"Server version: {remote.server_version}\n" |
| 47 | f"Server build id: {remote.server_build_id}\n" |
| 48 | f"Project count: {len(remote.projects)}") |
| 49 | if remote.is_admin: |
| 50 | print(f"Group count: {len(remote.groups)}\n" |
| 51 | f"User count: {len(remote.users)}") |
| 52 | else: |
| 53 | if remote.is_connected: |
| 54 | print(f"{remote.name} @ {remote.address} (id: {remote.unique_id})") |
| 55 | else: |
| 56 | print(f"{remote.name} @ {remote.address} (id: ???)") |
| 57 | |
| 58 | def print_project_info(project: RemoteProject, extended=False): |
| 59 | if extended: |