Skip to content

Merged actual used client version in demo #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Aug 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
access.txt
venv/

#################
## Eclipse
Expand Down
2 changes: 0 additions & 2 deletions BlocklyPropClient.linux.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ exe = EXE(pyz,
console=True,
icon='blocklyprop.ico' )
propeller_libs_and_tools = Tree('propeller-tools', prefix='propeller-tools', excludes=['*.pdf', 'windows', 'mac'])
propeller_libs_and_tools += Tree('propeller-lib', prefix='propeller-lib')
propeller_libs_and_tools += Tree('propeller-c-lib', prefix='propeller-c-lib', excludes=['*.html', 'html', '*.doxyfile', '*.side', '*.c'])
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
Expand Down
33 changes: 33 additions & 0 deletions BlocklyPropClient.macos.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- mode: python -*-
a = Analysis(['BlocklyPropClient.py'],

hiddenimports=[],
hookspath=None,
runtime_hooks=None)
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='BlocklyPropClient',
debug=False,
strip=None,
upx=True,
console=False,
windowed=True
)
# icon='blocklyprop.ico'
propeller_libs_and_tools = Tree('propeller-tools', prefix='propeller-tools', excludes=['*.pdf', 'windows', 'linux'])
propeller_libs_and_tools += [('about.txt', 'about.txt', 'About file')]
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
propeller_libs_and_tools,
strip=None,
upx=True,
name='BlocklyPropClient.app',
icon=None,
bundle_identifier=None)

# Analysis
# pathex=['D:\\Development\\python\\BlocklyPropClient'],
112 changes: 48 additions & 64 deletions BlocklyPropClient.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
__author__ = 'Michel & Vale'

import Tkinter as tk
import ttk as ttk
import tkMessageBox
Expand All @@ -11,12 +9,14 @@
import webbrowser
import os
import ip
import sys
import time
import BlocklyServer
from PropC_library_finder import propc_library_finder

__author__ = 'Michel & Vale'

PORT = 6009
VERSION = 0.2
VERSION = 0.4


class BlocklyPropClient(tk.Tk):
Expand All @@ -28,6 +28,9 @@ def __init__(self, *args, **kwargs):
self.version = 0.0
self.connected = False

# Path
self.appdir = os.path.dirname(sys.argv[0])

# initialize config variables
self.ip_address = tk.StringVar()
self.port = tk.StringVar()
Expand Down Expand Up @@ -61,7 +64,7 @@ def initialize(self):

self.lbl_port = ttk.Label(self, anchor=tk.E, text='Port :')
self.lbl_port.grid(column=0, row=1, sticky='nesw')

self.btn_open_browser = ttk.Button(self, text='Open Browser', command=self.handle_browser)
self.btn_open_browser.grid(column=0, row=2, sticky='nesw', padx=3, pady=3)

Expand All @@ -70,12 +73,12 @@ def initialize(self):

self.btn_connect = ttk.Button(self, text='Connect', command=self.handle_connect)
self.btn_connect.grid(column=1, row=2, sticky='nesw', padx=3, pady=3)
self.lbl_current_code = ttk.Label( self, anchor=tk.E, text='Code most recently compiled :' )
self.lbl_current_code.grid(column=0, row=5, sticky='nesw', padx=3, pady=3)
self.current_code = ScrolledText.ScrolledText( self, state='disabled')
self.current_code.grid(column=0, row=6, columnspan=2, sticky='nesw', padx=3, pady=3)

#self.lbl_current_code = ttk.Label( self, anchor=tk.E, text='Code most recently compiled :' )
#self.lbl_current_code.grid(column=0, row=5, sticky='nesw', padx=3, pady=3)

#self.current_code = ScrolledText.ScrolledText( self, state='disabled')
#self.current_code.grid(column=0, row=6, columnspan=2, sticky='nesw', padx=3, pady=3)

self.lbl_log = ttk.Label(self, anchor=tk.W, text='Log :')
self.lbl_log.grid(column=0, row=3, sticky='nesw', padx=3, pady=3)
Expand All @@ -88,7 +91,7 @@ def initialize(self):
#self.check_log_trace = ttk.Checkbutton(self, style='Right.TCheckbutton', text='Trace logging', variable=self.trace_log)
self.check_log_trace = tk.Checkbutton(self, anchor=tk.E, text='Trace logging', variable=self.trace_log, offvalue=1, onvalue=0)
self.check_log_trace.grid(column=1, row=3, sticky='nesw', padx=3, pady=3)

#self.btn_log_checkbox = ttk.Button(self, text='Low level logging: Currently False', command=self.handle_lowlevel_logging)
#self.btn_log_checkbox.grid(column=1, row=3, sticky='nesw', padx=3, pady=3)

Expand All @@ -110,35 +113,31 @@ def initialize(self):
monitor = threading.Thread(target=self.text_catcher)
monitor.daemon = True
monitor.start()

code_monitor = threading.Thread( target=self.code_catcher)
code_monitor.daemon = True
code_monitor.start()


def initialize_menu( self ):
menubar = tk.Menu( self )

file_menu = tk.Menu( menubar, tearoff=0 )
file_menu.add_command( label="Save" )
file_menu.add_command( label="Save As...", command=self.handle_save_as )
file_menu.add_command( label="Open" )
menubar.add_cascade( label="File", menu=file_menu )
# file_menu = tk.Menu( menubar, tearoff=0 )
# file_menu.add_command( label="Save" )
# file_menu.add_command( label="Save As...", command=self.handle_save_as )
# file_menu.add_command( label="Open" )
# menubar.add_cascade( label="File", menu=file_menu )

about_menu = tk.Menu( menubar, tearoff=0 )
about_menu.add_command( label="BlocklyPropClient Source Code", command=self.handle_client_code_browser )
about_menu.add_command( label="BlocklyProp Source Code", command=self.handle_code_browser )
about_menu.add_separator()
about_menu.add_command( label="About", command=self.about_info )
menubar.add_cascade( label="About", menu=about_menu)
options_menu = tk.Menu( menubar, tearoff=0 )
options_menu.add_command( label="Set Library Location", command=self.handle_library_location )
menubar.add_cascade( label="Options", menu=options_menu )
help_menu = tk.Menu( menubar, tearoff=0 )
help_menu.add_command( label="Help" )
menubar.add_cascade( label="Help", menu=help_menu )

# options_menu = tk.Menu( menubar, tearoff=0 )
# options_menu.add_command( label="Set Library Location", command=self.handle_library_location )
# menubar.add_cascade( label="Options", menu=options_menu )

# help_menu = tk.Menu( menubar, tearoff=0 )
# help_menu.add_command( label="Help" )
# menubar.add_cascade( label="Help", menu=help_menu )

self.config( menu=menubar )

def handle_connect(self):
Expand All @@ -162,25 +161,24 @@ def handle_save_as( self ):

file.write( code )
file.close()
tkMessageBox.showinfo( "Info", "The most recently compiled code has been saved to a file successfully" )

tkMessageBox.showinfo("Info", "The most recently compiled code has been saved to a file successfully" )

def handle_browser(self):
webbrowser.open_new( 'http://blocklyprop.creatingfuture.eu' )

def handle_code_browser( self ):
webbrowser.open_new( 'http://github.com/parallaxinc/BlocklyProp' )

def handle_client_code_browser( self ):
webbrowser.open_new( 'http://github.com/parallaxinc/BlocklyPropClient' )

def handle_library_location( self ):
library_finder = propc_library_finder()

tkMessageBox.showinfo( "Info", "Library Location Set To: " + library_finder.get_directory() )

def about_info( self ):
tkMessageBox.showinfo( "About BlocklyProp", "CurrentVersion: v0.2.0\n\nAuthors: Vale Tolpegin & Michel Lampo\n\nRepository Source Code: http://github.com/parallaxinc/BlocklyPropClient\n\nCopyright 2015 Parallax Inc" )
webbrowser.open_new('http://blockly.parallax.com')

def handle_code_browser(self):
webbrowser.open_new('http://github.com/parallaxinc/BlocklyProp')

def handle_client_code_browser(self):
webbrowser.open_new('http://github.com/parallaxinc/BlocklyPropClient')

def about_info(self):
try:
with open(self.appdir + '/about.txt', 'r') as about_file:
tkMessageBox.showinfo("About BlocklyProp", about_file.read())
except:
tkMessageBox.showinfo("About BlocklyProp", "About file is missing")

def handle_close(self):
if tkMessageBox.askokcancel("Quit?", "Are you sure you want to quit?"):
Expand All @@ -190,20 +188,6 @@ def handle_close(self):
self.server_process.terminate()
self.quit()

def code_catcher( self ):
while 1:
try:
code = open( "c_code_file", 'r' ).read()
except:
code = ""

self.current_code['state'] = 'normal'
self.current_code.delete( "1.0", tk.END )
self.current_code.insert( "1.0", code )
self.current_code['state'] = 'disabled'

time.sleep( 2 )

def text_catcher(self):
while 1:
(level, level_name, message) = self.q.get()
Expand All @@ -220,4 +204,4 @@ def text_catcher(self):

bp_client = BlocklyPropClient()
bp_client.set_version(VERSION)
bp_client.mainloop()
bp_client.mainloop()
6 changes: 3 additions & 3 deletions BlocklyPropClient.windows.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ exe = EXE(pyz,
console=False,
icon='blocklyprop.ico' )
propeller_libs_and_tools = Tree('propeller-tools', prefix='propeller-tools', excludes=['*.pdf', 'linux', 'mac'])
propeller_libs_and_tools += Tree('propeller-lib', prefix='propeller-lib')
propeller_libs_and_tools += Tree('propeller-c-lib', prefix='propeller-c-lib', excludes=['*.html', 'html', '*.doxyfile', '*.side', '*.c'])
propeller_libs_and_tools += [('blocklyprop.ico', 'blocklyprop.ico', 'Windows icon')]
#propeller_libs_and_tools += [('blocklyprop.png', 'blocklyprop.png', 'Windows icon')]
propeller_libs_and_tools += [('about.txt', 'about.txt', 'About file')]
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
Expand All @@ -28,4 +28,4 @@ coll = COLLECT(exe,
name='BlocklyPropClient.windows')

# Analysis
# pathex=['D:\\Development\\python\\BlocklyPropClient'],
# pathex=['D:\\Development\\python\\BlocklyPropClient'],
137 changes: 0 additions & 137 deletions BlocklyPropHTTPRequestHandler.py

This file was deleted.

Loading