-VERSION=3.3.2
+VERSION=3.4.0
EXAMPLE_SHELL=ns-unescape mz-unescape bkmk2db koi2win.db \
bkmk-koi bkmk-win bkmk-chk bkmk-set bkmk-sort hotexplode.pl \
check_title.py set-real_title.py set-title-list.py.py \
- bkmk-add.py bkmk-add bkmk-rsync
+ bkmk-add.py bkmk-add bkmk-rsync mz2ns
.PHONY: all
import string, os
import time, urllib
-from m_lib.www.util import parse_time
+from m_lib.net.www.util import parse_time
from m_lib.md5wrapper import md5wrapper
from HTMLParser import HTMLParseError
-from m_lib.www.html import HTMLParser as _HTMLParser
+from m_lib.net.www.html import HTMLParser as _HTMLParser
class HTMLHeadDone(Exception): pass
# Write results to output bookmarks files
db2bkmk.py || exit 1
-diff $HOME/.netscape/bookmarks.html bookmarks.html > diff.out
+#diff $HOME/.netscape/bookmarks.html bookmarks.html > diff.out
PATH=$HOME/lib/bookmarks_db:$PATH
-if [ -f ./bookmarks.html ]; then
- BKMK=
-elif [ -f $HOME/.netscape/bookmarks.html ]; then
- BKMK=$HOME/.netscape/bookmarks.html
-else
- echo Cannot find bookmarks.html, aborted
- exit 1
-fi
-
-ns-unescape || exit 1
+mz-unescape || exit 1
bkmk2db || exit 1
#check_db.py -l bookmarks.err || exit 1
towin < private-win.tmp > bookmark.ht0
towin < public-win.tmp > bookmark.ht1
-diff $HOME/.netscape/bookmarks.html bookmarks.html > diff.out
-
-if [ "$1" = "-c" ]; then
- echo -n "Copying to home: "
- cp -p bookmarks.html $HOME/.netscape/bookmarks.html && echo "Ok"
-fi
+#diff $HOME/.netscape/bookmarks.html bookmarks.html > diff.out
+#
+#if [ "$1" = "-c" ]; then
+# echo -n "Copying to home: "
+# cp -p bookmarks.html $HOME/.netscape/bookmarks.html && echo "Ok"
+#fi
remote_server=sun
-rsync -avz "$HOME/.netscape/bookmarks.html" "$remote_server:.netscape" # && \
+#rsync -avz "$HOME/.netscape/bookmarks.html" "$remote_server:.netscape" # && \
#rsync -avz "$HOME/Internet/WWW/phd.pp.ru/Bookmarks/bkmk-koi.html" \
# "$HOME/Internet/WWW/phd.pp.ru/Bookmarks/bkmk-win.html" \
fromwin < bookmark.htm > bookmarks.html || exit 1
-ns-unescape || exit 1
bkmk2db || exit 1
#check_db.py -l bookmarks.err || exit 1
towin < public-win.tmp > bookmark.ht1
-replace() {
- sed "s^$2^$3^" $1 > _tmp.$$
- mv _tmp.$$ $1
-}
+#replace() {
+# sed "s^$2^$3^" $1 > _tmp.$$
+# mv _tmp.$$ $1
+#}
+#
+#replace bookmarks.html http://win.postman.ru/ http://koi.postman.ru/
+#replace public-koi.tmp http://win.postman.ru/ http://koi.postman.ru/
-replace bookmarks.html http://win.aha.ru/ http://koi.aha.ru/
-replace public-koi.tmp http://win.aha.ru/ http://koi.aha.ru/
-replace bookmarks.html http://win.postman.ru/ http://koi.postman.ru/
-replace public-koi.tmp http://win.postman.ru/ http://koi.postman.ru/
-
-if [ "$1" = "-c" ]; then
- echo -n "Copying to home: "
- cp -p bookmarks.html $HOME/.netscape/bookmarks.html && echo "Ok"
-fi
+#if [ "$1" = "-c" ]; then
+# echo -n "Copying to home: "
+# cp -p bookmarks.html $HOME/.netscape/bookmarks.html && echo "Ok"
+#fi
#! /bin/sh
-PATH=$HOME/lib/bookmarks_db:$PATH
+PATH="$HOME/lib/bookmarks_db:$PATH"
+. "$HOME/lib/config/mozilla_home"
if [ ! -f ./bookmarks_db.pickle -a ! -f ./bookmarks_db.flad ]; then
if [ -f ./bookmarks.html ]; then
- BKMK=
- elif [ -f $HOME/.netscape/bookmarks.html ]; then
- BKMK=$HOME/.netscape/bookmarks.html
+ BKMK=bookmarks.html
+ elif [ -f "$mozilla_home/bookmarks.html" ]; then
+ BKMK="$mozilla_home/bookmarks.html"
+ elif [ -f "$HOME/.netscape/bookmarks.html" ]; then
+ BKMK="$HOME/.netscape/bookmarks.html"
else
echo Cannot find bookmarks.html, aborted
exit 1
fi
- bkmk2db.py $BKMK || exit 1
+ bkmk2db.py "$BKMK" || exit 1
elif [ -f ./bookmarks_db.pickle -a -f ./bookmarks.html -a ./bookmarks.html -nt ./bookmarks_db.pickle ]; then
bkmk2db.py || exit 1
"""
Objects to represent bookmarks.html structure
- Written by BroytMann, Mar 2000 - Jul 2002. Copyright (C) 2000-2002 PhiloSoft Design
+ Written by BroytMann, Mar 2000 - Jul 2003. Copyright (C) 2000-2003 PhiloSoft Design
"""
isFolder = 0
isBookmark = 1
- def __init__(self, href, add_date, last_visit, last_modified, comment = ''):
+ def __init__(self, href, add_date, last_visit=None, last_modified=None,
+ comment = ''):
self.comment = comment
self.href = href
self.add_date = add_date
"""
Parser for Netscape Navigator's bookmarks.html
- Written by BroytMann, Jun 1997 - Jun 2002. Copyright (C) 1997-2002 PhiloSoft Design
+ Written by BroytMann, Jun 1997 - Jul 2003. Copyright (C) 1997-2003 PhiloSoft Design
"""
import string
-from m_lib.www.html import HTMLParser
+from m_lib.net.www.html import HTMLParser
from bkmk_objects import Folder, Bookmark, Ruler
# Start bookmark
def start_a(self, attrs):
+ last_visit = None
+ last_modified = None
+
for attrname, value in attrs:
value = string.strip(value)
if attrname == 'href':
bookmarks").
+WHAT'S NEW in version 3.4.0
+ Updated to m_lib version 1.2. Extended support for Mozilla.
+
+
WHAT'S NEW in version 3.3.2
parse_html.py can now recode unicode entities in titles.
#! /bin/sh
-dest_dir=$HOME/.mozilla/phd/`ls -1 $HOME/.mozilla/phd`
+. "$HOME/lib/config/mozilla_home"
sed -e 's/</</g' -e 's/>/>/g' -e 's/&/\&/g' \
- $dest_dir/bookmarks.html >_tmp.$$ && \
-exec mv _tmp.$$ $dest_dir/bookmarks.html
+ "$mozilla_home/bookmarks.html" >_tmp.$$ && \
+exec mv _tmp.$$ "$mozilla_home/bookmarks.html"
#! /bin/sh
sed -e 's/</</g' -e 's/>/>/g' -e 's/&/\&/g' \
- $HOME/.netscape/bookmarks.html >_tmp.$$ && \
-exec mv _tmp.$$ $HOME/.netscape/bookmarks.html
+ "$HOME/.netscape/bookmarks.html" >_tmp.$$ && \
+exec mv _tmp.$$ "$HOME/.netscape/bookmarks.html"