• netsh interface ipv4 set interface [InterfaceNameOrIndex] weakhostsend=enabled|disabled
• netsh interface ipv4 set interface [InterfaceNameOrIndex] weakhostreceive=enabled|disabled
• netsh interface ipv6 set interface [InterfaceNameOrIndex] weakhostsend=enabled|disabled
• netsh interface ipv6 set interface [InterfaceNameOrIndex] weakhostreceive=enabled|disabled
# Author: Roman V. Kiseliov # Purpose: update version information in EXE import os from py2exe.resources.VersionInfo import VS_VERSIONINFO, RT_VERSION, StringFileInfo, VarFileInfo, VersionError from py2exe.py2exe_util import add_resource def update_version(exe_path): strings = [] version = "1,1,1,1" # standard info strings.append(("FileVersion", version)) strings.append(("ProductVersion", version)) strings.append(("OriginalFilename", os.path.basename(exe_path))) strings.append(("Comments", "comments")) strings.append(("CompanyName", "company_name")) strings.append(("FileDescription", "file_description")) strings.append(("InternalName", "internal_name")) strings.append(("LegalCopyright", "legal_copyright")) strings.append(("LegalTrademarks", "legal_trademarks")) strings.append(("PrivateBuild", "private_build")) strings.append(("ProductName", "product_name")) strings.append(("SpecialBuild", "special_build")) # something on my own strings.append(('Some data on my own', 'on my own')) try: vs = VS_VERSIONINFO(version, [StringFileInfo("041904B0", strings), VarFileInfo(0x04B00419)]) bytes = str(vs) except VersionError, detail: print "Version Info will not be included:\n %s" % detail return add_resource(unicode(exe_path), bytes, RT_VERSION, 1, False) if __name__ == "__main__": update_version("foobar.exe")
add_resource(exe, res_bytes, u"MYRESTYPE", res_id, True) # resource type in upper-case add_resource(exe, bmp_data[14:], RT_BITMAP, bmp_id, False) add_resource(exe, manifest, RT_MANIFEST, mfest_id, False) add_icon(exe, ico_filename, ico_id)
# Author: Roman V. Kiseliov # Purpose: illustrate basic work with in-process python Mercurial hooks from mercurial.node import nullrev, short from mercurial.util import datestr, Abort data_fmt_str = "%s changeset:\n\tnode=%s,\n\trev=%i,\n\tshort=%s,\n\tdate=%s\n" date_fmt_str = '%Y-%m-%d %H:%M:%S %1%2' # To fire up hook following must be stated in 'hgrc' supposed # 'hooks/update-build-info.py' is placed in root of working directory: # # [hooks] # commit.update-build-info = python:./hooks/update-build-info.py:myhook # def myhook(ui, repo, hooktype, *args, **kwargs): if hooktype != 'commit': raise Abort('Hooktype "%s" is not supported.' % hooktype) try: print 'root:', repo.root str_nodes = [(kwargs["node"], 'committed'), (kwargs["parent1"], 'parent #1'), (kwargs["parent2"], 'parent #2')] for str_node, description in str_nodes: if str_node: # <ugly> # node = repo.lookup(str_node) # log = repo.changelog # rev = log.rev(node) # changes = log.read(node) # date = datestr(changes[2], date_fmt_str) # </ugly> changeset_context = repo[str_node] node = changeset_context.node() rev = changeset_context.rev() date = changeset_context.date() date = datestr(date, date_fmt_str) data_tuple = (description, str_node, rev, short(node), date) print data_fmt_str % data_tuple except Exception, e: raise Abort('Hook has encountered an error "%s".' % e.message)
diff -r ac02b43bc08a -r ae77dcc39dc0 mercurial/hook.py --- a/mercurial/hook.py Mon Jul 27 18:38:20 2009 -0500 +++ b/mercurial/hook.py Wed Aug 05 03:56:01 2009 +0400 @@ -110,9 +110,9 @@ if hasattr(cmd, '__call__'): r = _pythonhook(ui, repo, name, hname, cmd, args, throw) or r elif cmd.startswith('python:'): - if cmd.count(':') == 2: - path, cmd = cmd[7:].split(':') - mod = extensions.loadpath(path, 'hgkook.%s' % hname) + if cmd.count(':') >= 2: + path, cmd = cmd[7:].rsplit(':', 1) + mod = extensions.loadpath(path, 'hghook.%s' % hname) hookfn = getattr(mod, cmd) else: hookfn = cmd[7:].strip()
![]() | You are viewing Log in Create a LiveJournal Account Learn more |