本文整理汇总了Python中dialog.Dialog.radiolist方法的典型用法代码示例。如果您正苦于以下问题:Python Dialog.radiolist方法的具体用法?Python Dialog.radiolist怎么用?Python Dialog.radiolist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dialog.Dialog
的用法示例。
在下文中一共展示了Dialog.radiolist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_alsa_mixer
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import radiolist [as 别名]
# Turn off AFIN
set_alsa_mixer('LOL Output Mixer L_DAC', 'off')
code = d.CANCEL
while code != d.OK:
code, call = d.inputbox("Input the repeater's callsign", title = 'Repeater Callsign');
if code == d.ESC or code == d.CANCEL:
quit()
call = call.upper()
callre = re.compile('^[A-Z0-9]{1,3}[0-9]{1}[A-Z0-9]{0,3}[A-Z]{1}$')
if not callre.match(call):
code = d.CANCEL
d.msgbox('The callsign you entered is invalid', title = 'Invalid Callsign');
code, module = d.radiolist("Repeater Module", title = 'Repeater Module', choices = [ ('A', 'Usually 23cm/1.2GHz', False),
('B', 'Usually 70cm/440MHz', True),
('C', 'Usually 2m/144MHz', False),
('D', 'Testing Module', False) ])
dstarrepeater_settings['callsign'] = "{:7.7s}{:1.1s}".format(call, module)
dstarrepeater_settings['gateway'] = "{:7.7s}G".format(call)
# Probably should see if this exists and throw an error
dstarrepeater_conf = open('dstarrepeater_1', 'w');
for key, value in sorted(dstarrepeater_settings.items()):
dstarrepeater_conf.write("{0}={1}\n".format(key, value))
if install_type == 'RepeaterOnly':
complete()
d.msgbox('ircDDBGateway configuration needs to happen here!', title = 'TO DO!')
示例2: SBoTemplates
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import radiolist [as 别名]
#.........这里部分代码省略.........
self.edit()
self.menu()
def README(self):
"""README handler file
"""
self.filename = "README"
if self.slack_desc_text:
yesno = self.d.yesno("Import description from <slack-desc> file ?")
if yesno == "ok":
self.data = self.slack_desc_text
self.write()
self.edit()
self.menu()
def SlackBuild(self):
"""SlackBuild handler file
"""
self.filename = "{0}.info".format(self.app)
text = ["x", "VERSION="] + (["x"] * 6)
self.__infoFileRead(text) # get version for .info file
self.filename = "{0}.SlackBuild".format(self.app)
if not os.path.isfile(self.pwd + self.filename):
version = self._version.replace('"', '')
height = 20
width = 80
choices = [
("autotools-template", "autotools-template.SlackBuild", False),
("cmake-template", "cmake-template.SlackBuild", False),
("perl-template", "perl-template.SlackBuild", False),
("python-template", "python-template.SlackBuild", False),
("rubygem-template", "rubygem-template.SlackBuild", False)
]
code, tag = self.d.radiolist("{0}".format(self.filename), height,
width, list_height=0, choices=choices)
self.msg = "{0} script created.".format(self.filename)
self.height = 7
self.width = len(self.msg) + 4
if tag == "autotools-template":
self.data = SlackBuilds(
self.app, version, self.year, self.maintainer,
self.live).autotools().splitlines()
self.write()
self.messageBox()
elif tag == "cmake-template":
self.data = SlackBuilds(
self.app, version, self.year, self.maintainer,
self.live).cmake().splitlines()
self.write()
self.messageBox()
elif tag == "perl-template":
self.data = SlackBuilds(
self.app, version, self.year, self.maintainer,
self.live).perl().splitlines()
self.write()
self.messageBox()
elif tag == "python-template":
self.data = SlackBuilds(
self.app, version, self.year, self.maintainer,
self.live).python().splitlines()
self.write()
self.messageBox()
elif tag == "rubygem-template":
self.data = SlackBuilds(
self.app, version, self.year, self.maintainer,
self.live).rubygem().splitlines()
示例3: listdir
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import radiolist [as 别名]
root=Dialog()
choices=[]
config=''
########################################################################
# Build the user interface
########################################################################
# grab a list of available desktop settings for the user to pick from
for item in listdir("/opt/hackbox/preconfiguredSettings/userSettings/"):
# ignore core settings,hidden files, and any files that are not folders
if (item != "CORE") and (("." in item) != True):
if "default" in item:
choices.append((item,'',1))
else:
choices.append((item,'',0))
if len(choices)>1:
userChoice=root.radiolist('Which desktop enviorment layout would you like to be the default?',20,60,15,choices)
if userChoice[0] == 'cancel':
print('Not changing anything and closing program...')
exit()
# returns a 2 value tuple, grab value # 1
userChoice=("/opt/hackbox/preconfiguredSettings/userSettings/"+userChoice[1])
# add to the config file
desktopLine=userChoice
########################################################################
# stop xfce4-panel and kill xfconfd which stores settings in ram
system('xfce4-panel --quit')
system('pkill xfconfd')
# remove users old config files
print('rm -rv ~/.config/xfce4/panel/')
system('rm -rv ~/.config/xfce4/panel/')
print('rm -v ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml')