-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #501 from ARGOeu/devel
Version 3.4.5
- Loading branch information
Showing
86 changed files
with
6,382 additions
and
3,565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
RUNASROOT="su -m -s /bin/bash root -c" | ||
PIDS=$(pgrep -f runserver | tr '\n' ' ') | ||
$RUNASROOT "kill -9 $PIDS 2>/dev/null" | ||
|
||
$RUNASROOT ". /home/pyvenv/poem/bin/activate && poem-manage runserver --settings=Poem.settings-devserver 0.0.0.0:8000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/python3 | ||
|
||
import json | ||
import argparse | ||
import os | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser( | ||
"Convert old metric format to new for all the files in the given " | ||
"directory; newly created files will have suffix '-new'" | ||
) | ||
parser.add_argument( | ||
"-d", "--directory", dest="directory", required=True, type=str, | ||
help="directory with the dumped json files" | ||
) | ||
args = parser.parse_args() | ||
|
||
files = [ | ||
os.path.join(args.directory, f) for f in os.listdir(args.directory) if | ||
os.path.isfile(os.path.join(args.directory, f)) | ||
] | ||
|
||
for file in files: | ||
with open(file, "r") as f: | ||
data = json.load(f) | ||
|
||
changed = False | ||
new_data = [item for item in data if item["model"] != "poem.metrictype"] | ||
for item in new_data: | ||
if item["model"] == "poem.metric": | ||
if item["fields"]["probekey"]: | ||
item["fields"]["probeversion"] = \ | ||
f"{item['fields']['probekey'][0]} " \ | ||
f"({item['fields']['probekey'][1]})" | ||
|
||
else: | ||
item["fields"]["probeversion"] = None | ||
|
||
item["fields"].pop("mtype") | ||
item["fields"].pop("probekey") | ||
item["fields"].pop("description") | ||
item["fields"].pop("parent") | ||
item["fields"].pop("probeexecutable") | ||
item["fields"].pop("attribute") | ||
item["fields"].pop("dependancy") | ||
item["fields"].pop("flags") | ||
item["fields"].pop("files") | ||
item["fields"].pop("parameter") | ||
item["fields"].pop("fileparameter") | ||
|
||
changed = True | ||
|
||
if changed: | ||
extension = file.split(".")[-1] | ||
new_name = file.split(f".{extension}")[0] + f"-new.{extension}" | ||
|
||
with open(new_name, "w") as f: | ||
json.dump(new_data, f, indent=4) | ||
|
||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.