示例#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 *
示例#2
0
from xhpy.init import register_xhpy_module
register_xhpy_module('lightning.ui')
register_xhpy_module('lightning.views')
示例#3
0
文件: tests.py 项目: lez/xhpy
 def test_lineno_02(self):
   register_xhpy_module('lineno_02')
   from . import lineno_02
   self.assertEqual(7, lineno_02.result[1])
示例#4
0
文件: tests.py 项目: 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))
示例#5
0
文件: tests.py 项目: 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)
示例#6
0
文件: tests.py 项目: lez/xhpy
 def test_docstrings_05(self):
   register_xhpy_module('docstrings_05')
   from . import docstrings_05
   self.assertEqual('b', docstrings_05.result)
示例#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]
示例#8
0
文件: tests.py 项目: lez/xhpy
 def test_attr_float(self):
   register_xhpy_module('attr_float')
   from . import attr_float
   self.assertEqual('pass', attr_float.result)
示例#9
0
from xhpy.init import register_xhpy_module
register_xhpy_module('foo.ui')
register_xhpy_module('foo.views')
示例#10
0
文件: __init__.py 项目: 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
示例#11
0
文件: tests.py 项目: Scarberian/xhpy
 def test_pep0263_01(self):
   register_xhpy_module('pep0263_01')
   import pep0263_01
   self.assertEqual(u'<p>Andr\xe9</p>', unicode(pep0263_01.result))
示例#12
0
文件: tests.py 项目: Scarberian/xhpy
 def test_lineno_01(self):
   register_xhpy_module('lineno_01')
   import lineno_01
   self.assertEqual(7, lineno_01.result[1])
示例#13
0
文件: tests.py 项目: Scarberian/xhpy
 def test_docstrings_02(self):
   register_xhpy_module('docstrings_02')
   import docstrings_02
   self.assertEqual('b', docstrings_02.result)
示例#14
0
文件: tests.py 项目: Scarberian/xhpy
 def test_whitespace_07(self):
   register_xhpy_module('whitespace_07')
   import whitespace_07
   self.assertEqual(u'<a>abc</a>', unicode(whitespace_07.result))
示例#15
0
文件: bar.py 项目: GunioRobot/xhpy
from xhpy.init import register_xhpy_module

register_xhpy_module("foo")
import foo
示例#16
0
文件: tests.py 项目: lez/xhpy
 def test_attr_entity(self):
   register_xhpy_module('attr_entity')
   from . import attr_entity
   self.assertEqual('pass', attr_entity.result)
示例#17
0
文件: tests.py 项目: 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)
示例#18
0
文件: tests.py 项目: lez/xhpy
 def test_attributes(self):
   register_xhpy_module('attributes')
   from . import attributes
   self.assertEqual('pass', attributes.result)
示例#19
0
文件: tests.py 项目: 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))
示例#20
0
文件: tests.py 项目: lez/xhpy
 def test_docstrings_03(self):
   register_xhpy_module('docstrings_03')
   from . import docstrings_03
   self.assertEqual('c', docstrings_03.result)
示例#21
0
文件: tests.py 项目: 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))
示例#22
0
文件: tests.py 项目: lez/xhpy
 def test_klass(self):
   register_xhpy_module('klass')
   from . import klass
   self.assertEqual('pass', klass.result)
示例#23
0
文件: tests.py 项目: 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))
示例#24
0
文件: tests.py 项目: lez/xhpy
 def test_logical_op(self):
   register_xhpy_module('logical_op')
   from . import logical_op
   self.assertEqual(True, logical_op.result)
示例#25
0
文件: tests.py 项目: 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)
示例#26
0
文件: oops1.py 项目: candu/pycon2012
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>"
])
示例#27
0
文件: tests.py 项目: lez/xhpy
 def test_array_constant(self):
   register_xhpy_module('array_constant')
   from . import array_constant
   self.assertEqual('pass', array_constant.result)
示例#28
0
文件: bar.py 项目: lez/xhpy
from xhpy.init import register_xhpy_module
register_xhpy_module('foo')
import foo
示例#29
0
文件: tests.py 项目: lez/xhpy
 def test_attr_blank(self):
   register_xhpy_module('attr_blank')
   from . import attr_blank
   self.assertEqual('pass', attr_blank.result)
示例#30
0
from xhpy.init import register_xhpy_module
register_xhpy_module('CodeStreak.contests.views')
示例#31
0
文件: tests.py 项目: Scarberian/xhpy
 def test_whitespace_05(self):
   register_xhpy_module('whitespace_05')
   import whitespace_05
   self.assertEqual(u'<a>foo</a>', unicode(whitespace_05.result))