SHARE
TWEET

wrapping package managers

a guest Sep 12th, 2016 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [root@934c87888401 cib]# python3
  2. Python 3.5.1 (default, Mar  4 2016, 15:21:15)
  3. [GCC 6.0.0 20160302 (Red Hat 6.0.0-0.14)] on linux
  4. Type "help", "copyright", "credits" or "license" for more information.
  5. >>> from coala_package_manager.package_managers import PackageManager, Dnf, Yum, Apt, Zypper, Pacman, Pip, Go, Npm, Gem, R, Julia
  6. >>> dnf=Dnf(); yum=Yum(); apt=Apt(); zypper=Zypper(); pacman=Pacman(); pip=Pip(); go=Go(); npm=Npm(); gem=Gem(); r=R(); julia=Julia()
  7. >>> pm_list = [dnf, yum, apt, zypper, pacman, pip, go, npm, gem, r, julia]
  8. >>> for pm in pm_list:
  9. ...   print(pm.executable_name, "\t", pm.is_installed() and "availabe" or "not")
  10. ...
  11. dnf      availabe
  12. yum      availabe
  13. apt-get  not
  14. zypper   not
  15. pacman   not
  16. pip3     availabe
  17. go       not
  18. npm      not
  19. gem      not
  20. R        not
  21. julia    not
  22. >>> dnf.available_package("gem")
  23. 'rubygems-2.4.8-100.fc24.noarch'
  24. >>> dnf.install_packages(["go", "npm", "rubygems", "R", "julia"])
  25. [dnf] installing julia...       [DONE]
  26. [dnf] installing R...           [TIMEOUT]
  27. [dnf] installing rubygems...    [DONE]
  28. [dnf] installing npm...         [DONE]
  29. [dnf] installing go...          [TIMEOUT]
  30. ['R', 'go']
  31. >>> # timeout of one minute is a little short...
  32. ...
  33. >>> for pm in pm_list:
  34. ...   print(pm.executable_name, "\t", pm.is_installed() and "availabe" or "not")
  35. ...
  36. dnf      availabe
  37. yum      availabe
  38. apt-get  not
  39. zypper   not
  40. pacman   not
  41. pip3     availabe
  42. go       not
  43. npm      availabe
  44. gem      availabe
  45. R        not
  46. julia    availabe
  47. >>> julia.available_package("Lint")
  48. 'Lint'
  49. >>> julia.available_package("formatR")
  50. >>> julia.install_packages(["Lint", "formatR"])
  51. [julia] installing formatR...   [FAILED]
  52. [julia] installing Lint...      [DONE]
  53. ['formatR']
  54. >>>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top