Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@934c87888401 cib]# python3
- Python 3.5.1 (default, Mar 4 2016, 15:21:15)
- [GCC 6.0.0 20160302 (Red Hat 6.0.0-0.14)] on linux
- Type "help", "copyright", "credits" or "license" for more information.
- >>> from coala_package_manager.package_managers import PackageManager, Dnf, Yum, Apt, Zypper, Pacman, Pip, Go, Npm, Gem, R, Julia
- >>> dnf=Dnf(); yum=Yum(); apt=Apt(); zypper=Zypper(); pacman=Pacman(); pip=Pip(); go=Go(); npm=Npm(); gem=Gem(); r=R(); julia=Julia()
- >>> pm_list = [dnf, yum, apt, zypper, pacman, pip, go, npm, gem, r, julia]
- >>> for pm in pm_list:
- ... print(pm.executable_name, "\t", pm.is_installed() and "availabe" or "not")
- ...
- dnf availabe
- yum availabe
- apt-get not
- zypper not
- pacman not
- pip3 availabe
- go not
- npm not
- gem not
- R not
- julia not
- >>> dnf.available_package("gem")
- 'rubygems-2.4.8-100.fc24.noarch'
- >>> dnf.install_packages(["go", "npm", "rubygems", "R", "julia"])
- [dnf] installing julia... [DONE]
- [dnf] installing R... [TIMEOUT]
- [dnf] installing rubygems... [DONE]
- [dnf] installing npm... [DONE]
- [dnf] installing go... [TIMEOUT]
- ['R', 'go']
- >>> # timeout of one minute is a little short...
- ...
- >>> for pm in pm_list:
- ... print(pm.executable_name, "\t", pm.is_installed() and "availabe" or "not")
- ...
- dnf availabe
- yum availabe
- apt-get not
- zypper not
- pacman not
- pip3 availabe
- go not
- npm availabe
- gem availabe
- R not
- julia availabe
- >>> julia.available_package("Lint")
- 'Lint'
- >>> julia.available_package("formatR")
- >>> julia.install_packages(["Lint", "formatR"])
- [julia] installing formatR... [FAILED]
- [julia] installing Lint... [DONE]
- ['formatR']
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement