本文整理汇总了Python中remi.start函数的典型用法代码示例。如果您正苦于以下问题:Python start函数的具体用法?Python start怎么用?Python start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了start函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: main
def main():
#p = Project()
#root = p.load('./example_project.py')
#p.append(root, "root")
#p.save(None)
# starts the webserver
# optional parameters
# start(MyApp,address='127.0.0.1', port=8081, multiple_instance=False,enable_file_cache=True, update_interval=0.1, start_browser=True)
start(Editor, debug=False, address='0.0.0.0', port=8082)
开发者ID:awesome-python,项目名称:remi,代码行数:10,代码来源:editor.py
示例2: exit
exit()
options_file_path=editor_dir+os.sep+'pp_config'+os.sep+'pp_web.cfg'
if not os.path.exists(options_file_path):
print 'Web Editor - Cannot find Web Options file'
exit()
"""reads options from options file to interface"""
config=ConfigParser.ConfigParser()
config.read(options_file_path)
ip =config.get('network','ip',0)
port=int(config.get('editor','port',0))
username=config.get('editor','username',0)
password=config.get('editor','password',0)
print 'Web Editor Started'
# print ip,port, username,password
# setting up remi debug level
# 2=all debug messages 1=error messages 0=no messages
import remi.server
remi.server.DEBUG_MODE = 0
# start the web server to serve the Web Editor App
start(PPWebEditor,address=ip, port=port,username=username,password=password,
multiple_instance=False,enable_file_cache=True,
update_interval=0.1, start_browser=False)
开发者ID:athope,项目名称:pipresents-gapless,代码行数:26,代码来源:pp_web_editor.py
示例3: date_changed
self.lbl.set_text('New color value: ' + value)
def date_changed(self, value):
self.lbl.set_text('New date value: ' + value)
def menu_save_clicked(self):
self.lbl.set_text('Menu clicked: Save')
def menu_saveas_clicked(self):
self.lbl.set_text('Menu clicked: Save As')
def menu_open_clicked(self):
self.lbl.set_text('Menu clicked: Open')
def menu_view_clicked(self):
self.lbl.set_text('Menu clicked: View')
def fileupload_on_success(self, filename):
self.lbl.set_text('File upload success: ' + filename)
def fileupload_on_failed(self, filename):
self.lbl.set_text('File upload failed: ' + filename)
if __name__ == "__main__":
# starts the webserver
# optional parameters
# start(MyApp,address='127.0.0.1', port=8081, multiple_instance=False,enable_file_cache=True, update_interval=0.1, start_browser=True)
start(MyApp, debug=True, address='0.0.0.0')
开发者ID:PURPORC,项目名称:remi,代码行数:30,代码来源:widgets_overview_app.py
示例4: MyApp
class MyApp(App):
def __init__(self, *args):
res_path = os.path.join(os.path.dirname(__file__), 'res')
super(MyApp, self).__init__(*args, static_file_path=res_path)
def idle(self):
pass
def main(self):
self.floatingPaneContainer = FloatingPanesContainer(width=800, height=600, margin='0px auto')
self.floatingPaneContainer.append(gui.Label("Click a panel to select, than drag and stretch"))
pane1 = gui.Widget(width=100, height=200)
pane1.style['background-color'] = 'yellow'
self.floatingPaneContainer.add_pane(pane1, 10, 100)
pane1.append(gui.Label("Panel1, drag and stretch"))
pane2 = gui.VBox(width=100, height=200)
pane2.style['background-color'] = 'green'
self.floatingPaneContainer.add_pane(pane2, 150, 100)
pane2.append(gui.Label("Panel2, drag and stretch"))
# returning the root widget
return self.floatingPaneContainer
if __name__ == "__main__":
start(MyApp, debug=False, address='0.0.0.0', port=8082, update_interval=2.0)
开发者ID:MrYsLab,项目名称:remi,代码行数:30,代码来源:resizable_panes.py
示例5: main
def main(self, name='world'):
# the arguments are width - height - layoutOrientationOrizontal
wid = gui.Widget(120, 100, False, 10)
self.lbl = gui.Label(100, 30, 'Hello %s!' % name)
self.bt = gui.Button(100, 30, 'Press me!')
# setting the listener for the onclick event of the button
self.npressed = 0
self.bt.set_on_click_listener(self, 'on_button_pressed')
# appending a widget to another, the first argument is a string key
wid.append(self.lbl)
wid.append(self.bt)
# returning the root widget
return wid
# listener function
def on_button_pressed(self):
self.npressed += 1
self.lbl.set_text('Button pressed %s times' % self.npressed)
self.bt.set_text('Hi!')
if __name__ == "__main__":
# starts the webserver
# optional parameters
# start(MyApp,address='127.0.0.1', port=8081, multiple_instance=False,enable_file_cache=True, update_interval=0.1, start_browser=True)
start(MyApp, debug=False)
开发者ID:Sagaragrawal,项目名称:remi,代码行数:29,代码来源:simple_app.py
示例6: conf_continue
def conf_continue(self,result):
if result is True:
# print 'dialog confirm'
result=self.t1field1.get_value()
self.t1f1_field.set_text('Tab1 Field1: '+result)
result=self.t2field1.get_value()
self.t2f1_field.set_text('Tab2 Field1: '+result)
self.tabbed_dialog.hide()
OKDialog('Tabbed Editor','Saved').show(self)
else:
OKDialog('Tabbed Editor','Not Saved').show(self)
#
# ***************************************
# MAIN
# ***************************************
if __name__ == "__main__":
# setting up remi debug level
# 2=all debug messages 1=error messages 0=no messages
import remi.server
remi.server.DEBUG_MODE = 2
# start the web server to serve the App
start(Tabbed,address='127.0.0.1', port=8082,
multiple_instance=False,enable_file_cache=True,
update_interval=0.1, start_browser=False)
开发者ID:athope,项目名称:pipresents-gapless,代码行数:30,代码来源:remi_plus.py
示例7: stop
time.sleep(1)
def stop(self):
self.running = False
self.thread.join()
# listener function
def on_button_pressed(self, widget, settings):
if not self.started:
# self.plt.status.play()
widget.set_text('Stop')
widget.style['background-color'] = 'red'
for idx in range(len(self.data)):
self.data[idx]['x'] = []
self.data[idx]['y'] = []
self.running = True
self.thread = threading.Thread(target=self.run)
self.thread.start()
else:
# self.plt.status.stop()
self.stop()
widget.set_text('Start')
widget.style['background-color'] = 'green'
self.started = not self.started
if __name__ == "__main__":
# starts the webserver
# start(MyApp,address='127.0.0.1', port=8081, multiple_instance=False,
# enable_file_cache=True, update_interval=0.1, start_browser=True)
start(MyApp, debug=False, port=8081, address='0.0.0.0', start_browser=True)
开发者ID:MrYsLab,项目名称:remi,代码行数:30,代码来源:plotly_app.py
示例8: str
self.published_topics = [topic_name for topic_name, topic_type in self.published_topics_and_types]
self.published_topics.sort()
rospy.loginfo("Found topics:\n" +
str(self.published_topics))
self.dropdown = gui.DropDown(-1, -1)
choose_ddi = gui.DropDownItem(-1, -1, "Choose topic...")
self.dropdown.append(0, choose_ddi)
for idx, topic_name in enumerate(self.published_topics):
ddi = gui.DropDownItem(-1, -1, topic_name)
self.dropdown.append(idx+1, ddi)
self.dropdown.set_on_change_listener(self, 'on_dropdown_change')
# using ID 2 to update the dropdown
self.hor_topics.append(2, self.dropdown)
# This makes the dropdown not be left
self.dropdown.style['display'] = 'block'
self.dropdown.style['margin'] = '10px auto'
self.dropdown.style['float'] = 'none'
self.wid.append(1, self.hor_topics)
if __name__ == "__main__":
rospy.init_node('web_topic_viewer')
start(MyApp,
address="0.0.0.0",
port=8091,
multiple_instance=True,
update_interval=0.1,
start_browser=False,
debug=False)
开发者ID:awesomebytes,项目名称:web_apps,代码行数:30,代码来源:topic_viewer_remi.py
示例9: print
print("tag deleted")
def onkeydown(self, keypressed):
if keypressed==46: #46 the delete keycode
self.toolbar_delete_clicked()
print("Key pressed: " + str(keypressed))
#function overload for widgets that have to be editable
#the normal onfocus function does not returns the widget instance
#def onfocus_with_instance(self):
# return self.eventManager.propagate(self.EVENT_ONFOCUS, [self])
def onclick_with_instance(self):
#return self.eventManager.propagate(self.EVENT_ON_WIDGET_SELECTION, [self])
self.editor.on_widget_selection(self)
def on_dropped(self, left, top):
self.style['left']=left
self.style['top']=top
if __name__ == "__main__":
#p = Project()
#root = p.load('./example_project.py')
#p.append(root, "root")
#p.save(None)
# starts the webserver
# optional parameters
# start(MyApp,address='127.0.0.1', port=8081, multiple_instance=False,enable_file_cache=True, update_interval=0.1, start_browser=True)
start(Editor, debug=False, port=8082)
开发者ID:CSCG,项目名称:remi,代码行数:30,代码来源:editor.py
示例10: api_set_text
# api function
def api_set_text(self, value1, value2):
self.set_text('parameters: %s - %s' % (value1, value2))
headers = {'Content-type': 'text/plain'}
return ['OK', headers]
class MyApp(App):
def __init__(self, *args):
super(MyApp, self).__init__(*args)
def main(self):
wid = gui.VBox()
#the 'id' param allows to have an alias in the url to refer to the widget that will manage the call
self.lbl = RemoteLabel('type in other page url "http://127.0.0.1:8082/label/api_set_text?value1=text1&value2=text2" !', width='80%', height='50%', id='label')
self.lbl.style['margin'] = 'auto'
# appending a widget to another, the first argument is a string key
wid.append(self.lbl)
# returning the root widget
return wid
if __name__ == "__main__":
# starts the webserver
# optional parameters
# start(MyApp,address='127.0.0.1', port=8081, multiple_instance=False,enable_file_cache=True, update_interval=0.1, start_browser=True)
start(MyApp, debug=True, address='127.0.0.1', port=8082)
开发者ID:MrYsLab,项目名称:remi,代码行数:30,代码来源:webAPI_app.py
示例11: MyApp
import remi.gui as gui
from remi import start, App
import os
class MyApp(App):
def __init__(self, *args):
res_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'res')
#static_file_path can be an array of strings allowing to define
# multiple resource path in where the resources will be placed
super(MyApp, self).__init__(*args, static_file_path=res_path)
def idle(self):
""" Idle loop, you can place here custom code,
avoid to use infinite iterations, it would stop gui update.
This is a Thread safe method where you can update the
gui with information from external Threads.
"""
pass
def main(self):
#creating a container VBox type, vertical (you can use also HBox or Widget)
main_container = gui.VBox(width=300, height=200, style={'margin':'0px auto'})
# returning the root widget
return main_container
if __name__ == "__main__":
# starts the webserver
start(MyApp, address='0.0.0.0', port=0, start_browser=True, username=None, password=None)
开发者ID:ElementSyncTech,项目名称:remi,代码行数:30,代码来源:template_app.py
示例12: start
self.dropdown.append(str(i), gui.DropDownItem(200, 20, s))
step_selec.append('0', self.dropdown)
self.img = gui.Image(300, 300, '/res/logo.png')
step_selec.append('1', self.img)
# Second row - Detect / Motor info
motor_info = gui.Widget(350, 500, gui.Widget.LAYOUT_VERTICAL, 10)
self.table = gui.Table(300, 200)
self.table.from_2d_matrix([['ID', 'First Name', 'Last Name'],
['101', 'Danny', 'Young'],
['102', 'Christine', 'Holand'],
['103', 'Lars', 'Gordon'],
['104', 'Roberto', 'Robitaille'],
['105', 'Maria', 'Papadopoulos']])
motor_info.append('0', self.table)
self.configure_btn = gui.Button(200, 30, 'CONFIGURE')
motor_info.append('1', self.configure_btn)
mc.append('0', step_selec)
mc.append('1', motor_info)
self.wid.append('1', self.title_label)
self.wid.append('2', mc)
return self.wid
start(Werborist)
开发者ID:pierre-rouanet,项目名称:werborist,代码行数:30,代码来源:werborist.py
示例13: add_data
self.svgplot.style['margin'] = '10px'
self.plotData1 = gui.SvgPolyline(500)
self.plotData1.set_stroke(2.0, 'rgba(255,0,0,0.8)')
self.plotData2 = gui.SvgPolyline(500)
self.plotData2.set_stroke(1.0, 'green')
self.plotData3 = gui.SvgPolyline(300)
self.plotData3.set_stroke(3.0, 'orange')
self.svgplot.append_poly(self.plotData1)
self.svgplot.append_poly(self.plotData2)
self.svgplot.append_poly(self.plotData3)
self.wid.append(self.svgplot)
self.count = 0
self.add_data()
# returning the root widget
return self.wid
def add_data(self):
self.plotData1.add_coord(self.count, math.atan(self.count / 180.0 * math.pi))
self.plotData2.add_coord(self.count, math.cos(self.count / 180.0 * math.pi))
self.plotData3.add_coord(self.count, math.sin(self.count / 180.0 * math.pi))
self.svgplot.render()
self.count += 1
Timer(0.01, self.add_data).start()
if __name__ == "__main__":
start(MyApp, address='0.0.0.0')
开发者ID:loopbio,项目名称:remi,代码行数:30,代码来源:svgplot_app.py
示例14: start
from remi import start, App
from simple_app import MyApp
if __name__ == "__main__":
start(MyApp, standalone=True)
开发者ID:MrYsLab,项目名称:remi,代码行数:6,代码来源:standalone_app.py
示例15: toolbar_delete_clicked
self.projectConfiguration.show(self)
def toolbar_delete_clicked(self, widget):
if self.selectedWidget==self.project:
return
for drag_helper in self.drag_helpers:
drag_helper.setup(None, None)
parent = self.selectedWidget.get_parent()
parent.remove_child(self.selectedWidget)
self.instancesWidget.update(self.project, self.selectedWidget)
self.selectedWidget = parent
print("tag deleted")
def onkeydown(self, emitter, key, keycode, ctrl, shift, alt):
if str(keycode)=='46': #46 the delete keycode
self.toolbar_delete_clicked(None)
print("Key pressed: " + str(keycode))
def on_dropped(self, left, top):
if len(left)<1:
left='0px'
if len(top)<1:
top='0px'
self.style['left']=left
self.style['top']=top
if __name__ == "__main__":
start(Editor, debug=False, address='0.0.0.0', port=8082, update_interval=0.01, multiple_instance=True)
开发者ID:ElementSyncTech,项目名称:remi,代码行数:30,代码来源:editor.py
示例16: super
res_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'res')
#static_file_path can be an array of strings allowing to define
# multiple resource path in where the resources will be placed
super(MyApp, self).__init__(*args, static_file_path=res_path, html_head=my_html_head, css_head=my_css_head, js_head=my_js_head)
def idle(self):
#idle loop, you can place here custom code
# avoid to use infinite iterations, it would stop gui update
pass
def main(self):
#creating a container VBox type, vertical (you can use also HBox or Widget)
main_container = gui.VBox(width=300, height=200, style={'margin':'0px auto'})
#add the following 3 lines to your app and the on_window_close method to make the console close automatically
tag = gui.Tag(_type='script')
tag.add_child("javascript", """window.onunload=function(e){sendCallback('%s','%s');return "close?";};""" % (str(id(self)), "on_window_close"))
main_container.add_child("onbeforeunloadevent", tag)
# returning the root widget
return main_container
def on_window_close(self):
#here you can handle the unload
self.close()
if __name__ == "__main__":
# starts the webserver
start(MyApp, address='127.0.0.1', port=8081, websocket_port=0, host_name=None, start_browser=True, username=None, password=None)
开发者ID:MrYsLab,项目名称:remi,代码行数:30,代码来源:template_advanced_app.py
示例17: explosion
for coord in [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]:
_x, _y = coord
if not self.coord_in_map(cell.x + _x, cell.y + _y):
continue
if not self.mine_matrix[cell.y + _y][cell.x + _x].opened:
self.mine_matrix[cell.y + _y][cell.x + _x].check_mine(None, False)
checked_cells.append(self.mine_matrix[cell.y + _y][cell.x + _x])
def explosion(self, cell):
print("explosion")
self.mine_table = gui.Table(margin='0px auto')
self.main_container.append(self.mine_table, key="mine_table")
for x in range(0, len(self.mine_matrix[0])):
for y in range(0, len(self.mine_matrix)):
self.mine_matrix[y][x].style['background-color'] = 'red'
self.mine_matrix[y][x].check_mine(None, False)
self.mine_table.empty()
#self.mine_table.append_from_list(self.mine_matrix, False)
for x in range(0, len(self.mine_matrix[0])):
row = gui.TableRow()
for y in range(0, len(self.mine_matrix)):
row.append(self.mine_matrix[y][x])
self.mine_matrix[y][x].onclick.do(self.mine_matrix[y][x].check_mine)
self.mine_table.append(row)
if __name__ == "__main__":
start(MyApp, multiple_instance=True, address='0.0.0.0', port=0, debug=True, start_browser=True )
开发者ID:ElementSyncTech,项目名称:remi,代码行数:30,代码来源:minefield_app.py
示例18: on_bt1_pressed
b1 = gui.Button('Show second tab', width=200, height=30)
tb = gui.TabBox(width='80%')
tb.add_tab(b1, 'First', None)
b2 = gui.Button('Show third tab', width=200, height=30)
tb.add_tab(b2, 'Second', None)
b3 = gui.Button('Show first tab', width=200, height=30)
tb.add_tab(b3, 'Third', None)
b1.onclick.do(self.on_bt1_pressed, tb, b2)
b2.onclick.do(self.on_bt2_pressed, tb, 'Third')
b3.onclick.do(self.on_bt3_pressed, tb, 0)
return tb
def on_bt1_pressed(self, widget, tabbox, refWidgetTab):
tabbox.select_by_widget(refWidgetTab)
def on_bt2_pressed(self, widget, tabbox, refWidgetTabName):
tabbox.select_by_name(refWidgetTabName)
def on_bt3_pressed(self, widget, tabbox, tabIndex):
tabbox.select_by_index(tabIndex)
if __name__ == "__main__":
start(MyApp, title="Tab Demo", standalone=False)
开发者ID:ElementSyncTech,项目名称:remi,代码行数:28,代码来源:tabbox.py
示例19: fill_void_cells
def fill_void_cells(self, cell):
checked_cells = [cell, ]
while len(checked_cells) > 0:
for cell in checked_cells[:]:
checked_cells.remove(cell)
if (not self.mine_matrix[cell.y][cell.x].has_mine) and \
(self.mine_matrix[cell.y][cell.x].nearest_mine == 0):
for coord in [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]:
_x, _y = coord
if not self.coord_in_map(cell.x + _x, cell.y + _y):
continue
if not self.mine_matrix[cell.y + _y][cell.x + _x].opened:
self.mine_matrix[cell.y + _y][cell.x + _x].check_mine(False)
checked_cells.append(self.mine_matrix[cell.y + _y][cell.x + _x])
def explosion(self, cell):
print("explosion")
self.mine_table = gui.Table()
self.main_container.append(self.mine_table, key="mine_table")
for x in range(0, len(self.mine_matrix[0])):
for y in range(0, len(self.mine_matrix)):
self.mine_matrix[y][x].style['background-color'] = 'red'
self.mine_matrix[y][x].check_mine(False)
self.mine_table.from_2d_matrix(self.mine_matrix, False)
if __name__ == "__main__":
start(MyApp, multiple_instance=False, address='0.0.0.0', port=8081, debug=False)
开发者ID:CSCG,项目名称:remi,代码行数:29,代码来源:minefield_app.py
示例20: onchange_comboJustifyContent
mainContainer.append(lblAlignItems,'lblAlignItems')
mainContainer.children['comboJustifyContent'].onchange.do(self.onchange_comboJustifyContent,vbox,hbox)
mainContainer.children['comboAlignItems'].onchange.do(self.onchange_comboAlignItems,vbox,hbox)
lblTitle = gui.Label("The following example shows the two main layout style properties for the VBox and HBox containers. Change the value of the two combo boxes.",
style='position:absolute; left:0px; top:0px')
mainContainer.append(lblTitle)
self.mainContainer = mainContainer
return self.mainContainer
def onchange_comboJustifyContent(self,emitter,new_value,vbox,hbox):
vbox.style['justify-content'] = new_value
hbox.style['justify-content'] = new_value
def onchange_comboAlignItems(self,emitter,new_value,vbox,hbox):
vbox.style['align-items'] = new_value
hbox.style['align-items'] = new_value
#Configuration
configuration = {'config_enable_file_cache': True, 'config_multiple_instance': True, 'config_port': 0, 'config_address': '0.0.0.0', 'config_start_browser': True, 'config_project_name': 'untitled', 'config_resourcepath': './res/'}
if __name__ == "__main__":
# start(MyApp,address='127.0.0.1', port=8081, multiple_instance=False,enable_file_cache=True, update_interval=0.1, start_browser=True)
start(untitled, address=configuration['config_address'], port=configuration['config_port'],
multiple_instance=configuration['config_multiple_instance'],
enable_file_cache=configuration['config_enable_file_cache'],
start_browser=configuration['config_start_browser'])
开发者ID:ElementSyncTech,项目名称:remi,代码行数:30,代码来源:layout_app.py
注:本文中的remi.start函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论