本文整理汇总了Python中yast.import_module函数的典型用法代码示例。如果您正苦于以下问题:Python import_module函数的具体用法?Python import_module怎么用?Python import_module使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了import_module函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: import_module
# encoding: utf-8
from yast import import_module
import_module('UI')
from yast import *
class IntField1Client:
def main(self):
UI.OpenDialog(
VBox(
IntField("Percentage:", 0, 100, 50),
PushButton(Opt("default"), "&OK")
)
)
UI.UserInput()
UI.CloseDialog()
IntField1Client().main()
开发者ID:yast,项目名称:yast-python-bindings,代码行数:18,代码来源:IntField1.py
示例2: import_module
# encoding: utf-8
# Full-fledged pattern selection
from yast import import_module
import_module('UI')
import_module('Pkg')
from yast import *
class PatternSelectorWizardWithPackagesClient:
def main(self):
# Pkg::SourceCreate( "http://dist.suse.de/install/SLP/SUSE-10.1-Beta3/i386/CD1/", "" );
# Pkg::SourceCreate( "file:/srv/sles-10-i386/CD1/", "" );
Pkg.SourceStartManager(True)
Pkg.TargetInit("/", False)
if not UI.HasSpecialWidget("PatternSelector"):
detailedSelection() # Fallback: Do detailed selection right away
return
UI.OpenDialog(
Opt("defaultsize"),
#Wizard("back", "", "cancel", "&Cancel", "ok", "&OK")
Wizard(Opt("stepsEnabled"), Id("back"), "", Id("cancel"), "&Cancel", Id("ok"), "&OK")
)
help_text = "<p>The available software for this system is shown by category in the left column. To view a description for an item, select it in the list.</p>" + "<p>Change the status of items by clicking on their status icon or right-click on any icon for a context menu. With the context menu you can also change the status of all items.</p>" + "<p><b>Details</b> opens the detailed software package selection where you can view and select individual software packages.</p>" + "<p>The <b>disk usage</b> display in the lower right corner shows the remaining disk space after all requested changes will have been performed. Please notice that hard disk partitions that are full or nearly full can degrade system performance and in some cases even cause serious problems. The system needs some available disk space to run properly.</p>"
开发者ID:yast,项目名称:yast-python-bindings,代码行数:30,代码来源:PatternSelector-wizard-with-packages.py
示例3: import_module
from yast import Declare, ycpbuiltins, import_module
import_module('PackageSystem')
import_module('Package')
from yast import PackageSystem, Package
if not PackageSystem.Installed('samba-python3'):
if not Package.InstallAll(['samba-python3']):
raise ImportError("Failed to install samba python bindings samba-python3")
from samba.net import Net
from samba.credentials import Credentials
from samba.dcerpc import nbt
# Global response to net.finddc()
cldap_ret = None
def net_lookup(domain):
global cldap_ret
net = Net(Credentials())
cldap_ret = net.finddc(domain=domain, flags=(nbt.NBT_SERVER_LDAP | nbt.NBT_SERVER_DS))
# Check if a given workgroup is a Active Directory domain and return the name
# of AD domain controler
#
# @param workgroup the name of a workgroup to be tested
# @return string non empty when ADS was found
@Declare('string', 'string')
def GetLDAPDS(workgroup):
global cldap_ret
if not cldap_ret:
net_lookup(workgroup)
ycpbuiltins.y2milestone('Found LDAP/DS server %s via cldap ping' % cldap_ret.pdc_dns_name if cldap_ret else '')
return cldap_ret.pdc_dns_name if cldap_ret else ''
开发者ID:noelpower,项目名称:yast-samba-client,代码行数:31,代码来源:SambaAPI.py
示例4: import_module
# encoding: utf-8
# NCurses SlideShow demo: No Wizard or MultiProgressMeter widget available,
# thus using simpler layout
from yast import import_module
import_module('Wizard')
import_module('UI')
from yast import *
import copy
class NCursesSlideShowDemoClient:
def main(self):
self.initialRpms = [600, 150, 30, 100]
self.rpms = copy.deepcopy(self.initialRpms)
self.totalToInstall = 0
self.useTimeout = False
self.currentCd = 1
megaBytesPerSecond = 2
#
# ----------------------------- main() ----------------------------------
#
help_text = "<p>Please wait while packages are being installed.</p>"
slide_text = "\t\t\t\t\t\t\t\t<table cellspacing=\"10\" cellpadding=\"5\">\t\t\t\t\t\t<tr>\t\t\t\t\t\t\t\t\t\t\t<td width =\"*\">\t\t\t\t\t\t\t\t\t<img src=\"/opt/kde3/share/icons/crystalsvg/128x128/apps/kscd.png\" width=\"100\"\talign=\"left\">\t\t\t\t\t\t\t\t\t\t</td>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td width=\"*\">\t\t\t\t\t\t\t\t\t<p><font color=\"#00007f\"><b>XMMS and JuK - Powerful Jukeboxes</b></font></p>\t\t<p>XMMS is an excellent sound player for Linux. It is easy to use and supports\t\tvarious formats, including audio CDs. Test the many visualization plug-ins or\t\tdownload your favorite XMMS skins from the web.</p>\t\t\t\t\t<p>New in KDE: JuK, which classifies your MP3s and organizes your music\t\t\tcollection.</p>\t\t\t\t\t\t\t\t\t\t<p><b>Want More?</b></p>\t\t\t\t\t\t\t\t<p>The SUSE distribution features a wide range of applications for playing\t\tyour CDs and MP3 songs. For example, KsCD is a user-friendly CD player. The\t\ttrack information for most CDs is available on the Internet. Simply activate\t\tthe respective function to display the list.</p>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\t\t\t\t\t\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t</table>"
开发者ID:yast,项目名称:yast-python-bindings,代码行数:30,代码来源:NCursesSlideShowDemo.py
示例5: import_module
# encoding: utf-8
from yast import import_module
import_module('Wizard')
import_module('UI')
import_module('Label')
from yast import *
class WindowIDClient:
def main(self):
image = SCR.Read(Path(".target.byte"), "empty.gif")
Wizard.CreateDialog()
help = "Help"
caption = "Penguins"
penguins = Frame("Penguins", Image(Id("img"), image, "Penguins"))
Wizard.SetContentsButtons(
caption,
penguins,
help,
Label.BackButton(),
Label.NextButton(),
)
windowID = UI.QueryWidget(Id("img"), "WindowID")
ycpbuiltins.y2debug("windowID=%1", windowID)
run = ycpbuiltins.sformat("/usr/bin/xpenguins --id %1", windowID)
# string run = sformat ("/usr/X11R6/lib/xscreensaver/xmatrix -window-id %1", windowID);
# string run = sformat ("/usr/X11R6/lib/xscreensaver/xflame -window-id %1", windowID);
开发者ID:yast,项目名称:yast-python-bindings,代码行数:31,代码来源:WindowID.py
示例6: import_module
# encoding: utf-8
from yast import import_module
import_module('Directory')
import_module('UI')
from yast import *
class TimezoneSelectorClient:
def main(self):
# Build a dialog with a "special" widget - one that may not be supported
# by all UIs.
examples = {
"Europe/Amsterdam" : "Netherlands",
"Europe/Athens" : "Greece",
"Europe/Berlin" : "Germany",
"Europe/Bratislava" : "Slovakia",
"Europe/Brussels" : "Belgium",
"Europe/Helsinki" : "Finland",
"Europe/Istanbul" : "Turkey",
# time zone
"Europe/Kaliningrad" : "Russia (Kaliningrad)",
"Europe/Kiev" : "Ukraine",
"Europe/Malta" : "Malta",
# time zone
"Europe/Minsk" : "Belarus",
"Europe/Monaco" : "Monaco",
# time zone
"Europe/Moscow" : "Russia (Moscow)",
"Europe/Oslo" : "Norway",
开发者ID:yast,项目名称:yast-python-bindings,代码行数:31,代码来源:TimezoneSelector.py
注:本文中的yast.import_module函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论