import webview
import threading

"""
This example demonstrates creating an open file dialog.
"""

def open_file_dialog():
    import time
    time.sleep(5)
    print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True))


if __name__ == '__main__':
    t = threading.Thread(target=open_file_dialog)
    t.start()

    webview.create_window("Open file dialog example", "http://www.flowrl.com")



import webview
import threading

"""
This example demonstrates creating an open file dialog.
"""

def open_file_dialog():
    import time
    time.sleep(5)
    file_types = ('Image Files (*.bmp;*.jpg;*.gif)', 'All files (*.*)')

    print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True, file_types=file_types))


if __name__ == '__main__':
    t = threading.Thread(target=open_file_dialog)
    t.start()

    webview.create_window("Open file dialog example", "http://www.flowrl.com")



Modify example to include file_types param
[All] Modify example to include file_types param

  import webview
  import threading
  
  """
  This example demonstrates creating an open file dialog.
  """
  
  def open_file_dialog():
      import time
      time.sleep(5)
+     file_types = ('Image Files (*.bmp;*.jpg;*.gif)', 'All files (*.*)')
+ 
-     print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True))
+     print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True, file_types=file_types))
  
  
  if __name__ == '__main__':
      t = threading.Thread(target=open_file_dialog)
      t.start()
  
      webview.create_window("Open file dialog example", "http://www.flowrl.com")
  
  
  
Modify example to include file_types param
## Code Before:
import webview
import threading

"""
This example demonstrates creating an open file dialog.
"""

def open_file_dialog():
    import time
    time.sleep(5)
    print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True))


if __name__ == '__main__':
    t = threading.Thread(target=open_file_dialog)
    t.start()

    webview.create_window("Open file dialog example", "http://www.flowrl.com")



## Instruction:
Modify example to include file_types param
## Code After:
import webview
import threading

"""
This example demonstrates creating an open file dialog.
"""

def open_file_dialog():
    import time
    time.sleep(5)
    file_types = ('Image Files (*.bmp;*.jpg;*.gif)', 'All files (*.*)')

    print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True, file_types=file_types))


if __name__ == '__main__':
    t = threading.Thread(target=open_file_dialog)
    t.start()

    webview.create_window("Open file dialog example", "http://www.flowrl.com")


