psdi-data-conversion 0.0.35__py3-none-any.whl → 0.0.37__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. psdi_data_conversion/app.py +110 -10
  2. psdi_data_conversion/constants.py +2 -0
  3. psdi_data_conversion/converter.py +16 -6
  4. psdi_data_conversion/converters/atomsk.py +3 -1
  5. psdi_data_conversion/converters/base.py +99 -39
  6. psdi_data_conversion/converters/c2x.py +3 -1
  7. psdi_data_conversion/converters/openbabel.py +40 -1
  8. psdi_data_conversion/database.py +5 -0
  9. psdi_data_conversion/main.py +18 -10
  10. psdi_data_conversion/static/content/accessibility.htm +5 -5
  11. psdi_data_conversion/static/content/convert.htm +18 -13
  12. psdi_data_conversion/static/content/convertato.htm +40 -33
  13. psdi_data_conversion/static/content/convertc2x.htm +40 -33
  14. psdi_data_conversion/static/content/documentation.htm +4 -4
  15. psdi_data_conversion/static/content/download.htm +26 -10
  16. psdi_data_conversion/static/content/feedback.htm +4 -4
  17. psdi_data_conversion/static/content/index-versions/psdi-common-header.html +1 -1
  18. psdi_data_conversion/static/content/psdi-common-header.html +1 -1
  19. psdi_data_conversion/static/content/report.htm +9 -7
  20. psdi_data_conversion/static/javascript/common.js +20 -0
  21. psdi_data_conversion/static/javascript/convert.js +1 -2
  22. psdi_data_conversion/static/javascript/convert_common.js +80 -7
  23. psdi_data_conversion/static/javascript/convertato.js +1 -2
  24. psdi_data_conversion/static/javascript/convertc2x.js +1 -2
  25. psdi_data_conversion/static/javascript/format.js +12 -0
  26. psdi_data_conversion/static/javascript/report.js +6 -0
  27. psdi_data_conversion/static/styles/format.css +0 -6
  28. psdi_data_conversion/static/styles/psdi-common.css +10 -6
  29. psdi_data_conversion/templates/index.htm +10 -2
  30. psdi_data_conversion/testing/constants.py +6 -3
  31. psdi_data_conversion/testing/conversion_callbacks.py +7 -6
  32. psdi_data_conversion/testing/conversion_test_specs.py +333 -153
  33. psdi_data_conversion/testing/gui.py +366 -0
  34. psdi_data_conversion/testing/utils.py +108 -51
  35. {psdi_data_conversion-0.0.35.dist-info → psdi_data_conversion-0.0.37.dist-info}/METADATA +90 -51
  36. {psdi_data_conversion-0.0.35.dist-info → psdi_data_conversion-0.0.37.dist-info}/RECORD +39 -38
  37. {psdi_data_conversion-0.0.35.dist-info → psdi_data_conversion-0.0.37.dist-info}/WHEEL +1 -1
  38. {psdi_data_conversion-0.0.35.dist-info → psdi_data_conversion-0.0.37.dist-info}/entry_points.txt +1 -0
  39. {psdi_data_conversion-0.0.35.dist-info → psdi_data_conversion-0.0.37.dist-info}/licenses/LICENSE +0 -0
@@ -371,7 +371,7 @@ def detail_converter_use(args: ConvertArgs):
371
371
  if format_name in l_formats:
372
372
  optional_not: str = ""
373
373
  else:
374
- optional_not: str = " not"
374
+ optional_not: str = "not "
375
375
  print_wrap(f"Conversion {to_or_from} {format_name} is {optional_not}supported by {args.name}.\n")
376
376
 
377
377
  # List all possible formats, and which can be used for input and which for output
@@ -551,12 +551,12 @@ def detail_possible_converters(from_format: str, to_format: str):
551
551
  return
552
552
 
553
553
  print_wrap(f"The following registered converters can convert from {from_format} to {to_format}:", newline=True)
554
- print("\n ".join(l_possible_registered_converters))
554
+ print(" " + "\n ".join(l_possible_registered_converters) + "\n")
555
555
  if l_possible_unregistered_converters:
556
556
  print("")
557
557
  print_wrap("Additionally, the following converters are supported by this package on other platforms and can "
558
558
  "perform this conversion:", newline=True)
559
- print("\n ".join(l_possible_registered_converters))
559
+ print(" " + "\n ".join(l_possible_unregistered_converters) + "\n")
560
560
 
561
561
  print_wrap("For details on input/output flags and options allowed by a converter for this conversion, call:")
562
562
  print(f"{CL_SCRIPT_NAME} -l <converter name> -f {from_format} -t {to_format}")
@@ -694,26 +694,34 @@ def run_from_args(args: ConvertArgs):
694
694
  delete_input=args.delete_input,
695
695
  refresh_local_log=False)
696
696
  except FileConverterHelpException as e:
697
- print_wrap(f"ERROR: {e}", err=True)
697
+ if not e.logged:
698
+ print_wrap(f"ERROR: {e}", err=True)
699
+ e.logged = True
698
700
  success = False
699
701
  continue
700
702
  except FileConverterAbortException as e:
701
- print_wrap(f"ERROR: Attempt to convert file {filename} aborted with status code {e.status_code} and "
702
- f"message:\n{e}\n", err=True)
703
+ if not e.logged:
704
+ print_wrap(f"ERROR: Attempt to convert file {filename} aborted with status code {e.status_code} and "
705
+ f"message:\n{e}\n", err=True)
706
+ e.logged = True
703
707
  success = False
704
708
  continue
705
709
  except FileConverterInputException as e:
706
710
  if "Conversion from" in str(e) and "is not supported" in str(e):
707
- print_wrap(f"ERROR: {e}", err=True, newline=True)
711
+ if not e.logged:
712
+ print_wrap(f"ERROR: {e}", err=True, newline=True)
708
713
  detail_possible_converters(args.from_format, args.to_format)
709
- else:
714
+ elif not e.logged:
710
715
  print_wrap(f"ERROR: Attempt to convert file {filename} failed at converter initialization with "
711
716
  f"exception type {type(e)} and message: \n{e}\n", err=True)
717
+ e.logged = True
712
718
  success = False
713
719
  continue
714
720
  except Exception as e:
715
- print_wrap(f"ERROR: Attempt to convert file {filename} failed with exception type {type(e)} and message: " +
716
- f"\n{e}\n", err=True)
721
+ if not hasattr(e, "logged") or e.logged is False:
722
+ print_wrap(f"ERROR: Attempt to convert file {filename} failed with exception type {type(e)} and "
723
+ f"message: \n{e}\n", err=True)
724
+ e.logged = True
717
725
  success = False
718
726
  continue
719
727
 
@@ -15,10 +15,14 @@
15
15
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:400" rel="stylesheet" type="text/css">
16
16
  <link href="https://fonts.googleapis.com/css?family=Lexend:400" rel="stylesheet" type="text/css">
17
17
  <link rel="stylesheet" href="../styles/format.css">
18
+
19
+ <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
20
+ crossorigin="anonymous"></script>
21
+
18
22
  <script src="../javascript/load_accessibility.js"></script>
19
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
20
23
  <script src="../javascript/common.js" type="module"></script>
21
24
  <script src="../javascript/psdi-common.js" type="module"></script>
25
+ <script src="../javascript/accessibility.js" type="module" language="JavaScript"></script>
22
26
  </head>
23
27
 
24
28
  <body marginwidth="0">
@@ -244,10 +248,6 @@
244
248
  </div>
245
249
  </form>
246
250
 
247
- <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
248
- crossorigin="anonymous"></script>
249
- <script src="../javascript/accessibility.js" type="module" language="JavaScript"></script>
250
-
251
251
  <footer class="footer" id="psdi-footer"></footer>
252
252
 
253
253
  </body>
@@ -15,16 +15,18 @@
15
15
  <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:700" rel="stylesheet" type="text/css">
16
16
 
17
17
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
18
- <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.slim.min.js"></script>
18
+
19
+ <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
20
+ crossorigin="anonymous"></script>
19
21
  <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
20
22
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
21
-
22
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
23
+ <script src="https://cdn.jsdelivr.net/jquery.dirtyforms/2.0.0/jquery.dirtyforms.min.js"></script>
23
24
 
24
25
  <link rel="stylesheet" href="../styles/format.css">
25
26
  <script src="../javascript/load_accessibility.js"></script>
26
27
  <script src="../javascript/common.js" type="module"></script>
27
28
  <script src="../javascript/psdi-common.js" type="module"></script>
29
+ <script src="../javascript/convert.js" type="module" language="JavaScript"></script>
28
30
  </head>
29
31
 
30
32
  <body marginwidth="0">
@@ -40,8 +42,13 @@
40
42
  </div>
41
43
  </div>
42
44
 
43
- <form name="gui">
45
+ <form name="gui" class="gui">
44
46
  <div class="max-width-box">
47
+ <a href="../../">
48
+ <input type="button" class="button" value=" ← Return to Format Selection " name="returnHome" id="returnHome">
49
+ </a>
50
+ <br>
51
+ <br>
45
52
  <p>Zero to two option flag select boxes and zero to two sets of option flag check boxes may be displayed,
46
53
  depending on the conversion and the degree of completion of the database. Further information may be displayed
47
54
  underneath the select boxes if available. One or more input or output flags may be selected if required (command
@@ -54,7 +61,7 @@
54
61
  <div id="inFlagList">
55
62
  <p>
56
63
  <label for="inFlags" id="in_label">Read (input) option flags
57
- (select all required):</label>
64
+ (hold CTRL to select multiple, or CTRL+click a selected option to unselect):</label>
58
65
  <div id="in_flag_break"></div>
59
66
  <select id="inFlags" class="large-width" size="4" multiple="multiple"></select>
60
67
  <div id=inFlagInfo></div>
@@ -63,7 +70,7 @@
63
70
  <div id="outFlagList">
64
71
  <p>
65
72
  <label for="outFlags" id="out_label">Write (output) option flags
66
- (select all required):</label>
73
+ (hold CTRL to select multiple, or CTRL+click a selected option to unselect):</label>
67
74
  <div id="out_flag_break"></div>
68
75
  <select id="outFlags" class="large-width" size="4" multiple="multiple"></select>
69
76
  <div id=outFlagInfo></div>
@@ -104,14 +111,15 @@
104
111
  <input type="radio" name="coordOptions" id="coordOptions" value="better" disabled=true> better
105
112
  <input type="radio" name="coordOptions" id="coordOptions" value="best" disabled=true> best
106
113
  </p>
107
- <p id="fileChecking">
108
- </p>
109
114
  <p id="convertFile">
110
115
  <input type="checkbox" checked id="extCheck"> Enforce file naming checking to ensure uploaded files (and files
111
116
  contained in archives) all have the correct extension<br>
112
117
  <input type="checkbox" id="requestLog"> Also download log file for the conversion<br>
113
- Select file to convert:
114
- <br><input type="file" name="fileToUpload" id="fileToUpload"><br>
118
+ Select file to convert<span class="max-file-size"></span>:
119
+ <br>
120
+ <input type="file" name="fileToUpload" id="fileToUpload">
121
+ <input type="button" class="button" value=" Clear Uploaded File " name="clearUpload" id="clearUpload">
122
+ <br>
115
123
  If you have sensitive data you might prefer to use
116
124
  <a href="download.htm">one of our downloadable tools or Python library</a> rather than uploading your data to
117
125
  our service.<br>
@@ -125,9 +133,6 @@
125
133
  </div>
126
134
  </form>
127
135
 
128
- <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
129
- crossorigin="anonymous"></script>
130
- <script src="../javascript/convert.js" type="module" language="JavaScript"></script>
131
136
 
132
137
  <footer class="footer" id="psdi-footer"></footer>
133
138
 
@@ -15,16 +15,18 @@
15
15
  <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:700" rel="stylesheet" type="text/css">
16
16
 
17
17
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
18
- <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.slim.min.js"></script>
18
+
19
+ <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
20
+ crossorigin="anonymous"></script>
19
21
  <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
20
22
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
21
-
22
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
23
+ <script src="https://cdn.jsdelivr.net/jquery.dirtyforms/2.0.0/jquery.dirtyforms.min.js"></script>
23
24
 
24
25
  <link rel="stylesheet" href="../styles/format.css">
25
26
  <script src="../javascript/load_accessibility.js"></script>
26
27
  <script src="../javascript/common.js" type="module"></script>
27
28
  <script src="../javascript/psdi-common.js" type="module"></script>
29
+ <script src="../javascript/convertato.js" type="module" language="JavaScript"></script>
28
30
  </head>
29
31
 
30
32
  <body marginwidth="0">
@@ -40,39 +42,44 @@
40
42
  </div>
41
43
  </div>
42
44
 
43
- <form name="gui">
44
- <div>
45
- <p>
46
- Click on 'Choose file' and then select an input file of the correct format (and extension). Clicking on
47
- 'Convert'
48
- uploads and converts the file. The output file is automatically downloaded, along with a log file. If any issues
49
- are
50
- encountered (e.g., the output file does not download), please click on 'Provide Feedback' in the navigation bar.
51
- </p>
52
- <h6 id="heading"></h6>
53
- <p id="convertFile">
54
- <input type="checkbox" checked id="extCheck"> Enforce file naming checking to ensure uploaded files (and files
55
- contained in archives) all have the correct extension<br>
56
- <input type="checkbox" id="requestLog"> Also download log file for the conversion<br>
57
- Select file to convert:
58
- <br><input type="file" name="fileToUpload" id="fileToUpload"><br>
59
- If you have sensitive data you might prefer to use
60
- <a href="download.htm">one of our downloadable tools or Python library</a> rather than uploading your data to
61
- our service.<br>
62
- <span class="convert-button-and-spinner">
63
- <input type="button" class="button init-disabled" value=" Convert " name="uploadButton" id="uploadButton"
64
- disabled=true>
65
- <span class="loading-spinner spinner-border"></span>
66
- </span>
67
- </p>
45
+ <form name="gui" class="gui">
46
+ <div class="max-width-box">
47
+ <div>
48
+ <a href="../../">
49
+ <input type="button" class="button" value=" ← Return to Format Selection " name="returnHome" id="returnHome">
50
+ </a>
51
+ <br>
52
+ <br>
53
+ <p>
54
+ Click on 'Choose file' and then select an input file of the correct format (and extension). Clicking on
55
+ 'Convert' uploads and converts the file. The output file is automatically downloaded, along with a log file.
56
+ If any issues are encountered (e.g., the output file does not download), please click on 'Provide Feedback' in
57
+ the navigation bar.
58
+ </p>
59
+ <h6 id="heading"></h6>
60
+ <p id="convertFile">
61
+ <input type="checkbox" checked id="extCheck"> Enforce file naming checking to ensure uploaded files (and files
62
+ contained in archives) all have the correct extension<br>
63
+ <input type="checkbox" id="requestLog"> Also download log file for the conversion<br>
64
+ Select file to convert<span class="max-file-size"></span>:
65
+ <br>
66
+ <input type="file" name="fileToUpload" id="fileToUpload">
67
+ <input type="button" class="button" value=" Clear Uploaded File " name="clearUpload" id="clearUpload">
68
+ <br>
69
+ If you have sensitive data you might prefer to use
70
+ <a href="download.htm">one of our downloadable tools or Python library</a> rather than uploading your data to
71
+ our service.<br>
72
+ <span class="convert-button-and-spinner">
73
+ <input type="button" class="button init-disabled" value=" Convert " name="uploadButton" id="uploadButton"
74
+ disabled=true>
75
+ <span class="loading-spinner spinner-border"></span>
76
+ </span>
77
+ </p>
78
+ </div>
79
+ <div class="largeGap"></div>
68
80
  </div>
69
- <div class="largeGap"></div>
70
81
  </form>
71
82
 
72
- <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
73
- crossorigin="anonymous"></script>
74
- <script src="../javascript/convertato.js" type="module" language="JavaScript"></script>
75
-
76
83
  <footer class="footer" id="psdi-footer"></footer>
77
84
 
78
85
  </body>
@@ -16,16 +16,18 @@
16
16
  <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:700" rel="stylesheet" type="text/css">
17
17
 
18
18
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
19
- <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.slim.min.js"></script>
19
+
20
+ <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
21
+ crossorigin="anonymous"></script>
20
22
  <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
21
23
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
22
-
23
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
24
+ <script src="https://cdn.jsdelivr.net/jquery.dirtyforms/2.0.0/jquery.dirtyforms.min.js"></script>
24
25
 
25
26
  <link rel="stylesheet" href="../styles/format.css">
26
27
  <script src="../javascript/load_accessibility.js"></script>
27
28
  <script src="../javascript/common.js" type="module"></script>
28
29
  <script src="../javascript/psdi-common.js" type="module"></script>
30
+ <script src="../javascript/convertc2x.js" type="module" language="JavaScript"></script>
29
31
  </head>
30
32
 
31
33
  <body marginwidth="0">
@@ -41,39 +43,44 @@
41
43
  </div>
42
44
  </div>
43
45
 
44
- <form name="gui">
45
- <div>
46
- <p>
47
- Click on 'Choose file' and then select an input file of the correct format (and extension). Clicking on
48
- 'Convert'
49
- uploads and converts the file. The output file is automatically downloaded, along with a log file. If any issues
50
- are
51
- encountered (e.g., the output file does not download), please click on 'Provide Feedback' in the navigation bar.
52
- </p>
53
- <h6 id="heading"></h6>
54
- <p id="convertFile">
55
- <input type="checkbox" checked id="extCheck"> Enforce file naming checking to ensure uploaded files (and files
56
- contained in archives) all have the correct extension<br>
57
- <input type="checkbox" id="requestLog"> Also download log file for the conversion<br>
58
- Select file to convert:
59
- <br><input type="file" name="fileToUpload" id="fileToUpload"><br>
60
- If you have sensitive data you might prefer to use
61
- <a href="download.htm">one of our downloadable tools or Python library</a> rather than uploading your data to
62
- our service.<br>
63
- <span class="convert-button-and-spinner">
64
- <input type="button" class="button init-disabled" value=" Convert " name="uploadButton" id="uploadButton"
65
- disabled=true>
66
- <span class="loading-spinner spinner-border"></span>
67
- </span>
68
- </p>
46
+ <form name="gui" class="gui">
47
+ <div class="max-width-box">
48
+ <div>
49
+ <a href="../../">
50
+ <input type="button" class="button" value=" ← Return to Format Selection " name="returnHome" id="returnHome">
51
+ </a>
52
+ <br>
53
+ <br>
54
+ <p>
55
+ Click on 'Choose file' and then select an input file of the correct format (and extension). Clicking on
56
+ 'Convert' uploads and converts the file. The output file is automatically downloaded, along with a log file.
57
+ If any issues are encountered (e.g., the output file does not download), please click on 'Provide Feedback' in
58
+ the navigation bar.
59
+ </p>
60
+ <h6 id="heading"></h6>
61
+ <p id="convertFile">
62
+ <input type="checkbox" checked id="extCheck"> Enforce file naming checking to ensure uploaded files (and files
63
+ contained in archives) all have the correct extension<br>
64
+ <input type="checkbox" id="requestLog"> Also download log file for the conversion<br>
65
+ Select file to convert<span class="max-file-size"></span>:
66
+ <br>
67
+ <input type="file" name="fileToUpload" id="fileToUpload">
68
+ <input type="button" class="button" value=" Clear Uploaded File " name="clearUpload" id="clearUpload">
69
+ <br>
70
+ If you have sensitive data you might prefer to use
71
+ <a href="download.htm">one of our downloadable tools or Python library</a> rather than uploading your data to
72
+ our service.<br>
73
+ <span class="convert-button-and-spinner">
74
+ <input type="button" class="button init-disabled" value=" Convert " name="uploadButton" id="uploadButton"
75
+ disabled=true>
76
+ <span class="loading-spinner spinner-border"></span>
77
+ </span>
78
+ </p>
79
+ </div>
80
+ <div class="largeGap"></div>
69
81
  </div>
70
- <div class="largeGap"></div>
71
82
  </form>
72
83
 
73
- <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
74
- crossorigin="anonymous"></script>
75
- <script src="../javascript/convertc2x.js" type="module" language="JavaScript"></script>
76
-
77
84
  <footer class="footer" id="psdi-footer"></footer>
78
85
 
79
86
  </body>
@@ -13,8 +13,11 @@
13
13
  <link href="https://fonts.googleapis.com/css?family=Lato:400" rel="stylesheet" type="text/css">
14
14
  <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:700" rel="stylesheet" type="text/css">
15
15
  <link rel="stylesheet" href="../styles/format.css">
16
+
17
+ <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
18
+ crossorigin="anonymous"></script>
19
+
16
20
  <script src="../javascript/load_accessibility.js"></script>
17
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
18
21
  <script src="../javascript/common.js" type="module"></script>
19
22
  <script src="../javascript/psdi-common.js" type="module"></script>
20
23
  </head>
@@ -85,9 +88,6 @@
85
88
  </div>
86
89
  </form>
87
90
 
88
- <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
89
- crossorigin="anonymous"></script>
90
-
91
91
  <footer class="footer" id="psdi-footer"></footer>
92
92
 
93
93
  </body>
@@ -13,8 +13,11 @@
13
13
  <link href="https://fonts.googleapis.com/css?family=Lato:400" rel="stylesheet" type="text/css">
14
14
  <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:700" rel="stylesheet" type="text/css">
15
15
  <link rel="stylesheet" href="../styles/format.css">
16
+
17
+ <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
18
+ crossorigin="anonymous"></script>
19
+
16
20
  <script src="../javascript/load_accessibility.js"></script>
17
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
18
21
  <script src="../javascript/common.js" type="module"></script>
19
22
  <script src="../javascript/psdi-common.js" type="module"></script>
20
23
  </head>
@@ -40,6 +43,8 @@
40
43
  Python library.
41
44
  </p>
42
45
 
46
+ <h2>Installation</h2>
47
+
43
48
  <h3>Install via pip</h3>
44
49
 
45
50
  <ul>
@@ -60,12 +65,6 @@
60
65
  Python library.
61
66
  </p>
62
67
 
63
- <p>
64
- If you do wish to run the local version of this webpage, you'll need to create a helper script to set up the
65
- proper parameters and start the server. See the README provided on the front page of this project's PyPI page,
66
- linked above, for the source of this helper script, which you can paste and use locally.
67
- </p>
68
-
69
68
  <h3>Source Code</h3>
70
69
 
71
70
  <ul>
@@ -83,11 +82,28 @@
83
82
  for other possible optional dependencies sets that can be installed.
84
83
  </p>
85
84
 
86
- <p>When installed in this manner, the helper script to run the local webpage is provided in the root directory
87
- of the repository as <code class="secondary">run_local.sh</code>. It can be run from this directory, copied to
88
- your <code class="secondary">$PATH</code>, or aliased as desired.
85
+ <h2>Use</h2>
86
+
87
+ <p>
88
+ Once installed, the project can be used in one of three ways:
89
89
  </p>
90
90
 
91
+ <ul>
92
+ <li><strong>Local Gui:</strong> Run the script <code class="secondary">psdi-data-convert-gui</code> to start the
93
+ server. Append the <code class="secondary">--help</code> option for to see optional arguments (generally not
94
+ required for end-users)
95
+ </li>
96
+ <li><strong>Command-Line Application:</strong> Run the script <code class="secondary">psdi-data-convert</code>
97
+ to use the application at the command-line. Append the <code class="secondary">--help</code> option to see
98
+ arguments for it, and/or find documentation in the project's README.
99
+ </li>
100
+ <li><strong>Python Library:</strong> Within a Python script, library, or terminal, the project can be imported
101
+ via <code class="secondary">import psdi_data_conversion</code>, with the most useful function being <code
102
+ class="secondary">psdi_data_conversion.converter.run_converter</code> - see the <code
103
+ class="secondary">help()</code> of this function and/or find documentation in the project's README.
104
+ </li>
105
+ </ul>
106
+
91
107
  <h2>Documentation</h2>
92
108
 
93
109
  <ul>
@@ -13,8 +13,11 @@
13
13
  <link href="https://fonts.googleapis.com/css?family=Lato:400" rel="stylesheet" type="text/css">
14
14
  <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:700" rel="stylesheet" type="text/css">
15
15
  <link rel="stylesheet" href="../styles/format.css">
16
+
17
+ <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
18
+ crossorigin="anonymous"></script>
19
+
16
20
  <script src="../javascript/load_accessibility.js"></script>
17
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
18
21
  <script src="../javascript/common.js" type="module"></script>
19
22
  <script src="../javascript/psdi-common.js" type="module"></script>
20
23
  </head>
@@ -44,9 +47,6 @@
44
47
  </div>
45
48
  </form>
46
49
 
47
- <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
48
- crossorigin="anonymous"></script>
49
-
50
50
  <footer class="footer" id="psdi-footer"></footer>
51
51
 
52
52
  </body>
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
  </div>
18
18
  <div class="navbar__items navbar__items--right">
19
- <!-- This file contains the links that will appear in the top-right of the header bar for .html files in the index.htm page. --> <a href="./" class="navbar__item navbar__link">Home</a> <a href="static/content/report.htm" class="navbar__item navbar__link">Report Missing Format/Conversion</a> <a href="static/content/feedback.htm" class="navbar__item navbar__link">Provide Feedback</a> <a href="static/content/documentation.htm" class="navbar__item navbar__link">Documentation</a> <a href="static/content/accessibility.htm" class="navbar__item navbar__link">Accessibility</a> <a href="mailto: psdi@soton.ac.uk" class="navbar__item navbar__link" id="mail">Contact</a>
19
+ <!-- This file contains the links that will appear in the top-right of the header bar for .html files in the index.htm page. --> <a href="./" class="navbar__item navbar__link">Home</a> <a href="static/content/report.htm" class="navbar__item navbar__link">Report Missing Format/Conversion</a> <a href="static/content/feedback.htm" class="navbar__item navbar__link">Provide Feedback</a> <a href="static/content/documentation.htm" class="navbar__item navbar__link">Documentation</a> <a href="static/content/download.htm" class="navbar__item navbar__link service-only">Download</a> <a href="static/content/accessibility.htm" class="navbar__item navbar__link">Accessibility</a> <a href="mailto: psdi@soton.ac.uk" class="navbar__item navbar__link" id="mail">Contact</a>
20
20
  <button class="clean-btn color-mode-toggle" title="Switch between dark and light mode"
21
21
  aria-label="Lightmode/darkmode toggle button">
22
22
  <img src="static/img/colormode-toggle-lm.svg" alt="Lightmode toggle icon"
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
  </div>
18
18
  <div class="navbar__items navbar__items--right">
19
- <!-- This file contains the links that will appear in the top-right of the header bar for .html files in this directory. --> <a href="../../" class="navbar__item navbar__link">Home</a> <a href="report.htm" class="navbar__item navbar__link">Report Missing Format/Conversion</a> <a href="feedback.htm" class="navbar__item navbar__link">Provide Feedback</a> <a href="documentation.htm" class="navbar__item navbar__link">Documentation</a> <a href="accessibility.htm" class="navbar__item navbar__link">Accessibility</a> <a href="mailto:support@psdi.ac.uk" class="navbar__item navbar__link" id="mail">Contact Us</a>
19
+ <!-- This file contains the links that will appear in the top-right of the header bar for .html files in this directory. --> <a href="../../" class="navbar__item navbar__link">Home</a> <a href="report.htm" class="navbar__item navbar__link">Report Missing Format/Conversion</a> <a href="feedback.htm" class="navbar__item navbar__link">Provide Feedback</a> <a href="documentation.htm" class="navbar__item navbar__link">Documentation</a> <a href="download.htm" class="navbar__item navbar__link service-only">Download</a> <a href="accessibility.htm" class="navbar__item navbar__link">Accessibility</a> <a href="mailto:support@psdi.ac.uk" class="navbar__item navbar__link" id="mail">Contact Us</a>
20
20
  <button class="clean-btn color-mode-toggle" title="Switch between dark and light mode"
21
21
  aria-label="Lightmode/darkmode toggle button">
22
22
  <img src="../img/colormode-toggle-lm.svg" alt="Lightmode toggle icon"
@@ -13,10 +13,16 @@
13
13
  <link href="https://fonts.googleapis.com/css?family=Lato:400" rel="stylesheet" type="text/css">
14
14
  <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:700" rel="stylesheet" type="text/css">
15
15
  <link rel="stylesheet" href="../styles/format.css">
16
+
17
+ <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
18
+ crossorigin="anonymous"></script>
19
+ <script src="https://cdn.jsdelivr.net/jquery.dirtyforms/2.0.0/jquery.dirtyforms.min.js"></script>
20
+
16
21
  <script src="../javascript/load_accessibility.js"></script>
17
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
18
22
  <script src="../javascript/common.js" type="module"></script>
19
23
  <script src="../javascript/psdi-common.js" type="module"></script>
24
+ <script src="../javascript/report.js" type="module" language="JavaScript"></script>
25
+
20
26
  </head>
21
27
 
22
28
  <body marginwidth="0">
@@ -32,7 +38,7 @@
32
38
  </div>
33
39
  </div>
34
40
 
35
- <form name="gui" class="service-only">
41
+ <form name="gui" class="gui service-only">
36
42
  <div class="max-width-box">
37
43
  <p>Select the type of report (missing file format or conversion) and then follow the instructions that appear.
38
44
  <p><b>Finally:</b> click on 'Report.'</p><br>
@@ -81,7 +87,7 @@
81
87
  </div>
82
88
  </form>
83
89
 
84
- <form name="gui" class="local-only">
90
+ <form name="gui" class="gui local-only">
85
91
  <div class="max-width-box">
86
92
  <div class="smallGap"></div>
87
93
  <p>
@@ -93,10 +99,6 @@
93
99
  </div>
94
100
  </form>
95
101
 
96
- <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
97
- crossorigin="anonymous"></script>
98
- <script src="../javascript/report.js" type="module" language="JavaScript"></script>
99
-
100
102
  <footer class="footer" id="psdi-footer"></footer>
101
103
 
102
104
  </body>
@@ -4,6 +4,26 @@
4
4
  * @author Bryan Gillis
5
5
  */
6
6
 
7
+ export function initDirtyForms() {
8
+ $("form.gui").dirtyForms();
9
+ }
10
+
11
+ export function cleanDirtyForms() {
12
+ $('form.gui').dirtyForms('setClean');
13
+ }
14
+
15
+ export function dirtyDirtyForms() {
16
+ $('form.gui').dirtyForms('setDirty');
17
+ }
18
+
19
+ export function enableDirtyForms() {
20
+ $('form.gui').removeClass($.DirtyForms.ignoreClass);
21
+ }
22
+
23
+ export function disableDirtyForms() {
24
+ $('form.gui').addClass($.DirtyForms.ignoreClass);
25
+ }
26
+
7
27
 
8
28
  /**
9
29
  * Gets whether or not the app is operating in "Service mode"
@@ -10,14 +10,13 @@ import { getInputFlags, getOutputFlags, getInputArgFlags, getOutputArgFlags } fr
10
10
  import { commonConvertReady, convertFile, getExtCheck, splitArchiveExt, isArchiveExt } from "./convert_common.js"
11
11
 
12
12
  var token = "",
13
- max_file_size = 0,
14
13
  in_ext = "",
15
14
  out_ext = "",
16
15
  in_str = "",
17
16
  out_str = "";
18
17
 
19
18
  $(document).ready(function () {
20
- [token, max_file_size, in_str, in_ext, out_str, out_ext] = commonConvertReady("Open Babel");
19
+ [token, in_str, in_ext, out_str, out_ext] = commonConvertReady("Open Babel");
21
20
 
22
21
  $('input[name="coordinates"]').change(coordOptionAvailability);
23
22
  $("#uploadButton").click(submitFile);