Skip to content

Commit af4b43f

Browse files
committed
v2.8.0 - add rnx2crx and crx2rnx to PATH
1 parent 4faafe4 commit af4b43f

File tree

5 files changed

+36
-6
lines changed

5 files changed

+36
-6
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
See also [CHANGES.md](rnxcmp/docs/CHANGES.md) of the original RNXCMP software package.
44

5+
## [2.8.0] - 2022-01-27
6+
7+
- `rnx2crx` and `crx2rnx` executables are now added to the PATH.
8+
59
## [2.7.0] - 2022-01-27
610

711
- Updated RNXCMP to version 4.1.0:
@@ -63,6 +67,7 @@ First release.
6367
- Provide Hatanaka decompression / compression support via `crx2rnx` and `rnx2crx` functions.
6468
- Install `crx2rnx` and `rnx2crx` as command line executables.
6569

70+
[2.8.0]: https://github.com/valgur/hatanaka/compare/v2.7.0...v2.8.0
6671
[2.7.0]: https://github.com/valgur/hatanaka/compare/v2.6.0...v2.7.0
6772
[2.6.0]: https://github.com/valgur/hatanaka/compare/v2.5.0...v2.6.0
6873
[2.5.0]: https://github.com/valgur/hatanaka/compare/v2.4.0...v2.5.0

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ rinex-compress 1lsu0010.21o
7070
rinex-decompress < 1lsu0010.21d.Z | grep 'SYS / # / OBS TYPES'
7171
```
7272

73+
Additionally, the original `rnx2crx` and `crx2rnx` executables are also installed for other tools that might want to make use of them, such as RTKLIB.
74+
7375
## Development
7476

7577
### Building from source

hatanaka/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .general_compression import *
22
from .hatanaka import *
33

4-
__version__ = '2.7.0'
4+
__version__ = '2.8.0'
55
rnxcmp_version = '4.1.0'

hatanaka/cli.py

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import argparse
2+
import os
23
import sys
34
from pathlib import Path
4-
from typing import List, Optional
5+
from typing import List
56

67
from hatanaka import __version__, compress, compress_on_disk, decompress, decompress_on_disk, \
78
rnxcmp_version
89
from hatanaka.general_compression import _record_warnings
10+
from hatanaka.hatanaka import _popen
911

1012
__all__ = ['decompress_cli', 'compress_cli']
1113

1214

13-
def decompress_cli(args: Optional[List[str]] = None) -> int:
15+
def decompress_cli(args: List[str] = None) -> int:
1416
if args is None:
1517
args = sys.argv[1:]
1618

@@ -37,7 +39,7 @@ def decompress_cli(args: Optional[List[str]] = None) -> int:
3739
return _run(decompress, decompress_on_disk, args, skip_strange_epochs=args.skip_strange_epochs)
3840

3941

40-
def compress_cli(args: Optional[List[str]] = None) -> int:
42+
def compress_cli(args: List[str] = None) -> int:
4143
if args is None:
4244
args = sys.argv[1:]
4345

@@ -106,3 +108,23 @@ def _add_common_args(parser):
106108
'finishes without any errors and warnings')
107109
parser.add_argument('--version', action='version', version=__version__)
108110
parser.add_argument('--rnxcmp-version', action='version', version=rnxcmp_version)
111+
112+
113+
def _wrap(program, args):
114+
try:
115+
if args is None:
116+
args = sys.argv[1:]
117+
proc = _popen(program, args)
118+
proc.wait()
119+
return proc.returncode
120+
except KeyboardInterrupt:
121+
sys.stderr = open(os.devnull, 'w')
122+
raise
123+
124+
125+
def rnx2crx(args: List[str] = None):
126+
return _wrap('rnx2crx', args)
127+
128+
129+
def crx2rnx(args: List[str] = None):
130+
return _wrap('crx2rnx', args)

setup.cfg

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = hatanaka
3-
version = 2.7.0
3+
version = 2.8.0
44
author = Martin Valgur
55
author_email = [email protected]
66
url = https://github.com/valgur/hatanaka
@@ -13,7 +13,6 @@ keywords =
1313
Hatanaka compression
1414
GNSS
1515
classifiers =
16-
Development Status :: 4 - Beta
1716
License :: OSI Approved :: MIT License
1817
Operating System :: OS Independent
1918
Programming Language :: Python :: 3
@@ -42,3 +41,5 @@ hatanaka.test.data = *
4241
console_scripts =
4342
rinex-decompress = hatanaka.cli:decompress_cli
4443
rinex-compress = hatanaka.cli:compress_cli
44+
rnx2crx = hatanaka.cli:rnx2crx
45+
crx2rnx = hatanaka.cli:crx2rnx

0 commit comments

Comments
 (0)