To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit f24e99e3 authored by scmalte's avatar scmalte
Browse files

Experimenting with scripts

parent 17d67a1a
# mossutils
## Python Package Tutorials
* https://python-packaging.readthedocs.io/en/latest/minimal.html
* https://dev.to/rf_schubert/how-to-create-a-pip-package-and-host-on-private-github-repo-58pa
## Installation
```
$ pip install git+https://gitlab.ethz.ch/scmalte/mossutils.git`
```
import mosspy
print("Keepin' it phonky!")
exit(0)
userid = 3795777 # Malte's MOSS ID
language="cc" # C++
ignoreLimit = 200 # Lines occurring more often are ignored (-m for Moss' Perl script)
numberOfMatchingFiles = 10 # Number of matching files shown in result (-n)
moss = mosspy.Moss(userid, language)
## Configure
moss.setIgnoreLimit(ignoreLimit)
moss.setNumberOfMatchingFiles(numberOfMatchingFiles)
## Add template file(s)
moss.addBaseFile("./template-main.cpp")
# Add submission file
moss.addFilesByWildcard("./*/main.cpp")
url = moss.send() # Submission Report URL
print("Report Url: " + url)
# Save report file
moss.saveWebPage(url, "moss-report.html")
# Download whole report locally including code diff links
mosspy.download_report(url, "_moss-report/", connections=8)
# TODO: Transform moss-report.html and replace remote links to match<n>.html
# with local ones to _moss-report/match<n>.html.
# Check that Mossum still correctly works on the transformed file!
...@@ -9,4 +9,8 @@ setup( ...@@ -9,4 +9,8 @@ setup(
author_email='malte.schwerhoff@inf.ethz.ch', author_email='malte.schwerhoff@inf.ethz.ch',
license='unlicensed', license='unlicensed',
packages=['mossutils'], packages=['mossutils'],
install_requires=[
'mosspy',
],
scripts=['bin/mossutils-moss'],
zip_safe=False) zip_safe=False)
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