Coverage for src/P4OO/File.py: 0%
11 statements
« prev ^ index » next coverage.py v7.4.1, created at 2024-09-07 17:17 +0000
« prev ^ index » next coverage.py v7.4.1, created at 2024-09-07 17:17 +0000
1######################################################################
2# Copyright (c)2012, David L. Armstrong.
3#
4# P4OO.File.py
5#
6######################################################################
8from dataclasses import dataclass, field
10from P4OO._Base import _P4OOBase
11from P4OO._Set import _P4OOSet
13@dataclass(unsafe_hash=True)
14class P4OOFile(_P4OOBase):
15 """
16 Perforce File Object
18 The `P4OOFile` object does not have a first-class equivalent in Perforce.
19 It is just used to manage a path to a local file, or a depot file,
20 or a revision range, or... Anything used to communicate filenames to
21 Perforce really.
23 Within P4OO.py, `P4OOFile` objects are used to track and connect output
24 from one Perforce operation to the next, carrying your `_P4OOConnection`
25 object(s) along for the ride.
27 id Required: Yes
29 See Also:
30 Perforce Helix Core Command Reference:
31 https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_files.html
32 """
34# TODO File are not Spec Objects, but...
35# # Subclasses must define SPECOBJ_TYPE
36# _SPECOBJ_TYPE = 'file'
38 def __repr__(self):
39 return '%s(%s)' % (self.__class__.__name__, self._getAttr('id'))
41@dataclass
42class P4OOFileSet(_P4OOSet):
43 """ `P4OOSet` of `P4OOFile` objects """
45 def query(self, archived: bool=False, allrevisions: bool=False,
46 excludeDeleted: bool=False, maxresults: int=None,
47 files: str=None, **kwargs):
48 """
49 Executes `p4 files` query
51 Args:
52 archived (bool, optional): List all revisions in specified range
53 allrevisions (bool, optional): Limit output to files in
54 archive depots
55 excludeDeleted (bool, optional): Exclude deleted/archived files.
56 archive depots
57 maxresults (int, optional): Return only the first [max] results
58 files (P4OOFileSet | P4OOFile | str, optional): The set of file
59 revisions to query
61 Returns:
62 (P4OOFileSet): `P4OOSet` of `P4OOFile` objects matching query
63 parameters
65 See Also:
66 Perforce Helix Core Command Reference:
67 https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_files.html
68 """
70 return self._query(setObjType='files', archived=archived,
71 allrevisions=allrevisions, excludeDeleted=excludeDeleted,
72 maxresults=maxresults, files=files, **kwargs)