ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ M!Vc@sddlmZddlmZddlZddlZddlZddlmZddlm Z ddlm Z ddl m Z d e fd YZ d e fd YZddd ZedkrendS(i(tArgumentParseri(tSafeConfigParserN(tcommand(tutil(t package_dir(tcompattConfigcBseZdZd dd ejd ejd dZd Z d Z d Z ej dZ dZej dZdZdZdZd Zd Zd d Zd d ZRS(sk Represent an Alembic configuration. Within an ``env.py`` script, this is available via the :attr:`.EnvironmentContext.config` attribute, which in turn is available at ``alembic.context``:: from alembic import context some_param = context.config.get_main_option("my option") When invoking Alembic programatically, a new :class:`.Config` can be created by passing the name of an .ini file to the constructor:: from alembic.config import Config alembic_cfg = Config("/path/to/yourapp/alembic.ini") With a :class:`.Config` object, you can then run Alembic commands programmatically using the directives in :mod:`alembic.command`. The :class:`.Config` object can also be constructed without a filename. Values can be set programmatically, and new sections will be created as needed:: from alembic.config import Config alembic_cfg = Config() alembic_cfg.set_main_option("script_location", "myapp:migrations") alembic_cfg.set_main_option("url", "postgresql://foo/bar") alembic_cfg.set_section_option("mysection", "foo", "bar") For passing non-string values to environments, such as connections and engines, use the :attr:`.Config.attributes` dictionary:: with engine.begin() as connection: alembic_cfg.attributes['connection'] = connection command.upgrade(alembic_cfg, "head") :param file_: name of the .ini file to open. :param ini_section: name of the main Alembic section within the .ini file :param output_buffer: optional file-like input buffer which will be passed to the :class:`.MigrationContext` - used to redirect the output of "offline generation" when using Alembic programmatically. :param stdout: buffer where the "print" output of commands will be sent. Defaults to ``sys.stdout``. .. versionadded:: 0.4 :param config_args: A dictionary of keys and values that will be used for substitution in the alembic config file. The dictionary as given is **copied** to a new one, stored locally as the attribute ``.config_args``. When the :attr:`.Config.file_config` attribute is first invoked, the replacement variable ``here`` will be added to this dictionary before the dictionary is passed to ``SafeConfigParser()`` to parse the .ini file. .. versionadded:: 0.7.0 :param attributes: optional dictionary of arbitrary Python keys/values, which will be populated into the :attr:`.Config.attributes` dictionary. .. versionadded:: 0.7.5 .. seealso:: :ref:`connection_sharing` talembiccCsY||_||_||_||_||_t||_|rU|jj|ndS(s*Construct a new :class:`.Config` N( tconfig_file_nametconfig_ini_sectiont output_buffertstdouttcmd_optstdictt config_argst attributestupdate(tselftfile_t ini_sectionR R R RR((s?/opt/alt/python27/lib/python2.7/site-packages/alembic/config.pyt__init__Us     cCsiS(sA Python dictionary for storage of additional state. This is a utility dictionary which can include not just strings but engines, connections, schema objects, or anything else. Use this to pass objects into an env.py script, such as passing a :class:`sqlalchemy.engine.base.Connection` when calling commands from :mod:`alembic.command` programmatically. .. versionadded:: 0.7.5 .. seealso:: :ref:`connection_sharing` :paramref:`.Config.attributes` ((R((s?/opt/alt/python27/lib/python2.7/site-packages/alembic/config.pyR}scGs'tj|jtj||ddS(s!Render a message to standard out.s N(Rtwrite_outstreamR Rt text_type(Rttexttarg((s?/opt/alt/python27/lib/python2.7/site-packages/alembic/config.pyt print_stdoutscCs|jr-tjjtjj|j}nd}||jdd?6}xO|D]G}||kr||}|d@dA!|dA}}|j||qqWx[|D]S}|d?krgj|dBdCd|j|q0j|d|j|q0WdS(DNs-ts --templateR4tgenericttypethelps"Setup template for use with 'init'ttemplates-ms --messages%Message string to use with 'revision'tmessages--sqltactiont store_truesADon't emit SQL to database - dump to standard output/file insteadtsqls--tags<Arbitrary 'tag' name - can be used by custom env.py scripts.ttags--headsCSpecify head revision or @head to base new revision on.theads--splices6Allow a non-head revision as the 'head' to splice ontotsplices --depends-ontappendsNSpecify one or more revision identifiers which this revision should depend on.t depends_ons--rev-ids9Specify a hardcoded revision id instead of generating onetrev_ids--version-paths2Specify specific path from config for version filet version_paths--branch-labels3Specify a branch label to apply to the new revisiont branch_labels-vs --verbosesUse more verbose outputtverboses--resolve-dependenciess+Treat dependency versions as down revisionstresolve_dependenciess--autogeneratesgPopulate revision script with candidate migration operations, based on comparison of database to model.t autogenerates --head-onlys0Deprecated. Use --verbose for additional outputt head_onlys-rs --rev-rangetstores1Specify a revision range; format is [start]:[end]t rev_rangeslocation of scripts directoryt directorysrevision identifiertrevisions/one or more revisions, or 'heads' for all headst revisionsiitnargst+(R tstrt add_argumentR3(tparsert positionaltkwargst kwargs_optstpositional_helpRtargstkw(t subparser(s?/opt/alt/python27/lib/python2.7/site-packages/alembic/config.pyt add_optionss                    R@s-cs--configRBR4s alembic.iniRCsAlternate config files-ns--nameRs6Name of section in .ini file to use for Alembic configs-xRFRLslAdditional arguments consumed by custom env.py scripts, e.g. -x setting1=somesetting -x setting2=somesettings --raiseerrRGs!Raise a full stack trace on errorit_salembic.commandiitcmd(RR]R\tadd_subparserstdirRtgetattrtinspectt isfunctionR7R8t getargspectlent add_parserR9t set_defaultsR^( RR@RfR^t subparserstntfntspecR_tkwarg((Res?/opt/alt/python27/lib/python2.7/site-packages/alembic/config.pyR?s> /    csj\}}}yF||g|D]}t|^q"tfd|DWn8tjk r}jr|qtjt|nXdS(Nc3s$|]}|t|fVqdS(N(Rk(t.0tk(toptions(s?/opt/alt/python27/lib/python2.7/site-packages/alembic/config.pys s(RhRkR RR1traiseerrterrR\(RtconfigRyRtR_RvRxte((Rys?/opt/alt/python27/lib/python2.7/site-packages/alembic/config.pytrun_cmds! cCsi|jj|}t|ds4|jjdn1td|jd|jd|}|j||dS(NRhstoo few argumentsRRR (R^t parse_argsthasattrterrorRR|R'R~(RtargvRytcfg((s?/opt/alt/python27/lib/python2.7/site-packages/alembic/config.pytmains N(R7R8R:RR?R~R(((s?/opt/alt/python27/lib/python2.7/site-packages/alembic/config.pyR>s  cKstd|jd|dS(s(The console runner function for Alembic.R@RN(R>R(RR@R`((s?/opt/alt/python27/lib/python2.7/site-packages/alembic/config.pyRst__main__(targparseRt util.compatRRlRR;RRRRRtobjectRR>R:RR7(((s?/opt/alt/python27/lib/python2.7/site-packages/alembic/config.pyts