Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File changes which can be handled by argument #3

Open
drdhaval2785 opened this issue Jul 14, 2019 · 5 comments
Open

File changes which can be handled by argument #3

drdhaval2785 opened this issue Jul 14, 2019 · 5 comments

Comments

@drdhaval2785
Copy link

drdhaval2785 commented Jul 14, 2019

sqlite/redo.sh

https://github.com/sanskrit-lexicon/csl-websanlexicon/blob/master/v00/makotemplates/sqlite/redo.sh

Current version

echo "remaking input.txt..."
php make_input.php ../../pywork/${dictlo}.xml input.txt
rm ${dictlo}.sqlite
echo "remaking sqlite table..."
sqlite3 ${dictlo}.sqlite < def.sql

Suggested version

# Usage - sh redo.sh dictcode
if [ $# -eq 0 ]
  then
    echo "Error: No arguments supplied"
    echo "Correct usage - sh redo.sh dictcode"
    exit
fi
echo "remaking input.txt..."
php make_input.php ../../pywork/$1.xml input.txt
rm $1.sqlite
echo "remaking sqlite table..."
sqlite3 $1.sqlite < def.sql
@drdhaval2785
Copy link
Author

drdhaval2785 commented Jul 14, 2019

webtc/dictinfo.php

https://github.com/sanskrit-lexicon/csl-websanlexicon/blob/master/v00/makotemplates/webtc/dictinfo.php

Only one line uses mako templating.

public $year = '${dictyear}';  # used in get_cologne_webPath method

This item can be pushed to webtc/dictcode.php which uses and must use mako template.
Then webtc/dictinfo.php can do require_once('dictcode.php'); and use it the way it wants.

@drdhaval2785
Copy link
Author

drdhaval2785 commented Jul 14, 2019

webtc2/init_query.sh

python init_query.py ../../pywork/${dictlo}.xml query_dump.txt

to be changed to

# Usage - sh init_query.sh dictcode
if [ $# -eq 0 ]
  then
    echo "Error: No arguments supplied"
    echo "Correct usage - sh init_query.sh dictcode"
    exit
fi
python init_query.py ../../pywork/$1.xml query_dump.txt

@drdhaval2785
Copy link
Author

This completes my survey of https://github.com/sanskrit-lexicon/csl-websanlexicon/blob/master/v00/inventory.txt for proper marking of C or T

@drdhaval2785
Copy link
Author

@funderburkjim would like to evaluate the pros and cons of making the code generic at cost of one additional argument v/s duplicating the codes by templates with one argument less.

I feel that anyways You and I will be the only people to use these shell files. So we can remember to use it with an argument / without it. Not much of a problem.

Whatever you choose, I am OK with it.

@funderburkjim
Copy link
Owner

csl-websanlexicon

https://github.com/sanskrit-lexicon/csl-websanlexicon is now the current repository. The one here in funderburkjim should be considered obsolete. In fact, I am now changing the name of the funderburkjim repository to old-websanlexicon (and similarly for sanlexhome and apidev -- current versions also in sanskrit-lexicon project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants