p4tools.py #8

  • //
  • guest/
  • mart/
  • p4fileobjects/
  • dev/
  • lib/
  • p4tools.py
  • Commits
# Change User Description Committed
#8 18027 mart out
#7 16063 mart just a few changes, but does not yet include latest 'pathlib & fspath'.
#6 15806 mart fixes, new validators for boolean expressions, and a few other things
#5 15640 mart p4tools: always extend and follow modP4 (until integrated back to sSqa - local)
#4 15551 mart quick update before exploding the package in an appropriate structure...
#3 15537 mart updating & reseting becaus of moved files
#2 15428 mart canges to Query() as well as to Seach()
#1 15402 mart renaming to lower case
//guest/mart/p4FileObjects/dev/lib/p4tools.py
#10 15389 mart just a few changes to `guessType()`
#9 15330 mart * SchemaParser
* client-side file objects
* improved cmd line options parser
* fixed many bugs
* added/fixed/improved validators
* added auto-cmd name changes when mismatch with expected vs retrieved
   number of records
* added ap-side path resolver (`p4 where`) since sometimes we can't know a user's
   intentions (I.e. when referencing a relative p4 path) - so we guess
* added separate object loader to treat files and revs separately from other
  types of objects
* separate file object 'read' attribute from 'select', so that there's a
  clear picture of what we are asking... That is, the thing of interest
  (i.e.: file content is the thing of interest when request file records)
   ... therefore:

        >>> with op4n('//depot/files/...','r') as reader:
        >>> ... query = ('change.user=mart','depotFile#\.py$')
        >>> ... files = reader(query).select()

the query isn't all that specific and there's
a good change this would return multiple records,
so unless we really want to get the file content
of multiple files, it would make sense to specify
`.select()` as opposed to `read()`

* note: individual records can access the `read`
  attribute to retrieve a file's content, I.e.: with
   the sample above, we could do:

        >>> for file in files:
        >>> ... content = file.read()

* making much better use of sec definitions to validate spec input / validation
* and more stuff...

** ALL READ test are passing test, including multi-threaded tests! :)


* new in tools:
    - class zipper (to interact with 'p4 zip' & 'unzip'
    - class p4get (like apt-get for p4 software, but something that
      works - will figure out dependencies, change permission bits,
      download, read files from url, git/hg clones, ftp, etc...)
#8 15080 mart more updates>

we have successful file reads of:
* depot files
* client files
* cmds
* specs

queries are successful determining when to give to P4D and when to keep the expression
#7 14983 mart updates, bug fixes, etc.
#6 14922 mart more updates...
queries are better, mapping of p4 options/keywords to query fields are also better...
#5 14814 mart more updates, new things, bla bla bla
#4 14724 mart updates, improved Query classes (ready to add runtime expansion classes), added p4downloader, etc....
bla bla bla
#3 14094 mart few more updates this weekend
#2 14034 mart * added no-fuss p4loger (as decordator)
* re-factored class SpecDef and shuffled class SpecClient round
#1 14009 mart adding - still pieces under construction - and have not yet re-implemeted write(), should complete as soon as possible...