Smoothing Programming Venture Scripting

Slide1 l.jpg
1 / 56
0
0
1413 days ago, 480 views
PowerPoint PPT Presentation
Need to work with other basic apparatuses (Sphinx, svn, virtualenv) ... documentation utilizing Sphinx. This uses the accompanying alternatives in a

Presentation Transcript

Slide 1

´╗┐Smoothing Software Project Scripting Mark Ramm repeating his honor winning part as Kevin Dangoor BlueSkyOnMars.com

Slide 2

Python is not incorporated (really, it is, but rather that is not critical right now)

Slide 3

Python extends positively needn't bother with Redistributable records to move around Deployment to different machines Interaction with source control frameworks Documentation that is worked from the source code Documentation that is worked from an arrangement other than its last show design

Slide 5

If just there was some scripting dialect that we definitely knew.

Slide 6

Waitasec. Isn't Python a scripting dialect?

Slide 7

Project-related scripts require... Summon line contention taking care of Configuration Often work with records Sometimes need to utilize distutils/setuptools, yet wish they could do somewhat more Need to work with other regular instruments (Sphinx, svn, virtualenv)

Slide 8

Command-line contention taking care of container/begin server - port 8675309

Slide 9

Configuration [messages] greeting=Hello [thing1] who=World message=${messages.greeting}, ${who}

Slide 10

Lots of working with documents import os if not os.path.exists("foo"): os.mkdir("foo") if not os.path.exists(os.path.join("foo, "bar")): open(os.path.join("foo", "bar"), "w").write("Hi")

Slide 11

Working with distutils/setuptools #!/receptacle/sh sphinx-construct (yakkity yak) python setup.py sdist transfer

Slide 12

Other normal apparatuses sphinx-assemble ... subprocess.Popen("svn info"... # and accomplish something with the yield virtualenv.create_bootstrap_script("# more code")

Slide 13

Do you truly need isolate scripts for everything? /usr/nearby/canister/git /usr/neighborhood/container/git-consolidate resolve/usr/neighborhood/receptacle/git-add /usr/nearby/canister/git-blend imbecilic/usr/nearby/receptacle/git-include - interactive /usr/neighborhood/container/git-combine subtree/usr/nearby/container/git-am /usr/neighborhood/container/git-combine tree/usr/nearby/receptacle/git-annotate /usr/nearby/canister/git-mergetool/usr/nearby/canister/git-apply /usr/neighborhood/receptacle/git-mktag/usr/nearby/receptacle/git-archimport /usr/nearby/receptacle/git-mktree/usr/nearby/canister/git-archive /usr/nearby/receptacle/git-mv/usr/neighborhood/receptacle/git-bisect /usr/neighborhood/container/git-name-rev/usr/neighborhood/container/git-blame /usr/neighborhood/canister/git-pack-objects/usr/nearby/receptacle/git-branch /usr/neighborhood/canister/git-pack-excess/usr/nearby/container/git-bundle /usr/neighborhood/container/git-pack-refs/usr/nearby/receptacle/git-feline file /usr/nearby/canister/git-parse-remote/usr/nearby/receptacle/git-registration/usr/nearby/container/git-fix id/usr/nearby/canister/git-registration format /usr/neighborhood/canister/git-look remote/usr/neighborhood/container/git-checkout /usr/nearby/canister/git-prune/usr/neighborhood/receptacle/git-checkout-index /usr/neighborhood/receptacle/git-prune-pressed/usr/neighborhood/canister/git-cherry /usr/nearby/canister/git-pull/usr/nearby/receptacle/git-cherry-pick /usr/nearby/receptacle/git-push/usr/nearby/receptacle/git-citool /usr/nearby/canister/git-quiltimport/usr/nearby/container/git-clean /usr/nearby/receptacle/git-read-tree/usr/nearby/canister/git-clone /usr/nearby/canister/git-rebase/usr/nearby/container/git-commit /usr/nearby/container/git-rebase- - intuitive/usr/nearby/receptacle/git-confer tree /usr/neighborhood/receptacle/git-get pack/usr/neighborhood/container/git-config /usr/neighborhood/container/git-reflog/usr/nearby/canister/git-change over objects /usr/nearby/container/git-relink/usr/nearby/container/git-number objects /usr/nearby/receptacle/git-remote/usr/nearby/container/git-cvsexportcommit /usr/nearby/container/git-repack/usr/neighborhood/receptacle/git-cvsimport /usr/neighborhood/container/git-repo-config/usr/neighborhood/container/git-cvsserver /usr/neighborhood/canister/git-ask for draw/usr/neighborhood/container/git-daemon /usr/neighborhood/container/git-rerere/usr/nearby/container/git-describe /usr/nearby/container/git-reset/usr/neighborhood/container/git-diff /usr/nearby/receptacle/git-rev-list/usr/nearby/container/git-diff-files /usr/nearby/receptacle/git-rev-parse/usr/nearby/receptacle/git-diff-index /usr/neighborhood/canister/git-return/usr/neighborhood/canister/git-diff-tree /usr/neighborhood/container/git-rm/usr/neighborhood/receptacle/git-quick import /usr/neighborhood/canister/git-runstatus/usr/nearby/canister/git-fetch /usr/nearby/canister/git-send-email/usr/nearby/canister/git-bring - tool /usr/neighborhood/receptacle/git-send-pack/usr/neighborhood/canister/git-get pack /usr/nearby/canister/git-sh-setup/usr/nearby/receptacle/git-channel branch /usr/neighborhood/receptacle/git-shell/usr/nearby/container/git-fmt-blend msg /usr/neighborhood/container/git-shortlog/usr/neighborhood/container/git-for-each-ref /usr/neighborhood/container/git-demonstrate/usr/neighborhood/canister/git-design patch /usr/nearby/container/git-indicate branch/usr/nearby/receptacle/git-fsck /usr/nearby/canister/git-indicate list/usr/nearby/receptacle/git-fsck-objects /usr/neighborhood/container/git-demonstrate ref/usr/nearby/canister/git-gc /usr/nearby/receptacle/git-ssh-bring/usr/nearby/container/git-get-tar-submit id /usr/nearby/canister/git-ssh-pull/usr/neighborhood/receptacle/git-grep /usr/neighborhood/container/git-ssh-push/usr/nearby/container/git-gui /usr/nearby/canister/git-ssh-transfer/usr/nearby/receptacle/git-hash-object /usr/nearby/container/git-stash/usr/nearby/receptacle/git-http-fetch /usr/nearby/container/git-status/usr/neighborhood/container/git-imap-send /usr/nearby/container/git-stripspace/usr/nearby/receptacle/git-file pack /usr/neighborhood/container/git-submodule/usr/neighborhood/canister/git-init /usr/nearby/container/git-svn/usr/neighborhood/canister/git-init-db /usr/neighborhood/canister/git-svnimport/usr/neighborhood/receptacle/git-instaweb /usr/neighborhood/receptacle/git-typical ref/usr/neighborhood/canister/git-neighborhood fetch /usr/neighborhood/receptacle/git-tag/usr/nearby/receptacle/git-log /usr/neighborhood/receptacle/git-tar-tree/usr/neighborhood/container/git-lost-found /usr/nearby/container/git-unload record/usr/nearby/canister/git-ls-files /usr/neighborhood/canister/git-unload objects/usr/neighborhood/canister/git-ls-remote /usr/neighborhood/canister/git-overhaul list/usr/nearby/container/git-ls-tree /usr/neighborhood/receptacle/git-redesign ref/usr/nearby/receptacle/git-mailinfo /usr/nearby/container/git-upgrade server-information/usr/nearby/container/git-mailsplit /usr/neighborhood/canister/git-transfer document/usr/nearby/canister/git-merge /usr/neighborhood/canister/git-transfer pack/usr/neighborhood/receptacle/git-consolidate base /usr/nearby/receptacle/git-var/usr/nearby/canister/git-combine file /usr/nearby/receptacle/git-confirm pack/usr/nearby/receptacle/git-consolidate index /usr/neighborhood/container/git-check tag/usr/nearby/canister/git-combine octopus /usr/nearby/container/git-whatchanged/usr/neighborhood/receptacle/git-combine one-file /usr/neighborhood/receptacle/git-compose tree/usr/nearby/receptacle/git-blend ours /usr/neighborhood/container/gitk/usr/nearby/container/git-combine recursive

Slide 15

easy_install Paver

Slide 16

paver paverdocs

Slide 17

pavement.py

Slide 18

Why Python manufacture records? You definitely know Python The dialect principles are very much characterized The dialect tenets are all around recorded Python is intense, so you'll never be left hanging or need an escape bring forth

Slide 19

Configuration choices( setup = setup_meta, minilib=Bunch( extra_files=[ "doctools" , "virtual" ] ), sphinx=Bunch( builddir= "build" , sourcedir= "source" ), virtualenv=Bunch( packages_to_install=[ "nose" , "sphinx" , "docutils" , "virtualenv" ], install_paver=False, script_name= "bootstrap.py" , paver_command_line=None )

Slide 20

Dynamic config values >>> from paver.defaults import * >>> import time >>> options(current=lambda: time.time()) >>> options.current 1216726815.0027969

Slide 21

Namespace looking >>> choices( ... setup=Bunch(version="1.0"), ... sphinx=Bunch(builddir="docbuild") ... ) >>> options.version "1.0"

Slide 22

Namespace looking (proceeded) >>> choices( ... setup=Bunch(version="1.0"), ... sphinx=Bunch(builddir="docbuild") ... ) >>> options.order('sphinx') >>> options.version Traceback (latest call last): File "<stdin>", line 1, in <module> File "/Users/administrator/ventures/paver/paver/runtime.py", line 31, in __getattr__ raise AttributeError(name) AttributeError: rendition

Slide 23

Configuration is still standard Python You can treat alternatives like a typical, settled lexicon The main strange thing would be that callables are called.

Slide 25

Tasks @task def clean(): """Cleans up this paver index. Evacuates the virtualenv follows and the construct directory.""" pass

Slide 26

paver help paver help - > paver.tasks.help Usage: paver [global options] taskname [task options] [taskname [taskoptions]] Options: - variant demonstrate program's form number and exit - n, - dry-run don't really do anything - v, - verbose show all logging yield - q, - calm show just mistakes - i, - intuitive empower inciting - f FILE, - file=FILE read undertakings from FILE [pavement.py] - h, - show this help data Tasks from paver.misctasks: generate_setup - Generates a setup

Slide 27

paver help <taskname> Usage: paver paver.misctasks.minilib [options] Options: - h, - show this help data Create a Paver scaled down library that contains enough for a basic pavement.py to be introduced utilizing a produced setup.py. This is a decent transitory measure until more individuals have sent paver. The yield document is 'paver-minilib.zip' in the present registry. Alternatives: extra_files rundown of other paver modules to incorporate (do exclude the .py expansion). As a matter of course, the accompanying modules are incorporated: defaults, way, discharge, setuputils, misctasks, alternatives, undertakings, simple

Slide 28

@needs @task @needs("uncog") def submit(): """Removes the created code from the docs and afterward focuses on bzr.""" pass

Slide 29

@cmdopts @task @cmdopts([("username=", "u", "Username for remote server"), ("server=", "s", "Server to send to")]) def convey(): """Copy the Paver site up.""" pass

Slide 30

paver <taskname> $ paver generate_setup minilib - > generate_setup Write setup.py - > minilib Generate paver-minilib.zip

Slide 31

Paver and Distutils/Setuptools

Slide 32

python setup.py introduce

Slide 33

Paver grasps and augments Distutils (don't stress, it´┐Ż

SPONSORS