Skip to content

Commit

Permalink
Remove whitespace [Gun.io WhitespaceBot]
Browse files Browse the repository at this point in the history
  • Loading branch information
Gun.io Whitespace Robot committed Oct 31, 2011
1 parent 15c337a commit d926e6a
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 28 deletions.
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,20 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc

# Logs and databases #
######################
*.log

# OS generated files #
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
12 changes: 6 additions & 6 deletions example/i18n/trans.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
<h1>{{ _("Internationalized templates") }}</h1> <h1>{{ _("Internationalized templates") }}</h1>


{% trans "Select languages" %} {% trans "Select languages" %}

<a href="?lang=en">{% trans "English" %}</a> | <a href="?lang=en">{% trans "English" %}</a> |
<a href="?lang=fi">{% trans "Finish"%} </a> | <a href="?lang=fi">{% trans "Finish"%} </a> |
<a href="?lang=fr">{% trans "French: %}</a> | <a href="?lang=fr">{% trans "French: %}</a> |
<a href="?lang=de">{% trans "German: %}</a> <a href="?lang=de">{% trans "German: %}</a>


<p> <p>
{% blocktrans %} {% blocktrans %}
(software engineering) The act or process of making a product suitable for (software engineering) The act or process of making a product suitable for
international markets, typically by making text messages easily translatable international markets, typically by making text messages easily translatable
and ensuring support of non-Latin character sets. and ensuring support of non-Latin character sets.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
Expand All @@ -36,7 +36,7 @@ <h2>{% trans "Pluralization support" %}</h2>
there are number of {{ count }} items. there are number of {{ count }} items.
{% endblocktrans %} {% endblocktrans %}
</p> </p>

<ul> <ul>
{% for index, user in users %} {% for index, user in users %}
{{ user.username }} - {{ user.tasks.length }} {{ user.username }} - {{ user.tasks.length }}
Expand All @@ -47,7 +47,7 @@ <h2>{% trans "Pluralization support" %}</h2>
{% plural %} {% plural %}
{{ name }} has {{ count }} tasks {{ name }} has {{ count }} tasks
{% endblocktrans %} {% endblocktrans %}

<ol> <ol>
{% for task in user.tasks %} {% for task in user.tasks %}
<li>{{ task }}</li> <li>{{ task }}</li>
Expand All @@ -59,7 +59,7 @@ <h2>{% trans "Pluralization support" %}</h2>
</div> </div>


<div id="footer"> <div id="footer">

</div> </div>
</body> </body>
</html> </html>
6 changes: 3 additions & 3 deletions example/inheritance/layout.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<h1>My Webpage</h1> <h1>My Webpage</h1>
<h2>My Subtitle</h2> <h2>My Subtitle</h2>
</div> </div>

<div id="navigation"> <div id="navigation">
<ul> <ul>
{% block navigation %} {% block navigation %}
Expand All @@ -34,13 +34,13 @@ <h2>My Subtitle</h2>
{% endblock %} {% endblock %}
</ul> </ul>
</div> </div>

<div id="content"> <div id="content">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
<div id="footer"> <div id="footer">
{% include 'shared/about.html' %} {% include 'shared/about.html' %}

&copy; Copyright 2007 by Yourself &copy; Copyright 2007 by Yourself
</div> </div>
{% endblock %} {% endblock %}
Expand Down
4 changes: 2 additions & 2 deletions example/inheritance/page.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ <h2>Userlist</h2>
<ul> <ul>
{% for user in users %} {% for user in users %}
<li><a href="/users/{{ user.username|urlencode|escape }}">{{ user.username|escape }}</a></li> <li><a href="/users/{{ user.username|urlencode|escape }}">{{ user.username|escape }}</a></li>

{% if not user.username == 'foobar' %} {% if not user.username == 'foobar' %}
haha haha
{% endif %} {% endif %}

{% endfor %} {% endfor %}
</ul> </ul>
{% endblock %} {% endblock %}
6 changes: 3 additions & 3 deletions example/simple/index.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ <h2>Userlist</h2>
{% for user in users limit:3 %} {% for user in users limit:3 %}
<li> <li>
<a href="/users/{{ user.username|urlencode }}">{{ user.username }}</a> - <a href="/users/{{ user.username|urlencode }}">{{ user.username }}</a> -

{{ user.tasks.first | safe }} {{ user.tasks.first | safe }}
</li> </li>

{% if not user.username == 'foobar' %} {% if not user.username == 'foobar' %}
haha haha
{% endif %} {% endif %}

{% endfor %} {% endfor %}
</ul> </ul>


Expand Down
2 changes: 1 addition & 1 deletion example/simple/layout.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h2>My Subtitle</h2>
{% endblock %} {% endblock %}
</ul> </ul>
</div> </div>

<div id="content"> <div id="content">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
Expand Down
16 changes: 8 additions & 8 deletions ext/cache.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,37 +3,37 @@
class Cache_Tag extends H2o_Node { class Cache_Tag extends H2o_Node {
private $cache, $ttl, $uid; private $cache, $ttl, $uid;
var $syntax = '/\d+/'; var $syntax = '/\d+/';

function __construct($argstring, $parser, $pos = 0) { function __construct($argstring, $parser, $pos = 0) {
if (!empty($argstring) && !preg_match($this->syntax, $argstring)) { if (!empty($argstring) && !preg_match($this->syntax, $argstring)) {
throw TemplateSyntaxError('Please specify time to live value for this cache block'); throw TemplateSyntaxError('Please specify time to live value for this cache block');
} }

$this->body = $parser->parse('endcache'); $this->body = $parser->parse('endcache');
$this->uid = md5($parser->filename.$pos); $this->uid = md5($parser->filename.$pos);
$this->ttl = (int) $argstring; $this->ttl = (int) $argstring;

$options = $parser->options; $options = $parser->options;

if ($this->ttl) { if ($this->ttl) {
$options['cache_ttl'] = $this->ttl; $options['cache_ttl'] = $this->ttl;
} }

if (!$options['cache']) { if (!$options['cache']) {
$options['cache'] = 'file'; $options['cache'] = 'file';
} }
$this->cache = h2o_cache($options); $this->cache = h2o_cache($options);
} }

function render($context, $stream) { function render($context, $stream) {
if ($output = $this->cache->read($this->uid)) { if ($output = $this->cache->read($this->uid)) {
$stream->write($output); $stream->write($output);
return; return;
} }

$output = new StreamWriter; $output = new StreamWriter;
$this->body->render($context, $output); $this->body->render($context, $output);

$output = $output->close(); $output = $output->close();
$this->cache->write($this->uid, $output); $this->cache->write($this->uid, $output);


Expand Down
8 changes: 4 additions & 4 deletions ext/design.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function __construct($argstring, $parser, $position = 0) {
$this->mode = $mode? $mode : 'p'; $this->mode = $mode? $mode : 'p';
$this->common = !$random; $this->common = !$random;
} }

function render($context, $stream) { function render($context, $stream) {
$output = ''; $output = '';
switch($this->mode) { switch($this->mode) {
Expand Down Expand Up @@ -45,8 +45,8 @@ function lorem_sentences($count) {
foreach(range(1, $count) as $s) { foreach(range(1, $count) as $s) {
$parts = array(); $parts = array();
foreach (range(1, rand(1,5)) as $j) foreach (range(1, rand(1,5)) as $j)
$parts[] = lorem_words(rand(3,12)); $parts[] = lorem_words(rand(3,12));
$sentenses[] = join(', ', $parts); $sentenses[] = join(', ', $parts);
} }
return join($delimiter[rand(0,1)].' ', $sentenses).$delimiter[rand(0,1)]; return join($delimiter[rand(0,1)].' ', $sentenses).$delimiter[rand(0,1)];
} }
Expand All @@ -56,7 +56,7 @@ function lorem_paragraphs($count, $common = false) {
foreach(range(1, $count) as $s) { foreach(range(1, $count) as $s) {
if ($s == 1 && $common) if ($s == 1 && $common)
$paras[] = lorem_dictionary('common_p'); $paras[] = lorem_dictionary('common_p');
else else
$paras[] = lorem_sentences(rand(1,4)); $paras[] = lorem_sentences(rand(1,4));
} }
return $paras; return $paras;
Expand Down
2 changes: 1 addition & 1 deletion spec/templates/inherit.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
{% block body %} {% block body %}
{{ block.super }} {{ block.super }}
asdf asdf
overwrite overwrite
{% endblock %} {% endblock %}

0 comments on commit d926e6a

Please sign in to comment.