Skip to content

Commit 45a2974

Browse files
committed
Apply isort
This patch applies effects of the following patch that adds `isort` to CI. The patch-ordering is because adding to CI first would cause CI to fail on finding files need to be re-formatted by `pre-commit`. This also separates manual changes from automated changes. Disclaimer: Participation by NIST in the creation of the documentation of mentioned software is not intended to imply a recommendation or endorsement by the National Institute of Standards and Technology, nor is it intended to imply that any specific software is necessarily the best available for the purpose. Signed-off-by: Alex Nelson <[email protected]>
1 parent 0989595 commit 45a2974

File tree

92 files changed

+297
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+297
-197
lines changed

demos/demo_fiwalk_diskimage.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
if the required buffer size exceeds available RAM!
77
"""
88

9-
import sys
109
import io
10+
import sys
11+
1112
from dfxml import fiwalk
1213

14+
1315
def writeDfxml(imageFile: str, outFile: str) -> None:
1416
"""Generate filesystem metadata for disk image and and write resulting
1517
dfxml to file"""

demos/demo_mac_timeline.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
sys.path.append( os.path.join(os.path.dirname(__file__), ".."))
88
import dfxml
99

10-
1110
timeline = []
1211

1312
def process(fi):

demos/demo_mac_timeline_iter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
sys.path.append( os.path.join(os.path.dirname(__file__), ".."))
2323
import dfxml
2424

25+
2526
def main():
2627
if len(sys.argv) < 2:
2728
print("Usage: {} <filename.xml>".format(sys.argv[0]))

demos/demo_piecewise.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
import sys
1010

1111
sys.path.append( os.path.join(os.path.dirname(__file__), ".."))
12-
import dfxml
13-
12+
import collections
13+
import math
14+
import sys
1415

15-
import math,sys,collections
16+
import dfxml
1617

1718

1819
class SectorCorrelator:

demos/demo_plot_times.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#!/usr/bin/python
2-
import fiwalk
3-
import time
4-
52
import os
63
import sys
4+
import time
5+
6+
import fiwalk
77

88
sys.path.append( os.path.join(os.path.dirname(__file__), ".."))
99
import dfxml
1010

11-
1211
if __name__=="__main__":
1312
import sys
1413
from optparse import OptionParser

demos/demo_readtimes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/python
22
"""Reads an fiwalk XML file and reports how many of the files are still in the image..."""
33

4-
import sys,os
5-
64
import os
75
import sys
86

97
sys.path.append( os.path.join(os.path.dirname(__file__), ".."))
8+
import time
9+
1010
import dfxml
1111
import dfxml.fiwalk as fiwalk
12-
import time
12+
1313

1414
def calc_jumps(fis,title):
1515
print(title)
@@ -39,7 +39,7 @@ def calc_jumps(fis,title):
3939
if __name__=="__main__":
4040
import sys
4141
from optparse import OptionParser
42-
from subprocess import Popen,PIPE
42+
from subprocess import PIPE, Popen
4343
global options
4444

4545
parser = OptionParser()

demos/demo_registry_timeline.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
sys.path.append( os.path.join(os.path.dirname(__file__), ".."))
66
import dfxml
77

8-
98
timeline = []
109

1110
def process(co):

demos/demo_sizes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
# Demo program that shows how to calculate the average size of file objects in a DFXML file
55
#
66

7+
import collections
78
import math
8-
import sys
99
import os
10-
import collections
10+
import sys
1111

1212
sys.path.append( os.path.join(os.path.dirname(__file__), ".."))
1313
import dfxml

demos/demo_spark.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
# This program runs spark if it is not already running
55

66

7-
import sys
87
import os
8+
import sys
99

1010
sys.path.append("../python")
1111
from dfxml_writer import DFXMLWriter
1212

13+
1314
def spark_demo():
1415
"""A small spark program. Must be run under spark"""
15-
from pyspark import SparkConf
16-
from pyspark import SparkContext
1716
import operator
1817

18+
from pyspark import SparkConf, SparkContext
19+
1920
conf = SparkConf()
2021
sc = SparkContext(conf=conf)
2122
m = 1000000

demos/spark/demo_spark.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
# This program runs Spark if it is not already running
55

66

7-
import sys
87
import os
8+
import sys
99

1010
sys.path.append("../python")
1111
from dfxml_writer import DFXMLWriter
1212

13+
1314
def spark_demo():
1415
"""A small Spark program. Must be run under Spark"""
15-
from pyspark import SparkConf
16-
from pyspark import SparkContext
1716
import operator
1817

18+
from pyspark import SparkConf, SparkContext
19+
1920
conf = SparkConf()
2021
sc = SparkContext(conf=conf)
2122
m = 1000000

0 commit comments

Comments
 (0)