~kobe24-lixiang/i-help-you-daemon/trunk

« back to all changes in this revision

Viewing changes to src/userinfo.py

  • Committer: kobe
  • Date: 2013-06-04 06:30:14 UTC
  • Revision ID: kobe24_lixiang@126.com-20130604063014-xzud9vrbg4tm7hyq
initial version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# -*- coding: utf-8 -*-
 
3
### BEGIN LICENSE
 
4
# Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd
 
5
# This program is free software: you can redistribute it and/or modify it
 
6
# under the terms of the GNU General Public License version 3, as published
 
7
# by the Free Software Foundation.
 
8
#
 
9
# This program is distributed in the hope that it will be useful, but
 
10
# WITHOUT ANY WARRANTY; without even the implied warranties of
 
11
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
12
# PURPOSE.  See the GNU General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License along
 
15
# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
### END LICENSE
 
17
 
 
18
import os
 
19
from gi.repository import Gtk, GLib
 
20
import gettext
 
21
from gettext import gettext as _
 
22
from gettext import ngettext as __
 
23
 
 
24
def get_userinfo():
 
25
    __icon__  = 'config-users'
 
26
    __title__ = _('User Information')
 
27
    return GLib.get_user_name(), GLib.get_home_dir(), GLib.getenv('SHELL'), GLib.getenv('LANG')
 
28
 
 
29
CURRENT_USER, HOME_DIRECTORY, SHELL, LANGUAGE = get_userinfo()
 
30
 
 
31
if __name__ == '__main__':
 
32
    print(get_userinfo())