danielfett / advancedcaching Goto Github PK
View Code? Open in Web Editor NEWAdvanced Geocaching Tool for Linux
Home Page: http://www.danielfett.de/internet-und-opensource,software,agtl
Advanced Geocaching Tool for Linux
Home Page: http://www.danielfett.de/internet-und-opensource,software,agtl
Since the last gc.com "update", downloading of hints isn't working anymore...
When using command line with --in, it gives error:
File "/opt/advancedcaching/cli.py", line 484, in import_points
self.caches, self.new_caches = self.core.on_download((c1, c2))
TypeError: 'bool' object is not iterable
cli.py:484
- self.caches, self.new_caches = self.core.on_download((c1, c2))
+ self.caches, self.new_caches = self.core.on_download((c1, c2), sync=True)
It would be nice to load all log messages of caches to local database before going to road.
Currently it loads same five than browser shows on cache's first page.
I downloaded "Dijnselburg" from Geocaching.com, N 52° 06.362 E 005° 14.362, http://coord.info/GC2GN9K.
Now the word "U" means "You" in Dutch. It is read into a Calc coordinate. When I wish to edit the Calc, I cannot access the edit button. It is probably off the right side of the screen.
Quick fix: locate edit button on left side instead?
Wonderful tool! I haven't located the possibility to mark a cache as "found", but otherwise I am happy with it.
Python's built-in rot13 doesn't work like expected. Non-English alphabets should be unmodified.
E.g. when using tools->ROT13 and writing non-English alphabets (or $ or £), error message is:
/opt/advancedcaching/hildongui.py:560: PangoWarning: Invalid UTF-8 string passed to pango_layout_set_text()
And then bottom box is empty.
E.g. hints of this cache contains Scandinavian letters:
http://www.geocaching.com/seek/cache_details.aspx?guid=812952a0-200c-4963-af33-18d79afbd04e
And they are messed.
Standalone algorithm with test case: http://pastebin.com/HjQUBgnz
And merged to the agtl (seems to work):
cachedownloader.py:112
@staticmethod
def _rot13(text):
return text.encode('rot13')
def _r13(char):
source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
target = 'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm'
if char in source:
return target[source.find(char)]
else:
return char
return ''.join(_r13(char) for char in text)
see title of "Farbschlüssel"
When downloading maps and caches before going to road, GPS is uselessly (and harmfully) forced to ON.
see top icon for geocache "Geologie RLP"
E.g. /opt/advancedcaching/core.py import --around 'N 62° 53.835 E 027° 40.844' 1 do --fetch-details
Gives about ten similar errors:
(9 of 56) Downloading 'Klassillinen kätkö'
45723 ERROR root 'ascii' codec can't decode byte 0xc3 in position 62: ordinal not in range(128)
Traceback (most recent call last):
File "/opt/advancedcaching/cachedownloader.py", line 211, in update_coordinate
u = self._parse_cache_page(response, coordinate)
File "/opt/advancedcaching/cachedownloader.py", line 426, in _parse_cache_page
coordinate.desc = self.__treat_desc(desc)
File "/opt/advancedcaching/cachedownloader.py", line 469, in __treat_desc
desc = self.__treat_html(desc.rsplit('\n', 5)[0])
File "/opt/advancedcaching/cachedownloader.py", line 480, in __treat_html
html = self.__replace_images(html)
File "/opt/advancedcaching/cachedownloader.py", line 551, in __replace_images
return re.sub(ur'''(?is)(<img[^>]+src=\n?["']?)([^ >"']+)([^>]+?/?>)''', self.__replace_image_callback, data)
File "/usr/lib/python2.5/re.py", line 150, in sub
return _compile(pattern, 0).sub(repl, string, count)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 62: ordinal not in range(128)
Reverting back this commit will remove errors:
cbab261
There appears to be a new issue that I have noticed today. When you try to download details or overview, AGT reports "Error: Please go to geacaching.com and set the website language to english!". I noticed this post http://talk.maemo.org/showpost.php?p=1105137&postcount=264 stating that simply messing with your settings can fix this.
I have been unsuccessful in resolving it :( My settings were:
Language: "English"
Timezone: "E. Australia : Canberra, Sydney"
Daylight Savings: CHECKED
Units: "Metric"
Date format: "YYYY-MM-DD"
I have tried different languages, timezones, daylight savings settings, units and date formats as well as combinations without success. I simply keep getting the error.
I am running version 0.8.0.7 with Website parser version 19 (from 2011-10-07).
When Downloading Details, dialog for user starts counting from 0. E.g. "Downloading 0 of 2" -> " Downloading 1 of 2" -> Ready.
It comes handy when your friend has cache description, but he does not have support for calculations :)
All other tabs that contains your notes for cache are enabled even if you do not have description.
version 0.8.0.7-0 on Maemo
Top menu -> Tools -> Ok. Doesn't close 'tools'.
(Not critical because clicking outside pop-up will close it)
Dear webhamster,
It seems downloading a page from geocaching.com does not work at all.
In my view, geocaching.com has two possible welcome texts: 1) Welcome, Visitor and 2) Hello, login_name.
I changed the code of downloader.py to search for possible causes. Both "Welcome, Visitor" and "Hello" are not being found in the downloaded html. I wish I knew how to save the results of the downloaded file to disk, but the first line looks like:
<addinfourl at 1102820816 whose fp = <socket_fileobject object at 0x41bb8d70>>
Yesterday I could download both overview and details of caches, and today I cannot. Nothing has changed overnight at my side. Furthermore I have a second N900 which has not been used for weeks. That machine cannot download either.
Fieldnote upload is not working anymore since gc.com html change. Didn't manage to fix it by my self :-(
Grüße aus Göttingen!
rm ~/.agtl/caches.db
/opt/advancedcaching/core.py import --in 'N 62° 53.453 E 027° 40.859' 'N 62° 53.454 E 027° 40.861' do --fetch-details
Expected: There are one cache with details.
Actual: Only overview was loaded.
After startup, if the first clicked cache details doesn't have calculations, there will be warning:
/opt/advancedcaching/hildongui.py:1201: Warning: value "0" of type guint' is invalid or out of range for property
n-rows' of type `guint'
table = gtk.Table(rows, cols)
I still can not upload fieldnotes, although this is third version I tried. AGTL does not write any error and it changes state of fieldnotes, but I have no logs at geocaching. Everything else works properly.
This can be fixed in geocaching.py line 315 with:
finder = re.finditer(r'\s+<img [^>]+>\s*' +
Greetings zxa
See text for "Hort des Wissens", "Zerstreuter Professor..."
coordinate captuerd form the Notes tab incorrectly interprets all longitude entries as "East", regardless of format. Attempted to enter "W 88 46.234", "-88 46.234", etc...
version 0.8.0.7-0 on maemo
When starting on terminal and closing with using cross:
Exception in thread Thread-3 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
File "/opt/advancedcaching/threadpool.py", line 148, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'Empty'
Sometimes this comes multiple times for different Threads.
Steps:
*Download overview
*Select cache X and check there are no description
*Download details
*Look description of cache X
Expected: There are full description
Actual: There are no full description
*Select another cache
*Select cache X
*Look description of cache X
-> Now it shows full description
Bottom text box should not be editable, it can cause confusion.
(version 0.8.0.7-0)
Traceback (most recent call last):
File "/opt/advancedcaching/core.py", line 34, in
from json import loads, dumps
ImportError: No module named json
Maemo5/N900 does not have python-json, but python-simplejson.
MyPaint uses it like this:
http://gitorious.org/mypaint/mypaint/blobs/78390f7f001b89e53a7eb8b3940466755ed71545/lib/helpers.py#line29
"Download Details" clicked, but Hints show : "No hints available" for every cache, even I can check with browser, there are hints.
After cloning latest git-version, It was not possible to run core.py --simple.
If you're on maemo, please install python-location
Traceback (most recent call last):
File "/home/christian/Dokumente/eclipse/python/agtl_github/advancedcaching/files/advancedcaching/core.py", line 874, in
start()
File "/home/christian/Dokumente/eclipse/python/agtl_github/advancedcaching/files/advancedcaching/core.py", line 825, in start
Core(gui, determine_path())
File "/home/christian/Dokumente/eclipse/python/agtl_github/advancedcaching/files/advancedcaching/core.py", line 158, in init
self.gui = guitype(self, dataroot)
File "/home/christian/Dokumente/eclipse/python/agtl_github/advancedcaching/files/advancedcaching/simplegui.py", line 152, in init
self.load_ui()
File "/home/christian/Dokumente/eclipse/python/agtl_github/advancedcaching/files/advancedcaching/simplegui.py", line 198, in load_ui
self.drawing_area.connect("expose_event", self._expose_event)
AttributeError: 'SimpleGui' object has no attribute '_expose_event'
It seems there are some methods missing... I don't know how/where to correct this.
Hi, I would love ti try this software, but having an issue installing on ubuntu. easy_install says it can't find an install script for agtl.
sudo easy_install agtl
Searching for agtl
Reading http://pypi.python.org/simple/agtl/
Reading http://wiki.openmoko.org/wiki/Advanced_Geocaching_Tool_for_Linux
Best match: agtl 0.8.0.0-freerunner0.linux-x86-64
Downloading http://pypi.python.org/packages/any/a/agtl/agtl-0.8.0.0-freerunner0.linux-x86_64.tar.gz#md5=640fceb299318786fd733cf5201c377a
Processing agtl-0.8.0.0-freerunner0.linux-x86_64.tar.gz
error: Couldn't find a setup script in /tmp/easy_install-CKKBHC/agtl-0.8.0.0-freerunner0.linux-x86_64.tar.gz
--- cli.py 2011-08-01 12:36:07.000000000 +0300
+++cli.py 2011-08-01 18:18:29.000000000 +0300
@@ -244,7 +244,7 @@
self.import_points(coord1, coord2)
elif token == '--around':
coord1 = self.parse_coord()
radius = self.parse_int()
radius = self.parse_float()
self.import_points(coord1, radius)
elif token == '--at-route':
coord1 = self.parse_coord()
@@ -414,6 +414,13 @@
if not self.has_next():
raise ParseError("Expected a float, found nothing.", self.nt-1)
text = sys.argv[self.nt]
self.nt += 1
return float(text)
@@ -480,14 +487,22 @@
print "\* Downloading Caches in %d km distance to %s" % (c2, c1)
print "\* Downloading Caches in %.3f km distance to %s" % (c2, c1)
Concerning N900 version
When tapping the close cross in the upper right corner, core.py (see ps ax) is still running and therefore holds the GPS chip up and running, consuming much battery...
Workaround so far 'kill -9 ' on terminal
After the July GC Update, fieldnotes aren't working again. (on Moko 0.6.1.1 maintenance)
gpsd 2.95, the default in Ubuntu 11.04, have switched to a json-based protocol. The old implementation in agtl have stopped working. I have a patch that I will attach shortly.
Parser crashes if an owner has an Umlaut in his name.
File "/usr/lib/site-python/advancedcaching/cachedownloader.py", line 361, in __parse_head
print size, diff, terr, owner, lat, lon
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 1: ordinal not in range(128)
Version 0.8.0.7-0 on Maemo
Steps:
*Use 'Download Overview'
*Move (and/or zoom) view so there are NO caches in view
*Press 'Download Overview'
-> Yellow notification warning: "Please select a smaller part of the map."
It seems error handling is meant for too depth recursion, but it triggers because of empty set.
1832418 ERROR root Please select a smaller part of the map.
Traceback (most recent call last):
File "/opt/advancedcaching/cachedownloader.py", line 224, in get_geocaches
points = self._parse_overview(content, location, rec_depth)
File "/opt/advancedcaching/cachedownloader.py", line 317, in _parse_overview
points += self.get_geocaches((nc1, mc1), rec_depth + 1)
File "/opt/advancedcaching/cachedownloader.py", line 231, in get_geocaches
raise e
Exception: Please select a smaller part of the map.
Coordinate expressions seem to be only parsed when found in the description. I think it would also be useful to parse them from the notes. This way, one can repair "broken" expressions from the description. In my case, the description contained [ A ][ 4 * B ] instead of (A)(4*B).
When trying to start the simple GUI, I get the following stack trace:
./agtl --simple
If you're on maemo, please install python-location
Traceback (most recent call last):
File "./agtl", line 4, in <module>
advancedcaching.core.start ()
File "/tmp/advancedcaching/files/advancedcaching/core.py", line 843, in start
Core(gui, determine_path())
File "/tmp/advancedcaching/files/advancedcaching/core.py", line 162, in __init__
self.gui = guitype(self, self.dataroot)
File "/tmp/advancedcaching/files/advancedcaching/simplegui.py", line 152, in __init__
self.load_ui()
File "/tmp/advancedcaching/files/advancedcaching/simplegui.py", line 198, in load_ui
self.drawing_area.connect("expose_event", self._expose_event)
AttributeError: SimpleGui instance has no attribute '_expose_event'
I have traced the problem back to change 2d85f2e when the Map class was taken out of simplegui.py.
Right now I can't understand how versions after that change can work for anybody, but maybe I'm just too tired. Am I doing something wrong there?
I'm very delighted to have found this nice tool and it would be great if I could get it to run again on my freerunner. :)
When i try to download cachedescriptions via "fetch details for visible", i always get the message that i try to load more than 20 caches, even when there's only one on the map.
...when details are already available
On 0.7.1.0-freerunner0, the map is not working if the freerunner has a GPS-Fix. It shows different unexpected behaviours like blanks, it isn't slideable and my position is not shown. After losing the GPS-Fix the map seems to work normal, plus my last position is shown.
Hi,
I'm unable to scroll horizontally (vertically is ok) :
After downloading and Installing advancedcaching from opkg.org I get an Error while trying to start it. After installing python-json from the shr repository everything works fine.
Regards Julian
root@om-gta02 ~ $ opkg install http://www.opkg.org/packages/advancedcaching_0.3.0_all.ipk
Downloading http://www.opkg.org/packages/advancedcaching_0.3.0_all.ipk
Installing advancedcaching (0.3.0) to root...
Installing python-html (2.6.2-ml7.1) to root...
Downloading http://build.shr-project.org/shr-unstable/ipk//armv4t/python-html_2.6.2-ml7.1_armv4t.ipk
Installing python-image (2.6.2-ml7.1) to root...
Downloading http://build.shr-project.org/shr-unstable/ipk//armv4t/python-image_2.6.2-ml7.1_armv4t.ipk
Configuring python-image
Configuring python-html
Configuring advancedcaching
root@om-gta02 ~ $ agtl --simple
Traceback (most recent call last):
File "/usr/bin/agtl", line 2, in
import advancedcaching.core
File "/usr/lib/site-python/advancedcaching/core.py", line 25, in
import json
ImportError: No module named json
root@om-gta02 ~ $ agtl
Traceback (most recent call last):
File "/usr/bin/agtl", line 2, in
import advancedcaching.core
File "/usr/lib/site-python/advancedcaching/core.py", line 25, in
import json
ImportError: No module named json
root@om-gta02 ~ $ opkg install python-json
Installing python-json (2.6.2-ml7.1) to root...
Downloading http://build.shr-project.org/shr-unstable/ipk//armv4t/python-json_2.6.2-ml7.1_armv4t.ipk
Configuring python-json
Now everything works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.