summaryrefslogtreecommitdiffstats
path: root/sci-geosciences/happycamel/files/happycamel-ds-icons.patch
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
commitca9627e70852f6b2e835660df870fe3ab405882d (patch)
tree0a008b1d5b16fa0679a195ed7b5662c7891f591c /sci-geosciences/happycamel/files/happycamel-ds-icons.patch
downloaddarklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.gz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.bz2
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.xz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.zip
Initial import
Diffstat (limited to 'sci-geosciences/happycamel/files/happycamel-ds-icons.patch')
-rw-r--r--sci-geosciences/happycamel/files/happycamel-ds-icons.patch167
1 files changed, 167 insertions, 0 deletions
diff --git a/sci-geosciences/happycamel/files/happycamel-ds-icons.patch b/sci-geosciences/happycamel/files/happycamel-ds-icons.patch
new file mode 100644
index 0000000..439f049
--- /dev/null
+++ b/sci-geosciences/happycamel/files/happycamel-ds-icons.patch
@@ -0,0 +1,167 @@
+diff -dPNur HappyCamel.current/cli.py HappyCamel/cli.py
+--- HappyCamel.current/cli.py 2013-08-27 05:13:35.000000000 +0200
++++ HappyCamel/cli.py 2013-09-24 19:46:02.000000000 +0200
+@@ -257,6 +257,10 @@
+ var = "show_waypoints",
+ default = defaults["show_waypoints"],
+ help = "Show the waypoints in the KMZ file. Currently set to %default.")
++ parser.addOption("--google-maps", type = "bool", bool_action = True,
++ var = "for_google_maps",
++ default = defaults["for_google_maps"],
++ help = "Generate for google-maps. Currently set to %default.")
+
+ # The options relating to image parsing
+ parser.addHelpRule("\nUsually, metadata is read through the internal library, but written through the external Exiftool command. Using Exiftool is much slower, but using the internal library for writing carries some risk as it is not as mature.\nThe following options influence this behavior:")
+@@ -333,6 +337,7 @@
+ options["between_color"] = False
+ options["between_width"] = False
+ options["show_waypoints"] = False
++ options["for_google_maps"]= True
+
+ # Check if the user specified any photo's
+ if (len(args) < 1) and not (options["report_times"] or options["save_config"]):
+diff -dPNur HappyCamel.current/config.py HappyCamel/config.py
+--- HappyCamel.current/config.py 2013-08-27 05:13:35.000000000 +0200
++++ HappyCamel/config.py 2013-09-24 19:46:49.000000000 +0200
+@@ -77,6 +77,7 @@
+ "between_color": [str, "KMZ File", "Between color", "60ffffff"],
+ "between_width": [float, "KMZ File", "Between width", 2.0],
+ "show_waypoints": [bool, "KMZ File", "Show waypoints", False],
++ "for_google_maps": [bool, "KMZ File", "Generate for Google Maps", True],
+ "order": [str, "KMZ File", "Order", "D"],
+ "image_size": [int, "KMZ File", "Pixels", 200],
+ "icon_size": [int, "KMZ File", "Icon pixels", 0],
+diff -dPNur HappyCamel.current/kmlhandler.py HappyCamel/kmlhandler.py
+--- HappyCamel.current/kmlhandler.py 2013-08-27 05:13:35.000000000 +0200
++++ HappyCamel/kmlhandler.py 2013-09-24 19:53:49.000000000 +0200
+@@ -59,7 +59,7 @@
+ self.between_tracks_width = between_tracks_width
+
+ def writeKML(self, out_fp, write_photos = True, write_waypoints = True,
+- write_track = True, write_between_tracks = True):
++ write_track = True, write_between_tracks = True, for_google_maps = True):
+ """ Write a KML file to the specified file pointer out_fp. The arguments
+ specify which parts of the file should be included. If write_photos is
+ True, thumbnails should be included. If write_waypoints is True,
+@@ -80,7 +80,7 @@
+
+ if (write_photos):
+ self.logger.debug("Writing photo folder")
+- self.writePhotos(out_fp)
++ self.writePhotos(out_fp, for_google_maps)
+
+ if (write_waypoints):
+ self.logger.debug("Writing waypoints folder")
+@@ -92,7 +92,7 @@
+
+ out_fp.write('</Document>\n')
+
+- def writePhotos(self, out_fp):
++ def writePhotos(self, out_fp, for_google_maps):
+ """ Write the photo references with comments and stuff to the file pointer
+ out_fp . """
+
+@@ -116,10 +116,9 @@
+ out_fp.write('<Folder>\n')
+ out_fp.write(' <name>Images</name>\n')
+ # Write each thumbnail as a placemark
++
+ for photo in self.photo_list:
+ if (photo in self.thumbnail_names): # Only process if there's a thumbnail
+- location = photo.getLocation()
+-
+ if (self.use_icons):
+ out_fp.write(' <Style id="photo_%s">\n' % self.thumbnail_names[photo])
+ out_fp.write(' <IconStyle>\n')
+@@ -133,6 +132,10 @@
+ out_fp.write(' </LabelStyle>\n')
+ out_fp.write(' </Style>\n')
+
++ for photo in self.photo_list:
++ if (photo in self.thumbnail_names): # Only process if there's a thumbnail
++ location = photo.getLocation()
++
+ out_fp.write(' <Placemark>\n')
+ out_fp.write(' <name>%s</name>\n' % photo.getName())
+ out_fp.write(' <description><![CDATA[')
+@@ -157,9 +160,22 @@
+ out_fp.write(' <Snippet>%s</Snippet>\n' % photo.getName())
+
+ if (self.use_icons):
+- out_fp.write(' <styleUrl>#photo_%s</styleUrl>\n' % self.thumbnail_names[photo])
++ if (for_google_maps):
++ out_fp.write(' <StyleMap><Pair><Style>\n')
++ out_fp.write(' <IconStyle>\n')
++ out_fp.write(' <scale>1.5</scale>\n')
++ out_fp.write(' <Icon>\n')
++ out_fp.write(' <href>icons/%s</href>\n' % self.thumbnail_names[photo])
++ out_fp.write(' </Icon>\n')
++ out_fp.write(' </IconStyle>\n')
++ out_fp.write(' <LabelStyle>\n')
++ out_fp.write(' <scale>0.2</scale>\n')
++ out_fp.write(' </LabelStyle>\n')
++ out_fp.write(' </Style></Pair></StyleMap>\n')
++ else:
++ out_fp.write(' <styleUrl>#photo_%s</styleUrl>\n' % self.thumbnail_names[photo])
+ else:
+- out_fp.write(' <styleUrl>#photo_mark</styleUrl>\n')
++ out_fp.write(' <styleUrl>#photo_mark</styleUrl>\n')
+ out_fp.write(' <Point>\n')
+ if (location[2]):
+ out_fp.write(' <altitudeMode>clampToGround</altitudeMode>\n')
+@@ -202,7 +218,7 @@
+ # Write the actual waypoints
+ for waypoint in waypoints:
+ out_fp.write(' <Placemark id="%s">\n' % waypoint[3])
+- out_fp.write(' <styleUrl>waypoint_style</styleUrl>\n')
++ out_fp.write(' <styleUrl>#waypoint_style</styleUrl>\n')
+ out_fp.write(' <Point>\n')
+ out_fp.write(' <coordinates>%.5f,%.5f,%.3f</coordinates>\n' % (waypoint[1], waypoint[0], (waypoint[2] or 0)))
+ out_fp.write(' </Point>\n')
+@@ -399,7 +415,7 @@
+ self.logger.error("Couldn't make a thumbnail of image %s." % photo.getName())
+
+ def writeFile(self, write_photos = False, write_waypoints = False,
+- write_track = False, write_between_tracks = False):
++ write_track = False, write_between_tracks = False, for_google_maps = True):
+ """ Write the KMZ file. The arguments specify which parts of the file should
+ be included. If write_photos is True, thumbnails should be included.
+ If write_waypoints is True, waypoints should be included. If write_track
+@@ -440,7 +456,7 @@
+ self.between_tracks_color, self.between_tracks_width,
+ self.photos_clickable, self.photos_url, bool(self.icon_size))
+ kml_fp = StringIO.StringIO()
+- kml.writeKML(kml_fp, write_photos, write_waypoints, write_track, write_between_tracks)
++ kml.writeKML(kml_fp, write_photos, write_waypoints, write_track, write_between_tracks, for_google_maps)
+
+ # Write the KML file to the ZIP archive
+ out_file.writestr("base.kml", kml_fp.getvalue())
+diff -dPNur HappyCamel.current/main.py HappyCamel/main.py
+--- HappyCamel.current/main.py 2013-08-27 05:13:35.000000000 +0200
++++ HappyCamel/main.py 2013-09-24 19:50:50.000000000 +0200
+@@ -264,7 +264,8 @@
+ self.conf.get("url"),
+ self.conf.get("show_waypoints"),
+ self.conf.get("show_track"),
+- self.conf.get("show_between_tracks"))
++ self.conf.get("show_between_tracks"),
++ self.conf.get("for_google_maps"))
+
+ def getLocSources(self, input_list):
+ """ Build and return a GeoSources instance with all possible sources of
+@@ -533,7 +534,7 @@
+ def writeKMZFile(self, gpx_files, photo_list, file_path, order, image_size, icon_size,
+ title, track_color, track_width, between_color,
+ between_width, clickable, photos_url, show_waypoints, show_track,
+- show_between_tracks):
++ show_between_tracks, for_google_maps):
+
+ """ Write the KMZ file with the specified options. """
+
+@@ -543,5 +544,5 @@
+
+ kmz.writeFile(write_photos = True,
+ write_waypoints = show_waypoints, write_track = show_track,
+- write_between_tracks = show_between_tracks)
++ write_between_tracks = show_between_tracks, for_google_maps = for_google_maps)
+