Skip to content
Commits on Source (6)
grass (7.8.2~rc2-1~exp1) experimental; urgency=medium
* New upstream release candidate.
* Update copyright file.
* Refresh patches.
-- Bas Couwenberg <sebastic@debian.org> Sat, 07 Dec 2019 13:39:48 +0100
grass (7.8.2~rc1-1~exp1) experimental; urgency=medium
* New upstream release candidate.
......
......@@ -69,11 +69,6 @@ Files: gui/icons/grass.appdata.xml
Copyright: 2014, Richard Hughes <richard@hughsie.com>
License: CC0-1.0
Files: gui/wxpython/gui_core/wxlibplot.py
Copyright: 2002, Gordon Williams
License: wxlibplot
Use as you wish.
Files: imagery/i.landsat.toar/earth_sun.c
imagery/i.landsat.toar/earth_sun.h
Copyright: 2006, E. Jorge Tizado
......@@ -82,6 +77,8 @@ License: LGPL-2+
Files: imagery/i.segment/pavl.c
imagery/i.segment/pavl.h
vector/v.in.ogr/pavl.c
vector/v.in.ogr/pavl.h
Copyright: 1998-2002, 2004, Free Software Foundation, Inc.
License: LGPL-3+
......
......@@ -4,7 +4,7 @@ Forwarded: not-needed
--- a/man/build_html.py
+++ b/man/build_html.py
@@ -330,7 +330,7 @@ headerpso_tmpl = \
@@ -334,7 +334,7 @@ headerpso_tmpl = \
r"""
<link rel="stylesheet" href="grassdocs.css" type="text/css">
<link rel="stylesheet" href="parser_standard_options.css" type="text/css">
......
......@@ -17,7 +17,7 @@ This program is free software under the GNU General Public License
import wx
from core.debug import Debug
from gui_core.wrap import PseudoDC, EmptyBitmap, Rect
from gui_core.wrap import PseudoDC, EmptyBitmap, Rect, BitmapFromImage
from .utils import ComputeScaledRect
......@@ -145,7 +145,7 @@ class AnimationWindow(BufferedWindow):
im.Rescale(params['width'], params['height'])
self.x = params['x']
self.y = params['y']
bitmap = wx.BitmapFromImage(im)
bitmap = BitmapFromImage(im)
if self._overlay:
im = wx.ImageFromBitmap(self.bitmap_overlay)
im.Rescale(
......@@ -154,7 +154,7 @@ class AnimationWindow(BufferedWindow):
im.GetHeight() *
params['scale'])
self._setOverlay(
wx.BitmapFromImage(im),
BitmapFromImage(im),
xperc=self.perc[0],
yperc=self.perc[1])
else:
......
......@@ -162,9 +162,6 @@ class Popen(subprocess.Popen):
def __init__(self, args, **kwargs):
if is_mswindows:
# encoding not needed for Python3
# args = list(map(EncodeString, args))
# The Windows shell (cmd.exe) requires some special characters to
# be escaped by preceding them with 3 carets (^^^). cmd.exe /?
# mentions <space> and &()[]{}^=;!'+,`~. A quick test revealed that
......
......@@ -40,7 +40,7 @@ from grass.exceptions import CalledModuleError
from core import utils
from core.ws import RenderWMSMgr
from core.gcmd import GException, GError, RunCommand, EncodeString
from core.gcmd import GException, GError, RunCommand
from core.debug import Debug
from core.settings import UserSettings
from core.gthread import gThread
......@@ -1297,8 +1297,7 @@ class Map(object):
renderMgr = layer.GetRenderMgr()
Debug.msg(
1, "Map.AddLayer(): ltype={0}, command={1}".format(
ltype, EncodeString(layer.GetCmd(
string=True))))
ltype, layer.GetCmd(string=True)))
if renderMgr:
if layer.type == 'wms':
renderMgr.dataFetched.connect(self.renderMgr.ReportProgress)
......@@ -1360,7 +1359,7 @@ class Map(object):
def SetLayers(self, layers):
self.layers = layers
Debug.msg(5, "Map.SetLayers(): layers={0}".format([EncodeString(layer.GetCmd(string=True)) for layer in layers]))
Debug.msg(5, "Map.SetLayers(): layers={0}".format([layer.GetCmd(string=True) for layer in layers]))
def ChangeLayer(self, layer, render=False, **kargs):
"""Change map layer properties
......@@ -1510,9 +1509,7 @@ class Map(object):
renderMgr = overlay.GetRenderMgr()
Debug.msg(
1, "Map.AddOverlay(): cmd={0}".format(EncodeString(
overlay.GetCmd(
string=True))))
1, "Map.AddOverlay(): cmd={0}".format(overlay.GetCmd(string=True)))
if renderMgr:
renderMgr.updateProgress.connect(self.renderMgr.ReportProgress)
renderMgr.renderingFailed.connect(self.renderMgr.RenderingFailed)
......
......@@ -106,23 +106,6 @@ def _debug(level, message):
gcore.debug(message, level)
def _encode_string(string):
"""Encode a unicode *string* using the system encoding
If it is not possible to use system encoding, UTF-8 is used.
"""
try:
from core.gcmd import EncodeString
return EncodeString(string)
except ImportError:
# This is the case when we have errors during compilation but
# the environment is not complete (compilation, custom setups
# of GRASS environmet) and we cannot import wx correctly.
# UTF-8 is pretty good guess for most cases (and should work for
# Mac OS X where wx 32 vs 64 bit issue is happaning).
return string.encode('utf-8')
def toolboxesOutdated():
"""Removes auto-generated menudata.xml
to let gui regenerate it next time it starts."""
......
......@@ -54,12 +54,12 @@ from core import utils
from core.render import Map
from gui_core.gselect import Select, LocationSelect, MapsetSelect
from gui_core.dialogs import GroupDialog
from core.gcmd import RunCommand, GMessage, GError, GWarning, EncodeString
from core.gcmd import RunCommand, GMessage, GError, GWarning
from core.settings import UserSettings
from gcp.mapdisplay import MapFrame
from core.giface import Notification
from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \
CheckListBox, TextCtrl, Menu, ListCtrl
CheckListBox, TextCtrl, Menu, ListCtrl, BitmapFromImage
from location_wizard.wizard import TitledPage as TitledPage
......@@ -296,7 +296,7 @@ class GCPWizard(object):
self.gisrc_dict['LOCATION_NAME'] = location
self.gisrc_dict['MAPSET'] = mapset
self.source_gisrc = EncodeString(utils.GetTempfile())
self.source_gisrc = utils.GetTempfile()
try:
f = open(self.source_gisrc, mode='w')
......@@ -1065,8 +1065,8 @@ class GCP(MapFrame, ColumnSorterMixin):
# CheckListCtrlMixin must set an ImageList first
self.il = self.list.GetImageList(wx.IMAGE_LIST_SMALL)
SmallUpArrow = wx.BitmapFromImage(getSmallUpArrowImage())
SmallDnArrow = wx.BitmapFromImage(getSmallDnArrowImage())
SmallUpArrow = BitmapFromImage(getSmallUpArrowImage())
SmallDnArrow = BitmapFromImage(getSmallDnArrowImage())
self.sm_dn = self.il.Add(SmallDnArrow)
self.sm_up = self.il.Add(SmallUpArrow)
......
......@@ -46,7 +46,7 @@ from location_wizard.dialogs import RegionDef
from gui_core.dialogs import TextEntryDialog
from gui_core.widgets import GenericValidator, StaticWrapText
from gui_core.wrap import Button, ListCtrl, StaticText, StaticBox, \
TextCtrl
TextCtrl, BitmapFromImage
class GRASSStartup(wx.Frame):
......@@ -101,7 +101,7 @@ class GRASSStartup(wx.Frame):
type=wx.BITMAP_TYPE_PNG))
except:
self.hbitmap = wx.StaticBitmap(
self.panel, wx.ID_ANY, wx.BitmapFromImage(
self.panel, wx.ID_ANY, BitmapFromImage(
wx.EmptyImage(530, 150)))
# labels
......
......@@ -33,7 +33,7 @@ import wx.lib.mixins.listctrl as listmix
from core import globalvar
from core import utils
from gui_core.widgets import SearchModuleWidget, SimpleValidator
from core.gcmd import GError, EncodeString
from core.gcmd import GError
from gui_core.dialogs import SimpleDialog, MapLayersDialogForModeler
from gui_core.prompt import GPromptSTC
from gui_core.gselect import Select, ElementSelect
......@@ -274,10 +274,7 @@ class ModelSearchDialog(wx.Dialog):
if len(line) == 0:
cmd = list()
else:
try:
cmd = utils.split(str(line))
except UnicodeError:
cmd = utils.split(EncodeString((line)))
cmd = utils.split(str(line))
return cmd
def GetCmd(self):
......
......@@ -46,7 +46,7 @@ from wx.lib import ogl
from core import globalvar
from core import utils
from core.gcmd import GMessage, GException, GError, RunCommand, EncodeString, GWarning, GetDefaultEncoding
from core.gcmd import GMessage, GException, GError, RunCommand, GWarning, GetDefaultEncoding
from core.settings import UserSettings
from gui_core.forms import GUI, CmdPanel
from gui_core.widgets import GNotebook
......@@ -2249,22 +2249,19 @@ class WriteModelFile:
'%s<name>%s</name>\n' %
(' ' *
self.indent,
EncodeString(
self.properties['name'])))
self.properties['name']))
if self.properties['description']:
self.fd.write(
'%s<description>%s</description>\n' %
(' ' *
self.indent,
EncodeString(
self.properties['description'])))
self.properties['description']))
if self.properties['author']:
self.fd.write(
'%s<author>%s</author>\n' %
(' ' *
self.indent,
EncodeString(
self.properties['author'])))
self.properties['author']))
if 'overwrite' in self.properties and \
self.properties['overwrite']:
......@@ -2283,15 +2280,15 @@ class WriteModelFile:
for name, values in six.iteritems(self.variables):
self.fd.write(
'%s<variable name="%s" type="%s">\n' %
(' ' * self.indent, EncodeString(name), values['type']))
(' ' * self.indent, name, values['type']))
self.indent += 4
if 'value' in values:
self.fd.write('%s<value>%s</value>\n' %
(' ' * self.indent, EncodeString(values['value'])))
(' ' * self.indent, values['value']))
if 'description' in values:
self.fd.write(
'%s<description>%s</description>\n' %
(' ' * self.indent, EncodeString(values['description'])))
(' ' * self.indent, values['description']))
self.indent -= 4
self.fd.write('%s</variable>\n' % (' ' * self.indent))
self.indent -= 4
......@@ -2313,21 +2310,19 @@ class WriteModelFile:
"""Write actions"""
self.fd.write(
'%s<action id="%d" name="%s" pos="%d,%d" size="%d,%d">\n' %
(' ' *
self.indent,
(' ' * self.indent,
action.GetId(),
EncodeString(
action.GetLabel()),
action.GetX(),
action.GetY(),
action.GetWidth(),
action.GetHeight()))
action.GetLabel(),
action.GetX(),
action.GetY(),
action.GetWidth(),
action.GetHeight()))
self.indent += 4
comment = action.GetComment()
if comment:
self.fd.write(
'%s<comment>%s</comment>\n' %
(' ' * self.indent, EncodeString(comment)))
(' ' * self.indent, comment))
self.fd.write('%s<task name="%s">\n' %
(' ' * self.indent, action.GetLog(string=False)[0]))
self.indent += 4
......@@ -2503,8 +2498,7 @@ class WriteModelFile:
comment.GetY(),
comment.GetWidth(),
comment.GetHeight(),
EncodeString(
comment.GetLabel())))
comment.GetLabel()))
class WritePythonFile:
......@@ -2556,10 +2550,9 @@ class WritePythonFile:
#
#{header_end}
""".format(header_begin='#' * 77,
module_name=EncodeString(properties['name']),
author=EncodeString(properties['author']),
purpose=EncodeString(
'\n# '.join(properties['description'].splitlines())),
module_name=properties['name'],
author=properties['author'],
purpose='\n# '.join(properties['description'].splitlines()),
date=time.asctime(),
header_end='#' * 77))
......@@ -2569,8 +2562,7 @@ class WritePythonFile:
#%module
#% description: {description}
#%end
""".format(description=EncodeString(
' '.join(properties['description'].splitlines()))))
""".format(description=' '.join(properties['description'].splitlines())))
modelItems = self.model.GetItems()
for item in modelItems:
......
......@@ -432,7 +432,7 @@ class GConsoleWindow(wx.SplitterWindow):
try:
output = open(path, "w")
output.write(EncodeString(text))
output.write(text)
except IOError as e:
GError(
_("Unable to write file '%(path)s'.\n\nDetails: %(error)s") % {
......
......@@ -29,7 +29,7 @@ if __name__ == '__main__':
from grass.script.setup import set_gui_path
set_gui_path()
from core.gcmd import EncodeString, GError
from core.gcmd import GError
from gui_core.pystc import PyStc
from core import globalvar
from core.menutree import MenuTreeModelBuilder
......@@ -89,9 +89,9 @@ def module_template():
#
#%s
""" % ('#' * 72,
EncodeString(properties['name']),
EncodeString(properties['author']),
EncodeString('\n# '.join(properties['description'].splitlines())),
properties['name'],
properties['author'],
'\n# '.join(properties['description'].splitlines()),
time.asctime(),
'#' * 72))
......@@ -101,7 +101,7 @@ def module_template():
#%%module
#%% description: %s
#%%end
""" % (EncodeString(' '.join(properties['description'].splitlines()))))
""" % (' '.join(properties['description'].splitlines())))
# import modules
output.write(
......
This diff is collapsed.
......@@ -17,7 +17,7 @@ for details.
import wx
import gui_core.wxlibplot as plot
import wx.lib.plot as plot
import wx.lib.scrolledpanel as scrolled
from core.gcmd import GError
......@@ -146,7 +146,7 @@ class PlotPanel(scrolled.ScrolledPanel):
def EnableZoom(self, type, enable=True):
for canvas in self.canvasList:
canvas.SetEnableZoom(enable)
canvas.enableZoom = enable
#canvas.zoom = type
......@@ -177,8 +177,8 @@ class PlotPanel(scrolled.ScrolledPanel):
for band in self.bandList:
canvas = plot.PlotCanvas(self.canvasPanel)
canvas.SetMinSize((-1, 140))
canvas.SetFontSizeTitle(10)
canvas.SetFontSizeAxis(8)
canvas.fontSizeTitle = 10
canvas.fontSizeAxis = 8
self.canvasList.append(canvas)
self.canvasSizer.Add(
......@@ -218,7 +218,7 @@ class PlotPanel(scrolled.ScrolledPanel):
def DrawCoincidencePlots(self):
"""Draw coincidence plots"""
for bandIdx in range(len(self.bandList)):
self.canvasList[bandIdx].SetYSpec(type='none')
self.canvasList[bandIdx].ySpec = 'none'
lines = []
level = 0.5
lines.append(self.DrawInvisibleLine(level))
......@@ -267,7 +267,7 @@ class PlotPanel(scrolled.ScrolledPanel):
self.histogramLines = []
for bandIdx in range(len(self.bandList)):
self.canvasList[bandIdx].Clear()
self.canvasList[bandIdx].SetYSpec(type='auto')
self.canvasList[bandIdx].ySpec = 'auto'
histgramLine = self.CreateHistogramLine(
bandValues=statistics.bands[bandIdx])
......
......@@ -40,7 +40,7 @@ from location_wizard.dialogs import RegionDef
from gui_core.dialogs import TextEntryDialog
from gui_core.widgets import GenericValidator, StaticWrapText
from gui_core.wrap import Button, ListCtrl, StaticText, \
StaticBox, TextCtrl
StaticBox, TextCtrl, BitmapFromImage
class GRASSStartup(wx.Frame):
......@@ -95,7 +95,7 @@ class GRASSStartup(wx.Frame):
type=wx.BITMAP_TYPE_PNG))
except:
self.hbitmap = wx.StaticBitmap(
self.panel, wx.ID_ANY, wx.BitmapFromImage(
self.panel, wx.ID_ANY, BitmapFromImage(
wx.EmptyImage(530, 150)))
# labels
......
......@@ -57,12 +57,12 @@ from core import utils
from core.render import Map
from gui_core.gselect import Select, LocationSelect, MapsetSelect
from gui_core.dialogs import GroupDialog
from core.gcmd import RunCommand, GMessage, GError, GWarning, EncodeString
from core.gcmd import RunCommand, GMessage, GError, GWarning
from core.settings import UserSettings
from gcp.mapdisplay import MapFrame
from core.giface import Notification
from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \
CheckListBox, TextCtrl, Menu, ListCtrl
CheckListBox, TextCtrl, Menu, ListCtrl, BitmapFromImage
from location_wizard.wizard import TitledPage as TitledPage
......@@ -323,7 +323,7 @@ class GCPWizard(object):
self.gisrc_dict['LOCATION_NAME'] = location
self.gisrc_dict['MAPSET'] = mapset
self.source_gisrc = EncodeString(utils.GetTempfile())
self.source_gisrc = utils.GetTempfile()
try:
f = open(self.source_gisrc, mode='w')
......@@ -1094,8 +1094,8 @@ class GCP(MapFrame, ColumnSorterMixin):
# CheckListCtrlMixin must set an ImageList first
self.il = self.list.GetImageList(wx.IMAGE_LIST_SMALL)
SmallUpArrow = wx.BitmapFromImage(getSmallUpArrowImage())
SmallDnArrow = wx.BitmapFromImage(getSmallDnArrowImage())
SmallUpArrow = BitmapFromImage(getSmallUpArrowImage())
SmallDnArrow = BitmapFromImage(getSmallDnArrowImage())
self.sm_dn = self.il.Add(SmallDnArrow)
self.sm_up = self.il.Add(SmallUpArrow)
......
......@@ -44,7 +44,7 @@ if os.path.join(globalvar.ETCDIR, "python") not in sys.path:
from grass.script import core as grass
from grass.script.utils import decode
from core.gcmd import RunCommand, GError, GMessage, EncodeString
from core.gcmd import RunCommand, GError, GMessage
from core.settings import UserSettings, GetDisplayVectSettings
from core.utils import SetAddOnPath, GetLayerNameFromCmd, command2ltype
from gui_core.preferences import MapsetAccess, PreferencesDialog
......@@ -976,15 +976,6 @@ class GMFrame(wx.Frame):
if not filename:
return False
try:
filename_encoded = EncodeString(filename)
except UnicodeEncodeError:
GError(
parent=self, message=_(
"Due to the limitations of your operating system, "
"the script path cannot contain certain non-ascii characters. "
"Please rename the script or move it to a different location."))
return
if not os.path.exists(filename):
GError(parent=self,
......@@ -1020,7 +1011,7 @@ class GMFrame(wx.Frame):
addonPath = os.getenv('GRASS_ADDON_PATH', [])
if addonPath:
addonPath = addonPath.split(os.pathsep)
dirName = os.path.dirname(filename_encoded)
dirName = os.path.dirname(filename)
if dirName not in addonPath:
addonPath.append(dirName)
dlg = wx.MessageDialog(
......
......@@ -567,7 +567,7 @@ class TransList(wx.VListBox):
def OnMeasureItem(self, n):
height = 0
if self._getItemText(n) is None:
return
return height
for line in self._getItemText(n).splitlines():
w, h = self.GetTextExtent(line)
height += h
......
......@@ -46,7 +46,7 @@ from core.debug import Debug as Debug
from core.settings import UserSettings
from gui_core.widgets import ColorTablesComboBox
from gui_core.wrap import SpinCtrl, PseudoDC, TextCtrl, Button, StaticText, \
StaticBox, EmptyBitmap
StaticBox, EmptyBitmap, BitmapFromImage
class RulesPanel:
......@@ -1983,7 +1983,7 @@ class BufferedWindow(wx.Window):
if pdctype == 'image' and img:
bg = wx.TRANSPARENT_BRUSH
pdc.SetBackground(bg)
bitmap = wx.BitmapFromImage(img)
bitmap = BitmapFromImage(img)
w, h = bitmap.GetSize()
pdc.DrawBitmap(bitmap, 0, 0, True) # draw the composite map
......