Galaxie Shell 0.2.6 documentation


Navigation:   | Index   | Search   | Top   | Up   | Prev   | Next   |
Table of Content: |glxshell.lib.utils module |Xlator |Xlator.xlat() |error_code_to_text() |get_bold_text() |humanized_size() |quoted_split() |size_of() |

© Copyright 2020-2024, Galaxie Shell Team.

Top » glxshell » glxshell package » glxshell.lib package » glxshell.lib.utils module

glxshell.lib.utils module

class glxshell.lib.utils.Xlator[source]

Bases: dict

All-in-one multiple-string-substitution class

xlat(text)[source]

Translate text, returns the modified text.

glxshell.lib.utils.error_code_to_text(code)[source]
glxshell.lib.utils.get_bold_text(text)[source]
glxshell.lib.utils.humanized_size(num, suffix='B', si=False)[source]
glxshell.lib.utils.quoted_split(s)[source]
glxshell.lib.utils.size_of(size, suffix='B') str[source]

Scale bytes to its proper format

Example:

1253656 => ‘1.20MB’ 1253656678 => ‘1.17GB’

Parameters:
  • size (int) – bytes size to convert

  • suffix (str) – what suffix is add at the end of the returned value

Top » glxshell » glxshell package » glxshell.lib package » glxshell.lib.utils module

© Copyright 2020-2024, Galaxie Shell Team.
This page is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License (CC BY-NC-SA 4.0).
Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
See History and License for more information.

Last updated on None.
Created using Sphinx 8.0.2.