0xGA: Check-in [90c4b69fbd]

Yet another PHP framework, but made for org-mode and geeks.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add poke command to narv script. Take into account already existing articles in narvblog.py index method.
Timelines: family | ancestors | descendants | both | narv
Files: files | file ages | folders
SHA1:90c4b69fbd23a5a2a95ce8f272d4ea4e24da6066
User & Date: milouse 2014-05-21 22:29:11
Context
2014-05-21
22:35
Updated install script check-in: 8b6dde1283 user: milouse tags: narv
22:29
Add poke command to narv script. Take into account already existing articles in narvblog.py index method. check-in: 90c4b69fbd user: milouse tags: narv
2014-05-14
23:00
More complete blog example (with atom feed support, only in french for now...) check-in: 4f674ae9ec user: milouse tags: narv
Changes

Changes to example/narvblog.py.

122
123
124
125
126
127
128
129
130
131

132
133




134
135
136
137
138
139
140
141
142
143
                            art_date = art_date.strftime("%Y-%m-%d %H:%M:%S")

                        title = ''
                        if 'title' in meta_infos:
                            title = meta_infos['title']
                            title = re.sub('"', '', title)

                        article = Article(self.appname, data={
                            'date': art_date,
                            'title': title,

                            'permalink': article_local_path
                        })




                        article.extract_abstract()
                        article.save()
                        total += 1

        logging.info('{0} article(s) have been indexed'.format(total))


    def blog(self):
        self.extension = 'html'








|
|
<
>
|
<
>
>
>
>
|
|
|







122
123
124
125
126
127
128
129
130

131
132

133
134
135
136
137
138
139
140
141
142
143
144
145
146
                            art_date = art_date.strftime("%Y-%m-%d %H:%M:%S")

                        title = ''
                        if 'title' in meta_infos:
                            title = meta_infos['title']
                            title = re.sub('"', '', title)

                        article = Article(self.appname)
                        article.find(article_local_path, 'permalink')


                        if article.is_new():

                            article.date = art_date
                            article.title = title
                            article.permalink = article_local_path
                        
                            article.extract_abstract()
                            article.save()
                            total += 1

        logging.info('{0} article(s) have been indexed'.format(total))


    def blog(self):
        self.extension = 'html'

Changes to narv.

28
29
30
31
32
33
34




35
36
37
38
39
40
41
..
44
45
46
47
48
49
50





















51
52
53
54
55
56
57
...
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
...
438
439
440
441
442
443
444
445

446
447
448
449
450
451
452
EOF
}

function narv_start {
    if [ -f "$WORKINGREP/var/$APPNAME.pid" ] ; then
        echo "Your Narv application is already running."
        exit 1;




    fi

    echo -n "Starting $WORKINGREP/usr/bin/$APPNAME.py"
    $WORKINGREP/usr/bin/$APPNAME.py &
    pgrep -f $APPNAME.py > $WORKINGREP/var/$APPNAME.pid
    echo "                   [OK]"
}
................................................................................
    if [ ! -f "$WORKINGREP/var/$APPNAME.pid" ] ; then
        echo "Your Narv application is NOT running."
        exit 1;
    fi
    echo -n "Stopping $WORKINGREP/usr/bin/$APPNAME.py"
    pkill -f $APPNAME.py
    rm $WORKINGREP/var/$APPNAME.pid





















    echo "                   [OK]"
}

function narv_restart {
    if [ ! -f "$WORKINGREP/var/$APPNAME.pid" ] ; then
        echo "Your Narv application is NOT running."
        exit 1;
................................................................................
                shift
                FOSSILFILE=`realpath $1`
                ;;
            --host|-H)
                shift
                DOMAINNAME=$1
                ;;
            create|deploy|init-chroot|restart|start|stop|-h|'help')
                COMMAND=$1
                ;;
            *)
                APPNAME=$1
                ;;
        esac
        shift
................................................................................
        ;;
    restart)
        narv_restart
        ;;
    init-chroot)
        init_chroot
        ;;
    deploy)

        ;;
    *)
        echo "There's something strange
in your neighborhood.
Who ya gonna call?"
        ;;
esac







>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|







 







|
>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
..
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
...
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
...
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
EOF
}

function narv_start {
    if [ -f "$WORKINGREP/var/$APPNAME.pid" ] ; then
        echo "Your Narv application is already running."
        exit 1;
    elif pgrep -f $APPNAME.py >/dev/null ; then
        pgrep -f $APPNAME.py > $WORKINGREP/var/$APPNAME.pid
        echo "Your Narv application seems to be always running. Try $0 stop $APPNAME"
        exit 1;
    fi

    echo -n "Starting $WORKINGREP/usr/bin/$APPNAME.py"
    $WORKINGREP/usr/bin/$APPNAME.py &
    pgrep -f $APPNAME.py > $WORKINGREP/var/$APPNAME.pid
    echo "                   [OK]"
}
................................................................................
    if [ ! -f "$WORKINGREP/var/$APPNAME.pid" ] ; then
        echo "Your Narv application is NOT running."
        exit 1;
    fi
    echo -n "Stopping $WORKINGREP/usr/bin/$APPNAME.py"
    pkill -f $APPNAME.py
    rm $WORKINGREP/var/$APPNAME.pid
    sleep 2
    if pgrep -f $APPNAME.py >/dev/null ; then
        yup=no
        while [ "$yup" != "yes" ] ; do
            sleep 5
            if pgrep -f $APPNAME.py >/dev/null ; then
                echo
                echo -n "$APPNAME.py does not respond... Kill violently (yes|r[etry]|no)? "
                read yup
                if [ "$yup" = "r" -o "$yup" = "retry" ] ; then
                    pkill -f $APPNAME.py
                fi
            else
                echo "[OK... finally]"
                exit 0
            fi
        done
        pkill -9 -f $APPNAME.py
        echo "Aaaoooww :s"
        exit $?
    fi
    echo "                   [OK]"
}

function narv_restart {
    if [ ! -f "$WORKINGREP/var/$APPNAME.pid" ] ; then
        echo "Your Narv application is NOT running."
        exit 1;
................................................................................
                shift
                FOSSILFILE=`realpath $1`
                ;;
            --host|-H)
                shift
                DOMAINNAME=$1
                ;;
            create|init-chroot|poke|restart|start|stop|-h|'help')
                COMMAND=$1
                ;;
            *)
                APPNAME=$1
                ;;
        esac
        shift
................................................................................
        ;;
    restart)
        narv_restart
        ;;
    init-chroot)
        init_chroot
        ;;
    poke)
        pkill -10 -f $APPNAME.py
        ;;
    *)
        echo "There's something strange
in your neighborhood.
Who ya gonna call?"
        ;;
esac