Compare commits
7 Commits
b2dcbd8368
...
28e8089316
Author | SHA1 | Date |
---|---|---|
Matteo Cypriani | 28e8089316 | |
Matteo Cypriani | 6dbb4152f5 | |
Matteo Cypriani | c3a865920e | |
Matteo Cypriani | 4a2c1224f9 | |
Matteo Cypriani | 7ba62cdfca | |
Matteo Cypriani | de8fe1900c | |
Matteo Cypriani | b2d16599a4 |
|
@ -1,5 +0,0 @@
|
||||||
include MANIFEST.in gcp.1
|
|
||||||
global-include *.py
|
|
||||||
global-include *.po *.mo
|
|
||||||
global-include CHANGELOG COPYING* README*
|
|
||||||
global-exclude *.un~ *.swp
|
|
|
@ -59,6 +59,7 @@ complete the installation (Debian packages names, but you get the idea):
|
||||||
- libdbus-glib-1-dev
|
- libdbus-glib-1-dev
|
||||||
- libgirepository1.0-dev
|
- libgirepository1.0-dev
|
||||||
- libcairo2-dev
|
- libcairo2-dev
|
||||||
|
- python3-cairo-dev
|
||||||
|
|
||||||
On Debian-based systems
|
On Debian-based systems
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
11
gcp
11
gcp
|
@ -317,13 +317,15 @@ class GCP():
|
||||||
|
|
||||||
def __copyNextFile(self):
|
def __copyNextFile(self):
|
||||||
"""Takes the last file in the list and launches the copy using glib
|
"""Takes the last file in the list and launches the copy using glib
|
||||||
io_watch event."""
|
io_watch event.
|
||||||
|
@return: True a file was added, False otherwise."""
|
||||||
if not self.copy_list:
|
if not self.copy_list:
|
||||||
# Nothing left to copy, we quit
|
# Nothing left to copy, we quit
|
||||||
if self.progress:
|
if self.progress:
|
||||||
self.__pbar_finish()
|
self.__pbar_finish()
|
||||||
self.journal.showErrors()
|
self.journal.showErrors()
|
||||||
self.loop.quit()
|
self.loop.quit()
|
||||||
|
return False
|
||||||
|
|
||||||
source_file, dest_path, options = self.copy_list.pop()
|
source_file, dest_path, options = self.copy_list.pop()
|
||||||
self.journal.startFile(source_file)
|
self.journal.startFile(source_file)
|
||||||
|
@ -333,7 +335,7 @@ class GCP():
|
||||||
self.journal.copyFailed()
|
self.journal.copyFailed()
|
||||||
self.journal.error("can't open source")
|
self.journal.error("can't open source")
|
||||||
self.journal.closeFile()
|
self.journal.closeFile()
|
||||||
return
|
return True
|
||||||
|
|
||||||
filename = os.path.basename(source_file)
|
filename = os.path.basename(source_file)
|
||||||
assert(filename)
|
assert(filename)
|
||||||
|
@ -348,7 +350,7 @@ class GCP():
|
||||||
self.journal.error("already exists")
|
self.journal.error("already exists")
|
||||||
self.journal.closeFile()
|
self.journal.closeFile()
|
||||||
source_fd.close()
|
source_fd.close()
|
||||||
return
|
return True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dest_fd = open(dest_file, 'wb')
|
dest_fd = open(dest_file, 'wb')
|
||||||
|
@ -357,7 +359,7 @@ class GCP():
|
||||||
self.journal.error("can't open dest")
|
self.journal.error("can't open dest")
|
||||||
self.journal.closeFile()
|
self.journal.closeFile()
|
||||||
source_fd.close()
|
source_fd.close()
|
||||||
return
|
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),
|
(dest_fd, options),
|
||||||
|
@ -365,6 +367,7 @@ class GCP():
|
||||||
if not self.progress:
|
if not self.progress:
|
||||||
info(_("COPYING %(source)s ==> %(dest)s")
|
info(_("COPYING %(source)s ==> %(dest)s")
|
||||||
% {"source":source_file, "dest":dest_file})
|
% {"source":source_file, "dest":dest_file})
|
||||||
|
return True
|
||||||
|
|
||||||
def __copyFailed(self, reason, source_fd, dest_fd):
|
def __copyFailed(self, reason, source_fd, dest_fd):
|
||||||
"""Write the failure in the journal and close files descriptors"""
|
"""Write the failure in the journal and close files descriptors"""
|
||||||
|
|
11
setup.py
11
setup.py
|
@ -1,10 +1,10 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from setuptools import setup
|
import setuptools
|
||||||
|
|
||||||
name = 'gcp'
|
name = 'gcp'
|
||||||
|
|
||||||
setup(
|
setuptools.setup(
|
||||||
name=name,
|
name=name,
|
||||||
version='0.2.0',
|
version='0.2.0',
|
||||||
url='https://code.lm7.fr/mcy/gcp',
|
url='https://code.lm7.fr/mcy/gcp',
|
||||||
|
@ -36,12 +36,15 @@ setup(
|
||||||
'Topic :: Utilities',
|
'Topic :: Utilities',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
scripts=['gcp'],
|
||||||
|
# entry_points={
|
||||||
|
# 'console_scripts': ['gcp=gcp:main'],
|
||||||
|
# },
|
||||||
data_files=[
|
data_files=[
|
||||||
('share/locale/fr/LC_MESSAGES', ['i18n/fr/LC_MESSAGES/gcp.mo']),
|
('share/locale/fr/LC_MESSAGES', ['i18n/fr/LC_MESSAGES/gcp.mo']),
|
||||||
('share/man/man1', ["gcp.1"]),
|
('share/man/man1', ["gcp.1"]),
|
||||||
('share/doc/%s' % name, ['COPYING', 'README.md']),
|
('share/doc/%s' % name, ['CHANGELOG', 'LICENSE.txt', 'README.md']),
|
||||||
],
|
],
|
||||||
scripts=['gcp'],
|
|
||||||
install_requires=['PyGObject', 'dbus-python'],
|
install_requires=['PyGObject', 'dbus-python'],
|
||||||
python_requires='>=3',
|
python_requires='>=3',
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue