ยปCore Development>Code coverage>Lib/plat-mac/lib-scriptpackages/Finder/Finder_Basics.py

Python code coverage for Lib/plat-mac/lib-scriptpackages/Finder/Finder_Basics.py

#countcontent
1n/a"""Suite Finder Basics: Commonly-used Finder commands and object classes
2n/aLevel 1, version 1
3n/a
4n/aGenerated from /System/Library/CoreServices/Finder.app
5n/aAETE/AEUT resource version 0/144, language 0, script 0
6n/a"""
7n/a
8n/aimport aetools
9n/aimport MacOS
10n/a
11n/a_code = 'fndr'
12n/a
13n/aclass Finder_Basics_Events:
14n/a
15n/a def copy(self, _no_object=None, _attributes={}, **_arguments):
16n/a """copy: (NOT AVAILABLE YET) Copy the selected items to the clipboard (the Finder must be the front application)
17n/a Keyword argument _attributes: AppleEvent attribute dictionary
18n/a """
19n/a _code = 'misc'
20n/a _subcode = 'copy'
21n/a
22n/a if _arguments: raise TypeError, 'No optional args expected'
23n/a if _no_object is not None: raise TypeError, 'No direct arg expected'
24n/a
25n/a
26n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
27n/a _arguments, _attributes)
28n/a if _arguments.get('errn', 0):
29n/a raise aetools.Error, aetools.decodeerror(_arguments)
30n/a # XXXX Optionally decode result
31n/a if _arguments.has_key('----'):
32n/a return _arguments['----']
33n/a
34n/a _argmap_sort = {
35n/a 'by' : 'by ',
36n/a }
37n/a
38n/a def sort(self, _object, _attributes={}, **_arguments):
39n/a """sort: (NOT AVAILABLE YET) Return the specified object(s) in a sorted list
40n/a Required argument: a list of finder objects to sort
41n/a Keyword argument by: the property to sort the items by (name, index, date, etc.)
42n/a Keyword argument _attributes: AppleEvent attribute dictionary
43n/a Returns: the sorted items in their new order
44n/a """
45n/a _code = 'DATA'
46n/a _subcode = 'SORT'
47n/a
48n/a aetools.keysubst(_arguments, self._argmap_sort)
49n/a _arguments['----'] = _object
50n/a
51n/a
52n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
53n/a _arguments, _attributes)
54n/a if _arguments.get('errn', 0):
55n/a raise aetools.Error, aetools.decodeerror(_arguments)
56n/a # XXXX Optionally decode result
57n/a if _arguments.has_key('----'):
58n/a return _arguments['----']
59n/a
60n/a
61n/aclass application(aetools.ComponentItem):
62n/a """application - The Finder """
63n/a want = 'capp'
64n/aclass _Prop_Finder_preferences(aetools.NProperty):
65n/a """Finder preferences - (NOT AVAILABLE YET) Various preferences that apply to the Finder as a whole """
66n/a which = 'pfrp'
67n/a want = 'cprf'
68n/aFinder_preferences = _Prop_Finder_preferences()
69n/aclass _Prop_clipboard(aetools.NProperty):
70n/a """clipboard - (NOT AVAILABLE YET) the Finder\xd5s clipboard window """
71n/a which = 'pcli'
72n/a want = 'obj '
73n/aclipboard = _Prop_clipboard()
74n/aclass _Prop_desktop(aetools.NProperty):
75n/a """desktop - the desktop """
76n/a which = 'desk'
77n/a want = 'cdsk'
78n/adesktop = _Prop_desktop()
79n/aclass _Prop_frontmost(aetools.NProperty):
80n/a """frontmost - Is the Finder the frontmost process? """
81n/a which = 'pisf'
82n/a want = 'bool'
83n/afrontmost = _Prop_frontmost()
84n/aclass _Prop_home(aetools.NProperty):
85n/a """home - the home directory """
86n/a which = 'home'
87n/a want = 'cfol'
88n/ahome = _Prop_home()
89n/aclass _Prop_insertion_location(aetools.NProperty):
90n/a """insertion location - the container in which a new folder would appear if \xd2New Folder\xd3 was selected """
91n/a which = 'pins'
92n/a want = 'obj '
93n/ainsertion_location = _Prop_insertion_location()
94n/aclass _Prop_name(aetools.NProperty):
95n/a """name - the Finder\xd5s name """
96n/a which = 'pnam'
97n/a want = 'itxt'
98n/aname = _Prop_name()
99n/aclass _Prop_product_version(aetools.NProperty):
100n/a """product version - the version of the System software running on this computer """
101n/a which = 'ver2'
102n/a want = 'utxt'
103n/aproduct_version = _Prop_product_version()
104n/aclass _Prop_selection(aetools.NProperty):
105n/a """selection - the selection in the frontmost Finder window """
106n/a which = 'sele'
107n/a want = 'obj '
108n/aselection = _Prop_selection()
109n/aclass _Prop_startup_disk(aetools.NProperty):
110n/a """startup disk - the startup disk """
111n/a which = 'sdsk'
112n/a want = 'cdis'
113n/astartup_disk = _Prop_startup_disk()
114n/aclass _Prop_trash(aetools.NProperty):
115n/a """trash - the trash """
116n/a which = 'trsh'
117n/a want = 'ctrs'
118n/atrash = _Prop_trash()
119n/aclass _Prop_version(aetools.NProperty):
120n/a """version - the version of the Finder """
121n/a which = 'vers'
122n/a want = 'utxt'
123n/aversion = _Prop_version()
124n/aclass _Prop_visible(aetools.NProperty):
125n/a """visible - Is the Finder\xd5s layer visible? """
126n/a which = 'pvis'
127n/a want = 'bool'
128n/avisible = _Prop_visible()
129n/a# element 'alia' as ['indx', 'name']
130n/a# element 'appf' as ['indx', 'name', 'ID ']
131n/a# element 'brow' as ['indx', 'ID ']
132n/a# element 'cdis' as ['indx', 'name', 'ID ']
133n/a# element 'cfol' as ['indx', 'name', 'ID ']
134n/a# element 'clpf' as ['indx', 'name']
135n/a# element 'cobj' as ['indx', 'rele', 'name', 'rang', 'test']
136n/a# element 'ctnr' as ['indx', 'name']
137n/a# element 'cwin' as ['indx', 'name']
138n/a# element 'docf' as ['indx', 'name']
139n/a# element 'file' as ['indx', 'name']
140n/a# element 'inlf' as ['indx', 'name']
141n/a# element 'lwnd' as ['indx', 'name']
142n/a# element 'pack' as ['indx', 'name']
143n/aapplication._superclassnames = []
144n/aimport Files
145n/aimport Window_classes
146n/aimport Containers_and_folders
147n/aimport Finder_items
148n/aapplication._privpropdict = {
149n/a 'Finder_preferences' : _Prop_Finder_preferences,
150n/a 'clipboard' : _Prop_clipboard,
151n/a 'desktop' : _Prop_desktop,
152n/a 'frontmost' : _Prop_frontmost,
153n/a 'home' : _Prop_home,
154n/a 'insertion_location' : _Prop_insertion_location,
155n/a 'name' : _Prop_name,
156n/a 'product_version' : _Prop_product_version,
157n/a 'selection' : _Prop_selection,
158n/a 'startup_disk' : _Prop_startup_disk,
159n/a 'trash' : _Prop_trash,
160n/a 'version' : _Prop_version,
161n/a 'visible' : _Prop_visible,
162n/a}
163n/aapplication._privelemdict = {
164n/a 'Finder_window' : Window_classes.Finder_window,
165n/a 'alias_file' : Files.alias_file,
166n/a 'application_file' : Files.application_file,
167n/a 'clipping' : Files.clipping,
168n/a 'clipping_window' : Window_classes.clipping_window,
169n/a 'container' : Containers_and_folders.container,
170n/a 'disk' : Containers_and_folders.disk,
171n/a 'document_file' : Files.document_file,
172n/a 'file' : Files.file,
173n/a 'folder' : Containers_and_folders.folder,
174n/a 'internet_location_file' : Files.internet_location_file,
175n/a 'item' : Finder_items.item,
176n/a 'package' : Files.package,
177n/a 'window' : Window_classes.window,
178n/a}
179n/a
180n/a#
181n/a# Indices of types declared in this module
182n/a#
183n/a_classdeclarations = {
184n/a 'capp' : application,
185n/a}
186n/a
187n/a_propdeclarations = {
188n/a 'desk' : _Prop_desktop,
189n/a 'home' : _Prop_home,
190n/a 'pcli' : _Prop_clipboard,
191n/a 'pfrp' : _Prop_Finder_preferences,
192n/a 'pins' : _Prop_insertion_location,
193n/a 'pisf' : _Prop_frontmost,
194n/a 'pnam' : _Prop_name,
195n/a 'pvis' : _Prop_visible,
196n/a 'sdsk' : _Prop_startup_disk,
197n/a 'sele' : _Prop_selection,
198n/a 'trsh' : _Prop_trash,
199n/a 'ver2' : _Prop_product_version,
200n/a 'vers' : _Prop_version,
201n/a}
202n/a
203n/a_compdeclarations = {
204n/a}
205n/a
206n/a_enumdeclarations = {
207n/a}