# Makefile.
#
-# This file is a part of phd.pp.ru homepage/blog/news generator scripts.
-# Author: Oleg BroytMan <phd@phd.pp.ru>.
-# Copyright: (C) 2006-2009 PhiloSoft Design.
+# This file is a part of phdru.name homepage/blog/news generator scripts.
+# Author: Oleg BroytMan <phd@phdru.name>.
+# Copyright: (C) 2006-2010 PhiloSoft Design.
# __version__ = "$Revision$"[11:-2]
# __revision__ = "$Id$"
# __date__ = "$Date$"[7:-2]
-# __author__ = "Oleg Broytman <phd@phd.pp.ru>"
-# __copyright__ = "Copyright (C) 2006-2009 PhiloSoft Design"
+# __author__ = "Oleg Broytman <phd@phdru.name>"
+# __copyright__ = "Copyright (C) 2006-2010 PhiloSoft Design"
%.py: %.tmpl
@(umask 022; PYTHONPATH=. cheetah fill --nobackup $<)
-.PHONY: phd.pp.ru
-phd.pp.ru: phd_pp_ru.py news blog html
+.PHONY: phdru.name
+phdru.name: phd_site.py news blog html
.PHONY: news
news: atom_10.py rss_20.py
- @(umask 022; PYTHONPATH=. ./make-news.py en ../htdocs/phd.pp.ru && ./make-news.py ru ../htdocs/phd.pp.ru/Russian)
+ @(umask 022; PYTHONPATH=. ./make-news.py en ../htdocs/phdru.name/public_html && ./make-news.py ru ../htdocs/phdru.name/public_html/Russian)
.PHONY: blog
@./reindex_blog_ru
-templates = $(shell find ../htdocs/phd.pp.ru -type f -name \*.tmpl -print)
+templates = $(shell find ../htdocs/phdru.name/public_html -type f -name \*.tmpl -print)
htmls = $(patsubst %.tmpl,%.html,$(templates))
.PHONY: html
<name>$author</name>
<email>$email</email>
</author>
- <generator uri="http://phd.pp.ru/about/make/${generator}.txt">http://phd.pp.ru/about/make/${generator}.txt</generator>
+ <generator uri="http://phdru.name/about/make/${generator}.txt">http://phdru.name/about/make/${generator}.txt</generator>
#for $post in $posts
<entry>
<title>$post.title</title>
__version__ = "$Revision$"[11:-2]
__revision__ = "$Id$"[5:-2]
__date__ = "$Date$"[7:-2]
-__author__ = "Oleg Broytman <phd@phd.pp.ru>"
+__author__ = "Oleg Broytman <phd@phdru.name>"
__copyright__ = "Copyright (C) 2004-2010 PhiloSoft Design"
import os, shutil, filecmp
txt_name = fname
html_file = open(html_fname, 'w')
- html_file.write("#extends phd_pp_ru\n")
+ html_file.write("#extends phd_site\n")
html_file.write("#implements respond\n")
html_file.write("#attr $Title = \"%s\"\n" % dot_name)
html_file.write("#attr $Copyright = 2003\n")
html_file.write(html)
html_file.write("#end raw\n")
html_file.write("#end def\n")
- html_file.write("$phd_pp_ru.respond(self)\n")
+ html_file.write("$phd_site.respond(self)\n")
html_file.close()
#! /bin/sh
-find ../htdocs/phd.pp.ru -type f -name \*.tmpl -print0 | \
+find ../htdocs/phdru.name/public_html -type f -name \*.tmpl -print0 | \
xargs -r0 ./make-files
#! /bin/sh
-find ../htdocs/phd.pp.ru -type f -name \*.tmpl -print | \
+find ../htdocs/phdru.name/public_html -type f -name \*.tmpl -print | \
./make-changed.py | xargs -r ./make-files
import sys, os
-main_tmpl_mtime = os.path.getmtime("phd_pp_ru.tmpl")
-main_prog_mtime = os.path.getmtime("phd_pp.py")
+main_prog_mtime = os.path.getmtime("phd.py")
+main_tmpl_mtime = os.path.getmtime("phd_site.tmpl")
for line in sys.stdin:
line = line.strip()
make = True
else:
make = (src_mtime > dest_mtime) or \
- (main_tmpl_mtime > dest_mtime) or (main_prog_mtime > dest_mtime)
+ (main_prog_mtime > dest_mtime) or (main_tmpl_mtime > dest_mtime)
if make:
print line
PYTHONPATH=.
export PYTHONPATH
-if [ phd_pp_ru.tmpl -nt phd_pp_ru.py ]; then
- cheetah compile --nobackup phd_pp_ru.tmpl
+if [ phd_site.tmpl -nt phd_site.py ]; then
+ cheetah compile --nobackup phd_site.tmpl
fi
exec cheetah fill --nobackup "$@"
#! /bin/sh
-find ../htdocs/phd.pp.ru -type f -name \*.tmpl -mtime -1 -print0 | \
+find ../htdocs/phdru.name/public_html -type f -name \*.tmpl -mtime -1 -print0 | \
xargs -r0 ./make-files
__version__ = "$Revision$"[11:-2]
__revision__ = "$Id$"[5:-2]
__date__ = "$Date$"[7:-2]
-__author__ = "Oleg Broytman <phd@phd.pp.ru>"
+__author__ = "Oleg Broytman <phd@phdru.name>"
__copyright__ = "Copyright (C) 2006-2009 PhiloSoft Design"
new_text.append("""\
</p>
#end def
-$phd_pp_ru.respond(self)
+$phd_site.respond(self)
""")
write_if_changed(os.path.join(root, "news.tmpl"), ''.join(new_text))
namespace = {
"title": "Oleg Broytman's Personal Page - News",
- "baseURL": "http://phd.pp.ru/",
+ "baseURL": "http://phdru.name/",
"indexFile": "news.html",
"description": "",
"lang": lang,
"author": "Oleg Broytman",
- "email": "phd@phd.pp.ru",
+ "email": "phd@phdru.name",
"generator": os.path.basename(sys.argv[0]),
"posts": news_items,
}
if lang == "ru":
namespace["title"] = "Oleg Broytman's Personal Page - Russian News"
- namespace["baseURL"] = baseURL = "http://phd.pp.ru/Russian/"
+ namespace["baseURL"] = baseURL = "http://phdru.name/Russian/"
for item in news_items:
item.baseURL = baseURL
__version__ = "$Revision$"[11:-2]
__revision__ = "$Id$"[5:-2]
__date__ = "$Date$"[7:-2]
-__author__ = "Oleg Broytman <phd@phd.pp.ru>"
-__copyright__ = "Copyright (C) 2006-2009 PhiloSoft Design"
+__author__ = "Oleg Broytman <phd@phdru.name>"
+__copyright__ = "Copyright (C) 2006-2010 PhiloSoft Design"
__docformat__ = "epytext en"
__all__ = ["get_news", "write_if_changed"]
from urlparse import urljoin
class NewsItem(object):
- baseURL = "http://phd.pp.ru/"
+ baseURL = "http://phdru.name/"
excerpt = None
content = None
categoryList = []
-#extends phd_pp_ru
+#extends phd_site
#implements respond
#attr $Title = "Oleg Broytman's Personal Page - News"
#attr $Description = "Broytman News Page Index Document"
-#extends phd_pp_ru
+#extends phd_site
#implements respond
#attr $Title = "Oleg Broytman's Personal Page - News"
#attr $Description = "Broytman News Page Index Document"
full_dirs = len(os.getcwd().split('/')) + 1
-class phd_pp(Template):
+class phd(Template):
def __init__(self, *args, **kw):
if not hasattr(self, "_fileBaseName"):
self._fileDirName, self._fileBaseName = os.path.split(os.path.abspath(self._CHEETAH_src))
#encoding koi8-r
-#extends phd_pp
+#extends phd
#implements respond
#attr $Lead = ''
#attr $Title = ''
<!-- THIS PAGE IS AUTOMATICALLY GENERATED USING CheetahTemplate. DO NOT EDIT. -->
<head>
<meta HTTP-Equiv="Content-Type" content="text/html">
-<meta HTTP-Equiv="Content-Location" content="http://phd.pp.ru$path">
+<meta HTTP-Equiv="Content-Location" content="http://phdru.name$path">
<meta HTTP-Equiv="Last-Modified" content="$last_modified_en">
<title>$Title</title>
#if $refresh:
<meta name="copyright" content="© $full_copyright PhiloSoft Design">
<link rel="copyright" href="$copy_href" title="© $full_copyright PhiloSoft Design">
#end if
-<link rev="made" href="mailto:phd@phd.pp.ru">
+<link rev="made" href="mailto:phd@phdru.name">
<meta name="generator" content="CheetahTemplate">
<meta name="robots" content="index, follow">
#if $root
#end if
<link rel="shortcut icon" href="${root}favicon.ico">
#if not $root
-<link rel="openid.delegate" href="http://phd.pp.ru/">
-<link rel="openid2.local_id" href="http://phd.pp.ru/">
-<link rel="openid.server" href="http://phd.pp.ru/cgi-bin/poit.py">
-<link rel="openid2.provider" href="http://phd.pp.ru/cgi-bin/poit.py">
+<link rel="openid.delegate" href="http://phdru.name/">
+<link rel="openid2.local_id" href="http://phdru.name/">
+<link rel="openid.server" href="http://phdru.name/cgi-bin/poit.py">
+<link rel="openid2.provider" href="http://phdru.name/cgi-bin/poit.py">
#end if
<meta name="MSSmartTagsPreventParsing" content="TRUE"> <!-- MUST DIE -->
</head>
#set $path = $path[:-len("index.html")]
#end if
#if $path.startswith("/Russian/")
-<p class="head" style="font-size: 60%">Эта страница <a href="http://phd.pp.ru$path">http://phd.pp.ru$path</a>
+<p class="head" style="font-size: 60%">Эта страница <a href="http://phdru.name$path">http://phdru.name$path</a>
была сгенерирована $last_modified_ru из шаблона CheetahTemplate <a href="$_fileBaseName">$_fileBaseName</a>;
<a href="${root}Russian/free.html">Некоторые права зарезервированы</a>.
Вы можете узнать <a href="${root}about/">о</a> <a href="${root}about/technical.html">технических</a> аспектах этого сайта.
</p>
#else
-<p class="head" style="font-size: 60%">This is the page <a href="http://phd.pp.ru$path">http://phd.pp.ru$path</a>.
+<p class="head" style="font-size: 60%">This is the page <a href="http://phdru.name$path">http://phdru.name$path</a>.
It was generated on $last_modified_en from CheetahTemplate <a href="$_fileBaseName">$_fileBaseName</a>.
<a href="./${root}free.html">Some rights are reserved</a>.
Read more <a href="${root}about/">about</a> <a href="${root}about/technical.html">technical</a> aspects of the site.
__version__ = "$Revision$"[11:-2]
__revision__ = "$Id$"[5:-2]
__date__ = "$Date$"[7:-2]
-__author__ = "Oleg Broytman <phd@phd.pp.ru>"
+__author__ = "Oleg Broytman <phd@phdru.name>"
__copyright__ = "Copyright (C) 2006-2010 PhiloSoft Design"
new_text = ["""\
## THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
-#extends phd_pp_ru
+#extends phd_site
#implements respond
"""]
new_text.append("""\
#end def
-$phd_pp_ru.respond(self)
+$phd_site.respond(self)
""")
write_if_changed(index_name, ''.join(new_text))
new_text = ["""\
## THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
-#extends phd_pp_ru
+#extends phd_site
#implements respond
#attr $Title = "Oleg Broytman's blog: tags"
#attr $Description = "Broytman Russian Blog Tags Index Document"
tag_text = ["""\
## THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
-#extends phd_pp_ru
+#extends phd_site
#implements respond
#attr $Title = "Oleg Broytman's blog: tag %s"
#attr $Description = "Broytman Russian Blog Tag %s Index Document"
</ul>
</p>
#end def
-$phd_pp_ru.respond(self)
+$phd_site.respond(self)
""")
write_if_changed(os.path.join(blog_root, "tags", tag+".tmpl"), ''.join(tag_text))
</dl>
</p>
#end def
-$phd_pp_ru.respond(self)
+$phd_site.respond(self)
""")
write_if_changed(os.path.join(blog_root, "tags", "index.tmpl"), ''.join(new_text))
from news import NewsItem
if blog_root:
- baseURL = "http://phd.pp.ru/%s/" % blog_root
+ baseURL = "http://phdru.name/%s/" % blog_root
else:
- baseURL = "http://phd.pp.ru/"
+ baseURL = "http://phdru.name/"
items = []
for item in tuple(reversed(all_titles_tags))[:10]:
"description": "",
"lang": "ru",
"author": "Oleg Broytman",
- "email": "phd@phd.pp.ru",
+ "email": "phd@phdru.name",
"generator": os.path.basename(sys.argv[0]),
"posts": items,
}
LC_TIME=ru_RU.KOI8-R
export LC_TIME
-cd ../htdocs/phd.pp.ru && \
-exec ../../phd.pp.ru/reindex_blog.py ../../phd.pp.ru/ru Russian/blog
+cd ../htdocs/phdru.name/public_html && \
+exec ../../../phdru.name/reindex_blog.py ../../../phdru.name/ru Russian/blog
<language>$lang</language>
<webMaster>$author <$email></webMaster>
<lastBuildDate>${posts[0].rfc822_date}</lastBuildDate>
- <generator>http://phd.pp.ru/about/make/${generator}.txt</generator>
+ <generator>http://phdru.name/about/make/${generator}.txt</generator>
#for $post in $posts
<item>
<title>$post.title</title>
cd ../htdocs && \
-ssh phdppru@phd.pp.ru "cd public_html && exec mv .htaccess awstats cgi-bin ../tmp" && \
-distribute -r public_html/ -d phd.pp.ru/ && \
-ssh phdppru@phd.pp.ru "cd tmp && exec mv .htaccess awstats cgi-bin ../public_html" && \
+ssh -4 phdppru@phdru.name 'cd public_html && exec mv .htaccess awstats cgi-bin "$HOME"/tmp' && \
+distribute -r public_html/ -d phdru.name/ && \
+ssh -4 phdppru@phdru.name "cd tmp && exec mv .htaccess awstats cgi-bin ../public_html" && \
-ssh iskra-aviel.phd.pp.ru sitecopy -u fatal.ru by.ru && \
-cd "$HOME" && rsync -avPz iskra-aviel.phd.pp.ru:.sitecopy . && \
+ssh -4 iskra-aviel.phdru.name sitecopy -u fatal.ru by.ru && \
+cd "$HOME" && rsync -avPz iskra-aviel.phdru.name:.sitecopy . && \
exec distribute .sitecopy