Commit ecf65b27 authored by Arnaud Legrand's avatar Arnaud Legrand

Improve portability by using python instead of shell commands

parent d01c3be2
...@@ -52,28 +52,27 @@ ...@@ -52,28 +52,27 @@
reproducible research technology. reproducible research technology.
#+END_abstract #+END_abstract
* Getting the LaTeX packages :noexport: * Getting the LaTeX packages :noexport:
#+begin_src shell :results output :exports both #+begin_src python :session python :results output :exports both
set -e import urllib.request
if which wget; then import os.path
wget --no-check-certificate -O IEEEtran.cls http://mirror.ibcp.fr/pub/CTAN/macros/latex/contrib/IEEEtran/IEEEtran.cls
wget --no-check-certificate -O IEEEtran.bst http://mirrors.ctan.org/macros/latex/contrib/IEEEtran/bibtex/IEEEtran.bst def download_urls(url_list):
else for url,filename in url_list:
if which curl; then if(not(os.path.isfile(filename))):
curl -o IEEEtran.cls http://mirror.ibcp.fr/pub/CTAN/macros/latex/contrib/IEEEtran/IEEEtran.cls urllib.request.urlretrieve(url, filename)
curl -o IEEEtran.bst http://mirrors.ctan.org/macros/latex/contrib/IEEEtran/bibtex/IEEEtran.bst
else download_urls([("http://mirrors.ctan.org/macros/latex/contrib/IEEEtran/IEEEtran.cls","IEEEtran.cls"),
echo "Neither wget nor curl was found!!! Get a real OS!" 1>&2 ("http://mirrors.ctan.org/macros/latex/contrib/IEEEtran/bibtex/IEEEtran.bst","IEEEtran.bst")])
exit 1
fi
fi
#+end_src #+end_src
#+RESULTS:
* Getting the data :noexport: * Getting the data :noexport:
#+begin_src shell :results output raw :exports both #+begin_src python :session python :results output :exports both
wget --no-check-certificate -O measurements.txt https://raw.githubusercontent.com/alegrand/M2R-ParallelQuicksort/master/data/sama_2014-10-13/measurements_03%3A47.txt download_urls([("https://raw.githubusercontent.com/alegrand/M2R-ParallelQuicksort/master/data/sama_2014-10-13/measurements_03%3A47.txt","measurements.txt")])
echo 'file:measurements.txt'
#+end_src #+end_src
#+RESULTS:
* Extracting traces from data files :noexport: * Extracting traces from data files :noexport:
#+begin_src python :results output raw :exports both :var input="measurements.txt" output="data.csv" #+begin_src python :results output raw :exports both :var input="measurements.txt" output="data.csv"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment