Code Monkey home page Code Monkey logo

advancedcaching's People

Contributors

aapo avatar danielfett avatar juho-p avatar m4rtink avatar ziima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

advancedcaching's Issues

Patch: cli parameter --in didn't worked

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)

"edit" button coordinates out of sight

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.

Patch: python's rot13 differs from geocaching.com's rot13

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)
    

Encoding errors with letters with code greater than 128 (e.g. diaeresis)

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

set website language to english error when downloading

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).

Feature request: Enable calcs for overviewed caches

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.

Cannot download Cache Overviews and Details

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 not working

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!

commandline: --fetch-details doesn't work

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.

Hildon: Warning if there are no any calculation in cache details

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 propertyn-rows' of type `guint'
table = gtk.Table(rows, cols)

Picture download fix

In line 303 this works for me, but i'm not the regex king ;-)

finder = re.finditer('<a href="([^"]+)" rel="lightbox" class="lnk">(.+?)

', data)

0.8.0.7 at N900 does not upload fieldnotes

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.

Captured coordinate error

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...

Errors/Warnings when shutting down

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.

Selected cache doesn't shown details when 'downloaded details' is used

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

Create new package for opkg.org

After cloning latest git-version, It was not possible to run core.py --simple.

Output as follows:

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.

easy install on ubuntu

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

Patch: Feature: import --around radius can be float

--- 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 @@

  • def parse_float(self):
  •    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)
    

Support gpsd 2.95

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 crash 0.6.2

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)

'Download Overview' gives wrong error message if there aren't any cache

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.

Feature Request: Parse coordinate expressions also from notes

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).

cannot start GUI since change 2d85f2e4188cc222a2a2a7e858cd5419bac208e4

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. :)

Cachedownloader limit

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.

Map not working if having GPS-Fix

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.

Unable to scroll horizontally (images, coord)

Hi,
I'm unable to scroll horizontally (vertically is ok) :

  • images tab : if the picture's too big, unable to see the right side
  • coord tab : if the description's too long, unable to see the end of it (right side)
    using Version 0.6.1.2
    Thanks for this great app :-)

shr-u dependancy missing python-json

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.