Skip to content

Broken import

Hi,

The interface not always being very intuitive (*) I mistakenly lost one of my configs.

(*) Having a profile selected for whatever reason and clicking on the "Save configuration" button results in a profile being copied, not saved to a file as I would have expected before I realized there is a "Export" button that does the job)

I have 2 configs:

  • 1 for single monitor, with 1 top and 1 bottom panel
  • 1 for dual monitor, with the same 2 "single monitor" panels copied on the 2 monitors

As it is PitA to recreate everything, I recreated the single monitor config, saved it and exported it.

Then I un-tar'ed the export, manually copied the panel configurations, retar'd the whole thing and tried to Import the new file [this process worked a few months ago when I created my lost config].

Unfortunately, the resulting .tar.bz2 config to crashs the app.

[09/04/20-18:08:44] user@empcarlabhc144:tmp$ xfce4-panel-profiles 
Traceback (most recent call last):
  File "/usr/share/xfce4-panel-profiles/xfce4-panel-profiles/xfce4-panel-profiles.py", line 246, in on_import_clicked
    self._copy(filename, dst)
  File "/usr/share/xfce4-panel-profiles/xfce4-panel-profiles/xfce4-panel-profiles.py", line 87, in _copy
    PanelConfig.from_file(src).to_file(dst)
  File "/usr/share/xfce4-panel-profiles/xfce4-panel-profiles/panelconfig.py", line 87, in from_file
    pc.find_desktops()
  File "/usr/share/xfce4-panel-profiles/xfce4-panel-profiles/panelconfig.py", line 148, in find_desktops
    if self.check_desktop(desktop_path):
  File "/usr/share/xfce4-panel-profiles/xfce4-panel-profiles/panelconfig.py", line 116, in check_desktop
    bytes = self.get_desktop_source_file(path).read()
  File "/usr/share/xfce4-panel-profiles/xfce4-panel-profiles/panelconfig.py", line 171, in get_desktop_source_file
    return self.source.extractfile(desktop)
  File "/usr/lib/python3.8/tarfile.py", line 2093, in extractfile
    tarinfo = self.getmember(member)
  File "/usr/lib/python3.8/tarfile.py", line 1780, in getmember
    raise KeyError("filename %r not found" % name)
KeyError: "filename 'launcher-39/15692594261.desktop' not found"

First problem is that the error appears only on the console, the GUI dialog boxes simply become inoperant. It took me large amount of time to understand that the error is displayed somewhere. It would be great if any error would be caught and displayed in the GUI...

Second thing is that the 'launcher-39/15692594261.desktop' file IS indeed present in the archive, so I don't understand the error. It is confirmed below:

[09/04/20-18:09:09] user@empcarlabhc144:tmp$ tar tvjf ../doublei3.tar.bz 
drwx------ user/user   0 2020-09-04 17:59 ./
drwx------ user/user   0 2020-09-04 17:57 ./launcher-65/
-rw------- user/user 410 2020-09-04 17:54 ./launcher-65/15868532572.desktop
drwx------ user/user   0 2020-09-04 17:57 ./launcher-45/
-rw------- user/user 2897 2020-09-04 17:54 ./launcher-45/15692594917.desktop
drwx------ user/user    0 2020-09-04 17:57 ./launcher-53/
-rw------- user/user  380 2020-09-04 17:54 ./launcher-53/156925957716.desktop
drwx------ user/user    0 2020-09-04 17:57 ./launcher-49/
-rw------- user/user  582 2020-09-04 17:54 ./launcher-49/156925954012.desktop
-rw------- user/user 4288 2020-09-04 17:59 ./config.txt
drwx------ user/user    0 2020-09-04 17:57 ./launcher-48/
-rw------- user/user  539 2020-09-04 17:54 ./launcher-48/156925952811.desktop
-rw------- user/user  549 2020-09-04 17:54 ./launcher-48/156925952210.desktop
drwx------ user/user    0 2020-09-04 17:57 ./launcher-52/
-rw------- user/user  548 2020-09-04 17:54 ./launcher-52/156925956915.desktop
drwx------ user/user    0 2020-09-04 17:57 ./launcher-43/
-rw------- user/user  821 2020-09-04 17:54 ./launcher-43/15692594725.desktop
drwx------ user/user    0 2020-09-04 17:57 ./launcher-47/
-rw------- user/user  407 2020-09-04 17:54 ./launcher-47/15692595129.desktop
drwx------ user/user    0 2020-09-04 17:57 ./launcher-42/
-rw------- user/user  878 2020-09-04 17:54 ./launcher-42/15692594624.desktop
drwx------ user/user    0 2020-09-04 17:57 ./launcher-39/
-rw------- user/user  314 2020-09-04 17:54 ./launcher-39/15692594261.desktop   <-------
drwx------ user/user    0 2020-09-04 17:57 ./launcher-55/
-rw------- user/user  552 2020-09-04 17:54 ./launcher-55/15694004992.desktop
drwx------ user/user    0 2020-09-04 17:57 ./launcher-46/
-rw------- user/user  281 2020-09-04 17:54 ./launcher-46/15692595008.desktop
drwx------ user/user    0 2020-09-04 17:57 ./launcher-41/
-rw------- user/user  743 2020-09-04 17:54 ./launcher-41/15692594533.desktop
drwx------ user/user    0 2020-09-04 17:57 ./launcher-54/
-rw------- user/user  497 2020-09-04 17:54 ./launcher-54/156925962117.desktop
drwx------ user/user    0 2020-09-04 17:57 ./launcher-51/
-rw------- user/user  424 2020-09-04 17:54 ./launcher-51/156925955914.desktop
drwx------ user/user    0 2020-09-04 17:57 ./launcher-44/
-rw------- user/user  736 2020-09-04 17:54 ./launcher-44/15692594826.desktop
hrw------- user/user    0 2020-09-04 17:59 config.txt link to ./config.txt

It is possible that the problem comes from the fact I have now multiple references to launcher/xxx (from multiple panels) in my config.txt file ?

Another thing: I use the app a lot today and noticed I often lost some configs... Is there any key binding (apart Del/Suppr) that are defined as a shortcut to deleting a profile that I might have mistakenly hit while the focus was on xfce4-panel-profiles when I thought it was on another app? If not there might be a bug that makes the configs disappear randomly...