Example #1
0
from xhpy.init import register_xhpy_module
register_xhpy_module('CodeStreak.xhpy.lib')
register_xhpy_module('CodeStreak.xhpy.base')
register_xhpy_module('CodeStreak.xhpy.contest')

from CodeStreak.xhpy.base import *
from CodeStreak.xhpy.contest import *
Example #2
0
from xhpy.init import register_xhpy_module
register_xhpy_module('lightning.ui')
register_xhpy_module('lightning.views')
Example #3
0
File: tests.py Project: lez/xhpy
 def test_lineno_02(self):
   register_xhpy_module('lineno_02')
   from . import lineno_02
   self.assertEqual(7, lineno_02.result[1])
Example #4
0
File: tests.py Project: lez/xhpy
 def test_pep0263_01(self):
   register_xhpy_module('pep0263_01')
   from . import pep0263_01
   self.assertEqual('<p>Andr\xe9</p>', str(pep0263_01.result))
Example #5
0
File: tests.py Project: lez/xhpy
 def test_class_constants(self):
   register_xhpy_module('class_constants')
   from . import class_constants
   self.assertEqual({'etc': 1, 'bar': 2}, class_constants.result)
Example #6
0
File: tests.py Project: lez/xhpy
 def test_docstrings_05(self):
   register_xhpy_module('docstrings_05')
   from . import docstrings_05
   self.assertEqual('b', docstrings_05.result)
Example #7
0
from xhpy.init import register_xhpy_module
register_xhpy_module('post')
from post import render_post, render_index

import codecs
import datetime
import json
import sys
import os
import os.path

def _write_file(html, path):
  filename = os.path.join(root, path)
  dirname = os.path.dirname(filename)
  if not os.path.exists(dirname):
    os.makedirs(dirname)
  with codecs.open(filename, mode='w', encoding='utf-8') as f:
    f.write(html)

sys.stdout = codecs.getwriter('UTF-8')(sys.stdout)
root = sys.argv[1]
posts = [json.loads(line) for line in sys.stdin]
posts.sort(key=lambda post: post['order'])
for i, data in enumerate(posts):
  print u'Generating post: {0}'.format(data['title'])
  data['prev'] = {}
  data['next'] = {}
  if i > 0:
    data['prev'] = posts[i - 1]
  if i < len(posts) - 1:
    data['next'] = posts[i + 1]
Example #8
0
File: tests.py Project: lez/xhpy
 def test_attr_float(self):
   register_xhpy_module('attr_float')
   from . import attr_float
   self.assertEqual('pass', attr_float.result)
Example #9
0
from xhpy.init import register_xhpy_module
register_xhpy_module('foo.ui')
register_xhpy_module('foo.views')
Example #10
0
File: __init__.py Project: candu/cv
# set up XHPy system, hook into UI libraries
from xhpy.init import register_xhpy_module
register_xhpy_module('cv.views')
register_xhpy_module('cv.ui')

# register signal handlers
# TODO: re-enable these. for now, we just want to find out how the
# through association looks so that we can use it in the correct manner...
#import signal_handlers
Example #11
0
 def test_pep0263_01(self):
   register_xhpy_module('pep0263_01')
   import pep0263_01
   self.assertEqual(u'<p>Andr\xe9</p>', unicode(pep0263_01.result))
Example #12
0
 def test_lineno_01(self):
   register_xhpy_module('lineno_01')
   import lineno_01
   self.assertEqual(7, lineno_01.result[1])
Example #13
0
 def test_docstrings_02(self):
   register_xhpy_module('docstrings_02')
   import docstrings_02
   self.assertEqual('b', docstrings_02.result)
Example #14
0
 def test_whitespace_07(self):
   register_xhpy_module('whitespace_07')
   import whitespace_07
   self.assertEqual(u'<a>abc</a>', unicode(whitespace_07.result))
Example #15
0
from xhpy.init import register_xhpy_module

register_xhpy_module("foo")
import foo
Example #16
0
File: tests.py Project: lez/xhpy
 def test_attr_entity(self):
   register_xhpy_module('attr_entity')
   from . import attr_entity
   self.assertEqual('pass', attr_entity.result)
Example #17
0
File: tests.py Project: lez/xhpy
 def test_stack_balance_fail(self):
   register_xhpy_module('stack_balance_fail')
   from . import stack_balance_fail
   self.assertEqual('pass', stack_balance_fail.result)
Example #18
0
File: tests.py Project: lez/xhpy
 def test_attributes(self):
   register_xhpy_module('attributes')
   from . import attributes
   self.assertEqual('pass', attributes.result)
Example #19
0
File: tests.py Project: lez/xhpy
 def test_whitespace_04(self):
   register_xhpy_module('whitespace_04')
   from . import whitespace_04
   self.assertEqual('<a><a></a>a</a>', str(whitespace_04.result))
Example #20
0
File: tests.py Project: lez/xhpy
 def test_docstrings_03(self):
   register_xhpy_module('docstrings_03')
   from . import docstrings_03
   self.assertEqual('c', docstrings_03.result)
Example #21
0
File: tests.py Project: lez/xhpy
 def test_whitespace_05(self):
   register_xhpy_module('whitespace_05')
   from . import whitespace_05
   self.assertEqual('<a>foo</a>', str(whitespace_05.result))
Example #22
0
File: tests.py Project: lez/xhpy
 def test_klass(self):
   register_xhpy_module('klass')
   from . import klass
   self.assertEqual('pass', klass.result)
Example #23
0
File: tests.py Project: lez/xhpy
 def test_whitespace_07(self):
   register_xhpy_module('whitespace_07')
   from . import whitespace_07
   self.assertEqual('<a>abc</a>', str(whitespace_07.result))
Example #24
0
File: tests.py Project: lez/xhpy
 def test_logical_op(self):
   register_xhpy_module('logical_op')
   from . import logical_op
   self.assertEqual(True, logical_op.result)
Example #25
0
File: tests.py Project: lez/xhpy
 def test_xhpy_function_param(self):
   register_xhpy_module('xhpy_function_param')
   from . import xhpy_function_param
   self.assertEqual('pass', xhpy_function_param.result)
Example #26
0
from xhpy.init import register_xhpy_module
register_xhpy_module('ui')
register_xhpy_module('view')
import view
view.render_list([
    "<script>alert('welcome to the jungle')</script>"
])
Example #27
0
File: tests.py Project: lez/xhpy
 def test_array_constant(self):
   register_xhpy_module('array_constant')
   from . import array_constant
   self.assertEqual('pass', array_constant.result)
Example #28
0
File: bar.py Project: lez/xhpy
from xhpy.init import register_xhpy_module
register_xhpy_module('foo')
import foo
Example #29
0
File: tests.py Project: lez/xhpy
 def test_attr_blank(self):
   register_xhpy_module('attr_blank')
   from . import attr_blank
   self.assertEqual('pass', attr_blank.result)
Example #30
0
from xhpy.init import register_xhpy_module
register_xhpy_module('CodeStreak.contests.views')
Example #31
0
 def test_whitespace_05(self):
   register_xhpy_module('whitespace_05')
   import whitespace_05
   self.assertEqual(u'<a>foo</a>', unicode(whitespace_05.result))