Skip to content

Commit 85c6bdc

Browse files
committed
More advanced use of the spinner.
1 parent 72eb0a1 commit 85c6bdc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎examples/ldap/UpdateDisplaynameProjects.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
"""
77

88
from linuxmusterTools.ldapconnector import LMNProjects
9-
from linuxmusterTools.common import spinner
9+
from linuxmusterTools.common import Spinner, SHELL_COLOR_INFO
1010

1111

1212
# Get a list of all projects, but with write permissions in Ldap!
1313
# Be careful to not change attributes if you not know what you are doing.
1414

1515
projects = LMNProjects()
1616

17-
with spinner as s:
17+
# The color paramater sets the color of the spinner.
18+
# It's possible to use the parameter progress too, to display all lines of the process.
19+
with Spinner(color=SHELL_COLOR_INFO) as s:
1820
total = len(projects)
1921
for idx, (cn, project) in enumerate(projects.items()):
2022
s.print(f"[{idx+1}/{total}] Updating display name of project {cn}")

0 commit comments

Comments
 (0)