Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 36 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ XML Menu Diff

Compare the content of two XML trigger menus.

$ tm-diff [-f|--format <format>] [-s|--skip <mode>] [--sort <key>]
[-d|--dump] [-o <file>]
<file1> <file2>
```bash
tm-diff [-f|--format <format>] [-s|--skip <mode>] [--sort <key>]
[-d|--dump] [-o <file>]
<file1> <file2>
```

### Format

Expand All @@ -23,7 +25,9 @@ Default format is `unified`.

**Example:**

$ tm-diff ... -fhtml -o diff.html # dumps diff as HTML table to file
```bash
tm-diff ... -fhtml -o diff.html # dumps diff as HTML table to file
```

### Skip

Expand All @@ -34,7 +38,9 @@ Use flag `-s|--skip <mode>` to ignore certain attributes. Options are

**Example:**

$ tm-diff ... -smodule -scomment # ignores module_is/index and any comments
```bash
tm-diff ... -smodule -scomment # ignores module_is/index and any comments
```

### Sort

Expand All @@ -53,33 +59,46 @@ option will create two text files with the menu names at the current working loc

**Example:**

$ tm-diff foo.xml bar.xml -d # dumps raw text to foo.xml.txt bar.xml.txt
```bash
tm-diff foo.xml bar.xml -d # dumps raw text to foo.xml.txt bar.xml.txt
```

### Output

Use flag `-o <file>` to write the output to a file.

**Example:**

$ tm-diff foo.xml bar.xml -o diff.txt # write output to file
```bash
tm-diff foo.xml bar.xml -o diff.txt # write output to file
```

This is equivalent to:

$ tm-diff foo.xml bar.xml > diff.txt # pipe stdout to file

```bash
tm-diff foo.xml bar.xml > diff.txt # pipe stdout to file
```

## Dependencies

* `tmTable`
Install following l1t-utm wheel or build l1t-utm python bindings.

* `tmTable>=0.7.3`


**Note:** make sure to set `UTM_ROOT` before executing.
## Install

Install using pip

## Setup
```bash
pip install https://github.com/cms-l1-globaltrigger/tm-diff/archive/master.zip#egg=tm-diff-0.6.0
```

$ . /path/to/utm-0.6.x/setup.sh # source UTM environment
Install from local source

$ git clone https://gitlab.cern.ch/.../tm-diff.git
$ cd tm-diff
$ . setup.sh
$
```bash
git clone https://gitlab.cern.ch/cms-l1-globaltrigger/tm-diff.git
cd tm-diff
python setup.py test
python setup.py install
```
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#tmTable>=0.7.3
17 changes: 12 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
from distutils.core import setup
from tmDiff import __version__ as version
from setuptools import setup

long_description = open('README.md').read()

setup(
name="tm-diff",
version=version,
version='0.6.0',
url="https://github.com/cms-l1-globaltrigger/tm-diff",
author="Bernhard Arnold",
author_email="bernhard.arnold@cern.ch",
description="Compare the content of two XML trigger menus.",
long_description=long_description,
packages=["tmDiff"],
scripts=["scripts/tm-diff"],
packages=['tmDiff'],
install_requires=[
#'tmTable>=0.7.3',
],
entry_points={
'console_scripts': [
'tm-diff = tmDiff.main:main',
],
},
test_suite='tests',
license="GPLv3",
keywords="",
platforms="any",
Expand Down
8 changes: 0 additions & 8 deletions setup.sh

This file was deleted.

Empty file added tests/__init__.py
Empty file.
4 changes: 1 addition & 3 deletions tmDiff/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

__version__ = '0.5.0'
__version__ = '0.6.0'
10 changes: 5 additions & 5 deletions scripts/tm-diff → tmDiff/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import argparse
import sys, os

from tmDiff import menudiff
from tmDiff import __version__
from . import menudiff
from . import __version__

FMT_UNIFIED = 'unified'
FMT_CONTEXT = 'context'
Expand Down Expand Up @@ -112,11 +112,11 @@ def main():
DIFF_FUNCTIONS[args.format](
fromfile=from_menu,
tofile=to_menu,
verbose=args.verbose > 0,
verbose=args.verbose,
ostream=args.ostream
)

sys.exit()
return 0

if __name__ == '__main__':
main()
sys.exit(main())
2 changes: 0 additions & 2 deletions tmDiff/menudiff.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python
#
# Diff for XML menus
#
# The algorithm specific content is extracted into a simple text representation
Expand Down