Skip to content

tmg2html in localupdate.sh #95

Closed
Closed

Description

@yakra

Once the symbolic link to the tmg2html executable is in place, how would I want to include tmg2html in localupdate.sh?

Would I want to change:

if [ "$graphflag" != "-k" ]; then
mv $tmwebbase/$graphdir $tmpdir/$datestr
mv $datestr/$graphdir $tmwebbase
fi

to something like this?

if [ "$graphflag" != "-k" ]; then
    graphs="ls "$datestr/$graphdir"/*.tmg"
    for g in $graphs
    do
        tmg2html $g $g".html"                                        
    done
    mv $tmwebbase/$graphdir $tmpdir/$datestr
    mv $datestr/$graphdir $tmwebbase
fi

Activity

  1. jteresco commented on Sep 9, 2018

    @jteresco
    Contributor

    You can see how I did this for nmpfilter in the latest localupdate.sh .

  2. yakra commented on Sep 9, 2018

    @yakra
    ContributorAuthor

    nmpfilter only needs to be run once; it creates .nmp files for all regions.
    tmg2html, OTOH, only processes one .tmg file at a time, so it needs to be run from a for loop inside the shell script.

  3. jteresco commented on Sep 9, 2018

    @jteresco
    Contributor

    It might be easier to call it from Python as each .tmg file is created. If this is done every time graphs are generated, links to the .html versions could be added to http://travelmapping.net/graphs/ also.

  4. yakra commented on Sep 11, 2018

    @yakra
    ContributorAuthor

    If that could work, then that could work...
    You can call/run other programs using the OS module then, I take it?
    I'm divided on whether it could be a Good Thing though. Seems it may be better practice to not make siteupdate.py too reliant on a patchwork of other programs that may or may not be there, especially if someone is setting up their first instance of the site.
    Two cents.

  5. jteresco commented on Sep 11, 2018

    @jteresco
    Contributor

    Yes, there is some benefit in keeping things relatively simple. One possibility is to have the equivalent functionality (in Python) right in siteupdate.py.

    We can at the least check for existence of the program before trying to execute, like how the nmpfilter in localupdate.sh is protected in

    if [ -x ../../nmpfilter/nmpfilter ]; then
    
  6. jteresco commented on Dec 31, 2022

    @jteresco
    Contributor

    Are we still interested in tmg2html support?

  7. yakra commented on Dec 31, 2022

    @yakra
    ContributorAuthor

    Nah. I almost never use it anymore. Can't remember the last time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions