From 42465be8abac2fdb32c939bc7e5ad0fbca5df2f8 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 24 Dec 2010 09:08:05 +0000 Subject: [PATCH] phd.pp.ru => phdru.name. git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@117 7bb0bf08-9e0d-0410-b083-99cee3bf18b8 --- Makefile | 18 +++++++++--------- atom_10.tmpl | 2 +- dotfiles2html/dotfiles2html.py | 6 +++--- make-all | 2 +- make-changed | 2 +- make-changed.py | 6 +++--- make-files | 4 ++-- make-new | 2 +- make-news.py | 10 +++++----- news.py | 6 +++--- news.tmpl-en | 2 +- news.tmpl-ru | 2 +- phd_pp.py => phd.py | 2 +- phd_pp_ru.tmpl => phd_site.tmpl | 18 +++++++++--------- reindex_blog.py | 20 ++++++++++---------- reindex_blog_ru | 4 ++-- rss_20.tmpl | 2 +- update-all | 10 +++++----- 18 files changed, 59 insertions(+), 59 deletions(-) rename phd_pp.py => phd.py (99%) rename phd_pp_ru.tmpl => phd_site.tmpl (89%) diff --git a/Makefile b/Makefile index e5bcbd1..be27920 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,14 @@ # Makefile. # -# This file is a part of phd.pp.ru homepage/blog/news generator scripts. -# Author: Oleg BroytMan . -# Copyright: (C) 2006-2009 PhiloSoft Design. +# This file is a part of phdru.name homepage/blog/news generator scripts. +# Author: Oleg BroytMan . +# Copyright: (C) 2006-2010 PhiloSoft Design. # __version__ = "$Revision$"[11:-2] # __revision__ = "$Id$" # __date__ = "$Date$"[7:-2] -# __author__ = "Oleg Broytman " -# __copyright__ = "Copyright (C) 2006-2009 PhiloSoft Design" +# __author__ = "Oleg Broytman " +# __copyright__ = "Copyright (C) 2006-2010 PhiloSoft Design" %.py: %.tmpl @@ -18,13 +18,13 @@ @(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 @@ -32,7 +32,7 @@ blog: atom_10.py rss_20.py @./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 diff --git a/atom_10.tmpl b/atom_10.tmpl index 1c8ac1b..c8bb7db 100644 --- a/atom_10.tmpl +++ b/atom_10.tmpl @@ -10,7 +10,7 @@ $author $email - http://phd.pp.ru/about/make/${generator}.txt + http://phdru.name/about/make/${generator}.txt #for $post in $posts $post.title diff --git a/dotfiles2html/dotfiles2html.py b/dotfiles2html/dotfiles2html.py index 7c1595a..e7c3a41 100755 --- a/dotfiles2html/dotfiles2html.py +++ b/dotfiles2html/dotfiles2html.py @@ -3,7 +3,7 @@ __version__ = "$Revision$"[11:-2] __revision__ = "$Id$"[5:-2] __date__ = "$Date$"[7:-2] -__author__ = "Oleg Broytman " +__author__ = "Oleg Broytman " __copyright__ = "Copyright (C) 2004-2010 PhiloSoft Design" import os, shutil, filecmp @@ -32,7 +32,7 @@ def add_headers(fname, first, prev, next, last): 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") @@ -51,7 +51,7 @@ def add_headers(fname, first, prev, next, last): 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() diff --git a/make-all b/make-all index 7bc7b88..544d59e 100755 --- a/make-all +++ b/make-all @@ -1,4 +1,4 @@ #! /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 diff --git a/make-changed b/make-changed index a6c1b13..f579a09 100755 --- a/make-changed +++ b/make-changed @@ -1,4 +1,4 @@ #! /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 diff --git a/make-changed.py b/make-changed.py index 31443aa..2464394 100755 --- a/make-changed.py +++ b/make-changed.py @@ -2,8 +2,8 @@ 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() @@ -16,7 +16,7 @@ for line in sys.stdin: 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 diff --git a/make-files b/make-files index 43b9c01..49d5182 100755 --- a/make-files +++ b/make-files @@ -4,8 +4,8 @@ umask 022 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 "$@" diff --git a/make-new b/make-new index f3c359b..5ede80c 100755 --- a/make-new +++ b/make-new @@ -1,4 +1,4 @@ #! /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 diff --git a/make-news.py b/make-news.py index e0779cf..19ed93e 100755 --- a/make-news.py +++ b/make-news.py @@ -4,7 +4,7 @@ __version__ = "$Revision$"[11:-2] __revision__ = "$Id$"[5:-2] __date__ = "$Date$"[7:-2] -__author__ = "Oleg Broytman " +__author__ = "Oleg Broytman " __copyright__ = "Copyright (C) 2006-2009 PhiloSoft Design" @@ -51,7 +51,7 @@ elif lang == "ru": new_text.append("""\

#end def -$phd_pp_ru.respond(self) +$phd_site.respond(self) """) write_if_changed(os.path.join(root, "news.tmpl"), ''.join(new_text)) @@ -62,19 +62,19 @@ from rss_20 import rss_20 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 diff --git a/news.py b/news.py index 0ee2270..f454592 100644 --- a/news.py +++ b/news.py @@ -3,8 +3,8 @@ __version__ = "$Revision$"[11:-2] __revision__ = "$Id$"[5:-2] __date__ = "$Date$"[7:-2] -__author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 2006-2009 PhiloSoft Design" +__author__ = "Oleg Broytman " +__copyright__ = "Copyright (C) 2006-2010 PhiloSoft Design" __docformat__ = "epytext en" __all__ = ["get_news", "write_if_changed"] @@ -14,7 +14,7 @@ from datetime import date from urlparse import urljoin class NewsItem(object): - baseURL = "http://phd.pp.ru/" + baseURL = "http://phdru.name/" excerpt = None content = None categoryList = [] diff --git a/news.tmpl-en b/news.tmpl-en index bd15194..1d00518 100644 --- a/news.tmpl-en +++ b/news.tmpl-en @@ -1,4 +1,4 @@ -#extends phd_pp_ru +#extends phd_site #implements respond #attr $Title = "Oleg Broytman's Personal Page - News" #attr $Description = "Broytman News Page Index Document" diff --git a/news.tmpl-ru b/news.tmpl-ru index ce54afe..7e4c1cb 100644 --- a/news.tmpl-ru +++ b/news.tmpl-ru @@ -1,4 +1,4 @@ -#extends phd_pp_ru +#extends phd_site #implements respond #attr $Title = "Oleg Broytman's Personal Page - News" #attr $Description = "Broytman News Page Index Document" diff --git a/phd_pp.py b/phd.py similarity index 99% rename from phd_pp.py rename to phd.py index d4b2e32..e12fb90 100644 --- a/phd_pp.py +++ b/phd.py @@ -11,7 +11,7 @@ def _url2href(match): 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)) diff --git a/phd_pp_ru.tmpl b/phd_site.tmpl similarity index 89% rename from phd_pp_ru.tmpl rename to phd_site.tmpl index 8f9effb..bf636a4 100644 --- a/phd_pp_ru.tmpl +++ b/phd_site.tmpl @@ -1,5 +1,5 @@ #encoding koi8-r -#extends phd_pp +#extends phd #implements respond #attr $Lead = '' #attr $Title = '' @@ -24,7 +24,7 @@ - + $Title #if $refresh: @@ -50,7 +50,7 @@ #end if - + #if $root @@ -96,10 +96,10 @@ $style #end if #if not $root - - - - + + + + #end if @@ -134,13 +134,13 @@ $link_tag($tag) #set $path = $path[:-len("index.html")] #end if #if $path.startswith("/Russian/") -

üÔÁ ÓÔÒÁÎÉÃÁ http://phd.pp.ru$path +

üÔÁ ÓÔÒÁÎÉÃÁ http://phdru.name$path ÂÙÌÁ ÓÇÅÎÅÒÉÒÏ×ÁÎÁ $last_modified_ru ÉÚ ÛÁÂÌÏÎÁ CheetahTemplate $_fileBaseName; îÅËÏÔÏÒÙÅ ÐÒÁ×Á ÚÁÒÅÚÅÒ×ÉÒÏ×ÁÎÙ. ÷Ù ÍÏÖÅÔÅ ÕÚÎÁÔØ Ï ÔÅÈÎÉÞÅÓËÉÈ ÁÓÐÅËÔÁÈ ÜÔÏÇÏ ÓÁÊÔÁ.

#else -

This is the page http://phd.pp.ru$path. +

This is the page http://phdru.name$path. It was generated on $last_modified_en from CheetahTemplate $_fileBaseName. Some rights are reserved. Read more about technical aspects of the site. diff --git a/reindex_blog.py b/reindex_blog.py index cc9a540..6c2717c 100755 --- a/reindex_blog.py +++ b/reindex_blog.py @@ -4,7 +4,7 @@ __version__ = "$Revision$"[11:-2] __revision__ = "$Id$"[5:-2] __date__ = "$Date$"[7:-2] -__author__ = "Oleg Broytman " +__author__ = "Oleg Broytman " __copyright__ = "Copyright (C) 2006-2010 PhiloSoft Design" @@ -128,7 +128,7 @@ def write_template(level, year, month, day, titles, tags=None): new_text = ["""\ ## THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. -#extends phd_pp_ru +#extends phd_site #implements respond """] @@ -281,7 +281,7 @@ def write_template(level, year, month, day, titles, tags=None): new_text.append("""\ #end def -$phd_pp_ru.respond(self) +$phd_site.respond(self) """) write_if_changed(index_name, ''.join(new_text)) @@ -334,7 +334,7 @@ write_template(0, year, month, day, all_titles[-20:], all_tags) 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" @@ -365,7 +365,7 @@ for i, (count, tag, links) in enumerate(all_tags): 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" @@ -414,7 +414,7 @@ for i, (count, tag, links) in enumerate(all_tags):

#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)) @@ -422,7 +422,7 @@ new_text.append("""\

#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)) @@ -502,9 +502,9 @@ from rss_20 import rss_20 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]: @@ -529,7 +529,7 @@ namespace = { "description": "", "lang": "ru", "author": "Oleg Broytman", - "email": "phd@phd.pp.ru", + "email": "phd@phdru.name", "generator": os.path.basename(sys.argv[0]), "posts": items, } diff --git a/reindex_blog_ru b/reindex_blog_ru index c881635..795047d 100755 --- a/reindex_blog_ru +++ b/reindex_blog_ru @@ -5,5 +5,5 @@ umask 022 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 diff --git a/rss_20.tmpl b/rss_20.tmpl index 84149ba..9719df8 100644 --- a/rss_20.tmpl +++ b/rss_20.tmpl @@ -7,7 +7,7 @@ $lang $author <$email> ${posts[0].rfc822_date} - http://phd.pp.ru/about/make/${generator}.txt + http://phdru.name/about/make/${generator}.txt #for $post in $posts $post.title diff --git a/update-all b/update-all index 67c24cd..31b39d5 100755 --- a/update-all +++ b/update-all @@ -2,10 +2,10 @@ 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 -- 2.39.5