[gnome-builder] icons: sort resources for consistency



commit 07530a3c815730cffaf386f548056040df1ab9e0
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 20 13:16:16 2017 -0700

    icons: sort resources for consistency
    
    Otherwise these might change based on the order files were
    created in the particular directory.

 data/icons/hicolor/icons.gresource.xml |    6 +++---
 data/icons/hicolor/render-symbolic.py  |   12 +++++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/data/icons/hicolor/icons.gresource.xml b/data/icons/hicolor/icons.gresource.xml
index dc573c5..ea7668e 100644
--- a/data/icons/hicolor/icons.gresource.xml
+++ b/data/icons/hicolor/icons.gresource.xml
@@ -179,11 +179,11 @@
     <file>128x128/apps/org.gnome.Builder-symbolic.symbolic.png</file>
     <file>256x256/apps/org.gnome.Builder-symbolic.symbolic.png</file>
     <file>512x512/apps/org.gnome.Builder-symbolic.symbolic.png</file>
+    <file alias="scalable/actions/pattern-browse.svg">scalable/patterns/pattern-browse.svg</file>
+    <file alias="scalable/actions/pattern-cli.svg">scalable/patterns/pattern-cli.svg</file>
+    <file alias="scalable/actions/pattern-gnome.svg">scalable/patterns/pattern-gnome.svg</file>
     <file alias="scalable/actions/pattern-grid.svg">scalable/patterns/pattern-grid.svg</file>
     <file alias="scalable/actions/pattern-legacy.svg">scalable/patterns/pattern-legacy.svg</file>
     <file alias="scalable/actions/pattern-library.svg">scalable/patterns/pattern-library.svg</file>
-    <file alias="scalable/actions/pattern-browse.svg">scalable/patterns/pattern-browse.svg</file>
-    <file alias="scalable/actions/pattern-gnome.svg">scalable/patterns/pattern-gnome.svg</file>
-    <file alias="scalable/actions/pattern-cli.svg">scalable/patterns/pattern-cli.svg</file>
   </gresource>
 </gresources>
diff --git a/data/icons/hicolor/render-symbolic.py b/data/icons/hicolor/render-symbolic.py
index 66f8036..08d4fa4 100755
--- a/data/icons/hicolor/render-symbolic.py
+++ b/data/icons/hicolor/render-symbolic.py
@@ -19,6 +19,11 @@ def gtkEncodeSymbolicSvg(outdir, path, size):
     print(cmd)
     os.system(cmd)
 
+def sort(l):
+    l = list(l)
+    l.sort()
+    return l
+
 # These just need to be aliased properly
 for name in os.listdir('scalable/patterns'):
     _aliases[os.path.join('scalable/actions', name)] = os.path.join('scalable/patterns', name)
@@ -26,7 +31,7 @@ for name in os.listdir('scalable/patterns'):
 # These need to be scaled as symbolic icons into
 # 16 and their 2x and 3x counterparts
 for dirname in ('actions',):
-    for name in os.listdir(os.path.join('scalable', dirname)):
+    for name in sort(os.listdir(os.path.join('scalable', dirname))):
         for size in (16, 32, 48):
             outdir = '%dx%d/%s' % (size, size, dirname)
             path = os.path.join('scalable', dirname, name)
@@ -36,7 +41,7 @@ for dirname in ('actions',):
 
 # We need larger versions for apps
 for dirname in ('apps',):
-    for name in os.listdir(os.path.join('scalable', dirname)):
+    for name in sort(os.listdir(os.path.join('scalable', dirname))):
         for size in (16, 32, 48, 128, 256, 512):
             outdir = '%dx%d/%s' % (size, size, dirname)
             path = os.path.join('scalable', dirname, name)
@@ -55,7 +60,8 @@ with open("icons.gresource.xml", "w") as stream:
         names.sort()
         for name in names:
             stream.write('    <file>%s/%s</file>\n' % (dirname, name))
-    for alias, name in _aliases.items():
+    for alias in sort(_aliases.keys()):
+        name = _aliases[alias]
         stream.write('    <file alias="%s">%s</file>\n' % (alias, name))
     stream.write('''  </gresource>
 </gresources>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]