Skip to content

Commit 5e64f2f

Browse files
committed
Merge pull request openaps#64 from openaps/dev
stub out dev branch next version
2 parents 65c0c23 + 2a6f2d3 commit 5e64f2f

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed

openaps/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
__version__ = '0.0.7'
2+
__version__ = '0.0.8'
33

openaps/reports/add.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def configure_parser (parser):
2323
def main (args, app):
2424
report = Report(report=args.report, device=args.device, reporter=args.reporter, use=args.use)
2525
task = app.actions.selected(args).usages.commands[args.device].method.commands[report.fields['use']]
26-
params = task.method.get_params(args)
26+
params = task.method.to_ini(args)
2727
for k, v in params.items( ):
2828
report.add_option(k, str(v))
2929
report.store(app.config)

openaps/reports/invoke.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def main (args, app):
2626
# print device.name, device
2727
# print report.name, report.fields
2828
# XXX.bewest: very crude, need to prime the Use's args from the config
29-
app.parser.set_defaults(**report.fields)
29+
app.parser.set_defaults(**task.method.from_ini(report.fields))
3030
args, extra = app.parser.parse_known_args( )
3131
"""
3232
for k, v in report.fields.items( ):
@@ -40,8 +40,14 @@ def main (args, app):
4040
output = task.method(args, app)
4141
except Exception as e:
4242
print(report.name, ' raised ', e, file=sys.stderr)
43+
# save prior progress in git
44+
app.epilog( )
45+
# ensure we still blow up with non-zero exit
4346
raise
4447
else:
4548
reporters.Reporter(report, device, task)(output)
4649
print('reporting', report.name)
47-
repo.index.add([report.name])
50+
repo.git.add([report.name])
51+
# XXX: https://github.com/gitpython-developers/GitPython/issues/265o
52+
# GitPython < 0.3.7, this can corrupt the index
53+
# repo.index.add([report.name])

openaps/uses/use.py

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ def main (self, args, app):
2222
print "HAHA", args, app
2323
"""
2424

25+
def to_ini (self, args):
26+
return self.get_params(args)
27+
28+
def from_ini (self, fields):
29+
return fields
30+
2531
def get_params (self, args):
2632
"""
2733
Return dictionary of all parameters collected from args.

openaps/vendors/medtronic.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,12 @@ class read_bg_targets (SelectedNameCommand):
277277

278278
@use( )
279279
class read_insulin_sensitivies (SameNameCommand):
280-
""" Read insulin sensitivies. """
280+
""" XXX: Deprecated. Don't use. Use read_insulin_sensitivities instead. """
281+
282+
283+
@use( )
284+
class read_insulin_sensitivities (SameNameCommand):
285+
""" Read insulin sensitivities. """
281286

282287

283288
@use( )

openaps/vendors/process.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def set_config (args, device):
3232
def display_device (device):
3333
data = dict(**device.fields)
3434
data.update(**device.extra.fields)
35+
data.update(cmd=device.get('cmd'), args=device.get('args'))
3536
return '/{cmd:s}/{args:s}'.format(**data)
3637

3738
@use( )
@@ -77,7 +78,7 @@ def main (self, args, app):
7778
command.append(getattr(args, opt))
7879
command.extend(getattr(args, 'remainder', []))
7980
command = shlex.split(' '.join(command))
80-
proc = subprocess.Popen(command, stdin=PIPE, stdout=PIPE)
81+
proc = subprocess.Popen(command, stdout=PIPE)
8182
output, stderr = proc.communicate( )
8283
# output = check_output(command, shell=True)
8384
return output

0 commit comments

Comments
 (0)