Permalink
Browse files

Added more users examples, changed users methods, changed install fol…

…der to /usr/share/mandriva, changed some docs

git-svn-id: https://camelo.conectiva/repos/projetos/qtlab/mcc2@8704 aeaf0dc8-91d7-0310-8701-e1fc1a66ab8d
  • Loading branch information...
1 parent 72872c1 commit b63109787312fd0b3ad7337f7af99f68c0fcd0b9 wiliam committed Feb 10, 2011
View
29 INSTALL
@@ -4,18 +4,31 @@ Install
basicaly run python setup.py install.
+Urpmi
+-----
+
+urpmi mandriva-control-center
+
Requirements
============
- * pyside
- * qt4
+ * python-dbus 0.83.2
+Backend
+-------
-Urpmi
------
-
-urpmi mcc2
+ * systemd 17
+ * libuser 0.57.1
+ * libuser-python 0.57.1
+Frontend
+--------
-Python install script
----------------------
+ * qt4 4.7.1
+ * pyside 1.0.0-0.beta5
+
+Documentation
+=============
+
+Run ``make html`` in docs folder to generate mandriva control center
+developer documentation.
View
@@ -5,4 +5,5 @@ include README
include AUTHORS
include TODO
recursive-include docs *
-prune docs/_build
+recursive-include examples *
+prune docs/_build
View
1 README
@@ -1,3 +1,4 @@
=======================
Mandriva Control Center
=======================
+
View
9 TODO
@@ -16,12 +16,21 @@ Backend
stop, restar and start services we should change that.
* Add an exception handler to dbus connection in all classes.
+
+ * Add backends dbus interface method stop.
+
+ * Add support to rpm stop dbus interfaces when updating or removing packages.
Frontend
--------
*
+RPM
+---
+
+ *
+
TESTS
=====
View
@@ -1,7 +1,7 @@
#!/usr/bin/python
import sys
-sys.path.append('/usr/share/mcc2/')
+sys.path.append('/usr/share/mandriva/')
from mcc2.frontends.services import view
if __name__ == '__main__':
View
@@ -1,7 +1,7 @@
#!/usr/bin/python
import sys
-sys.path.append('/usr/share/mcc2/')
+sys.path.append('/usr/share/mandriva/')
from mcc2.frontends.services import view
if __name__ == '__main__':
@@ -1,7 +1,7 @@
#!/usr/bin/python
import sys
-sys.path.append('/usr/share/mcc2/')
+sys.path.append('/usr/share/mandriva/')
from mcc2.backends.services.service import Services
if __name__ == '__main__':
View
@@ -1,7 +1,7 @@
#!/usr/bin/python
import sys
-sys.path.append('/usr/share/mcc2/')
+sys.path.append('/usr/share/mandriva/')
from mcc2.backends.users.service import Users
if __name__ == '__main__':
View
@@ -1 +1 @@
-/usr/share/mcc2/
+/usr/share/mandriva/
@@ -1,4 +1,4 @@
[D-BUS Service]
Name=org.mandrivalinux.mcc2.Services
-Exec=/usr/share/mcc2/bin/services-mechanism.py
+Exec=/usr/share/mandriva/bin/services-mechanism.py
User=root
@@ -1,4 +1,4 @@
[D-BUS Service]
Name=org.mandrivalinux.mcc2.Users
-Exec=/usr/share/mcc2/bin/users-mechanism.py
+Exec=/usr/share/mandriva/bin/users-mechanism.py
User=root
View
@@ -50,7 +50,7 @@
# The short X.Y version.
version = '0.1'
# The full version, including alpha/beta/rc tags.
-release = '01.beta'
+release = '0.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
View
@@ -0,0 +1,2 @@
+Frequently Asked Questions
+==========================
View
@@ -1,19 +1,69 @@
.. _getting-started:
+===============
Getting Started
===============
-xxxx
+Mandriva control center export the following d-bus interfaces to interact with
+the system wide configurations:
+
+ * org.mandrivalinux.org.mcc2.users
+ * org.mandrivalinux.org.mcc2.services
Installing software
--------------------
+===================
+
+From source code:
-xxx
+ python setup.py install
Users and Groups
-----------------
+================
+
+Let's learn by example.
+
+Here's a quick examples, how to use org.mandrivalinux.org.mcc2.users d-bus
+interfaces::
+
+ # Connecting to the Bus
+ >>> import dbus
+ >>> bus = dbus.SystemBus()
+
+ # Proxy object
+ >>> proxy = bus.get_object(
+ ... 'org.mandrivalinux.mcc2.Users',
+ ... '/org/mandrivalinux/mcc2/Users')
+
+ #
+ >>> interface = dbus.Interface(proxy, 'org.mandrivalinux.mcc2.Users')
+ >>> for user in interface.Users():
+ ... print user
+
+
+
+
+
+
-xxx
System Services
----------------
+===============
+
+.. admonition:: Mac OS X permissions
+
+ If you're using Mac OS X, you may see the message "permission denied" when
+ you try to run ``django-admin.py startproject``. This is because, on
+ Unix-based systems like OS X, a file must be marked as "executable" before it
+ can be run as a program. To do this, open Terminal.app and navigate (using
+ the ``cd`` command) to the directory where :doc:`django-admin.py
+ </ref/django-admin>` is installed, then run the command
+ ``chmod +x django-admin.py``.
+
+.. note::
+
+ You'll need to avoid naming projects after built-in Python or Django
+ components. In particular, this means you should avoid using names like
+ ``django`` (which will conflict with Django itself) or ``test`` (which
+ conflicts with a built-in Python package).
+
+
View
@@ -3,12 +3,11 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-Welcome to Mandriva Control Center's documentation!
-===================================================
+Mandriva Control Center's documentation!
+========================================
.. rubric:: Describe mandriva control center here.
-
Developer guide
===============
View
@@ -23,5 +23,31 @@ The implementation of this part will be in top of `D-Bus`_ and `PolicyKit`_.
.. _PySide: http://www.pyside.org/
.. _QT4: http://qt.nokia.com/products/
.. _Qt Quick: http://qt.nokia.com/products/qt-quick/
-.. D-Bus: http://www.freedesktop.org/wiki/Software/dbus
-.. PolicyKit: http://www.freedesktop.org/wiki/Software/PolicyKit
+.. _D-Bus: http://www.freedesktop.org/wiki/Software/dbus
+.. _PolicyKit: http://www.freedesktop.org/wiki/Software/PolicyKit
+
+Files and Folders
+=================
+
+/usr/bin:
+ * mcc2
+ * mcc2-services
+ * mcc2-users
+ * mcc2-boot
+ * mcc2-sshd
+
+/usr/share/mcc2:
+ * bin
+ * mcc2
+
+/etc/dbus-1/system.d/:
+ * org.mandrivalinux.mcc2.Services.conf
+ * org.mandrivalinux.mcc2.Users.conf
+
+/usr/share/dbus-1/:
+ * org.mandrivalinux.mcc2.Services.service
+ * org.mandrivalinux.mcc2.Users.service
+
+/usr/share/polkit-1/actions/:
+ * org.mandrivalinux.mcc2.services.policy
+ * org.mandrivalinux.mcc2.users.policy
@@ -4,7 +4,9 @@
'org.mandrivalinux.mcc2.Services',
'/org/mandrivalinux/mcc2/Services')
interface = dbus.Interface(proxy, 'org.mandrivalinux.mcc2.Services')
-for service in interface.List():
- for s in service:
- print s
- print '-'*80
+print type(interface.List())
+
+#for service in interface.List():
+# for s in service:
+# print s
+# print '-'*80
@@ -20,4 +20,4 @@
}
result = interface.AddUser(user_info)
-print result
+print result
@@ -5,4 +5,4 @@
'/org/mandrivalinux/mcc2/Users')
interface = dbus.Interface(proxy, 'org.mandrivalinux.mcc2.Users')
result = interface.DeleteGroup('john')
-print result['name'], result['gid']
+print result['groupname'], result['gid']
@@ -5,4 +5,4 @@
'/org/mandrivalinux/mcc2/Users')
interface = dbus.Interface(proxy, 'org.mandrivalinux.mcc2.Users')
result = interface.DeleteUser('john')
-print result['name'], result['uid']
+print result['groupname'], result['uid']
@@ -0,0 +1,8 @@
+import dbus
+bus = dbus.SystemBus()
+proxy = bus.get_object(
+ 'org.mandrivalinux.mcc2.Users',
+ '/org/mandrivalinux/mcc2/Users')
+interface = dbus.Interface(proxy, 'org.mandrivalinux.mcc2.Users')
+for group in interface.ListGroups():
+ print group
@@ -4,5 +4,5 @@
'org.mandrivalinux.mcc2.Users',
'/org/mandrivalinux/mcc2/Users')
interface = dbus.Interface(proxy, 'org.mandrivalinux.mcc2.Users')
-for user in interface.Users():
+for user in interface.ListUsers():
print user
@@ -0,0 +1,15 @@
+import dbus
+bus = dbus.SystemBus()
+proxy = bus.get_object(
+ 'org.mandrivalinux.mcc2.Users',
+ '/org/mandrivalinux/mcc2/Users')
+interface = dbus.Interface(proxy, 'org.mandrivalinux.mcc2.Users')
+
+group_info = {
+ 'groupname': 'john',
+ 'new_groupname': 'johns',
+ 'members': ['users', 'wheel', 'john']
+ }
+
+result = interface.ModifyGroup(group_info)
+print result
@@ -6,9 +6,9 @@
interface = dbus.Interface(proxy, 'org.mandrivalinux.mcc2.Users')
user_info = {
- 'old_username': 'john',
+ 'username': 'john',
+ 'new_username': 'johns',
'fullname': 'Johns Does',
- 'username': 'johns',
'shell': '/bin/bash',
'uid': 666,
'gid': 666,
@@ -21,9 +21,6 @@
#'shadow_inactive': -1,
#'shadow_last_change': 'YYYY-MM-DD'
}
-
-
-
result = interface.ModifyUser(user_info)
print result
Oops, something went wrong.

0 comments on commit b631097

Please sign in to comment.