Merge lp:~nataliabidart/magicicada-client/snapping into lp:magicicada-client
- snapping
- Merge into trunk
Proposed by
Natalia Bidart
Status: | Work in progress |
---|---|
Proposed branch: | lp:~nataliabidart/magicicada-client/snapping |
Merge into: | lp:magicicada-client |
Diff against target: |
526 lines (+69/-363) 11 files modified
.snapcraft.yaml (+33/-0) HACKING (+1/-1) data/com.ubuntuone.SyncDaemon.service.in (+0/-1) data/logging.conf.in (+0/-13) data/source_ubuntuone-client.py (+0/-61) data/syncdaemon.conf (+1/-2) data/ubuntuone-client-crashdb.conf (+0/-5) dependencies.txt (+1/-1) setup.py (+24/-250) ubuntuone-client.pth (+0/-1) ubuntuone/platform/os_helper/linux.py (+9/-28) |
To merge this branch: | bzr merge lp:~nataliabidart/magicicada-client/snapping |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
chicharreros | Pending | ||
Review via email:
|
Commit message
- Initial work on snapping the client.
Description of the change
To post a comment you must log in.
- 1431. By Natalia Bidart
-
Debugging.
Unmerged revisions
- 1431. By Natalia Bidart
-
Debugging.
- 1430. By Natalia Bidart
-
Initial work on snapping the client.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file '.snapcraft.yaml' |
2 | --- .snapcraft.yaml 1970-01-01 00:00:00 +0000 |
3 | +++ .snapcraft.yaml 2016-09-02 00:06:46 +0000 |
4 | @@ -0,0 +1,33 @@ |
5 | +name: magicicada-client |
6 | +version: 0.1 |
7 | +summary: The client for the Magicicada filesync service (ex-Ubuntu One). |
8 | +description: Magicicada is an open source fork of the original Ubuntu One filesync service. |
9 | +confinement: devmode |
10 | + |
11 | +apps: |
12 | + syncdaemon: |
13 | + command: ./bin/ubuntuone-syncdaemon |
14 | + daemon: simple |
15 | + |
16 | +parts: |
17 | + magicicada-protocol: |
18 | + plugin: python2 |
19 | + source: lp:magicicada-protocol |
20 | + build-packages: |
21 | + - protobuf-compiler |
22 | + magicicada-client: |
23 | + plugin: python2 |
24 | + source: . |
25 | + stage-packages: |
26 | + - gir1.2-notify-0.7 |
27 | + - gir1.2-soup-2.4 |
28 | + - python-configglue |
29 | + - python-dirspec |
30 | + - python-distutils-extra |
31 | + - python-gi |
32 | + - python-httplib2 |
33 | + - python-protobuf |
34 | + - python-pyinotify |
35 | + - python-qt4-dbus |
36 | + - python-qt4reactor |
37 | + - python-twisted |
38 | |
39 | === modified file 'HACKING' |
40 | --- HACKING 2015-09-29 21:05:26 +0000 |
41 | +++ HACKING 2016-09-02 00:06:46 +0000 |
42 | @@ -5,7 +5,7 @@ |
43 | |
44 | Or you can simply bootstrap and everything will happen automagically: |
45 | |
46 | -$: make boostrap |
47 | +$: make bootstrap |
48 | |
49 | After configuring, in order to run the tests, all you need to do is run |
50 | make check. |
51 | |
52 | === modified file 'data/com.ubuntuone.SyncDaemon.service.in' |
53 | --- data/com.ubuntuone.SyncDaemon.service.in 2009-06-17 16:08:17 +0000 |
54 | +++ data/com.ubuntuone.SyncDaemon.service.in 2016-09-02 00:06:46 +0000 |
55 | @@ -1,4 +1,3 @@ |
56 | [D-BUS Service] |
57 | Name=com.ubuntuone.SyncDaemon |
58 | Exec=@libexecdir@/ubuntuone-syncdaemon |
59 | - |
60 | |
61 | === removed file 'data/logging.conf.in' |
62 | --- data/logging.conf.in 2009-12-23 22:05:44 +0000 |
63 | +++ data/logging.conf.in 1970-01-01 00:00:00 +0000 |
64 | @@ -1,13 +0,0 @@ |
65 | -[logging] |
66 | -level.default = @LOG_LEVEL@ |
67 | -level.parser = log_level |
68 | -level.help = Set the log level (TRACE, DEBUG, INFO, WARNING, ERROR, NOTE |
69 | - CRITICAL, FATAL) |
70 | - |
71 | -file_size.default = @LOG_FILE_SIZE@ |
72 | -file_size.parser = int |
73 | -file_size.help = max file size (the file will be rotated) |
74 | - |
75 | -backup_count.default = 5 |
76 | -backup_count.parser = int |
77 | -backup_count.help = number of rotated log files to keep around. |
78 | |
79 | === removed file 'data/source_ubuntuone-client.py' |
80 | --- data/source_ubuntuone-client.py 2013-01-31 20:35:21 +0000 |
81 | +++ data/source_ubuntuone-client.py 1970-01-01 00:00:00 +0000 |
82 | @@ -1,61 +0,0 @@ |
83 | -# Copyright 2009-2013 Canonical Ltd. |
84 | -# |
85 | -# This program is free software: you can redistribute it and/or modify it |
86 | -# under the terms of the GNU General Public License version 3, as published |
87 | -# by the Free Software Foundation. |
88 | -# |
89 | -# This program is distributed in the hope that it will be useful, but |
90 | -# WITHOUT ANY WARRANTY; without even the implied warranties of |
91 | -# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
92 | -# PURPOSE. See the GNU General Public License for more details. |
93 | -# |
94 | -# You should have received a copy of the GNU General Public License along |
95 | -# with this program. If not, see <http://www.gnu.org/licenses/>. |
96 | -# |
97 | -# In addition, as a special exception, the copyright holders give |
98 | -# permission to link the code of portions of this program with the |
99 | -# OpenSSL library under certain conditions as described in each |
100 | -# individual source file, and distribute linked combinations |
101 | -# including the two. |
102 | -# You must obey the GNU General Public License in all respects |
103 | -# for all of the code used other than OpenSSL. If you modify |
104 | -# file(s) with this exception, you may extend this exception to your |
105 | -# version of the file(s), but you are not obligated to do so. If you |
106 | -# do not wish to do so, delete this exception statement from your |
107 | -# version. If you delete this exception statement from all source |
108 | -# files in the program, then also delete it here. |
109 | -"""Stub for Apport""" |
110 | - |
111 | -from __future__ import print_function, unicode_literals |
112 | - |
113 | -import apport |
114 | -import os |
115 | - |
116 | -from apport.hookutils import attach_file_if_exists |
117 | -from dirspec.basedir import xdg_cache_home, xdg_config_home |
118 | - |
119 | -# Paths where things we might want live |
120 | -u1_log_path = os.path.join(xdg_cache_home, b"ubuntuone", b"log") |
121 | -u1_user_config_path = os.path.join(xdg_config_home, b"ubuntuone") |
122 | -# things we may want to collect for the report |
123 | -u1_client_log = os.path.join(u1_log_path, b"syncdaemon.log") |
124 | -u1_except_log = os.path.join(u1_log_path, b"syncdaemon-exceptions.log") |
125 | -u1_invalidnames_log = os.path.join(u1_log_path, b"syncdaemon-invalid-names.log") |
126 | -u1_sd_conf = os.path.join(b"etc", b"xdg", b"ubuntuone", b"syncdaemon.conf") |
127 | -u1_usersd_conf = os.path.join(u1_user_config_path, b"syncdaemon.conf") |
128 | - |
129 | - |
130 | -def add_info(report): |
131 | - """add report info""" |
132 | - attach_file_if_exists(report, u1_except_log, |
133 | - "UbuntuOneSyncdaemonExceptionsLog") |
134 | - attach_file_if_exists(report, u1_invalidnames_log, |
135 | - "UbuntuOneSyncdaemonInvalidNamesLog") |
136 | - attach_file_if_exists(report, u1_usersd_conf, |
137 | - "UbuntuOneUserSyncdaemonConfig") |
138 | - attach_file_if_exists(report, u1_sd_conf, |
139 | - "UbuntuOneSyncdaemonConfig") |
140 | - |
141 | - if not apport.packaging.is_distro_package(report['Package'].split()[0]): |
142 | - report['ThirdParty'] = 'True' |
143 | - report['CrashDB'] = 'ubuntuone' |
144 | |
145 | === modified file 'data/syncdaemon.conf' |
146 | --- data/syncdaemon.conf 2015-09-29 02:25:44 +0000 |
147 | +++ data/syncdaemon.conf 2016-09-02 00:06:46 +0000 |
148 | @@ -52,8 +52,7 @@ |
149 | send_events_over_dbus.default = False |
150 | send_events_over_dbus.parser = bool |
151 | send_events_over_dbus.action = store_true |
152 | -send_events_over_dbus.help = Enable sending "Event" singals for each internal |
153 | - event |
154 | +send_events_over_dbus.help = Enable sending "Event" singals for each internal event |
155 | |
156 | handshake_timeout.default = 50 |
157 | handshake_timeout.parser = int |
158 | |
159 | === removed file 'data/ubuntuone-client-crashdb.conf' |
160 | --- data/ubuntuone-client-crashdb.conf 2009-08-05 18:01:19 +0000 |
161 | +++ data/ubuntuone-client-crashdb.conf 1970-01-01 00:00:00 +0000 |
162 | @@ -1,5 +0,0 @@ |
163 | -ubuntuone = { |
164 | - 'impl' : 'launchpad', |
165 | - 'project' : 'ubuntuone-client', |
166 | - 'bug_pattern_base' : None, |
167 | -} |
168 | |
169 | === modified file 'dependencies.txt' |
170 | --- dependencies.txt 2016-07-13 22:12:48 +0000 |
171 | +++ dependencies.txt 2016-09-02 00:06:46 +0000 |
172 | @@ -1,4 +1,4 @@ |
173 | -gir1.2-notify |
174 | +gir1.2-notify-0.7 |
175 | gir1.2-soup-2.4 |
176 | protobuf-compiler |
177 | python-configglue |
178 | |
179 | === modified file 'setup.py' (properties changed: +x to -x) |
180 | --- setup.py 2016-08-06 20:02:14 +0000 |
181 | +++ setup.py 2016-09-02 00:06:46 +0000 |
182 | @@ -1,252 +1,26 @@ |
183 | -#!/usr/bin/python |
184 | -# |
185 | -# Copyright 2013 Canonical Ltd. |
186 | -# |
187 | -# This program is free software: you can redistribute it and/or modify it |
188 | -# under the terms of the GNU General Public License version 3, as published |
189 | -# by the Free Software Foundation. |
190 | -# |
191 | -# This program is distributed in the hope that it will be useful, but |
192 | -# WITHOUT ANY WARRANTY; without even the implied warranties of |
193 | -# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
194 | -# PURPOSE. See the GNU General Public License for more details. |
195 | -# |
196 | -# You should have received a copy of the GNU General Public License along |
197 | -# with this program. If not, see <http://www.gnu.org/licenses/>. |
198 | -# |
199 | -# In addition, as a special exception, the copyright holders give |
200 | -# permission to link the code of portions of this program with the |
201 | -# OpenSSL library under certain conditions as described in each |
202 | -# individual source file, and distribute linked combinations |
203 | -# including the two. |
204 | -# You must obey the GNU General Public License in all respects |
205 | -# for all of the code used other than OpenSSL. If you modify |
206 | -# file(s) with this exception, you may extend this exception to your |
207 | -# version of the file(s), but you are not obligated to do so. If you |
208 | -# do not wish to do so, delete this exception statement from your |
209 | -# version. If you delete this exception statement from all source |
210 | -# files in the program, then also delete it here. |
211 | -"""Setup.py: build, distribute, clean.""" |
212 | - |
213 | import os |
214 | -import sys |
215 | - |
216 | -try: |
217 | - from DistUtilsExtra.command import build_extra, build_i18n |
218 | - import DistUtilsExtra.auto |
219 | -except ImportError: |
220 | - print >> sys.stderr, 'To build this program you need '\ |
221 | - 'https://launchpad.net/python-distutils-extra' |
222 | - raise |
223 | -assert DistUtilsExtra.auto.__version__ >= '2.18', \ |
224 | - 'needs DistUtilsExtra.auto >= 2.18' |
225 | - |
226 | - |
227 | -PROJECT_NAME = 'magicicada-client' |
228 | -VERSION = '1.0' |
229 | - |
230 | -POT_FILE = 'po/%s.pot' % PROJECT_NAME |
231 | -SERVICE_FILES = ['data/com.ubuntuone.Credentials.service', |
232 | - 'data/com.ubuntuone.SyncDaemon.service'] |
233 | -CONFIG_FILES = ['data/logging.conf'] |
234 | -CLIENTDEFS = 'ubuntuone/clientdefs.py' |
235 | - |
236 | -BUILD_FILES = [CLIENTDEFS] + CONFIG_FILES |
237 | -CLEANFILES = [POT_FILE, 'MANIFEST'] + BUILD_FILES + SERVICE_FILES |
238 | - |
239 | -if int(VERSION.split('.')[1]) % 2 != 0: |
240 | - LOG_LEVEL = 'DEBUG' |
241 | - LOG_FILE_SIZE = '10485760' |
242 | -else: |
243 | - LOG_LEVEL = 'INFO' |
244 | - LOG_FILE_SIZE = '1048576' |
245 | - |
246 | - |
247 | -def replace_variables(files_to_replace, prefix=None, *args, **kwargs): |
248 | - """Replace the @VERSION@ in the constants file with the actual version.""" |
249 | - for fname in files_to_replace: |
250 | - with open(fname + '.in') as in_file: |
251 | - content = in_file.read() |
252 | - with open(fname, 'w') as out_file: |
253 | - content = content.replace('@VERSION@', VERSION) |
254 | - content = content.replace('@PROJECT_NAME@', PROJECT_NAME) |
255 | - content = content.replace('@GETTEXT_PACKAGE@', PROJECT_NAME) |
256 | - content = content.replace('@LOG_LEVEL@', LOG_LEVEL) |
257 | - content = content.replace('@LOG_FILE_SIZE@', LOG_FILE_SIZE) |
258 | - if prefix is not None: |
259 | - content = content.replace( |
260 | - '@localedir@', os.path.join(prefix, |
261 | - 'share', 'locale')) |
262 | - content = content.replace( |
263 | - '@libexecdir@', os.path.join(prefix, |
264 | - 'lib', PROJECT_NAME)) |
265 | - out_file.write(content) |
266 | - |
267 | - |
268 | -class Install(DistUtilsExtra.auto.install_auto): |
269 | - """Class to install proper files.""" |
270 | - |
271 | - def run(self): |
272 | - """Do the install. |
273 | - |
274 | - Read from *.service.in and generate .service files by replacing |
275 | - @prefix@ by self.prefix. |
276 | - |
277 | - """ |
278 | - |
279 | - # Remove the contrib and tests packages from the packages list |
280 | - # as they are not meant to be installed to the system. |
281 | - pkgs = [x for x in self.distribution.packages if not ( |
282 | - x.startswith('contrib') or x.startswith('tests'))] |
283 | - self.distribution.packages = pkgs |
284 | - |
285 | - # Remove the input and dev files from the data files list, |
286 | - # as they are not meant to be installed. |
287 | - data_files = [x for x in self.distribution.data_files if not ( |
288 | - x[1][0].endswith('.in') or x[1][0].endswith('-dev.conf'))] |
289 | - self.distribution.data_files = data_files |
290 | - |
291 | - # Get just the prefix value, without the root |
292 | - prefix = self.install_data.replace( |
293 | - self.root if self.root is not None else '', '') |
294 | - replace_variables(SERVICE_FILES, prefix) |
295 | - DistUtilsExtra.auto.install_auto.run(self) |
296 | - # Replace the CLIENTDEFS paths here, so that we can do it directly in |
297 | - # the installed copy, rather than the lcoal copy. This allows us to |
298 | - # have a semi-generated version for use in tests, and a full version |
299 | - # for use in installed systems. |
300 | - with open(CLIENTDEFS) as in_file: |
301 | - content = in_file.read() |
302 | - with open(os.path.join(self.install_purelib, |
303 | - PROJECT_NAME, |
304 | - CLIENTDEFS), 'w') as out_file: |
305 | - content = content.replace( |
306 | - '@localedir@', os.path.join(prefix, 'share', 'locale')) |
307 | - content = content.replace( |
308 | - '@libexecdir@', os.path.join(prefix, 'lib', PROJECT_NAME)) |
309 | - out_file.write(content) |
310 | - |
311 | - |
312 | -class Build(build_extra.build_extra): |
313 | - """Build PyQt (.ui) files and resources.""" |
314 | - |
315 | - description = "build PyQt GUIs (.ui) and resources (.qrc)" |
316 | - |
317 | - def run(self): |
318 | - """Execute the command.""" |
319 | - replace_variables(BUILD_FILES) |
320 | - build_extra.build_extra.run(self) |
321 | - |
322 | - |
323 | -class Clean(DistUtilsExtra.auto.clean_build_tree): |
324 | - """Class to clean up after the build.""" |
325 | - |
326 | - def run(self): |
327 | - """Clean up the built files.""" |
328 | - for built_file in CLEANFILES: |
329 | - if os.path.exists(built_file): |
330 | - os.unlink(built_file) |
331 | - |
332 | - DistUtilsExtra.auto.clean_build_tree.run(self) |
333 | - |
334 | - |
335 | -class BuildLocale(build_i18n.build_i18n): |
336 | - """Work around a bug in DistUtilsExtra.""" |
337 | - |
338 | - def run(self): |
339 | - """Magic.""" |
340 | - build_i18n.build_i18n.run(self) |
341 | - i = 0 |
342 | - for df in self.distribution.data_files: |
343 | - if df[0].startswith('etc/xdg/'): |
344 | - if sys.platform not in ('darwin', 'win32'): |
345 | - new_df = (df[0].replace('etc/xdg/', '/etc/xdg/'), df[1]) |
346 | - self.distribution.data_files[i] = new_df |
347 | - else: |
348 | - self.distribution.data_files.pop(i) |
349 | - i += 1 |
350 | - |
351 | - |
352 | -def set_py2exe_paths(): |
353 | - """Set the path so that py2exe finds the required modules.""" |
354 | - # Pylint does not understand same spaced imports |
355 | - import win32com |
356 | - try: |
357 | - import py2exe.mf as modulefinder |
358 | - except ImportError: |
359 | - import modulefinder |
360 | - |
361 | - # py2exe 0.6.4 introduced a replacement modulefinder. |
362 | - # This means we have to add package paths there, |
363 | - # not to the built-in one. If this new modulefinder gets |
364 | - # integrated into Python, then we might be able to revert |
365 | - # this some day. If this doesn't work, try import modulefinder |
366 | - for package_path in win32com.__path__[1:]: |
367 | - modulefinder.AddPackagePath("win32com", package_path) |
368 | - for extra_mod in ["win32com.server", "win32com.client"]: |
369 | - __import__(extra_mod) |
370 | - module = sys.modules[extra_mod] |
371 | - for module_path in module.__path__[1:]: |
372 | - modulefinder.AddPackagePath(extra_mod, module_path) |
373 | - |
374 | - |
375 | -cmdclass = { |
376 | - 'install': Install, |
377 | - 'build': Build, |
378 | - 'clean': Clean, |
379 | - 'build_i18n': BuildLocale, |
380 | -} |
381 | - |
382 | -bin_scripts = [ |
383 | - 'bin/u1sdtool', |
384 | - 'bin/ubuntuone-launch', |
385 | -] |
386 | - |
387 | -libexec_scripts = [ |
388 | - 'bin/ubuntuone-proxy-tunnel', |
389 | - 'bin/ubuntuone-syncdaemon', |
390 | -] |
391 | - |
392 | -data_files = [] |
393 | -scripts = [] |
394 | - |
395 | -if sys.platform == 'win32': |
396 | - set_py2exe_paths() |
397 | - extra = { |
398 | - 'options': { |
399 | - 'py2exe': { |
400 | - 'bundle_files': 1, |
401 | - 'skip_archive': 0, |
402 | - 'optimize': 1, |
403 | - 'dll_excludes': ["mswsock.dll", "powrprof.dll"], |
404 | - }, |
405 | - }, |
406 | - # add the console script so that py2exe compiles it |
407 | - 'console': bin_scripts + libexec_scripts, |
408 | - 'zipfile': None, |
409 | - } |
410 | -else: |
411 | - data_files.extend([ |
412 | - ('lib/%s' % PROJECT_NAME, libexec_scripts), |
413 | - ('share/dbus-1/services', SERVICE_FILES), |
414 | - ('/etc/xdg/ubuntuone', CONFIG_FILES + ['data/syncdaemon.conf']), |
415 | - ('/etc/apport/crashdb.conf.d', ['data/ubuntuone-client-crashdb.conf']), |
416 | - ('share/apport/package-hooks', ['data/source_ubuntuone-client.py']), |
417 | - ('share/man/man1', ['docs/man/u1sdtool.1']), |
418 | - ]) |
419 | - scripts.extend(bin_scripts) |
420 | - extra = {} |
421 | - |
422 | -DistUtilsExtra.auto.setup( |
423 | - name=PROJECT_NAME, |
424 | - version=VERSION, |
425 | - license='GPL v3', |
426 | + |
427 | +from setuptools import setup, find_packages |
428 | + |
429 | +# Utility function to read the README file. |
430 | +# Used for the long_description. It's nice, because now 1) we have a top level |
431 | +# README file and 2) it's easier to type in the README file than to put a raw |
432 | +# string in below ... |
433 | +def read(fname): |
434 | + return open(os.path.join(os.path.dirname(__file__), fname)).read() |
435 | + |
436 | + |
437 | +setup( |
438 | + name='magicicada-client', |
439 | + version='0.1', |
440 | author='Chicharreros', |
441 | - author_email='magicicada-hackers@@lists.launchpad.net', |
442 | - description='Magicicada file synchronization client', |
443 | - url='https://launchpad.net/%s' % PROJECT_NAME, |
444 | - extra_path=PROJECT_NAME, |
445 | - scripts=scripts, |
446 | - data_files=data_files, |
447 | - cmdclass=cmdclass, |
448 | - **extra) |
449 | + author_email='magicicada-hackers@lists.launchpad.net', |
450 | + description='Magicicada filesync client', |
451 | + license='GPL', |
452 | + keywords='filesync', |
453 | + url='https://launchpad.net/magicicada', |
454 | + packages=find_packages(), |
455 | + long_description=read('README'), |
456 | + include_package_data=True, |
457 | + scripts=['bin/ubuntuone-syncdaemon', 'bin/u1sdtool'], |
458 | +) |
459 | |
460 | === removed file 'ubuntuone-client.pth' |
461 | --- ubuntuone-client.pth 2013-06-10 19:27:21 +0000 |
462 | +++ ubuntuone-client.pth 1970-01-01 00:00:00 +0000 |
463 | @@ -1,1 +0,0 @@ |
464 | -ubuntuone-client |
465 | |
466 | === modified file 'ubuntuone/platform/os_helper/linux.py' |
467 | --- ubuntuone/platform/os_helper/linux.py 2013-02-12 23:15:48 +0000 |
468 | +++ ubuntuone/platform/os_helper/linux.py 2016-09-02 00:06:46 +0000 |
469 | @@ -36,12 +36,7 @@ |
470 | import os |
471 | import shutil |
472 | |
473 | -try: |
474 | - from gi.repository import Gio, GLib |
475 | - has_gi = True |
476 | -except ImportError: |
477 | - import gio |
478 | - has_gi = False |
479 | +from gi.repository import GLib, GObject, Gio |
480 | |
481 | from ubuntuone.platform.os_helper import unix |
482 | |
483 | @@ -55,22 +50,13 @@ |
484 | |
485 | If had any error, or the system can't do it, just remove it. |
486 | """ |
487 | - if has_gi: |
488 | - not_supported = Gio.IOErrorEnum.NOT_SUPPORTED |
489 | - try: |
490 | - return_code = Gio.File.new_for_path(path).trash(None) |
491 | - except GLib.GError: |
492 | - exc = OSError() |
493 | - exc.errno = errno.ENOENT |
494 | - raise exc |
495 | - else: |
496 | - not_supported = gio.ERROR_NOT_SUPPORTED |
497 | - try: |
498 | - return_code = gio.File(path).trash() |
499 | - except gio.Error: |
500 | - exc = OSError() |
501 | - exc.errno = errno.ENOENT |
502 | - raise exc |
503 | + not_supported = Gio.IOErrorEnum.NOT_SUPPORTED |
504 | + try: |
505 | + return_code = Gio.File.new_for_path(path).trash(None) |
506 | + except GLib.GError: |
507 | + exc = OSError() |
508 | + exc.errno = errno.ENOENT |
509 | + raise exc |
510 | |
511 | if not return_code or return_code == not_supported: |
512 | logger.warning("Problems moving to trash! (%s) Removing anyway: %r", |
513 | @@ -83,12 +69,7 @@ |
514 | |
515 | def set_application_name(app_name): |
516 | """Set the name of the application.""" |
517 | - if has_gi: |
518 | - from gi.repository import GObject |
519 | - GObject.set_application_name(app_name) |
520 | - else: |
521 | - import gobject |
522 | - gobject.set_application_name(app_name) |
523 | + GObject.set_application_name(app_name) |
524 | |
525 | |
526 | set_no_rights = unix.set_no_rights |