rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
def write(self, text, alert=sys._MessageBox):
def write(self, text, alert=sys._MessageBox, fname=sys.executable + '.log'):
def write(self, text, alert=sys._MessageBox): if self._file is None and self._error is None: fname = sys.executable + '.log' try: self._file = open(fname, 'a') except Exception, details: self._error = details import atexit atexit.register(alert, 0, "The logfile '%s' could be opened:\n %s" % (fname, details), "Errors oc...
fname = sys.executable + '.log'
def write(self, text, alert=sys._MessageBox): if self._file is None and self._error is None: fname = sys.executable + '.log' try: self._file = open(fname, 'a') except Exception, details: self._error = details import atexit atexit.register(alert, 0, "The logfile '%s' could be opened:\n %s" % (fname, details), "Errors oc...
"The logfile '%s' could be opened:\n %s" % (fname, details),
"The logfile '%s' could not be opened:\n %s" % \ (fname, details),
def write(self, text, alert=sys._MessageBox): if self._file is None and self._error is None: fname = sys.executable + '.log' try: self._file = open(fname, 'a') except Exception, details: self._error = details import atexit atexit.register(alert, 0, "The logfile '%s' could be opened:\n %s" % (fname, details), "Errors oc...
import sys win32evtlogutil.AddSourceToRegistry(self._svc_display_name_, sys.executable, "Application")
def __init__(self, args): import sys # The exe-file has messages for the Event Log Viewer. # Register the exe-file as event source. # # Probably it would be better if this is done at installation time, # so that it also could be removed if the service is uninstalled. # Unfortunately it cannot be done in the 'if __name_...
win32evtlogutil.ReportEvent(self._svc_display_name_,
win32evtlogutil.ReportEvent(self._svc_name_,
def SvcDoRun(self): import servicemanager # Write a 'started' event to the event log... win32evtlogutil.ReportEvent(self._svc_display_name_, servicemanager.PYS_SERVICE_STARTED, 0, # category servicemanager.EVENTLOG_INFORMATION_TYPE, (self._svc_name_, ''))
self.copy_file(dll, dst)
_, copied = self.copy_file(dll, dst) if not self.dry_run and copied and base.lower() == python_dll.lower(): self.patch_python_dll_winver(dst)
def create_binaries(self, py_files, extensions, dlls): dist = self.distribution # byte compile the python modules into the target directory print "*** byte compile python files ***" byte_compile(py_files, target_dir=self.collect_dir, optimize=self.optimize, force=0, verbose=self.verbose, dry_run=self.dry_run)
if not self.dry_run: dll = os.path.join(self.exe_dir, python_dll) if os.path.isfile(dll): self.patch_python_dll_winver(dll)
def create_binaries(self, py_files, extensions, dlls): dist = self.distribution # byte compile the python modules into the target directory print "*** byte compile python files ***" byte_compile(py_files, target_dir=self.collect_dir, optimize=self.optimize, force=0, verbose=self.verbose, dry_run=self.dry_run)
print "build_executable\n\t", target, template, arcname, script, vars
def build_executable(self, target, template, arcname, script, vars={}): print "build_executable\n\t", target, template, arcname, script, vars
svc_name, svc_display_name = self.get_service_names()
svc_name, svc_display_name, svc_deps = self.get_service_names()
def create_exe (self, exe_name, arcname, use_runw): import struct
return klass._svc_name_, klass._svc_display_name_
deps = () if hasattr(klass, "_svc_deps_"): deps = klass._svc_deps_ return klass._svc_name_, klass._svc_display_name_, deps
def get_service_names(self): # import the script without too many sideeffects import new mod = new.module("__service__") exec compile(open(self.script).read(), self.script, "exec") in mod.__dict__
if src.endswith(".py"):
suffix = os.path.splitext(src)[1] if suffix in _py_suffixes:
def parse_mf_results(self, mf): for name, imports in self.get_hidden_imports().items(): if name in mf.modules.keys(): for mod in imports: mf.import_hook(mod)
continue for suffix in _c_suffixes: if src.endswith(suffix): extensions.append(item) loader = self.create_loader(item) if loader: py_files.append(loader) break
elif suffix in _c_suffixes: extensions.append(item) loader = self.create_loader(item) if loader: py_files.append(loader)
def parse_mf_results(self, mf): for name, imports in self.get_hidden_imports().items(): if name in mf.modules.keys(): for mod in imports: mf.import_hook(mod)
if file.__file__[-3:] != ".py": raise RuntimeError, "cannot compile '%s'" % file.__file__
def byte_compile(py_files, optimize=0, force=0, target_dir=None, verbose=1, dry_run=0, direct=None): if direct is None: direct = (__debug__ and optimize == 0) # "Indirect" byte-compilation: write a temporary script and then # run it with the appropriate flags. if not direct: from tempfile import mktemp from distutils...
compile(file.__file__, cfile, dfile)
suffix = os.path.splitext(file.__file__)[1] if suffix == ".py": compile(file.__file__, cfile, dfile) elif suffix in _py_suffixes: copy_file(file.__file__, cfile) else: raise RuntimeError \ ("Don't know how to handle %r" % file.__file__)
def byte_compile(py_files, optimize=0, force=0, target_dir=None, verbose=1, dry_run=0, direct=None): if direct is None: direct = (__debug__ and optimize == 0) # "Indirect" byte-compilation: write a temporary script and then # run it with the appropriate flags. if not direct: from tempfile import mktemp from distutils...
product_version = version)
product_version = get("product_version") or version)
def get(name, md = self.distribution.metadata): # Try to get an attribute from the target, if not defined # there, from the distribution's metadata, or None. Note # that only *some* attributes are allowed by distutils on # the distribution's metadata: version, description, and # name. return getattr(target, name, geta...
boolean_options = ['unbuffered', 'optimize']
for target_def in targets: if type(target_def) in types.StringTypes : # Create a default target object, with the string as the attribute target = Target(**{default_attribute: target_def}) else: if not target_def.has_key(default_attribute): raise DistutilsOptionError, \ "This target requires a '%s' definition" % default...
required_modules = dist.com_server
required_modules = dist.com_server[:]
def run(self): # refactor, refactor, refactor! bdist_base = self.get_finalized_command('bdist').bdist_base self.bdist_dir = os.path.join(bdist_base, 'winexe')
dlls.remove(item.__file__)
if item.__file__ in dlls: dlls.remove(item.__file__)
def run(self): # refactor, refactor, refactor! bdist_base = self.get_finalized_command('bdist').bdist_base self.bdist_dir = os.path.join(bdist_base, 'winexe')
from modulefinder import ModuleFinder
from modulefinder import ModuleFinder, ReplacePackage ReplacePackage("_xmlplus", "xml")
def find_needed_modules(self, files, modules): # feed Modulefinder with everything, and return it. from modulefinder import ModuleFinder mf = ModuleFinder(excludes=self.excludes)
def find_module_path(self, modname): result = imp.find_module(modname)
def find_module_path(self, modname): result = imp.find_module(modname)
except Exception, detail:
except Exception:
def copy_dlls(self, final_dir, dlls): for src in dlls: dst = os.path.join(final_dir, os.path.basename(src)) try: self.copy_file(src, dst) except Exception, detail: import traceback traceback.print_exc()
add_resource(exe_name, str(vr), RT_VERSION, 1, delete)
try: add_resource(exe_name, str(vr), RT_VERSION, 1, delete) except RuntimeError, details: self.warn("%s\n No VersionInfo will be created" % details) return delete
def add_versioninfo(self, exe_name, delete): # "companyname filedescription fileversion" # "legalcopyright legaltrademarks originalfilename productname" # "productversion" try: from resources.VersionInfo import VS_VERSIONINFO, RT_VERSION, \ StringFileInfo, VarFileInfo, VersionError except ImportError, details: self.wa...
raise Exception, ("Seems not to be an exe-file", data)
raise Exception, ("Seems not to be an exe-file", pathname)
def isSystemDLL(pathname): if (string.lower(os.path.basename(pathname))) in EXCLUDED_DLLS: return 1 # How can we determine whether a dll is a 'SYSTEM DLL'? # Is it sufficient to use the Image Load Address? import struct file = open(pathname, "rb") if file.read(2) != "MZ": raise Exception, "Seems not to be an exe-file" ...
return "Module(%s, %s)" %\
return "Module(%s, %s, %s)" %\
def __repr__(self): if self.__path__: return "Module(%s, %s)" %\ (`self.__name__`, `self.__file__`, `self.__path__`) else: return "Module(%s, %s)" % (`self.__name__`, `self.__file__`)
["source/run.c"],
["source/run.c", "source/start.c"],
def _removefiles(self, dstdir, srcdir): if not os.path.isdir(srcdir): return for n in os.listdir(srcdir): name = os.path.join(dstdir, n) if os.path.isfile(name): self.announce("removing '%s'" % name) if not self.dry_run: os.remove(name) if os.path.splitext(name)[1] == '.py': try: os.remove(name + 'c') except: pass try:...
libraries=["zlibstat", "mylib"],
libraries=["zlibstat"],
def _removefiles(self, dstdir, srcdir): if not os.path.isdir(srcdir): return for n in os.listdir(srcdir): name = os.path.join(dstdir, n) if os.path.isfile(name): self.announce("removing '%s'" % name) if not self.dry_run: os.remove(name) if os.path.splitext(name)[1] == '.py': try: os.remove(name + 'c') except: pass try:...
["source/run_w.c"],
["source/run_w.c", "source/start.c"],
def _removefiles(self, dstdir, srcdir): if not os.path.isdir(srcdir): return for n in os.listdir(srcdir): name = os.path.join(dstdir, n) if os.path.isfile(name): self.announce("removing '%s'" % name) if not self.dry_run: os.remove(name) if os.path.splitext(name)[1] == '.py': try: os.remove(name + 'c') except: pass try:...
libraries=["zlibstat", "user32", "mylib"],
libraries=["zlibstat", "user32"],
def _removefiles(self, dstdir, srcdir): if not os.path.isdir(srcdir): return for n in os.listdir(srcdir): name = os.path.join(dstdir, n) if os.path.isfile(name): self.announce("removing '%s'" % name) if not self.dry_run: os.remove(name) if os.path.splitext(name)[1] == '.py': try: os.remove(name + 'c') except: pass try:...
from distutils import sysconfig pythoninc = sysconfig.get_python_inc()
def _removefiles(self, dstdir, srcdir): if not os.path.isdir(srcdir): return for n in os.listdir(srcdir): name = os.path.join(dstdir, n) if os.path.isfile(name): self.announce("removing '%s'" % name) if not self.dry_run: os.remove(name) if os.path.splitext(name)[1] == '.py': try: os.remove(name + 'c') except: pass try:...
ext_modules = [Extension("py2exe_util",
ext_modules = [Extension("py2exe.py2exe_util",
def _removefiles(self, dstdir, srcdir): if not os.path.isdir(srcdir): return for n in os.listdir(srcdir): name = os.path.join(dstdir, n) if os.path.isfile(name): self.announce("removing '%s'" % name) if not self.dry_run: os.remove(name) if os.path.splitext(name)[1] == '.py': try: os.remove(name + 'c') except: pass try:...
libraries = [ ("mylib", {"sources": ["source/start.c"], "include_dirs": [pythoninc, "source/zlib"], "macros": [("ZLIB_DLL", None), ("_WINDOWS", None)], }, ), ],
def _removefiles(self, dstdir, srcdir): if not os.path.isdir(srcdir): return for n in os.listdir(srcdir): name = os.path.join(dstdir, n) if os.path.isfile(name): self.announce("removing '%s'" % name) if not self.dry_run: os.remove(name) if os.path.splitext(name)[1] == '.py': try: os.remove(name + 'c') except: pass try:...
os.remove(os.path.join(self.exe_dir, python_dll))
def create_binaries(self, py_files, extensions, dlls): dist = self.distribution # byte compile the python modules into the target directory print "*** byte compile python files ***" self.compiled_files = byte_compile(py_files, target_dir=self.collect_dir, optimize=self.optimize, force=0, verbose=self.verbose, dry_run=...
install.ensure_finalized() sys_path_old = sys.path[:] sys.path.append(install.install_lib)
def run (self): if not self.distribution.scripts: # nothing to do # should raise an error! raise "Error", "Nothing to do" return
ext_mapping = {}
self.ext_mapping = {}
def visit(arg, dirname, names): if '__init__.py' in names: arg.append(dirname)
ext_mapping[ext_module.__name__] = (os.path.basename(pathname), suffix)
self.ext_mapping[ext_module.__name__] = (os.path.basename(pathname), suffix)
def visit(arg, dirname, names): if '__init__.py' in names: arg.append(dirname)
for key, value in ext_mapping.items():
for key, value in self.ext_mapping.items():
def visit(arg, dirname, names): if '__init__.py' in names: arg.append(dirname)
dlls, unfriendly_dlls = self.find_dependend_dlls(use_runw, dlls)
def visit(arg, dirname, names): if '__init__.py' in names: arg.append(dirname)
file.write("_extensions_mapping = %s\n" % `ext_mapping`)
file.write("_extensions_mapping = %s\n" % `self.ext_mapping`)
def visit(arg, dirname, names): if '__init__.py' in names: arg.append(dirname)
"Scripts.py2exe\\__main__.py"))
"Scripts.py2exe\\__main__.py"), preserve_mode=0)
file.write("def _force_imports():\n")
for key, value in ext_mapping.items():
for key, value in self.ext_mapping.items():
file.write("def _force_imports():\n")
def find_dependend_dlls(self, use_runw, dlls):
def find_dependend_dlls(self, use_runw, dlls, pypath):
def find_dependend_dlls(self, use_runw, dlls): import py2exe_util sysdir = py2exe_util.get_sysdir() windir = py2exe_util.get_windir() # This is the tail of the path windows uses when looking for dlls # XXX On Windows NT, the SYSTEM directory is also searched exedir = os.path.dirname(sys.executable) syspath = os.environ...
fclus = 4
fclus = 5
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
groups = [] phrases = []
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
for cc_i in range(head, head+num):
for cc_i in range(head, head+num+1):
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
floatImage.save_PNG(r"/home/olzzen/fh/6sem/dia/houghDomain.png") image0.save_PNG(r"/home/olzzen/fh/6sem/dia/out2.png")
floatImage.save_PNG(r"houghDomain.png") image0.save_PNG(r"out2.png")
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
for x in range(5):
for x in range(0,179):
def calcMax(img, RT_c): """Searches for maxima in Hough-Space. When found, stores the pixelvalue and the x/y-coordinates.""" max = [] temp_max = (0.0,0,0) maxima = 0.0 for x in range(5): for y in range(img.nrows): if maxima <= img.get((x,y)): maxima = img.get((x, y)) if maxima > RT_c: temp_max = (maxima, x, y) max.app...
for x in range(85,95):
""" for x in range(85,95):
def calcMax(img, RT_c): """Searches for maxima in Hough-Space. When found, stores the pixelvalue and the x/y-coordinates.""" max = [] temp_max = (0.0,0,0) maxima = 0.0 for x in range(5): for y in range(img.nrows): if maxima <= img.get((x,y)): maxima = img.get((x, y)) if maxima > RT_c: temp_max = (maxima, x, y) max.app...
"""
def calcMax(img, RT_c): """Searches for maxima in Hough-Space. When found, stores the pixelvalue and the x/y-coordinates.""" max = [] temp_max = (0.0,0,0) maxima = 0.0 for x in range(5): for y in range(img.nrows): if maxima <= img.get((x,y)): maxima = img.get((x, y)) if maxima > RT_c: temp_max = (maxima, x, y) max.app...
def string_segmentation(args, cluster, ccs, string, groups, H_a, theta, R, hough_image): global position
def super_cmp( x, y ): tmp = x[2] - y[2] if tmp == 0: return 0 if tmp < 0: return int(floor(tmp)) if tmp > 0: return int(ceil(tmp)) def string_segmentation(args, cluster, ccs, string, groups, phrases, H_a, theta, R, hough_image, image):
def string_segmentation(args, cluster, ccs, string, groups, H_a, theta, R, hough_image): global position """This function should perform the string segmentation."""
groups = []
gn = 0 phrase = 0
def string_segmentation(args, cluster, ccs, string, groups, H_a, theta, R, hough_image): global position """This function should perform the string segmentation."""
groups.append( ("i", [], [], 0) )
groups.append( ["i", None, None, 0] )
def string_segmentation(args, cluster, ccs, string, groups, H_a, theta, R, hough_image): global position """This function should perform the string segmentation."""
string.append(ccs[n])
rho = abs((i - (hough_image.nrows / 2)) * (-1) * R) string.append( [ccs[n], rho, None] )
def string_segmentation(args, cluster, ccs, string, groups, H_a, theta, R, hough_image): global position """This function should perform the string segmentation."""
for r in cluster: rho = abs((r - (hough_image.nrows / 2)) * (-1) * R) for d in string: if theta == 0: distance = int(abs(sqrt(pow(rho, 2) - pow(d.center_y, 2)))) if theta == 90: distance = int(abs(sqrt(pow(rho, 2) - pow(d.center_x, 2)))) if theta == 180: distance = int(abs(sqrt(pow(rho, 2) - pow(d.center_x, 2)))) i...
def string_segmentation(args, cluster, ccs, string, groups, H_a, theta, R, hough_image): global position """This function should perform the string segmentation."""
print "distances (sorted): ", distances
for cc in string: hyp = abs(sqrt( pow(cc[0].center_y,2) + pow(cc[0].center_x,2) )) distance = abs(sqrt( pow(hyp, 2) - pow(cc[1], 2) )) cc[2] = distance string.sort(cmp=super_cmp) for cc_i in range(len(string)): offset = 0 tmp_strings = [string[cc_i]] i = 4 while i > 0: offset += 1 new_cc = cc_i + offset if new_cc ...
def string_segmentation(args, cluster, ccs, string, groups, H_a, theta, R, hough_image): global position """This function should perform the string segmentation."""
print "CCs der Maximas: ", args[0][theta][rho]
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
print "Cluster ", cluster
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
print "clustern: ", cluster_cc_pos_list
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
break
breakx
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
print "Recluster ", cluster
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
string_segmentation(args, cluster, ccs, string, groups, H_a, theta, int(R), floatImage)
phrases = [] string_segmentation(args, cluster, ccs, string, groups, phrases, H_a, theta, int(R), floatImage, image0) print "Sätze ", phrases for p in phrases: for g in p: head = g[1] num = g[3] if head != None: rand_color = RGBPixel( randrange(0,255), randrange(0,255), randrange(0,255) ) for cc_i in range(head, h...
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
floatImage.save_PNG(r"/home/olzzen/fh/6sem/dia/houghDomain.png")
floatImage.save_PNG(r"/home/pragma/workspace/svn_dia-tss/houghDomain.png") image0.save_PNG(r"/home/pragma/workspace/svn_dia-tss/out2.png")
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
drawFoundLines(max, onebit0.ncols, onebit0.nrows, output_image, R)
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
print str[4]
def string_segmentation(args, cluster, ccs, string, groups, phrases, H_a, theta, R, hough_image, image): """This function should perform the string segmentation."""
if str[4] <= str[3] and str[4] != None:
if str[4] != None and str[4] <= str[3]:
def string_segmentation(args, cluster, ccs, string, groups, phrases, H_a, theta, R, hough_image, image): """This function should perform the string segmentation."""
print "Wortgruppe komplett"
def string_segmentation(args, cluster, ccs, string, groups, phrases, H_a, theta, R, hough_image, image): """This function should perform the string segmentation."""
phrases[-1].append( groups[gn] ) groups[gn][0] = 'p'
def string_segmentation(args, cluster, ccs, string, groups, phrases, H_a, theta, R, hough_image, image): """This function should perform the string segmentation."""
print "Performing hough transformation:"
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
groups = [] phrases = []
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
while count != 1:
while count <= 1:
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
print "Calculate maximas:"
print "--------------------------------- ", RT_c
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
print "Sätze ", phrases
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
print cc
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
os.system("free -m") os.system("read")
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
count = 1
count += 1 if count == 1: args = [] RT_c = 20 floatImage = tss.plugins.TextStringSep.hough_transform(ccs, args, [0.0,180.0],R,1.0,onebit0.ncols,onebit0.nrows)
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] image0 = load_image(r"%s"%input_image) onebit0 = image0.to_onebit() print "Performing area ra...
for x in range(0,5):
for x in range(0,180):
def calcMax(img, RT_c): """Searches for maxima in Hough-Space. When found, stores the pixelvalue and the x/y-coordinates.""" max = [] temp_max = (0.0,0,0) maxima = 0.0 for x in range(0,5): for y in range(img.nrows): if maxima <= img.get((x,y)): maxima = img.get((x, y)) if maxima > RT_c: temp_max = (maxima, x, y) max.a...
maxima = 0.0 for x in range(85,95): for y in range(img.nrows): if maxima <= img.get((x, y)): maxima = img.get((x, y)) if maxima > RT_c: temp_max = (maxima,x,y) max.append(temp_max) maxima = 0.0 for x in range(175,181): for y in range(img.nrows): if maxima <= img.get((x, y)): maxima = img.get((x, y)) if maxima > RT_c...
def calcMax(img, RT_c): """Searches for maxima in Hough-Space. When found, stores the pixelvalue and the x/y-coordinates.""" max = [] temp_max = (0.0,0,0) maxima = 0.0 for x in range(0,5): for y in range(img.nrows): if maxima <= img.get((x,y)): maxima = img.get((x, y)) if maxima > RT_c: temp_max = (maxima, x, y) max.a...
onebit0 = image0.to_onebit()
if image0.pixel_type_name != "OneBit": onebit0 = image0.to_onebit() else: onebit0 = image0
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] # load image image0 = load_image(r"%s"%input_image) # convert it to onebit onebit0 = image...
print "Performing area ratio filter:"
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] # load image image0 = load_image(r"%s"%input_image) # convert it to onebit onebit0 = image...
image0.highlight(cc, rand_color )
cc.fill_white()
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] # load image image0 = load_image(r"%s"%input_image) # convert it to onebit onebit0 = image...
os.system("free -m")
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] # load image image0 = load_image(r"%s"%input_image) # convert it to onebit onebit0 = image...
floatImage.save_PNG(r"houghDomain.png") image0.save_PNG(r"out2.png") print "-----------------------------------------------------"
onebit0.save_PNG(r"grafik.png")
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] # load image image0 = load_image(r"%s"%input_image) # convert it to onebit onebit0 = image...
del string del phrases del groups string = None phrases = None groups = None
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] # load image image0 = load_image(r"%s"%input_image) # convert it to onebit onebit0 = image...
os.system("free -m") del floatImage gc.collect() os.system("free -m")
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] # load image image0 = load_image(r"%s"%input_image) # convert it to onebit onebit0 = image...
os.system("read")
def main(): if len(argv) != 3: print "to few arguments in call to %s" %argv[0] print "usage: %s input.png output.png" %argv[0] exit(-1) init_gamera() from gamera.toolkits import tss input_image = argv[1] output_image = argv[2] # load image image0 = load_image(r"%s"%input_image) # convert it to onebit onebit0 = image...
def Lab2Plot(labfile, output, attributeName, filter, childScope, labelAttribute):
def Lab2Plot(labfile, output, segmentationAttribute, filter, childScope, labelAttribute):
def Lab2Plot(labfile, output, attributeName, filter, childScope, labelAttribute): print >> output, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' print >> output, '<DescriptorsPool>' print >> output, '\t<ScopePool name="Song" size="1">' tokens = list() labelFilter = re.compile(filter) for line in labfile: se...
print >> output, '\t\t<AttributePool name="%s" size="%s">'%(attributeName, len(tokens)) ,
print >> output, '\t\t<AttributePool name="%s" size="%s">'%(segmentationAttribute, len(tokens)*2) ,
def Lab2Plot(labfile, output, attributeName, filter, childScope, labelAttribute): print >> output, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' print >> output, '<DescriptorsPool>' print >> output, '\t<ScopePool name="Song" size="1">' tokens = list() labelFilter = re.compile(filter) for line in labfile: se...
print >> output, float(segment[0])*sampleRate, float(segment[1])*sampleRate,
print >> output, int(round(float(segment[0])*sampleRate)), int(round(float(segment[1])*sampleRate)),
def Lab2Plot(labfile, output, attributeName, filter, childScope, labelAttribute): print >> output, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' print >> output, '<DescriptorsPool>' print >> output, '\t<ScopePool name="Song" size="1">' tokens = list() labelFilter = re.compile(filter) for line in labfile: se...
(labfilename,attributeName) = sys.argv[1:3]
(labFileList,segmentationAttribute) = sys.argv[1:3]
def Lab2Plot(labfile, output, attributeName, filter, childScope, labelAttribute): print >> output, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' print >> output, '<DescriptorsPool>' print >> output, '\t<ScopePool name="Song" size="1">' tokens = list() labelFilter = re.compile(filter) for line in labfile: se...
(labfilename,attributeName,filter) = sys.argv[1:4]
(labFileList,segmentationAttribute,filter) = sys.argv[1:4]
def Lab2Plot(labfile, output, attributeName, filter, childScope, labelAttribute): print >> output, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' print >> output, '<DescriptorsPool>' print >> output, '\t<ScopePool name="Song" size="1">' tokens = list() labelFilter = re.compile(filter) for line in labfile: se...
(labfilename,attributeName,childScope,labelAttribute) = sys.argv[1:5]
(labFileList,segmentationAttribute,childScope,labelAttribute) = sys.argv[1:5]
def Lab2Plot(labfile, output, attributeName, filter, childScope, labelAttribute): print >> output, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' print >> output, '<DescriptorsPool>' print >> output, '\t<ScopePool name="Song" size="1">' tokens = list() labelFilter = re.compile(filter) for line in labfile: se...
(labfilename,attributeName,filter,childScope,labelAttribute) = sys.argv[1:6]
(labFileList,segmentationAttribute,filter,childScope,labelAttribute) = sys.argv[1:6]
def Lab2Plot(labfile, output, attributeName, filter, childScope, labelAttribute): print >> output, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' print >> output, '<DescriptorsPool>' print >> output, '\t<ScopePool name="Song" size="1">' tokens = list() labelFilter = re.compile(filter) for line in labfile: se...
print >> sys.stderr, "Usage: " + sys.argv[0] + " <labFile> <attributeName> [<labelFilter>] [<childScope> <labelAttribute>]"
print >> sys.stderr, "Usage: " + sys.argv[0] + " <labFile> <segmentationAttr> [<labelFilter>] [<childScope> <labelAttribute>]"
def Lab2Plot(labfile, output, attributeName, filter, childScope, labelAttribute): print >> output, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' print >> output, '<DescriptorsPool>' print >> output, '\t<ScopePool name="Song" size="1">' tokens = list() labelFilter = re.compile(filter) for line in labfile: se...
print >> sys.stderr, " <labFile> An annotation file from wave surfer" print >> sys.stderr, " <attributeName> Attribute name for the segmentation" print >> sys.stderr, " <labelFilter> A regular expresion to filter segments by label (default: all segments)" print >> sys.stderr, " <childScope> If defined th...
print >> sys.stderr, " <labFileList> A list of annotation files from wave surfer ('-' means stdin)" print >> sys.stderr, " <segmentationAttr> Attribute name for the segmentation" print >> sys.stderr, " <labelFilter> A regular expresion to filter segments by label (default: all segments)" print >> sys.stder...
def Lab2Plot(labfile, output, attributeName, filter, childScope, labelAttribute): print >> output, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' print >> output, '<DescriptorsPool>' print >> output, '\t<ScopePool name="Song" size="1">' tokens = list() labelFilter = re.compile(filter) for line in labfile: se...
print Lab2Plot( file(labfilename), file(labfilename+".pool","w"), attributeName, filter, childScope, labelAttribute)
if labFileList == '-' : labFileList = sys.stdin labelValues = []; for labfilename in labFileList : labfilename = labfilename.lstrip().rstrip() values = Lab2Plot( file(labfilename), file(labfilename+".pool","w"), segmentationAttribute, filter, childScope, labelAttribute) labelValues += values labelValues = dict.fromkey...
def Lab2Plot(labfile, output, attributeName, filter, childScope, labelAttribute): print >> output, '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' print >> output, '<DescriptorsPool>' print >> output, '\t<ScopePool name="Song" size="1">' tokens = list() labelFilter = re.compile(filter) for line in labfile: se...
makecmd = 'scons clam_prefix=%s install_prefix=.' % clam_prefix
makecmd = 'scons clam_prefix=%s' % clam_prefix
def compileAndRun(name, path, useScons) : global foundCompilationErrors, foundExecutionErrors, foundTestsFailures, configurations if name == '' : return 'found invalid test (see message above)', '', TestResult() os.chdir(path) # compilation phase summaryText = [''] testResult = TestResult() testResult.name = name det...
Detailed status of CLAM and externals apps.
Status of CLAM and externals apps.
def compileAndRun(name, path, useScons) : global foundCompilationErrors, foundExecutionErrors, foundTestsFailures, configurations if name == '' : return 'found invalid test (see message above)', '', TestResult() os.chdir(path) # compilation phase summaryText = [''] testResult = TestResult() testResult.name = name det...
if useScons : withoutSlash += ' LD_LIBRARY_PATH=%s/lib' % clam_prefix
def runInBackgroundForAWhile(path, command, sleeptime=10, useScons='') : os.chdir(path) time.sleep( sleeptime ) withoutSlash = command[command.find('/')+1 : ] if useScons : withoutSlash += ' LD_LIBRARY_PATH=%s/lib' % clam_prefix status, dummy = commands.getstatusoutput('killall '+ withoutSlash) # print 'kill status ',...
self.AppendUnique(CPPFLAGS='-DQT_GUI_LIB')
self.AppendUnique(CPPFLAGS=['-DQT_GUI_LIB'])
def enable_modules(self, modules, debug=False) : import sys validModules = [ 'QtCore', 'QtGui', 'QtOpenGL', 'Qt3Support', # The next modules have not been tested yet so, please # maybe they require additional work on non Linux platforms 'QtSql', 'QtNetwork', 'QtSvg', 'QtTest', 'QtXml', 'QtUiTools', ] pclessModules = [...
cmd = "cvs rlog -N -r%s -r%s %s" % (fst, sec, file)
cmd = "cvs rlog -N -r%s::%s %s" % (fst, sec, file)
def queryLogs(module) : filename = "cvsdiff-%s" % module lines = open(filename).readlines() diffs = filter(lambda line:line.find("diff -c")==0, lines) "\n".join(diffs) authors = Set() logs = [] for diff in diffs : type, file, fst, sec = getFilenameAndTags(diff) if type != ChangedFile: #TODO have into account new/re...
def enable_modules(self, modules) :
def enable_modules(self, modules, debug=False) :
def enable_modules(self, modules) : import sys if sys.platform == "linux2" : self.ParseConfig('PKG_CONFIG_PATH=%s/lib/pkgconfig pkg-config %s --libs --cflags'% ( self['QTDIR'], ' '.join(modules))) return if sys.platform == "win32" : self.AppendUnique(LIBS=[lib+'4' for lib in modules]) if 'QtOpenGL' in modules: self.App...