Skip to content

Commit

Permalink
Fixes based on example code
Browse files Browse the repository at this point in the history
Don't always import Wizard and UI, these should be explicitly imported.
'path' should be 'Path'.
Create the SCR module.
etc.
  • Loading branch information
dmulder committed Nov 28, 2017
1 parent 144f832 commit e33319f
Show file tree
Hide file tree
Showing 242 changed files with 684 additions and 61 deletions.
2 changes: 2 additions & 0 deletions examples/Alignment1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

class Alignment:
Expand Down
2 changes: 2 additions & 0 deletions examples/AutoShortcut1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

class AutoShortcut1Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/AutoShortcut2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# encoding: utf-8

import ycpbuiltins
from yast import import_module
import_module('UI')
from yast import *

class AutoShortcut2Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/BackgroundPixmap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

# Simple example how to use background pixmaps in alignments
Expand Down
2 changes: 2 additions & 0 deletions examples/BarGraph1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

# BarGraph1.ycp
Expand Down
2 changes: 2 additions & 0 deletions examples/BarGraph2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

class BarGraph2Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/BarGraph3.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# Create a dialog with a BarGraph with a number of segments
# and a "+" and a "-" button for each segment.
import copy
from yast import import_module
import_module('UI')
from yast import *
import ycpbuiltins

Expand Down
2 changes: 2 additions & 0 deletions examples/Beep.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *
import ycpbuiltins

Expand Down
2 changes: 2 additions & 0 deletions examples/BusyIndicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# Simple BusyIndicator example

from yast import import_module
import_module('UI')
from yast import *

class BusyIndicatorClient:
Expand Down
2 changes: 2 additions & 0 deletions examples/ButtonBox1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# Example for ButtonBox

from yast import import_module
import_module('UI')
from yast import *

class ButtonBox1Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/ButtonBox2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# Demo for common ButtonBox-based dialogs
import copy
from yast import import_module
import_module('UI')
from yast import *

class ButtonBox2Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/ButtonBox3-relaxed.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

# Example for ButtonBox: Relaxed sanity check.
Expand Down
2 changes: 2 additions & 0 deletions examples/CheckBox1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

class CheckBox1Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/CheckBox2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

class CheckBox2Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/CheckBox3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# encoding: utf-8
from yast import import_module
import_module('UI')
from yast import *

class CheckBox3Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/CheckBox4.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# encoding: utf-8
from yast import import_module
import_module('UI')
from yast import *

class CheckBox4Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/CheckBoxFrame1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# encoding: utf-8
from yast import import_module
import_module('UI')
from yast import *

class CheckBoxFrame1Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/CheckBoxFrame2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

# Example for CheckBoxFrame with inverted check box:
Expand Down
2 changes: 2 additions & 0 deletions examples/CheckBoxFrame3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8
import ycpbuiltins
from yast import import_module
import_module('UI')
from yast import *

# Example for CheckBoxFrame without auto enable:
Expand Down
2 changes: 2 additions & 0 deletions examples/CheckBoxFrame4.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

class CheckBoxFrame4Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/ComboBox-empty.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# encoding: utf-8
from yast import import_module
import_module('UI')
from yast import *

class ComboBoxEmptyClient:
Expand Down
2 changes: 2 additions & 0 deletions examples/ComboBox-icons.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# encoding: utf-8
from yast import import_module
import_module('UI')
from yast import *

# Combo box with icons
Expand Down
2 changes: 2 additions & 0 deletions examples/ComboBox-replace-items1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# encoding: utf-8
from yast import import_module
import_module('UI')
from yast import *

# Example showing how to replace SelectionBox items
Expand Down
2 changes: 2 additions & 0 deletions examples/ComboBox-set-empty.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# encoding: utf-8
from yast import import_module
import_module('UI')
from yast import *

# Create a combo box with three entries.
Expand Down
2 changes: 2 additions & 0 deletions examples/ComboBox-setInputMaxLength.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

class ComboBoxSetInputMaxLengthClient:
Expand Down
2 changes: 2 additions & 0 deletions examples/ComboBox1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

class ComboBox1Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/ComboBox2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

# Create a combo box with three entries.
Expand Down
2 changes: 2 additions & 0 deletions examples/ComboBox3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

# Create a combo box with three entries.
Expand Down
2 changes: 2 additions & 0 deletions examples/ComboBox4.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

# Create an editable combo box with restricted input character set.
Expand Down
2 changes: 2 additions & 0 deletions examples/ComboBox5.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *

# Advanced ComboBox / SelecionBox example:
Expand Down
2 changes: 2 additions & 0 deletions examples/ContextMenu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# encoding: utf-8

import copy
from yast import import_module
import_module('UI')
from yast import *

class ContextMenuClient:
Expand Down
2 changes: 2 additions & 0 deletions examples/DateField1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# encoding: utf-8

# Simple example for DateField
from yast import import_module
import_module('UI')
from yast import *

class DateField1Client:
Expand Down
2 changes: 2 additions & 0 deletions examples/Decorated.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *
class DecoratedClient:
def main(self):
Expand Down
4 changes: 3 additions & 1 deletion examples/DefaultButtons1.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Note: YCP applications are discouraged from using the Wizard widget directly.
# Use the Wizard module instead.
from yast import import_module
import_module('UI')
from yast import *

class DefaultButtons1Client:
Expand Down Expand Up @@ -43,7 +45,7 @@ def main(self):

UI.OpenDialog(
Opt("defaultsize"),
YCPWizard(
Wizard(
Opt("stepsEnabled"),
Id("back"),
"&Back",
Expand Down
4 changes: 3 additions & 1 deletion examples/DefaultButtons2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Note: YCP applications are discouraged from using the Wizard widget directly.
# Use the Wizard module instead.
from yast import import_module
import_module('UI')
from yast import *
class DefaultButtons2Client:
def main(self):
Expand Down Expand Up @@ -42,7 +44,7 @@ def main(self):
help_text = "<p>This is a help text.</p>" + "<p>It should be helpful.</p>" + "<p>If it isn't helpful, it should rather not be called a <i>help text</i>.</p>" + "<p>Help texts may contain the product name (&product;) with a macro that will " + "automatically be expanded - multiple times (&product;) if needed.</p>"
UI.OpenDialog(
Opt("defaultsize"),
YCPWizard(
Wizard(
Opt("stepsEnabled"),
Id("back"),
"&Back",
Expand Down
4 changes: 3 additions & 1 deletion examples/DefaultButtons3.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Note: YCP applications are discouraged from using the Wizard widget directly.
# Use the Wizard module instead.
from yast import import_module
import_module('UI')
from yast import *
class DefaultButtons3Client:
def main(self):
Expand Down Expand Up @@ -42,7 +44,7 @@ def main(self):
help_text = "<p>This is a help text.</p>" + "<p>It should be helpful.</p>" + "<p>If it isn't helpful, it should rather not be called a <i>help text</i>.</p>" + "<p>Help texts may contain the product name (&product;) with a macro that will " + "automatically be expanded - multiple times (&product;) if needed.</p>"
UI.OpenDialog(
Opt("defaultsize"),
YCPWizard(
Wizard(
Opt("stepsEnabled"),
Id("back"),
"&Back",
Expand Down
2 changes: 2 additions & 0 deletions examples/DefaultSizeDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# DefaultSizeDialogs.ycp
#
# Example for multiple dialogs
from yast import import_module
import_module('UI')
from yast import *
class DefaultSizeDialogsClient:
def main(self):
Expand Down
2 changes: 2 additions & 0 deletions examples/DownloadProgress1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *
class DownloadProgress1Client:
def main(self):
Expand Down
2 changes: 2 additions & 0 deletions examples/DownloadProgress2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *
class DownloadProgress2Client:
def main(self):
Expand Down
2 changes: 2 additions & 0 deletions examples/DumbTab1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# encoding: utf-8

# Minimalistic example for tab widget
from yast import import_module
import_module('UI')
from yast import *
class DumbTab1Client:
def main(self):
Expand Down
2 changes: 2 additions & 0 deletions examples/DumbTab2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# encoding: utf-8

# Typical usage example for tab widget
from yast import import_module
import_module('UI')
from yast import *
class DumbTab2Client:
def main(self):
Expand Down
2 changes: 2 additions & 0 deletions examples/DumbTab3.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# encoding: utf-8

# Minimalistic example for tab widget
from yast import import_module
import_module('UI')
from yast import *
class DumbTab3Client:
def main(self):
Expand Down
2 changes: 2 additions & 0 deletions examples/Enabling1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *
class Enabling1Client:
def main(self):
Expand Down
2 changes: 2 additions & 0 deletions examples/Enabling2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *
class Enabling2Client:
def main(self):
Expand Down
2 changes: 2 additions & 0 deletions examples/Enabling3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

from yast import import_module
import_module('UI')
from yast import *
class Enabling3Client:
def main(self):
Expand Down
Loading

0 comments on commit e33319f

Please sign in to comment.