~cmiller/ubuntu/quantal/deluge/fix-parameter-move-storage

« back to all changes in this revision

Viewing changes to deluge/ui/webui/scripts/copy_icons.py

  • Committer: Bazaar Package Importer
  • Author(s): Cristian Greco
  • Date: 2009-11-13 02:39:45 UTC
  • mfrom: (4.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091113023945-te1bybo2912ejzuc
Tags: 1.2.0~rc3-4
* debian/control: bump build-dep on python-setuptools to (>= 0.6c9).
* debian/patches:
  - 25_r5921_fastresume_files.patch
    new, should fix problems with fresh configs;
  - 30_r5931_ipc_lockfile.patch:
    new, should fix an issue where Deluge will fail to start if there is a
    stale ipc lockfile. (Closes: #555849)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
# -*- coding: utf-8 -*-
3
 
#
4
 
# Copyright (C) Martijn Voncken 2008 <mvoncken@gmail.com>
5
 
#
6
 
# This program is free software; you can redistribute it and/or modify
7
 
# it under the terms of the GNU General Public License as published by
8
 
# the Free Software Foundation; either version 3, or (at your option)
9
 
# any later version.
10
 
#
11
 
# This program is distributed in the hope that it will be useful,
12
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
# GNU General Public License for more details.
15
 
#
16
 
# You should have received a copy of the GNU General Public License
17
 
# along with this program.  If not, write to:
18
 
#     The Free Software Foundation, Inc.,
19
 
#     51 Franklin Street, Fifth Floor
20
 
#     Boston, MA  02110-1301, USA.
21
 
#
22
 
#    In addition, as a special exception, the copyright holders give
23
 
#    permission to link the code of portions of this program with the OpenSSL
24
 
#    library.
25
 
#    You must obey the GNU General Public License in all respects for all of
26
 
#    the code used other than OpenSSL. If you modify file(s) with this
27
 
#    exception, you may extend this exception to your version of the file(s),
28
 
#    but you are not obligated to do so. If you do not wish to do so, delete
29
 
#    this exception statement from your version. If you delete this exception
30
 
#    statement from all source files in the program, then also delete it here.
31
 
#
32
 
 
33
 
#
34
 
 
35
 
"""
36
 
copy  icons from kde icon set.
37
 
Edit ICON_SET and TARGET_DIR before running this file.
38
 
#perl -pi -w -e 's/tango/16/g;' *.html
39
 
"""
40
 
import os
41
 
from os import path
42
 
from shutil import copyfile
43
 
 
44
 
ICON_SET  = "/home/martijn/prj/oxygen/oxygen"
45
 
TARGET_DIR = "/home/martijn/src/deluge/deluge/ui/webui"
46
 
 
47
 
def copy_icons(source_dir , target_dir , mapping):
48
 
    for target, source in mapping.iteritems():
49
 
        source = path.join(source_dir, source) +  ".png"
50
 
        target = path.join(target_dir, target) +  ".png"
51
 
        print "%s -> %s" % (source, target)
52
 
        copyfile(source, target)
53
 
 
54
 
map_static16 = {
55
 
    "down":"actions/1downarrow",
56
 
    "up":"actions/1downarrow",
57
 
    "connections":"apps/preferences_system_network_sharing",
58
 
    "details":"actions/object_edit",
59
 
    "edit-clear":"actions/clear_left",
60
 
    "edit-redo":"actions/edit_redo",
61
 
    "go-bottom":"actions/2downarrow",
62
 
    "go-top":"actions/2uparrow",
63
 
    "label":"actions/rss_tag",
64
 
    "list-add":"actions/add",
65
 
    "list-remove":"actions/fileclose",
66
 
    "move":"actions/filesaveas",
67
 
    "pause":"actions/media_playback_pause",
68
 
    "preferences-system":"apps/preferences_system",
69
 
    "process-stop":"actions/process_stop",
70
 
    "queue-down":"actions/1downarrow",
71
 
    "queue-up":"actions/1uparrow",
72
 
    "start":"actions/media_playback_start",
73
 
    "stop":"actions/media_playback_stop",
74
 
    "system-log-out":"actions/system_log_out",
75
 
    "user-trash":"actions/edittrash",
76
 
    "view-refresh":"actions/view_refresh",
77
 
    "gtk-yes":"actions/flag_green",
78
 
    "drive-harddisk":"devices/drive_harddisk",
79
 
    "select-all":"actions/edit_select_all"
80
 
}
81
 
 
82
 
map_ajax16 = {
83
 
    "gtk-edit":"actions/object_edit",
84
 
    "gtk-yes":"actions/flag_green",
85
 
    "network-idle":"apps/preferences_system_network_sharing",
86
 
    "view-refresh":"actions/view_refresh",
87
 
    "view-sort-ascending":"actions/view_sort_ascending",
88
 
    "view-sort-descending":"actions/view_sort_descending"
89
 
}
90
 
 
91
 
map_ajax32 = {
92
 
    "add":"actions/add",
93
 
    "connections":"apps/preferences_system_network_sharing",
94
 
    "down":"actions/1downarrow",
95
 
    "up":"actions/1uparrow",
96
 
    "new":"actions/document_new",
97
 
    "options":"apps/preferences_system",
98
 
    "pause":"actions/media_playback_pause",
99
 
    "remove":"actions/fileclose",
100
 
    "resume":"actions/media_playback_start"
101
 
}
102
 
 
103
 
 
104
 
copy_icons( path.join(ICON_SET, "16x16"), path.join(TARGET_DIR, "static/images/16"), map_static16)
105
 
copy_icons( path.join(ICON_SET, "16x16"), path.join(TARGET_DIR, "templates/ajax/static/icons/16"), map_ajax16)
106
 
copy_icons( path.join(ICON_SET, "32x32"), path.join(TARGET_DIR, "templates/ajax/static/icons/32"), map_ajax32)
107
 
 
108