Skip to content

Commit f4d6768

Browse files
Merge pull request #2 from pbauermeister/refactoring
Refactoring
2 parents 34e9f01 + 965fbb8 commit f4d6768

26 files changed

+709
-458
lines changed

CHANGES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changes
2+
3+
## Version 2.0.6
4+
- use more recent setuptools.
5+
- use Typing and mypy.
6+
- require Python 3.10 or upper.
7+
8+
## Version 2.0.5 and below
9+
- Rewrite of https://github.com/pbauermeister/umlsequence in pure
10+
Python (+ reportlab).

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
umlsequence2
22
============
33

4-
UML Sequence Diagrams Generator - Commandline tool to generate
4+
UML Sequence Diagrams Generator, version 2<sup>[1]</sup> -
5+
Commandline tool to generate
56
diagrams as images in various formats (SVG, PNG, JPG, PDF, etc.) from
67
source text files.
78

8-
Source code: https://github.com/pbauermeister/umlsequence2
9+
- Source code: https://github.com/pbauermeister/umlsequence2
10+
- Package page: https://pypi.org/project/umlsequence2/
911

10-
(This is a pure-Python rewrite of the
12+
<sub>[1] This is a pure-Python rewrite of the
1113
https://github.com/pbauermeister/umlsequence project, which was itself
12-
based on umlgraph by Diomidis Spinellis.)
14+
based on umlgraph (in Java) by Diomidis Spinellis.</sub>
15+
16+
## Scope
17+
18+
"*A sequence diagram or system sequence diagram (SSD) shows process interactions
19+
arranged in time sequence in the field of software engineering. It depicts the
20+
processes involved and the sequence of messages exchanged between the processes
21+
needed to carry out the functionality.*"
22+
-- [Wikipedia](https://en.wikipedia.org/wiki/Sequence_diagram)
23+
## Summary
1324

1425
Source text files are in the so-called "umlsequence" syntax.
1526

@@ -20,21 +31,21 @@ Umlsequence syntax example:
2031
T : t:thread
2132
O : :Toolkit
2233
P :
23-
34+
2435
# messages and activations
2536
E -> T+ a1:run(3)
2637
T -> O+ run()
2738
O >callbackLoop()
28-
39+
2940
# creation
3041
O+ :> P p:Peer
31-
42+
3243
# message with response
3344
O- => P result=handleExpose()
34-
45+
3546
# destruction
3647
O #> P
37-
48+
3849
# deactivation
3950
T- O-
4051

TODO.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# TODO:
2+
3+
- in uml_builder, move keywords to constants defined in model
4+
- in parser, move preprocess to own module
5+
- in parser, refactor regex and handling
6+
- in parser, refactor horrendous do_line() in smaller functions.
7+

build-testpypi.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

build.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
. ./set-ex.sh
3+
4+
banner2 "Cleaning up"
5+
./clean.sh
6+
7+
banner2 "Linting"
8+
./lint.sh
9+
10+
# TODO:
11+
#banner2 "Testing"
12+
#./test.sh
13+
14+
banner2 "Making doc"
15+
./make-doc.sh

clean.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
clean() {
6+
$1 rm -rf build/ dist/ src/*.egg-info/ $(find -name __pycache__)
7+
}
8+
9+
clean || clean sudo

examples/example.svg

Lines changed: 2 additions & 0 deletions
Loading

install-locally.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
. ./set-ex.sh
3+
4+
WHAT=umlsequence2
5+
6+
./build.sh
7+
8+
yes | pip3 uninstall $WHAT 2>/dev/null || true
9+
yes | sudo pip3 uninstall $WHAT
10+
11+
python3 setup.py build
12+
13+
sudo python3 setup.py install

lint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -ex
3+
4+
MYPY_OPTS=""
5+
MYPY_OPTS+=" --warn-redundant-casts"
6+
MYPY_OPTS+=" --warn-return-any"
7+
#MYPY_OPTS+=" --warn-unreachable"
8+
MYPY_OPTS+=" --strict-equality"
9+
MYPY_OPTS+=" --strict --namespace-packages"
10+
11+
#SRCS=$(find src tests -name "*.py")
12+
SRCS=$(find src -name "*.py")
13+
mypy --ignore-missing-imports --pretty $MYPY_OPTS --no-strict-optional $SRCS

make-doc.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
. ./set-ex.sh
3+
4+
WHAT=umlsequence2
5+
6+
#OPTS=--debug
7+
OPTS=
8+
9+
for dir in doc examples; do (
10+
cd $dir
11+
12+
rm -f *.svg
13+
14+
if ls *.md; then
15+
for doc in *.md; do
16+
../$WHAT $OPTS $doc --markdown
17+
done
18+
fi
19+
20+
if ls *.umlsequence; then
21+
for doc in *.umlsequence; do
22+
../$WHAT $OPTS $doc
23+
done
24+
fi
25+
)
26+
done
27+
28+
./$WHAT README.md --markdown

0 commit comments

Comments
 (0)