This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"attribution": "Maps © Stamen\nData © OpenStreetMap contributors", | |
"extension": ".png", | |
"format": "slippy", | |
"name": "Stamen Toner", | |
"source": "maps.stamen.com", | |
"url": "http://tile.stamen.com/toner/{z}/{x}/{y}.png" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"attribution": "Peruskartta © Maanmittauslaitos", | |
"extension": ".png", | |
"format": "slippy", | |
"name": "Kapsi MML peruskartta @1x", | |
"scale": 0.5, | |
"smooth": true, | |
"source": "kartat.kapsi.fi", | |
"url": "http://tiles.kartat.kapsi.fi/peruskartta/{z}/{x}/{y}.png" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyotherside | |
import threading | |
import time | |
def run(): | |
while True: | |
pyotherside.send("test-errors") | |
time.sleep(3) | |
thread = threading.Thread(target=run) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import aeidon | |
project = aeidon.Project() | |
project.open_main("test.srt") | |
for i in range(len(project.subtitles) - 1): | |
end = project.subtitles[i].end_seconds | |
next_start = project.subtitles[i+1].start_seconds | |
if end > next_start: | |
print (i + 1, | |
project.calc.seconds_to_time(end), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from gi.repository import Gtk | |
from gi.repository import Pango | |
def on_text_view_draw(text_view, cairoc): | |
print("Drawing...") | |
# XXX: Rest of function not yet ported. | |
text_buffer = text_view.get_buffer() | |
bounds = text_buffer.get_bounds() | |
text = text_buffer.get_text(*bounds) | |
nlines = text.count("\n") + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import gtk | |
import pango | |
def on_text_view_expose_event(text_view, event): | |
text_buffer = text_view.get_buffer() | |
bounds = text_buffer.get_bounds() | |
text = text_buffer.get_text(*bounds) | |
nlines = text.count("\n") + 1 | |
layout = pango.Layout(text_view.get_pango_context()) | |
layout.set_markup("\n".join([str(x + 1) for x in range(nlines)])) |
NewerOlder