Actually convert to Python3
- Update shebang. - Drop encoding line, useless in Python3. - Use GObject rather than gobject.
This commit is contained in:
parent
ecfe87cd99
commit
cd317355f1
13
gcp
13
gcp
|
@ -1,5 +1,4 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
gcp: Goffi's CoPier
|
gcp: Goffi's CoPier
|
||||||
|
@ -35,7 +34,7 @@ import os,os.path
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
import pickle
|
import pickle
|
||||||
try:
|
try:
|
||||||
import gobject
|
from gi.repository import GObject
|
||||||
#DBus
|
#DBus
|
||||||
import dbus, dbus.glib
|
import dbus, dbus.glib
|
||||||
import dbus.service
|
import dbus.service
|
||||||
|
@ -341,8 +340,8 @@ class GCP():
|
||||||
source_fd.close()
|
source_fd.close()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
gobject.io_add_watch(source_fd,gobject.IO_IN,self._copyFile,
|
GObject.io_add_watch(source_fd, GObject.IO_IN,self._copyFile,
|
||||||
(dest_fd, options), priority=gobject.PRIORITY_DEFAULT)
|
(dest_fd, options), priority=GObject.PRIORITY_DEFAULT)
|
||||||
if not self.progress:
|
if not self.progress:
|
||||||
info(_("COPYING %(source)s ==> %(dest)s") % {"source":source_file, "dest":dest_file})
|
info(_("COPYING %(source)s ==> %(dest)s") % {"source":source_file, "dest":dest_file})
|
||||||
return True
|
return True
|
||||||
|
@ -665,7 +664,7 @@ class GCP():
|
||||||
self.__checkArgs(options, source_dir, args)
|
self.__checkArgs(options, source_dir, args)
|
||||||
if not self.__launched:
|
if not self.__launched:
|
||||||
self.journal = Journal()
|
self.journal = Journal()
|
||||||
gobject.idle_add(self.__copyNextFile)
|
GObject.idle_add(self.__copyNextFile)
|
||||||
self.__launched = True
|
self.__launched = True
|
||||||
return (True,'')
|
return (True,'')
|
||||||
|
|
||||||
|
@ -675,7 +674,7 @@ class GCP():
|
||||||
|
|
||||||
def go(self):
|
def go(self):
|
||||||
"""Launch main loop"""
|
"""Launch main loop"""
|
||||||
self.loop = gobject.MainLoop()
|
self.loop = GObject.MainLoop()
|
||||||
try:
|
try:
|
||||||
self.loop.run()
|
self.loop.run()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|
Loading…
Reference in New Issue