Skip to content

Commit b30f208

Browse files
committed
Default server port changed from 8081 to 0. Some example changes.
1 parent bb88cef commit b30f208

7 files changed

Lines changed: 8 additions & 34 deletions

File tree

examples/append_and_remove_widgets_app.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@
2323
import os
2424

2525
class MyApp(App):
26-
def __init__(self, *args):
27-
res_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'res')
28-
#static_file_path can be an array of strings allowing to define
29-
# multiple resource path in where the resources will be placed
30-
super(MyApp, self).__init__(*args, static_file_path=res_path)
31-
3226
def main(self):
3327
main_container = gui.VBox()
3428
lbl = gui.Label("Press the buttons to add or remove labels")
@@ -61,5 +55,4 @@ def on_empty_pressed(self, emitter):
6155
self.lbls_container.empty()
6256

6357
if __name__ == "__main__":
64-
# starts the webserver
65-
start(MyApp, address='127.0.0.1', port=8081, start_browser=True, username=None, password=None)
58+
start(MyApp)

examples/closeable_app.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222

2323

2424
class MyApp(App):
25-
def __init__(self, *args):
26-
super(MyApp, self).__init__(*args)
27-
2825
def main(self, name='world'):
2926
# margin 0px auto allows to center the app to the screen
3027
wid = gui.VBox(width=300, height=200, margin='0px auto')
@@ -36,8 +33,6 @@ def main(self, name='world'):
3633
bt.onclick.connect(self.on_button_pressed)
3734

3835
wid.append(bt)
39-
40-
# returning the root widget
4136
return wid
4237

4338
# listener function
@@ -53,7 +48,4 @@ def on_close(self):
5348

5449

5550
if __name__ == "__main__":
56-
# starts the webserver
57-
# optional parameters
58-
# start(MyApp,address='127.0.0.1', port=8081, multiple_instance=False,enable_file_cache=True, update_interval=0.1, start_browser=True)
59-
start(MyApp, debug=True, address='0.0.0.0', start_browser=True)
51+
start(MyApp)

examples/gauge_app.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@ def onmousemove(self, widget, x, y):
156156

157157

158158
class MyApp(App):
159-
def __init__(self, *args):
160-
super(MyApp, self).__init__(*args)
161-
162159
def main(self, name='world'):
163160
self.wid = gui.VBox(margin='0px auto') #margin 0px auto to center the screen
164161

@@ -169,4 +166,4 @@ def main(self, name='world'):
169166
return self.wid
170167

171168
if __name__ == "__main__":
172-
start(MyApp, address='0.0.0.0', port=0)
169+
start(MyApp)

examples/grid_layout_app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,4 @@ def redefine_grid(self, emitter, container):
6060

6161

6262
if __name__ == "__main__":
63-
# starts the webserver
64-
start(MyApp, address='0.0.0.0', port=0, start_browser=True, username=None, password=None)
63+
start(MyApp)

examples/helloworld_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ def __init__(self, *args):
2525
super(MyApp, self).__init__(*args)
2626

2727
def main(self):
28-
#creating a contner VBox type, vertical
28+
#creating a container VBox type, vertical
2929
wid = gui.VBox(width=300, height=200)
3030

31-
#creating a text label
31+
#creating a text label, "white-space":"pre" preserves newline
3232
self.lbl = gui.Label('Hello\n test', width='80%', height='50%', style={"white-space":"pre"})
3333

3434
#a button for simple interaction

examples/onclose_window_app.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717

1818

1919
class MyApp(App):
20-
def __init__(self, *args):
21-
super(MyApp, self).__init__(*args)
22-
2320
def main(self, name='world'):
2421
# margin 0px auto allows to center the app to the screen
2522
wid = gui.VBox(width=300, height=200, margin='0px auto')
@@ -42,8 +39,4 @@ def on_window_close(self):
4239

4340

4441
if __name__ == "__main__":
45-
# starts the webserver
46-
# optional parameters
47-
# start(MyApp,address='127.0.0.1', port=8081, multiple_instance=False,enable_file_cache=True, update_interval=0.1, start_browser=True)
48-
start(MyApp, debug=True, address='0.0.0.0', port=0, start_browser=True) #standalone=True)
49-
print("potatoes")
42+
start(MyApp)

remi/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ def __init__(self, server_address, RequestHandlerClass,
745745

746746
class Server(object):
747747
# noinspection PyShadowingNames
748-
def __init__(self, gui_class, title='', start=True, address='127.0.0.1', port=8081, username=None, password=None,
748+
def __init__(self, gui_class, title='', start=True, address='127.0.0.1', port=0, username=None, password=None,
749749
multiple_instance=False, enable_file_cache=True, update_interval=0.1, start_browser=True,
750750
websocket_timeout_timer_ms=1000, pending_messages_queue_length=1000,
751751
certfile=None, keyfile=None, ssl_version=None, userdata=()):

0 commit comments

Comments
 (0)