summary refs log tree commit diff stats
path: root/code/directory.py
diff options
context:
space:
mode:
Diffstat (limited to 'code/directory.py')
-rw-r--r--code/directory.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/code/directory.py b/code/directory.py
new file mode 100644
index 00000000..4cb9fd72
--- /dev/null
+++ b/code/directory.py
@@ -0,0 +1,33 @@
+
+class Directory():
+	def __init__(self, path):
+		self.path = path
+		self.files_loaded = False
+		self.scheduled = False
+		self.files = None
+		self.mtime = None
+		self.exists = True
+
+	def load_files(self):
+		import os
+		try:
+			self.files = os.listdir(self.path)
+			self.exists = True
+		except OSError:
+			self.files = []
+			self.exists = False
+		self.files_loaded = True
+
+	def __len__(self):
+		return len(self.files)
+	
+	def __getitem__(self, key):
+		return self.files[key]
+
+if __name__ == '__main__':
+	d = Directory('.')
+	d.load_files()
+	print(d.files)
+	print(d[1])
+
+	
Anselm R. Garbe <garbeam@wmii.de> 2006-07-13 09:32:22 +0200 added logo+description' href='/acidbong/suckless/dwm/commit/Makefile?h=5.6.1&id=650a1fb4e1a798aca48a53739f5bb2649191bc1c'>650a1fb ^
dbf7e03 ^



1076f2b



9e8b325 ^
1076f2b
650a1fb ^
1076f2b
8b59083 ^
1076f2b

7b5638f ^
dbf7e03 ^

650a1fb ^
7faa8a9 ^
650a1fb ^


dbf7e03 ^



eccd02d ^


dbf7e03 ^


eccd02d ^


dbf7e03 ^








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60