コード例 #1
0
 def __init__(self, name):
     folder = os.path.dirname(traceback.extract_stack()[-2][0])
     Lesson.__init__(self, name, "GeoGig lessons", "lesson.html", folder=folder)
     helpFile= os.path.abspath(os.path.join(os.path.dirname(__file__),
                                           "common",
                                            "preparegeogig.md"))
     self.addStep("Prepare GeoGig environment", helpFile,
        endcheck=checkGeoGig, steptype=Step.MANUALSTEP)
     self.setCleanup(cleanup)
コード例 #2
0
 def __init__(self, name):
     Lesson.__init__(self, name, "GeoGig lessons", "lesson.html")
     self.folder = os.path.dirname(traceback.extract_stack()[-2][0])
     self.description = self.resolveFile(self.description)
     self.addStep("Preparing lesson", "Preparing lesson",
                  backupConfiguration)
     helpFile = os.path.abspath(
         os.path.join(os.path.dirname(__file__), "common",
                      "preparegeogig.html"))
     self.addStep("Prepare GeoGig environment",
                  helpFile,
                  endcheck=checkGeoGig,
                  steptype=Step.MANUALSTEP)
     self.setCleanup(restoreConfiguration)
コード例 #3
0
 def __init__(self, name):
     folder = os.path.dirname(traceback.extract_stack()[-2][0])
     Lesson.__init__(self,
                     name,
                     "GeoGig lessons",
                     "lesson.html",
                     folder=folder)
     helpFile = os.path.abspath(
         os.path.join(os.path.dirname(__file__), "common",
                      "preparegeogig.md"))
     self.addStep("Prepare GeoGig environment",
                  helpFile,
                  endcheck=checkGeoGig,
                  steptype=Step.MANUALSTEP)
     self.setCleanup(cleanup)
コード例 #4
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

lesson = Lesson("04. Set and define a vector layer CRS", "General tasks", "lesson.html")

lesson.addStep("Introduction", "introduction.html", steptype=Step.MANUALSTEP)
lesson.addStep("Set 'Wake_BlockGroup_2010' layer as active layer", "activelayer.html",
               function=lambda: setActiveLayer("Wake_BlockGroup_2010"),
               endcheck=lambda: layerActive("Wake_BlockGroup_2010"),
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Set CRS of Layer(s)")
lesson.addStep("Set the layer's correct CRS", "setcrs.html", steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Vector/Data Management Tools/Define current projection", "gotodefineprojection.html")
lesson.addStep("Define new CRS to file", "defineprojection.html", steptype=Step.MANUALSTEP)
lesson.addNextLesson("General tasks", "05. Reproject vector layer")
コード例 #5
0
ファイル: main.py プロジェクト: alessandroaimar/MyASVZPal
import logging
logging.basicConfig(level=logging.INFO,
                    format='%(asctime)s %(levelname)-8s %(message)s',
                    datefmt='%d-%m-%Y %H:%M:%S')
log = logging.getLogger()

from worker import Worker
from lessons.lesson import Lesson as Lesson

#############################################
#### TODO REPLACE WITH USER CLASS
from users.Ale import Ale as User
############################################

user = User()
lesson = Lesson()

#############################################
# TODO Replace with link to the class to subscribe
#############################################
lesson.set_path("https://schalter.asvz.ch/tn/lessons/90878")

#############################################
# TODO Replace with the time of REGISTRATION to the class
lesson.set_enrollment_date_and_time(year=2020,
                                    month=3,
                                    day=2,
                                    hour=14,
                                    minute=15)
############################################
コード例 #6
0
from lessons.lesson import Lesson, Step
from lessons.utils import *
from qgis.utils import iface
from lessons import addLessonModule

# Lesson's description

lesson = Lesson ("10. Using data-defined properties", "Layer styling",
                 "00_lesson.html")


# Steps

lesson.addStep("Introduction", "01_intro.md", steptype=Step.MANUALSTEP)

lesson.addStep("Make 'Wake_MajorRoads' active", "02_active_layer.md", function=lambda: setActiveLayer("Wake_MajorRoads"),
               endcheck=lambda: layerActive("Wake_MajorRoads"), steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "03_open_properties.md")

lesson.addStep("Set data-override to Pen Width option", "04_set_overrride_settings.md", steptype=Step.MANUALSTEP)

lesson.addStep("Confirm data-override results", "05_override_results.md", steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "03_open_properties.md")

lesson.addStep("Set an expression for Pen Width option", "06_set_overrride_expression.md", steptype=Step.MANUALSTEP)

lesson.addStep("Confirm expression results", "07_set_expression_results.md", steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "03_open_properties.md")
コード例 #7
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Step, Lesson
from lessons.utils import layerExists, layerFromName
from qgis.utils import iface

# EndCheck functions

lesson = Lesson("01. Load ArcGIS REST services layers",
                "Third party integration", "lesson.html")

lesson.addStep("Introduction", "01_introduction.md", steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layers/Add Layer/Add ArcGIS MapServer",
                        "02_open_arcgis_add_mapserver_layer.md")
lesson.addStep("Setup a ArcGISMapServer connection",
               "03_setup_connection.md",
               endcheck=lambda: layerExists("States", "raster"),
               steptype=Step.MANUALSTEP)
lesson.addStep("Inspect ArcGISMapServer layer",
               "04_inspect_ArcGisMapServer_layer.md",
               steptype=Step.MANUALSTEP)
lesson.addStep("Open Browser Panel",
               "05_open_browser_panel.md",
               steptype=Step.MANUALSTEP)
lesson.addStep("Add ArcGISFeatureServer connection",
               "06_Add_a_connection_in_browser.md",
               steptype=Step.MANUALSTEP)
lesson.addStep("Load Layer using Browser",
コード例 #8
0
from lessons.lesson import Lesson, Step
from qgis.utils import iface
from lessons import addLessonModule
from lessons.utils import copyLessonData


# Copy dataset to the user's folder
def copyTable():
    filepath = os.path.join(os.path.dirname(os.path.dirname(__file__)),
                            "Setting_layer_default_style/data",
                            "Wake_BlockGroup_2010.zip")
    copyLessonData(filepath, os.path.basename(os.path.dirname(__file__)))


# Lesson's description
lesson = Lesson("08. Setting layer's default style", "Layer styling",
                "00_lesson.html")

# Steps
lesson.addStep("Copy data", "Copy data", copyTable)

lesson.addStep('Introduction', '01_intro.html', steptype=Step.MANUALSTEP)

lesson.addMenuClickStep('Layer/Add Layer/Add Vector Layer...')

lesson.addStep('Load example dataset',
               '02_select_dataset_file.html',
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep('Layer/Properties...', '03_open_properties.html')

lesson.addStep('Change layer style',
コード例 #9
0
from lessons.lesson import Lesson, Step
from lessons.utils import *
from qgis.utils import iface
from lessons import addLessonModule
from lessons.utils import copyLessonData


def copyTable():
    filepath = os.path.join(
        os.path.dirname(os.path.dirname(__file__)),
        "Transform_X_and_Y_CSV_table_into_a_point_vector_layer/data",
        "songs.csv")
    copyLessonData(filepath, os.path.basename(os.path.dirname(__file__)))


lesson = Lesson("07. Transform X and Y CSV table into a point vector layer",
                "General tasks", "lesson.html")

lesson.addStep("Copy data", "Copy data", copyTable)
lesson.addStep('Introduction', 'introduction.html', steptype=Step.MANUALSTEP)
lesson.addMenuClickStep('Layer/Add Layer/Add Delimited Text Layer...')
lesson.addStep('Configure importing settings',
               'delimited_text_settings.html',
               steptype=Step.MANUALSTEP)
lesson.addStep('Set layer as active layer',
               'set_active_layer.html',
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep('Layer/Save As...')
lesson.addStep('Save the file as GeoPackage',
               'save_as_geopackage.html',
               steptype=Step.MANUALSTEP)
コード例 #10
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

# Lesson description
lesson = Lesson("05. Create Proportional Symbols", "Layer styling",
                "00_lesson.html")

# Steps
lesson.addStep("Set 'Wake_Public_Schools' layer as active layer",
               "01_activelayer.html",
               function=lambda: setActiveLayer("Wake_Public_Schools"),
               endcheck=lambda: layerActive("Wake_Public_Schools"),
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Use size assistant to set symbols",
               "03_set_proportional_symbols.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "04_proportional_size_results.html",
               steptype=Step.MANUALSTEP)
コード例 #11
0
from lessons.lesson import Lesson, Step
from lessons.utils import *
from qgis.utils import iface
from lessons import addLessonModule

# Lesson's description

lesson = Lesson("01. Vector Single Symbol", "Layer styling", "00_lesson.html")

# Steps

lesson.addStep("Introduction", "01_introduction.md", steptype=Step.MANUALSTEP)

lesson.addStep("Set active layer",
               "02_active_layer.md",
               function=lambda: setActiveLayer("Raleigh_Downtown"),
               endcheck=lambda: layerActive("Raleigh_Downtown"),
               steptype=Step.MANUALSTEP)

lesson.addStep("Open Styling panel",
               "03_open_styling_panel.md",
               steptype=Step.MANUALSTEP)

lesson.addStep("Change layer's symbol",
               "04_change_simple_fill_settings.md",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm symbol's changes",
               "05_simple_fill_results.md",
               steptype=Step.MANUALSTEP)
コード例 #12
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import *
from qgis.utils import iface
from lessons import addLessonModule

def isLayerActive():
    layer = iface.activeLayer()
    return layer is not None and layer.name() == "points"

def setActiveLayer():
    layer = layerFromName("points")
    iface.setActiveLayer(layer)

lesson = Lesson("Export to geojson", "Basic lessons", "lesson.html")
lesson.addStep("Set 'points' layer as active layer", "activelayer.html",
               function = setActiveLayer, endcheck=isLayerActive, steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Save As...")
lesson.addStep("Save the file as geojson", "saveas.html", steptype=Step.MANUALSTEP)

コード例 #13
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from qgis.utils import iface
from lessons import addLessonModule

# Lesson description
lesson = Lesson("09. Manage multiple styles in a layer", "Layer styling",
                "00_lesson.html")

# Steps
lesson.addStep("Introduction", "01_intro.html", steptype=Step.MANUALSTEP)

lesson.addStep("Rename current style",
               "02_rename_existing_style.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Create new style",
               "03_create_new_style.html",
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "04_open_properties.html")

lesson.addStep("Change new style settings",
               "05_create_occupied_ratio_style.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Go back to previous style",
コード例 #14
0
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import *
from qgis.utils import iface
from lessons import addLessonModule


def isLayerActive():
    layer = iface.activeLayer()
    return layer is not None and layer.name() == "points"


def setActiveLayer():
    layer = layerFromName("points")
    iface.setActiveLayer(layer)


lesson = Lesson("Export to geojson", "Basic lessons", "lesson.html")
lesson.addStep("Set 'points' layer as active layer",
               "activelayer.html",
               function=setActiveLayer,
               endcheck=isLayerActive,
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Save As...")
lesson.addStep("Save the file as geojson",
               "saveas.html",
               steptype=Step.MANUALSTEP)
コード例 #15
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

# Lesson description
lesson = Lesson("07. Raster multiband styling", "Layer styling",
                "00_lesson.html")

# Steps
lesson.addStep("Set 'landsat_8_sample' layer as active layer",
               "01_activelayer.html",
               function=lambda: setActiveLayer("landsat_8_sample"),
               endcheck=lambda: layerActive("landsat_8_sample"),
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Set layer style to Singleband pseudocolor",
               "03_set_432_natural_color.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "04_set_432_natural_color_results.html",
               steptype=Step.MANUALSTEP)
コード例 #16
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

# Lesson description
lesson = Lesson("06. Raster singleband styling", "Layer styling",
                "00_lesson.html")

# Steps
lesson.addStep("Set 'dem25' layer as active layer",
               "01_activelayer.html",
               function=lambda: setActiveLayer("dem25"),
               endcheck=lambda: layerActive("dem25"),
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Set layer style to Singleband pseudocolor",
               "03_set_singleband_pseudocolor.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "04_set_singleband_pseudocolor_results.html",
               steptype=Step.MANUALSTEP)
コード例 #17
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

# Lesson description
lesson = Lesson("04. Vector rule-based symbols", "Layer styling",
                "00_lesson.html")

# Steps
lesson.addStep("Introduction", "01_intro.html", steptype=Step.MANUALSTEP)

lesson.addStep("Set 'Buildings' layer as active layer",
               "02_active_layer.html",
               function=lambda: setActiveLayer("Buildings"),
               endcheck=lambda: layerActive("Buildings"),
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "03_open_properties.html")

lesson.addStep("Set the first rule",
               "04_set_first_rule.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm the results",
               "05_set_first_rule_results.html",
コード例 #18
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

lesson = Lesson("Export to geojson", "Basic lessons", "lesson.html")
lesson.addStep("Set 'points' layer as active layer", "activelayer.md",
               function=lambda: setActiveLayer("points"),
               endcheck=lambda: layerActive("points"),
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Save As...")
lesson.addStep("Save the file as geojson", "saveas.html", steptype=Step.MANUALSTEP)
lesson.addNextLesson("Basic lessons", "Export to geojson (yaml example)")

コード例 #19
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

lesson = Lesson("Export to geojson", "Basic lessons", "lesson.html")
lesson.addStep("Set 'points' layer as active layer", "activelayer.md",
               function=lambda: setActiveLayer("points"),
               endcheck=lambda:layerActive("points"),
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Save As...")
lesson.addStep("Save the file as geojson", "saveas.html", steptype=Step.MANUALSTEP)
lesson.addNextLesson("Basic lessons", "Export to geojson (yaml example)")

コード例 #20
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Step, Lesson
from lessons import utils
from qgis.utils import iface

lesson = Lesson("Sample lesson")
lesson.addStep("New Project", "New Project", iface.newProject)
コード例 #21
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Step, Lesson
from lessons import utils
from qgis.utils import iface

lesson = Lesson("Using Boundless Connect", "Boundless Connect plugin",
                "lesson.html")

#lesson.addStep("New Project", "New Project", iface.newProject)


lesson.addStep("Introduction",
               "01_introduction.md",
               steptype=Step.MANUALSTEP)
lesson.addStep("Enable Boundless Connect Panel",
               "02_enable_boundless_connect_panel.md",
               steptype=Step.MANUALSTEP)
lesson.addStep("Enter username and password",
               "03_enter_username_and_password.md",
               steptype=Step.MANUALSTEP)
lesson.addStep("Set master password",
               "04_set_master_password.md",
               steptype=Step.MANUALSTEP)
lesson.addStep("Confirm login",
               "05_confirm_login.md",
               steptype=Step.MANUALSTEP)
lesson.addStep("Search for Knowledge Content",
コード例 #22
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

lesson = Lesson("01. Export vector layer", "General tasks", "lesson.html")
lesson.addStep("Introduction", "introduction.html", steptype=Step.MANUALSTEP)
lesson.addStep("Set 'Wake_Fire_Stations' layer as active layer",
               "activelayer.html",
               function=lambda: setActiveLayer("Wake_Fire_Stations"),
               endcheck=lambda: layerActive("Wake_Fire_Stations"),
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Save As...",
                        name="Click on 'Layer > Save As...' menu item.")
lesson.addStep("Save layer to new format",
               "saveas.html",
               steptype=Step.MANUALSTEP)
lesson.addNextLesson("General tasks", "02. Export raster layer")
コード例 #23
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule


# Lesson description
lesson = Lesson("11. Labelling vector layers", "Layer styling",
                "00_lesson.html")

# Steps
lesson.addStep("Set 'Wake_ZIP_Codes' layer as active layer", "01_activelayer.html",
               function=lambda: setActiveLayer("Wake_ZIP_Codes"),
               endcheck=lambda: layerActive("Wake_ZIP_Codes"),
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Set labels settings for polygons layer", "03_turn_labels_on.html", steptype=Step.MANUALSTEP)

lesson.addStep("Confirm labels results", "04_label_results.html", steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Set improved position", "05_improve_label_position.html", steptype=Step.MANUALSTEP)

lesson.addStep("Confirm position changes", "06_label_position_results.html", steptype=Step.MANUALSTEP)
コード例 #24
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

# Lesson description
lesson = Lesson("02. Vector categorized symbols", "Layer styling",
                "00_lesson.html")

# Steps
lesson.addStep("Set 'Downtown streets' layer as active layer",
               "01_activelayer.html",
               function=lambda: setActiveLayer("Downtown streets"),
               endcheck=lambda: layerActive("Downtown streets"),
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Configure categorized Symbol",
               "03_set_categories.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "04_set_categories_results.html",
               steptype=Step.MANUALSTEP)
コード例 #25
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

lesson = Lesson("05. Reproject vector layer", "General tasks", "lesson.html")
lesson.addStep("Introduction", "introduction.html", steptype=Step.MANUALSTEP)
lesson.addStep("Set 'Wake_Fire_Stations' layer as active layer",
               "activelayer.html",
               function=lambda: setActiveLayer("Wake_Fire_Stations"),
               endcheck=lambda: layerActive("Wake_Fire_Stations"),
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Properties...", "openproperties.html")
lesson.addStep("Confirm layer CRS",
               "confirmcrs.html",
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Save As...")
lesson.addStep("Save a reprojected copy of the layer",
               "saveas.html",
               steptype=Step.MANUALSTEP)
lesson.addNextLesson("General tasks",
                     "06. Reproject vector layer (using Processing)")
コード例 #26
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

# Lesson description
lesson = Lesson("03. Vector graduated symbols", "Layer styling",
                "00_lesson.html")

# Steps
lesson.addStep("Set 'Wake BlockGroup 2010' layer as active layer",
               "01_activelayer.html",
               function=lambda: setActiveLayer("Wake BlockGroup 2010"),
               endcheck=lambda: layerActive("Wake BlockGroup 2010"),
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Configure graduated Symbol",
               "03_set_graduated.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "04_set_graduated_results.html",
               steptype=Step.MANUALSTEP)