Skip to content

Instantly share code, notes, and snippets.

cruise@asharite:/var/lib/cruise-server/pipelines/ars-shortener/ars_shortener$ ./manage.py syncdb --settings=ars_shortener.settings_live
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_manager(settings)
File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 340, in execute_manager
utility.execute()
File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 295, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.5/site-packages/django/core/management/base.py", line 192, in run_from_argv
self.execute(*args, **options.__dict__)
import re
class Parser:
__js_block = re.compile(r"(<script.+?runat=\"proxy\".*?>)(.*?)(</script>)")
__script_start = re.compile(r"<script.+?runat=\"proxy\".*?>")
__script_end = "</script>"
def __init__(self, raw):
self.data = Parser.__js_block.split(raw)
In 2009, the offices will be closed on the following holidays:
* Jan 1 New Year's Day
Jan 2 Day after New Year’s Day
Jan 19 MLK, Jr. Day
Feb 16 President’s Day
* May 25 Memorial Day
* Jul 3 Day before Independence Day
* Sept 7 Labor Day
* Nov 26 Thanksgiving Day
Nov 27 Day after Thanksgiving Day
<script src="includes.js" runat="edge"></script>
<html>
<script runat="edge">Mixer('header.html');</script>
<body>
<script runat="edge">
Mixer('nav2.html', {
timeout: 200, //in ms
errors : {default: 'Failed', not_found: 'Content not found', timeout: 'Content timed out'}
});
<?
class render{
var $set;
public static function template($set, $data){
$tmpl = render::_get_template_for_resource($set, $data);
$render = new render();
$render->set = $set;
render::_template($render, $tmpl, $data);
<? $render->open_layout('standard'); ?>
<? $GLOBALS['category'] = $category; ?>
<h1><?= $category->name ?></h1>
<? if($category->archives){ ?>
<h4>Archives:</h4>
<ul>
<? foreach($category->archives->load() as $archive){ ?>
<li><a href="<?= $archive->url ?>"><?= $render->title($archive) ?></a></li>
<? } ?>
</ul>
<?
$cat_type = $GLOBALS['resource']->is_parent_of($entry) ? 'primary' : 'secondary';
$page_count = count($entry->pages);
$multipage = ($page_count > 1);
$has_extended_body = ($page_count > 0);
?>
<div class="journal-item <?= $cat_type ?> opened">
<h3 class="journal-title">
<? if($cat_type == 'secondary'){ ?><a href="#" class="disclosure collapse">&nbsp;</a><? } ?>
<a href="<?= $entry->url ?>" name="<?= $entry->id ?>" class="<?= $multipage ? "multipage" : "onepage" ?> article-headline"><?= $entry->title ?>
class ResourceList extends ArrayObject{
private static $resolver = '';
private $resolved = false;
public static function set_resolver($method){
self::$resolver = explode('::', $method);
}
public function load(){
if($this->resolved !== false) return $this->resolved;
$this->resolved = array();
<h1><?= $category->name ?></h1>
<? if($category->archives){ ?>
<h4>Archives:</h4>
<ul>
<? foreach($category->archives->load() as $archive){ ?>
<li><a href="<?= $archive->url ?>"><?= category_title($archive) ?></a></li>
<? } ?>
</ul>
<? } ?>
<? if($category->entries){ ?>
<?
require_once('/home/kurt/ars-technica-mt-bits/published/includes_c/classes.inc.php');
$_resource = new Category();
$_resource->entries = array('http://kurt.staging.arstechnica.com/published/2009/01/asdf.php', 'http://kurt.staging.arstechnica.com/published/2009/01/i-am-testing-stuff-here8.php', 'http://kurt.staging.arstechnica.com/published/2009/01/this-is-a-test-of-the-blah-blah-blah-system.php', 'http://kurt.staging.arstechnica.com/published/2007/08/two-more-iphone-ads-all-these-years-and-all-the-parts.php');//Category
$_resource->name = 'apple';
$_resource->children = array(
'http://kurt.staging.arstechnica.com/published/apple/guides/', 'http://kurt.staging.arstechnica.com/published/apple/news/', 'http://kurt.staging.arstechnica.com/published/apple/reviews/', 'http://kurt.staging.arstechnica.com/published/apple/iphone/', 'http://kurt.staging.arstechnica.com/published/apple/mwsf/',