This repository has been archived by the owner on Nov 13, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
146 additions
and
26 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env python | ||
|
||
import pangocairo | ||
import cairo | ||
import pango | ||
import sys | ||
from gtk import gdk | ||
|
||
def usage(): | ||
print "usage: draw_theory_logo.py VERSION OUTPUTFILE" | ||
|
||
def set_context_color(c,color): | ||
col = gdk.color_parse(color) | ||
r = float(col.red) / 65535 | ||
g = float(col.green) / 65535 | ||
b = float(col.blue) / 65535 | ||
c.set_source_rgb(r,g,b) | ||
|
||
def main(): | ||
if len(sys.argv) != 3: | ||
usage() | ||
sys.exit(1) | ||
|
||
version = sys.argv[1] | ||
imgpath = sys.argv[2] | ||
|
||
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 140,24) | ||
ctx = cairo.Context(surface) | ||
c = pangocairo.CairoContext(ctx) | ||
|
||
l = c.create_layout() | ||
font_desc = pango.FontDescription('Grixel Acme 7 Wide Bold 14') | ||
l.set_font_description(font_desc) | ||
fo = cairo.FontOptions() | ||
fo.set_antialias(cairo.ANTIALIAS_NONE) | ||
|
||
c.set_font_options(fo) | ||
pangocairo.context_set_font_options (l.get_context(), fo) | ||
l.set_text('theory') | ||
set_context_color(ctx,'#333333') | ||
ctx.move_to(4,-8) | ||
c.show_layout(l) | ||
c.update_layout(l) | ||
|
||
|
||
l = c.create_layout() | ||
font_desc = pango.FontDescription('Grixel Acme 7 Wide 7') | ||
attr = pango.AttrList() | ||
attr.insert(pango.AttrLetterSpacing(1200,0,100)) | ||
l.set_attributes(attr) | ||
l.set_font_description(font_desc) | ||
fo = cairo.FontOptions() | ||
fo.set_antialias(cairo.ANTIALIAS_NONE) | ||
pangocairo.context_set_font_options (l.get_context(), fo) | ||
l.set_text(version) | ||
ctx.move_to(105,8) | ||
ctx.set_source_rgb (.33,.33,.33) | ||
|
||
c.show_layout(l) | ||
c.update_layout(l) | ||
|
||
surface.write_to_png(imgpath) | ||
|
||
if __name__ == "__main__": | ||
main() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import shutil | ||
import sys | ||
import subprocess | ||
import cairo | ||
|
||
|
||
def main(): | ||
version = '0.1.6' | ||
|
||
script_location = sys.argv[0] | ||
script_path = os.path.abspath(script_location) | ||
app_path = os.sep.join(script_path.split(os.sep)[:-3]) | ||
|
||
src = os.path.join(app_path,'theory') | ||
dest = os.path.join(app_path,"theory-%s" % version) | ||
tar_file = os.path.join(app_path,"theory-%s.tar.bz2" % version) | ||
exclude_file = os.path.join(src,"tar_exclude") | ||
|
||
# draw logo | ||
imgpath = os.path.join(app_path,'theory','theory','public','img','theory-logo.png') | ||
logo_exec = os.path.join(app_path,'theory','scripts','draw_theory_logo.py') | ||
|
||
args = [logo_exec,version,imgpath] | ||
subprocess.call(args) | ||
|
||
# remove destination dir in case it exists | ||
try: | ||
shutil.rmtree(dest) | ||
except OSError: | ||
pass | ||
shutil.copytree(src,dest) | ||
|
||
os.chdir(app_path) | ||
|
||
args = ["tar","jcvf",tar_file,"--exclude-from=%s" % exclude_file,"--exclude-vcs","theory-%s" % version] | ||
|
||
subprocess.call(args) | ||
|
||
|
||
def exclude_check(f): | ||
print "check_exclude: %s" % f | ||
|
||
if __name__ == "__main__": | ||
main() |
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
body { | ||
margin:0; | ||
padding:0; | ||
background-color:#eeeeee; | ||
} | ||
</style> | ||
|
||
|
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