Example #1
0
def main(argv = None):

    if argv is None:
        argv = sys.argv
    try:
        try:
            opts, args = getopt.getopt(argv[1:], "hw:",
                                       ["help", "workspace"])
        except getopt.error as msg:
            raise Usage(msg)
    except Usage as err:
        print >> sys.stderr, err.msg
        print >> sys.stderr, "for help use --help"
        printHelp()
    
    workspaceFile = process_opt(opts, args)
    app = GMApp(workspaceFile)
    
    # suppress wxPython logs
    q = wx.LogNull()
    set_raise_on_error(True)

    # register GUI PID
    registerPid(os.getpid())
    
    app.MainLoop()
Example #2
0
    def OnInit(self):
        grass.set_raise_on_error(True)
        # actual use of StandaloneGrassInterface not yet tested
        # needed for adding functionality in future
        self._giface = DMonGrassInterface(None)

        return True
Example #3
0
def main(argv=None):

    if argv is None:
        argv = sys.argv
    try:
        try:
            opts, args = getopt.getopt(argv[1:], "hw:",
                                       ["help", "workspace"])
        except getopt.error as msg:
            raise Usage(msg)
    except Usage as err:
        print >> sys.stderr, err.msg
        print >> sys.stderr, "for help use --help"
        printHelp()

    workspaceFile = process_opt(opts, args)
    app = GMApp(workspaceFile)

    # suppress wxPython logs
    q = wx.LogNull()
    set_raise_on_error(True)

    # register GUI PID
    registerPid(os.getpid())

    app.MainLoop()
Example #4
0
    def OnInit(self):
        if not globalvar.CheckWxVersion([2, 9]):
            wx.InitAllImageHandlers()

        grass.set_raise_on_error(True)
        # actual use of StandaloneGrassInterface not yet tested
        # needed for adding functionality in future
        giface = DMonGrassInterface(None)

        if __name__ == "__main__":
            self.cmdTimeStamp = os.path.getmtime(monFile['cmd'])
            self.Map = DMonMap(giface=giface, cmdfile=monFile['cmd'],
                               mapfile = monFile['map'])
        else:
            self.Map = None

        self.mapFrm = DMonFrame(parent = None, id = wx.ID_ANY, Map = self.Map,
                                giface = giface, size = monSize)
        # FIXME: hack to solve dependency
        giface._mapframe = self.mapFrm
        # self.SetTopWindow(Map)
        self.mapFrm.GetMapWindow().SetAlwaysRenderEnabled(True)
        self.Map.saveToFile.connect(lambda cmd: self.mapFrm.DOutFile(cmd))
        self.Map.dToRast.connect(lambda cmd: self.mapFrm.DToRast(cmd))
        self.Map.query.connect(lambda ltype, maps: self.mapFrm.SetQueryLayersAndActivate(ltype=ltype, maps=maps))
        self.mapFrm.Show()
        
        if __name__ == "__main__":
            self.timer = wx.PyTimer(self.watcher)
            #check each 0.5s
            global mtime
            mtime = 500
            self.timer.Start(mtime)
            
        return True
Example #5
0
    def OnInit(self):
        if not globalvar.CheckWxVersion([2, 9]):
            wx.InitAllImageHandlers()

        grass.set_raise_on_error(True)
        # actual use of StandaloneGrassInterface not yet tested
        # needed for adding functionality in future
        self._giface = DMonGrassInterface(None)

        return True
Example #6
0
    def OnInit(self):
        if not globalvar.CheckWxVersion([2, 9]):
            wx.InitAllImageHandlers()

        grass.set_raise_on_error(True)
        # actual use of StandaloneGrassInterface not yet tested
        # needed for adding functionality in future
        self._giface = DMonGrassInterface(None)

        return True
from __future__ import print_function

import copy
from datetime import datetime
import grass.script.core as core
from .temporal_granularity import *
from .datetime_math import *
from .space_time_datasets import *

import grass.lib.vector as vector
import grass.lib.rtree as rtree
import grass.lib.gis as gis
from ctypes import *

# Uncomment this to detect the error
core.set_raise_on_error(True)

###############################################################################


def test_increment_datetime_by_string():

    # First test
    print("# Test 1")
    dt = datetime(2001, 9, 1, 0, 0, 0)
    string = "60 seconds, 4 minutes, 12 hours, 10 days, 1 weeks, 5 months, 1 years"

    dt1 = datetime(2003, 2, 18, 12, 5, 0)
    dt2 = increment_datetime_by_string(dt, string)

    print(dt)
Example #8
0
:authors: Soeren Gebbert
"""
import copy
from datetime import datetime
import grass.script.core as core
from temporal_granularity import *
from datetime_math import *
from space_time_datasets import *

import grass.lib.vector as vector
import grass.lib.rtree as rtree
import grass.lib.gis as gis
from ctypes import *

# Uncomment this to detect the error
core.set_raise_on_error(True)

###############################################################################


def test_increment_datetime_by_string():

    # First test
    print "# Test 1"
    dt = datetime(2001, 9, 1, 0, 0, 0)
    string = "60 seconds, 4 minutes, 12 hours, 10 days, 1 weeks, 5 months, 1 years"

    dt1 = datetime(2003, 2, 18, 12, 5, 0)
    dt2 = increment_datetime_by_string(dt, string)

    print dt