MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / find

Method find

pydevd_attach_to_process/winappdbg/sql.py:813–886  ·  view source on GitHub ↗

Retrieve all crash dumps in the database, optionally filtering them by signature and timestamp, and/or sorting them by timestamp. Results can be paged to avoid consuming too much memory if the database is large. @see: L{find_by_example} @type sign

(self, signature=None, order=0, since=None, until=None, offset=None, limit=None)

Source from the content-addressed store, hash-verified

811
812 @Transactional
813 def find(self, signature=None, order=0, since=None, until=None, offset=None, limit=None):
814 """
815 Retrieve all crash dumps in the database, optionally filtering them by
816 signature and timestamp, and/or sorting them by timestamp.
817
818 Results can be paged to avoid consuming too much memory if the database
819 is large.
820
821 @see: L{find_by_example}
822
823 @type signature: object
824 @param signature: (Optional) Return only through crashes matching
825 this signature. See L{Crash.signature} for more details.
826
827 @type order: int
828 @param order: (Optional) Sort by timestamp.
829 If C{== 0}, results are not sorted.
830 If C{> 0}, results are sorted from older to newer.
831 If C{< 0}, results are sorted from newer to older.
832
833 @type since: datetime
834 @param since: (Optional) Return only the crashes after and
835 including this date and time.
836
837 @type until: datetime
838 @param until: (Optional) Return only the crashes before this date
839 and time, not including it.
840
841 @type offset: int
842 @param offset: (Optional) Skip the first I{offset} results.
843
844 @type limit: int
845 @param limit: (Optional) Return at most I{limit} results.
846
847 @rtype: list(L{Crash})
848 @return: List of Crash objects.
849 """
850
851 # Validate the parameters.
852 if since and until and since > until:
853 warnings.warn("CrashDAO.find() got the 'since' and 'until' arguments reversed, corrected automatically.")
854 since, until = until, since
855 if limit is not None and not limit:
856 warnings.warn("CrashDAO.find() was set a limit of 0 results, returning without executing a query.")
857 return []
858
859 # Build the SQL query.
860 query = self._session.query(CrashDTO)
861 if signature is not None:
862 sig_pickled = pickle.dumps(signature, protocol=0)
863 query = query.filter(CrashDTO.signature == sig_pickled)
864 if since:
865 query = query.filter(CrashDTO.timestamp >= since)
866 if until:
867 query = query.filter(CrashDTO.timestamp < until)
868 if order:
869 if order > 0:
870 query = query.order_by(asc(CrashDTO.timestamp))

Callers 15

mainFunction · 0.45
__getfilesystemencodingFunction · 0.45
interpreterInfo.pyFile · 0.45
existsFunction · 0.45
runMethod · 0.45
test_runfiles.pyFile · 0.45
find_class_nameFunction · 0.45
test_console_requestsMethod · 0.45

Calls 2

dumpsMethod · 0.80
toCrashMethod · 0.80

Tested by 10

test_console_requestsMethod · 0.36
test_imports5Method · 0.36
read_msgMethod · 0.36
read_msgMethod · 0.36
_reportErrorsMethod · 0.36
_read_lineMethod · 0.36