~parthpanchl/gtg/workspace2

« back to all changes in this revision

Viewing changes to GTG/gtg.py

  • Committer: Parin Porecha
  • Date: 2014-01-31 06:59:35 UTC
  • mfrom: (1240.2.94 port-to-gtk3-py3)
  • Revision ID: parinporecha@gmail.com-20140131065935-ub6evnrwpmmm25hz
Merged the gtk3 and python3 port with GTG trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python2
 
1
#!/usr/bin/env python3
2
2
# -*- coding: utf-8 -*-
3
3
# -----------------------------------------------------------------------------
4
4
# Getting Things GNOME! - a personal organizer for the GNOME desktop
74
74
    pidfile = os.path.join(directory, "gtg.pid")
75
75
    if not os.path.exists(pidfile):
76
76
        open(pidfile, "w").close()
77
 
        os.chmod(pidfile, 0600)
 
77
        os.chmod(pidfile, 0o600)
78
78
 
79
79
    # see if gtg is already running
80
80
    pid = open(pidfile, "r").readline()
82
82
        p = os.system("/bin/ps %s >/dev/null" % pid)
83
83
        p_name = os.popen("/bin/ps -f %s" % pid).read()
84
84
        if p == 0 and "gtg" in p_name:
85
 
            print _("gtg is already running!")
 
85
            print(_("gtg is already running!"))
86
86
            try:
87
87
                d = dbus.SessionBus().get_object(CoreConfig.BUSNAME,
88
88
                                                 CoreConfig.BUSINTERFACE)