Loading bin/is +22 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ import fnmatch import warnings import argparse import json import psutil import installsystems import installsystems.printer import installsystems.tools as istools Loading Loading @@ -479,6 +480,10 @@ def arg_parser_init(): help="doesn't sync repository database cache") parser.add_argument("--no-color", action="store_true", help="dot not display colored output") parser.add_argument("--nice", type=int, default=0, help="nice of the process") parser.add_argument("--ionice", choices=["none","rt", "be","idle"], help="ionice class of the process (default: none)") # create a subparser for commands subparser = parser.add_subparsers() # add command parser Loading Loading @@ -701,6 +706,23 @@ def main(): # no warning if we are not in debug mode if installsystems.verbosity < 2: warnings.filterwarnings("ignore") # nice and ionice process if options.nice is not None or options.ionice is not None: proc = psutil.Process(os.getpid()) if options.nice is not None: try: proc.nice = options.nice except Exception: warn("Unable to nice process to %s" % options.nice) if options.ionice is not None: try: ioclassmap = { "none": psutil.IOPRIO_CLASS_NONE, "rt": psutil.IOPRIO_CLASS_RT, "be": psutil.IOPRIO_CLASS_BE, "idle": psutil.IOPRIO_CLASS_IDLE} proc.set_ionice(ioclassmap[options.ionice]) except Exception: warn("Unable to ionice process to %s" % options.ionice) # except for install command we parse all args! # install command is responsible of parsing if options.func is not c_install: Loading completion/bash/is +2 −1 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ _is() { '-c' '--config' '-C' '--cache' '-t' '--timeout' '--nice' '--ionice' '--no-cache' '--no-color' '--no-sync') Loading Loading @@ -131,7 +133,6 @@ _is() { _local_repo ;; install) #[[ "$cur" == -* ]] && _opt '-b --best' && return 0 _count_args (( args == 2 )) && _image (( args > 2 )) && _filedir Loading debian/control +1 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ Standards-Version: 3.9.1 Package: installsystems Architecture: all Depends: ${misc:Depends}, ${python:Depends}, python-installsystems (>= ${source:Version}) Depends: ${misc:Depends}, ${python:Depends}, python-installsystems (>= ${source:Version}), python-psutil (>= 0.2.1) XB-Python-Version: ${python:Versions} Description: InstallSytems Installer InstallSystems command line tool Loading installsystems/config.py +2 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ class MainConfigFile(ConfigFile): "repo_search": str, "repo_filter": str, "repo_config": str, "nice": int, "ionice": ["none", "rt", "be", "idle"] } def __init__(self, filename, prefix=os.path.basename(sys.argv[0])): self.prefix = prefix Loading samples/installsystems.conf +6 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,12 @@ # Set verbosity (0: quiet, 1: normal, 2: debug) #verbosity = 2 # Set nice process value #nice = 0 # Set ionice class #ionice = idle # define a custom cache directory #cache = /tmp/sex Loading Loading
bin/is +22 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ import fnmatch import warnings import argparse import json import psutil import installsystems import installsystems.printer import installsystems.tools as istools Loading Loading @@ -479,6 +480,10 @@ def arg_parser_init(): help="doesn't sync repository database cache") parser.add_argument("--no-color", action="store_true", help="dot not display colored output") parser.add_argument("--nice", type=int, default=0, help="nice of the process") parser.add_argument("--ionice", choices=["none","rt", "be","idle"], help="ionice class of the process (default: none)") # create a subparser for commands subparser = parser.add_subparsers() # add command parser Loading Loading @@ -701,6 +706,23 @@ def main(): # no warning if we are not in debug mode if installsystems.verbosity < 2: warnings.filterwarnings("ignore") # nice and ionice process if options.nice is not None or options.ionice is not None: proc = psutil.Process(os.getpid()) if options.nice is not None: try: proc.nice = options.nice except Exception: warn("Unable to nice process to %s" % options.nice) if options.ionice is not None: try: ioclassmap = { "none": psutil.IOPRIO_CLASS_NONE, "rt": psutil.IOPRIO_CLASS_RT, "be": psutil.IOPRIO_CLASS_BE, "idle": psutil.IOPRIO_CLASS_IDLE} proc.set_ionice(ioclassmap[options.ionice]) except Exception: warn("Unable to ionice process to %s" % options.ionice) # except for install command we parse all args! # install command is responsible of parsing if options.func is not c_install: Loading
completion/bash/is +2 −1 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ _is() { '-c' '--config' '-C' '--cache' '-t' '--timeout' '--nice' '--ionice' '--no-cache' '--no-color' '--no-sync') Loading Loading @@ -131,7 +133,6 @@ _is() { _local_repo ;; install) #[[ "$cur" == -* ]] && _opt '-b --best' && return 0 _count_args (( args == 2 )) && _image (( args > 2 )) && _filedir Loading
debian/control +1 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ Standards-Version: 3.9.1 Package: installsystems Architecture: all Depends: ${misc:Depends}, ${python:Depends}, python-installsystems (>= ${source:Version}) Depends: ${misc:Depends}, ${python:Depends}, python-installsystems (>= ${source:Version}), python-psutil (>= 0.2.1) XB-Python-Version: ${python:Versions} Description: InstallSytems Installer InstallSystems command line tool Loading
installsystems/config.py +2 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ class MainConfigFile(ConfigFile): "repo_search": str, "repo_filter": str, "repo_config": str, "nice": int, "ionice": ["none", "rt", "be", "idle"] } def __init__(self, filename, prefix=os.path.basename(sys.argv[0])): self.prefix = prefix Loading
samples/installsystems.conf +6 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,12 @@ # Set verbosity (0: quiet, 1: normal, 2: debug) #verbosity = 2 # Set nice process value #nice = 0 # Set ionice class #ionice = idle # define a custom cache directory #cache = /tmp/sex Loading