Skip to content

Commit

Permalink
Change licence in package.json (BSD-3-Clause)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Quentel committed Mar 28, 2017
1 parent 45c9c46 commit bd59bf8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 40 deletions.
2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Python"
],
"author": "Pierre Quentel",
"license": "BSD-2-Clause",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/brython-dev/brython/issues"
},
Expand Down
25 changes: 0 additions & 25 deletions package.json

This file was deleted.

28 changes: 14 additions & 14 deletions www/gallery/sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def enter(self, ev):
# mark all columns between initially selected and the one
# we are entering
clear_selections()
col_start = selected_line.col_num()
col_start = Column(selected_line).col_num()
this_col = Column(self).col_num()
row = self.closest('tr')
if this_col > col_start:
Expand All @@ -207,8 +207,9 @@ def enter(self, ev):
Column(row.childNodes[num]).mark_cells()

def end_select_column(self, ev):
global mouseDown
global mouseDown, selected_line
mouseDown -= 1
selected_line = None

class Column:

Expand Down Expand Up @@ -314,9 +315,10 @@ def coords(td):

class Cell(html.TD):

def __init__(self):
def __init__(self, col_head):
html.TD.__init__(self, contentEditable="true",
style=dict(padding='2px'))
self.col_head = col_head
self.bind("mousedown", self.select)
self.bind("mouseenter", self.mousemove)
self.bind("mouseleave", self.mousemove)
Expand All @@ -336,7 +338,6 @@ def blur(self, ev):

def extend_selection(self, ev):
# mark all cells from selected to ev.target
#ev.target.classList.add('selected')
clear_selections()
c0, r0 = coords(selected)
c1, r1 = coords(ev.target)
Expand Down Expand Up @@ -392,8 +393,7 @@ def keydown(self, ev):
self.move_sel(ev)

def mousemove(self, ev):
print('mouse move')
if mouseDown:
if mouseDown and selected_line is None:
self.extend_selection(ev)

def mouseup(self, ev):
Expand Down Expand Up @@ -468,23 +468,23 @@ def load(sheet_name=None):
rows, cols = 20, 20
col_widths = [100 for i in range(rows)]

line = html.TR()
line <= html.TH()
col_heads = html.TR()
col_heads <= html.TH()
for i in range(cols):
col_name = chr(65+i)
line <= ColumnHead(col_name, Class="col-head",
col_heads <= ColumnHead(col_name, Class="col-head",
style={'min-width':'%spx' %col_widths[i]})
t <= line
t <= col_heads

for i in range(rows*cols):
for i in range(rows * cols):
row, column = divmod(i, cols)
if row>srow:
if row > srow:
line = html.TR()
line <= RowHead(row+1, Class="row-head")
line <= RowHead(row + 1, Class="row-head")
t <= line
srow = row

line <= Cell()
line <= Cell(col_heads.children[column + 1])

panel <= html.DIV(t, style=dict(float='left'))

Expand Down
4 changes: 4 additions & 0 deletions www/src/Lib/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ def to_struct_time(*arg):
arg.append(-1)
return struct_time(tuple(arg))

def wait(secs):
# experimental - replacement for "sleep"
pass

def strptime(string, _format):
import _strptime
return _strptime._strptime_datetime(to_struct_time, string, _format)
Expand Down

0 comments on commit bd59bf8

Please sign in to comment.