Permalink
Browse files

Initial commit

git-svn-id: https://camelo.conectiva/repos/projetos/qtlab/mcc2@8609 aeaf0dc8-91d7-0310-8701-e1fc1a66ab8d
  • Loading branch information...
wiliam
wiliam committed Jan 24, 2011
1 parent 904c32b commit 76fb00397ac3f71ed642c5defb655afe19fc8b53
Showing with 9,711 additions and 0 deletions.
  1. 0 AUTHORS
  2. +12 −0 INSTALL
  3. +1 −0 LICENSE
  4. +8 −0 MANIFEST.in
  5. +21 −0 README
  6. +28 −0 TODO
  7. 0 mcc2.py
  8. +12 −0 mcc2/__init__.py
  9. +12 −0 mcc2/backends/__init__.py
  10. +17 −0 mcc2/backends/system_services/README
  11. 0 mcc2/backends/system_services/__init__.py
  12. +17 −0 mcc2/backends/system_services/com.mandriva.mcc2.SystemServices.conf
  13. +4 −0 mcc2/backends/system_services/com.mandriva.mcc2.SystemServices.service
  14. +58 −0 mcc2/backends/system_services/com.mandriva.mcc2.systemservices.policy
  15. +10 −0 mcc2/backends/system_services/mcc2-list-services.py
  16. +7 −0 mcc2/backends/system_services/mcc2-resstart-crond.py
  17. +12 −0 mcc2/backends/system_services/mcc2-services-detail.py
  18. +7 −0 mcc2/backends/system_services/mcc2-start-crond.py
  19. +7 −0 mcc2/backends/system_services/mcc2-stop-crond.py
  20. +161 −0 mcc2/backends/system_services/service.py
  21. +4 −0 mcc2/backends/system_services/system-services-mechanism.py
  22. +80 −0 mcc2/frontend/system-services/ScrollBar.qml
  23. +82 −0 mcc2/frontend/system-services/ServicesListView.qml
  24. +125 −0 mcc2/frontend/system-services/SystemServices.qml
  25. +210 −0 mcc2/frontend/system-services/colibri/CLButton.qml
  26. +197 −0 mcc2/frontend/system-services/colibri/CLCarousel.qml
  27. +178 −0 mcc2/frontend/system-services/colibri/CLCheckBox.qml
  28. +533 −0 mcc2/frontend/system-services/colibri/CLComboBox.qml
  29. +424 −0 mcc2/frontend/system-services/colibri/CLDatePicker.qml
  30. +154 −0 mcc2/frontend/system-services/colibri/CLDial.qml
  31. +178 −0 mcc2/frontend/system-services/colibri/CLHistogram.qml
  32. +552 −0 mcc2/frontend/system-services/colibri/CLKeyboard.qml
  33. +77 −0 mcc2/frontend/system-services/colibri/CLLayer.qml
  34. +244 −0 mcc2/frontend/system-services/colibri/CLLineEdit.qml
  35. +336 −0 mcc2/frontend/system-services/colibri/CLListbox.qml
  36. +102 −0 mcc2/frontend/system-services/colibri/CLProgressBar.qml
  37. +109 −0 mcc2/frontend/system-services/colibri/CLRating.qml
  38. +270 −0 mcc2/frontend/system-services/colibri/CLScrollBar.qml
  39. +274 −0 mcc2/frontend/system-services/colibri/CLScrollBarVertical.qml
  40. +231 −0 mcc2/frontend/system-services/colibri/CLSlider.qml
  41. +231 −0 mcc2/frontend/system-services/colibri/CLSliderVertical.qml
  42. +108 −0 mcc2/frontend/system-services/colibri/CLStyle.qml
  43. +292 −0 mcc2/frontend/system-services/colibri/CLTab.qml
  44. +596 −0 mcc2/frontend/system-services/colibri/CLTextArea.qml
  45. +55 −0 mcc2/frontend/system-services/colibri/gradients/Blue.qml
  46. +53 −0 mcc2/frontend/system-services/colibri/gradients/Grey.qml
  47. +55 −0 mcc2/frontend/system-services/colibri/gradients/LightBlue.qml
  48. +54 −0 mcc2/frontend/system-services/colibri/gradients/Red.qml
  49. BIN mcc2/frontend/system-services/colibri/images/arrow_down_50x50.png
  50. BIN mcc2/frontend/system-services/colibri/images/arrow_left_50x50.png
  51. BIN mcc2/frontend/system-services/colibri/images/arrow_right_50x50.png
  52. BIN mcc2/frontend/system-services/colibri/images/arrow_up_50x50.png
  53. BIN mcc2/frontend/system-services/colibri/images/backspace_50x70.png
  54. BIN mcc2/frontend/system-services/colibri/images/calendar_icon.png
  55. BIN mcc2/frontend/system-services/colibri/images/cover1.jpg
  56. BIN mcc2/frontend/system-services/colibri/images/cover2.jpg
  57. BIN mcc2/frontend/system-services/colibri/images/cover3.jpg
  58. BIN mcc2/frontend/system-services/colibri/images/cover4.jpg
  59. BIN mcc2/frontend/system-services/colibri/images/cover5.jpg
  60. BIN mcc2/frontend/system-services/colibri/images/cover6.jpg
  61. BIN mcc2/frontend/system-services/colibri/images/cover7.jpg
  62. BIN mcc2/frontend/system-services/colibri/images/cover8.jpg
  63. BIN mcc2/frontend/system-services/colibri/images/delete_50x50.png
  64. BIN mcc2/frontend/system-services/colibri/images/enter_50x70.png
  65. BIN mcc2/frontend/system-services/colibri/images/lock_closed_web.png
  66. BIN mcc2/frontend/system-services/colibri/images/lock_open_web.png
  67. BIN mcc2/frontend/system-services/colibri/images/logo.jpg
  68. BIN mcc2/frontend/system-services/colibri/images/logo_transparent.png
  69. BIN mcc2/frontend/system-services/colibri/images/logo_transparent2.png
  70. BIN mcc2/frontend/system-services/colibri/images/ok_50x50.png
  71. BIN mcc2/frontend/system-services/colibri/images/shift_50x50.png
  72. BIN mcc2/frontend/system-services/colibri/images/star_off.png
  73. BIN mcc2/frontend/system-services/colibri/images/star_on.png
  74. BIN mcc2/frontend/system-services/colibri/images/tab.png
  75. BIN mcc2/frontend/system-services/colibri/images/tick.png
  76. +97 −0 mcc2/frontend/system-services/colibri/includes/Fruits.qml
  77. +91 −0 mcc2/frontend/system-services/colibri/includes/HistogramColumn.qml
  78. +144 −0 mcc2/frontend/system-services/colibri/includes/KeyboardButton.qml
  79. +96 −0 mcc2/frontend/system-services/colibri/includes/RatingStar.qml
  80. +96 −0 mcc2/frontend/system-services/colibri/includes/Screen.qml
  81. +108 −0 mcc2/frontend/system-services/colibri/includes/TestCoverList.qml
  82. +97 −0 mcc2/frontend/system-services/colibri/includes/TestItemList.qml
  83. +104 −0 mcc2/frontend/system-services/colibri/javascripts/date.js
  84. +279 −0 mcc2/frontend/system-services/colibri/javascripts/datepicker.js
  85. +95 −0 mcc2/frontend/system-services/colibri/javascripts/functions.js
  86. +180 −0 mcc2/frontend/system-services/colibri/javascripts/histogram.js
  87. +168 −0 mcc2/frontend/system-services/colibri/javascripts/histogram2.js
  88. +168 −0 mcc2/frontend/system-services/colibri/javascripts/keyboard.js
  89. 0 mcc2/frontend/system-services/controller.py
  90. BIN mcc2/frontend/system-services/icons/green.png
  91. +538 −0 mcc2/frontend/system-services/icons/green.svg
  92. BIN mcc2/frontend/system-services/icons/mandriva.png
  93. BIN mcc2/frontend/system-services/icons/orange.png
  94. +538 −0 mcc2/frontend/system-services/icons/orange.svg
  95. BIN mcc2/frontend/system-services/icons/red.png
  96. +538 −0 mcc2/frontend/system-services/icons/red.svg
  97. +45 −0 mcc2/frontend/system-services/model.py
  98. +85 −0 mcc2/frontend/system-services/view.py
  99. 0 settings.py
  100. +46 −0 setup.py
View
No changes.
View
12 INSTALL
@@ -0,0 +1,12 @@
+=======
+Install
+=======
+
+basicaly run python setup.py install.
+
+Requirements
+============
+
+ * pyside
+ * qt4
+
View
@@ -0,0 +1 @@
+
View
@@ -0,0 +1,8 @@
+include INSTALL
+include LICENSE
+include MANIFEST.in
+include README
+include AUTHORS
+include TODO
+recursive-include docs *
+prune docs/_build
View
21 README
@@ -0,0 +1,21 @@
+=======================
+Mandriva Control Center
+=======================
+
+
+
+Basic usage
+===========
+
+1. Edit file mcc2/backends/system_services/com.mandriva.mcc2.SystemServices.service
+and change the follow line:
+
+Exec=/home/wiliam/dev/mandriva-control-center/mcc2/backends/system_services/system-services-mechanism.py
+
+Copy this file to /usr/share/dbus-1/system-services/
+
+2. Copy mcc2/backends/system_services/com.mandriva.mcc2.systemservices.policy
+to /usr/share/polkit-1/actions/
+
+3. Copy mcc2/backends/system_services/com.mandriva.mcc2.SystemServices.conf
+to /etc/dbus-1/system.d/
View
28 TODO
@@ -0,0 +1,28 @@
+====
+TODO
+====
+
+This is todo file for python-systemd.
+
+CODE
+====
+
+ * Pass some methods(__properties) to a more generic class(systemd.core.Core).
+
+ * Filter signals and only update properties that realy was updated.
+
+ * Improve the exceptions mechanism.
+
+TESTS
+=====
+
+ * Improve tests, some tests like start, stop, reload and restart should check
+ the timestamp or other property to ensure the unit was correct started,
+ stoped, reloaded or restarted.
+
+ * Tests like get_unit_by_pid and get_unit need a existent PID or unit to be
+ tested, how to ensure the tests always get a valid PID and unit.
+
+ * How to test functions like reexecute, reload, reset_failed, reset_failed_unit,
+ set_environment, start_unit_replace, subscribe, unset_environment, reexecute
+ unsubscribe,
View
No changes.
View
@@ -0,0 +1,12 @@
+VERSION = (0, 1, 0, 'planning', 0)
+
+def get_version():
+ version = '%s.%s' % (VERSION[0], VERSION[1])
+ if VERSION[2]:
+ version = '%s.%s' % (version, VERSION[2])
+ if VERSION[3:] == ('alpha', 0):
+ version = '%s pre-alpha' % version
+ else:
+ if VERSION[3] != 'final':
+ version = '%s %s %s' % (version, VERSION[3], VERSION[4])
+ return version
View
@@ -0,0 +1,12 @@
+VERSION = (0, 1, 0, 'planning', 0)
+
+def get_version():
+ version = '%s.%s' % (VERSION[0], VERSION[1])
+ if VERSION[2]:
+ version = '%s.%s' % (version, VERSION[2])
+ if VERSION[3:] == ('alpha', 0):
+ version = '%s pre-alpha' % version
+ else:
+ if VERSION[3] != 'final':
+ version = '%s %s %s' % (version, VERSION[3], VERSION[4])
+ return version
@@ -0,0 +1,17 @@
+Usage
+=====
+
+import dbus
+bus = dbus.SystemBus()
+proxy = bus.get_object(
+ 'com.mandriva.mcc2.SystemServices',
+ '/com/mandriva/mcc2/SystemServices')
+interface = dbus.Interface(proxy, 'com.mandriva.mcc2.SystemServices')
+
+# Don't ask for password
+print interface.list()
+
+# Root password is asked
+print interface.restart('crond.service', 'fail')
+print interface.start('crond.service', 'fail')
+print interface.stop('crond.service', 'fail')
No changes.
@@ -0,0 +1,17 @@
+<!DOCTYPE busconfig PUBLIC
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <policy user="root">
+ <allow own="com.mandriva.mcc2.SystemServices"/>
+ </policy>
+
+ <policy context="default">
+ <allow send_destination="com.mandriva.mcc2.SystemServices"
+ send_interface="com.mandriva.mcc2.SystemServices"/>
+ <allow send_destination="com.mandriva.mcc2.SystemServices"
+ send_interface="org.freedesktop.DBus.Introspectable"/>
+ <allow send_destination="com.mandriva.mcc2.SystemServices"
+ send_interface="org.freedesktop.DBus.Properties"/>
+ </policy>
+</busconfig>
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=com.mandriva.mcc2.SystemServices
+Exec=/home/wiliam/dev/mandriva-control-center/mcc2/backends/system_services/system-services-mechanism.py
+User=root
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+ "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
+<policyconfig>
+ <vendor>Mandriva Linux</vendor>
+ <vendor_url>http://www.mandriva.com</vendor_url>
+
+ <action id="com.mandriva.mcc2.systemservices.start">
+ <description>Start System Service</description>
+ <message>Authentication is required to start system service</message>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin</allow_active>
+ </defaults>
+ </action>
+
+ <action id="com.mandriva.mcc2.systemservices.stop">
+ <description>Stop System Service</description>
+ <message>Authentication is required to stop system service</message>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin</allow_active>
+ </defaults>
+ </action>
+
+ <action id="com.mandriva.mcc2.systemservices.restart">
+ <description>Restart System Service</description>
+ <message>Authentication is required to restart system service</message>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin</allow_active>
+ </defaults>
+ </action>
+
+ <action id="com.mandriva.mcc2.systemservices.list">
+ <description>List System Service</description>
+ <message>Authentication is required to list services</message>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>yes</allow_active>
+ </defaults>
+ </action>
+
+ <action id="com.mandriva.mcc2.systemservices.service_details">
+ <description>System Service Details</description>
+ <message>Authentication is required to list services</message>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>yes</allow_active>
+ </defaults>
+ </action>
+</policyconfig>
@@ -0,0 +1,10 @@
+import dbus
+bus = dbus.SystemBus()
+proxy = bus.get_object(
+ 'com.mandriva.mcc2.SystemServices',
+ '/com/mandriva/mcc2/SystemServices')
+interface = dbus.Interface(proxy, 'com.mandriva.mcc2.SystemServices')
+for service in interface.list():
+ for s in service:
+ print s
+ print '-'*80
@@ -0,0 +1,7 @@
+import dbus
+bus = dbus.SystemBus()
+proxy = bus.get_object(
+ 'com.mandriva.mcc2.SystemServices',
+ '/com/mandriva/mcc2/SystemServices')
+interface = dbus.Interface(proxy, 'com.mandriva.mcc2.SystemServices')
+print interface.restart('crond.service', 'fail')
@@ -0,0 +1,12 @@
+import dbus
+bus = dbus.SystemBus()
+proxy = bus.get_object(
+ 'com.mandriva.mcc2.SystemServices',
+ '/com/mandriva/mcc2/SystemServices')
+interface = dbus.Interface(proxy, 'com.mandriva.mcc2.SystemServices')
+for service in interface.list():
+ details = interface.service_details(service[6])
+ print details['Id']
+ #for key, value in details.items():
+ # print key, value
+ print '-'*80
@@ -0,0 +1,7 @@
+import dbus
+bus = dbus.SystemBus()
+proxy = bus.get_object(
+ 'com.mandriva.mcc2.SystemServices',
+ '/com/mandriva/mcc2/SystemServices')
+interface = dbus.Interface(proxy, 'com.mandriva.mcc2.SystemServices')
+print interface.start('crond.service', 'fail')
@@ -0,0 +1,7 @@
+import dbus
+bus = dbus.SystemBus()
+proxy = bus.get_object(
+ 'com.mandriva.mcc2.SystemServices',
+ '/com/mandriva/mcc2/SystemServices')
+interface = dbus.Interface(proxy, 'com.mandriva.mcc2.SystemServices')
+print interface.stop('crond.service', 'fail')
Oops, something went wrong.

0 comments on commit 76fb003

Please sign in to comment.