On Mon, Nov 30, 2015 at 02:05:29PM +0000, Andrés Muñiz Piniella wrote:
> Sorry for giving the false impression that I knew what I was doing. Is
> this what you meant?

I meant more something like this.   But DO NOT USE IT.  If people need
such terrible hacks we are doing something wrong.  So let us instead
have a discussion what should be the default behaviour when opening RHK
files.

Yeti


import gwy, re

plugin_type = "FILE"
plugin_name = "rhk-sm4-wrapper"
plugin_desc = "RHK data (.SM4)"

def detect_by_name(filename):
    return 0

def detect_by_content(filename, head, tail, filesize):
    if filename.lower().endswith(".sm4"):
        return 110
    return 0

def load(filename, mode):
    c = gwy.gwy_file_func_run_load("rhk-sm4", filename, mode)
    for k in c.keys_by_name():
        match = re.search(r'^/(\d+)/meta$', k)
        if match:
            i = int(match.group(1))
            m = c['/%d/meta' % i]
            if m['Type'] == 'Topographic':
                c['/%d/data/visible' % i] = True
    return c


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Gwyddion-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gwyddion-users

Reply via email to