rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
extra = '.lib' src = os.path.join(self.build_temp, name + extra) dst = os.path.join(self.build_temp, "..", ext.name + extra) | prefix = '' extra = extra + '.lib' src = os.path.join(self.build_temp, prefix + name + extra) dst = os.path.join(self.build_temp, "..", prefix + ext.name + extra) | def build_extension(self, ext): # some source files are compiled for different extensions # with special defines. So we cannot use a shared # directory for objects, we must use special ones. old_temp = self.build_temp try: self.build_temp = os.path.join(self.build_temp, ext.name) |
subObj.BuildEvents() | if subObj.flags & axscript.SCRIPTITEM_ISSOURCE: subObj.BuildEvents() | def FindBuildSubItemEvents(self): # Called during connection to event source. Seeks out and connects to # all children. As per the AX spec, this is not recursive # (ie, children sub-items are not seeked) try: multiTypeInfo = self.dispatch.QueryInterface(axscript.IID_IProvideMultipleClassInfo) numTypeInfos = multiType... |
swig_cmd.extend(["-o", os.path.abspath(target), os.path.abspath(source)]) log.info("swigging %s to %s", source, target) out_dir = os.path.dirname(source) cwd = os.getcwd() os.chdir(out_dir) try: self.spawn(swig_cmd) finally: os.chdir(cwd) | if newer(os.path.abspath(source), os.path.abspath(target)): swig_cmd.extend(["-o", os.path.abspath(target), os.path.abspath(source)]) log.info("swigging %s to %s", source, target) out_dir = os.path.dirname(source) cwd = os.getcwd() os.chdir(out_dir) try: self.spawn(swig_cmd) finally: os.chdir(cwd) else: log.info("skipp... | def swig_sources (self, sources): new_sources = [] swig_sources = [] swig_targets = {} # XXX this drops generated C/C++ files into the source tree, which # is fine for developers who want to distribute the generated # source -- but there should be an option to put SWIG output in # the temp dir. # XXX - further, the way... |
long_description="Includes access to much of the Win32 API, the " "ability to create and use COM objects, and the " "Pythonwin environment", | long_description="Includes access to much of the Win32 API, the\n" "ability to create and use COM objects, and the\n" "Pythonwin environment.", | def convert_optional_data_files(files): ret = [] for file in files: try: temp = convert_data_files([file]) except RuntimeError, details: if not str(details).startswith("No file"): raise log.info('NOTE: Optional file %s not found - skipping' % file) else: ret.append(temp[0]) return ret |
options = {"bdist_wininst": {"install_script": "pywin32_postinstall.py"}}, | options = {"bdist_wininst": {"install_script": "pywin32_postinstall.py", "pre_install_script": "pywin32_preinstall.py", }, }, | def convert_optional_data_files(files): ret = [] for file in files: try: temp = convert_data_files([file]) except RuntimeError, details: if not str(details).startswith("No file"): raise log.info('NOTE: Optional file %s not found - skipping' % file) else: ret.append(temp[0]) return ret |
return className[1:] + '_' | return demunge_leading_underscores(className) | def MakePublicAttributeName(className, is_global = False): # Given a class attribute that needs to be public, convert it to a # reasonable name. # Also need to be careful that the munging doesnt # create duplicates - eg, just removing a leading "_" is likely to cause # a clash. # if is_global is True, then the name is ... |
mod_doc = "<no module found>" return "<win32com.gen_py.%s.%s>" % (mod_doc, self.__class__.__name__) | mod_name = "win32com.gen_py.unknown" return "<%s.%s>" % (mod_name, self.__class__.__name__) | def __repr__(self): # Need to get the docstring for the module for this class. try: mod_doc = sys.modules[self.__class__.__module__].__doc__ except KeyError: mod_doc = "<no module found>" return "<win32com.gen_py.%s.%s>" % (mod_doc, self.__class__.__name__) |
key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, tzRegKeyPath, 0, win32con.KEY_READ ) | key = _winreg.OpenKeyEx( _winreg.HKEY_LOCAL_MACHINE, tzRegKeyPath ) | def __init__( self, timeZoneName, fixedStandardTime=False ): self.timeZoneName = timeZoneName tzRegKeyPath = os.path.join( self.tzRegKey, timeZoneName ) try: key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, tzRegKeyPath, 0, win32con.KEY_READ ) except: raise ValueError, 'Timezone Name %s not found.' % timeZoneN... |
self._LoadInfoFromKey( key ) self.fixedStandardTime = fixedStandardTime | return key | def __init__( self, timeZoneName, fixedStandardTime=False ): self.timeZoneName = timeZoneName tzRegKeyPath = os.path.join( self.tzRegKey, timeZoneName ) try: key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, tzRegKeyPath, 0, win32con.KEY_READ ) except: raise ValueError, 'Timezone Name %s not found.' % timeZoneN... |
self.displayName = win32api.RegQueryValueEx( key, "Display" )[0] self.standardName = win32api.RegQueryValueEx( key, "Std" )[0] self.daylightName = win32api.RegQueryValueEx( key, "Dlt" )[0] | self.displayName = _winreg.QueryValueEx( key, "Display" )[0] self.standardName = _winreg.QueryValueEx( key, "Std" )[0] self.daylightName = _winreg.QueryValueEx( key, "Dlt" )[0] | def _LoadInfoFromKey( self, key ): """Loads the information from an opened time zone registry key into relevant fields of this TZI object""" self.displayName = win32api.RegQueryValueEx( key, "Display" )[0] self.standardName = win32api.RegQueryValueEx( key, "Std" )[0] self.daylightName = win32api.RegQueryValueEx( key, "... |
winTZI, type = win32api.RegQueryValueEx( key, "TZI" ) | winTZI, type = _winreg.QueryValueEx( key, "TZI" ) | def _LoadInfoFromKey( self, key ): """Loads the information from an opened time zone registry key into relevant fields of this TZI object""" self.displayName = win32api.RegQueryValueEx( key, "Display" )[0] self.standardName = win32api.RegQueryValueEx( key, "Std" )[0] self.daylightName = win32api.RegQueryValueEx( key, "... |
if dt is None: return None | if dt is None: return | def utcoffset( self, dt ): "Calculates the utcoffset according to the datetime.tzinfo spec" if dt is None: return None return -( self.bias + self.dst( dt ) ) |
if dt is None: return None | if dt is None: return | def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return None assert dt.tzinfo is self result = self.standardBiasOffset |
yield win32api.RegEnumKey( key, index ) | yield func( key, index ) | def _RegKeyEnumerator( key ): "Enumerates an open registry key as an iterable generator" index = 0 try: while 1: yield win32api.RegEnumKey( key, index ) index += 1 except win32api.error: pass |
except win32api.error: pass | except WindowsError: pass def _RegKeyDict( key ): values = _RegValueEnumerator( key ) values = tuple( values ) return dict( map( lambda (name,value,type): (name,value), values ) ) | def _RegKeyEnumerator( key ): "Enumerates an open registry key as an iterable generator" index = 0 try: while 1: yield win32api.RegEnumKey( key, index ) index += 1 except win32api.error: pass |
key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, TimeZoneInfo.tzRegKey, 0, win32con.KEY_READ ) | key = _winreg.OpenKeyEx( _winreg.HKEY_LOCAL_MACHINE, TimeZoneInfo.tzRegKey ) | def GetTimeZoneNames( ): "Returns the names of the time zones as defined in the registry" key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, TimeZoneInfo.tzRegKey, 0, win32con.KEY_READ ) return _RegKeyEnumerator( key ) |
def GetIndexedTimeZoneNames( ): """Returns the names of the time zones as defined in the registry, but includes the index by which they may be sorted longitudinally.""" | def GetIndexedTimeZoneNames( index_key = 'Index' ): """Returns the names of the time zones as defined in the registry, but includes an index by which they may be sorted. Default index is "Index" by which they may be sorted longitudinally.""" | def GetIndexedTimeZoneNames( ): """Returns the names of the time zones as defined in the registry, but includes the index by which they may be sorted longitudinally.""" for timeZoneName in GetTimeZoneNames(): tzRegKeyPath = os.path.join( TimeZoneInfo.tzRegKey, timeZoneName ) key = win32api.RegOpenKeyEx( win32con.HKEY_L... |
key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, tzRegKeyPath, 0, win32con.KEY_READ ) tzIndex, type = win32api.RegQueryValueEx( key, 'Index' ) | key = _winreg.OpenKeyEx( _winreg.HKEY_LOCAL_MACHINE, tzRegKeyPath ) tzIndex, type = _winreg.QueryValueEx( key, index_key ) | def GetIndexedTimeZoneNames( ): """Returns the names of the time zones as defined in the registry, but includes the index by which they may be sorted longitudinally.""" for timeZoneName in GetTimeZoneNames(): tzRegKeyPath = os.path.join( TimeZoneInfo.tzRegKey, timeZoneName ) key = win32api.RegOpenKeyEx( win32con.HKEY_L... |
menu = CreatePopupMenu() item, extras = PackMENUITEMINFO(text = "Exit", hbmpItem=win32con.HBMMENU_MBAR_CLOSE, wID=1000) InsertMenuItem(menu, 0, 1, item) item, extras = PackMENUITEMINFO(text = "Text only item", wID=1001) InsertMenuItem(menu, 0, 1, item) load_bmp_flags=win32con.LR_LOADFROMFILE | \ win32con.LR_LOADTRA... | def OnTaskbarNotify(self, hwnd, msg, wparam, lparam): if lparam==win32con.WM_RBUTTONUP: print "You right clicked me." menu = CreatePopupMenu() # Create our 'Exit' item with the standard, ugly 'close' icon. item, extras = PackMENUITEMINFO(text = "Exit", hbmpItem=win32con.HBMMENU_MBAR_CLOSE, wID=1000) InsertMenuItem(menu... | |
TrackPopupMenu(menu, win32con.TPM_LEFTALIGN, pos[0], pos[1], 0, self.hwnd, None) | TrackPopupMenu(self.hmenu, win32con.TPM_LEFTALIGN, pos[0], pos[1], 0, self.hwnd, None) | def OnTaskbarNotify(self, hwnd, msg, wparam, lparam): if lparam==win32con.WM_RBUTTONUP: print "You right clicked me." menu = CreatePopupMenu() # Create our 'Exit' item with the standard, ugly 'close' icon. item, extras = PackMENUITEMINFO(text = "Exit", hbmpItem=win32con.HBMMENU_MBAR_CLOSE, wID=1000) InsertMenuItem(menu... |
self.hmenu = menu | elif lparam==win32con.WM_LBUTTONDBLCLK: print "You double-clicked me" cmd = GetMenuDefaultItem(self.hmenu, False, 0) if cmd == -1: print "Can't find a default!" self.OnCommand(hwnd, win32con.WM_COMMAND, cmd, 0) | def OnTaskbarNotify(self, hwnd, msg, wparam, lparam): if lparam==win32con.WM_RBUTTONUP: print "You right clicked me." menu = CreatePopupMenu() # Create our 'Exit' item with the standard, ugly 'close' icon. item, extras = PackMENUITEMINFO(text = "Exit", hbmpItem=win32con.HBMMENU_MBAR_CLOSE, wID=1000) InsertMenuItem(menu... |
elif id==1003: | elif id in (1003, 1004, 1005): | def OnCommand(self, hwnd, msg, wparam, lparam): id = LOWORD(wparam) if id == 1000: print "Goodbye" DestroyWindow(self.hwnd) elif id==1003: # Our 'checkbox' item state = GetMenuState(self.sub_menu, id, win32con.MF_BYCOMMAND) if state==-1: raise RuntimeError, "No item found" if state & win32con.MF_CHECKED: check_flags = ... |
elif state & win32con.MF_UNCHECKED: | else: | def OnCommand(self, hwnd, msg, wparam, lparam): id = LOWORD(wparam) if id == 1000: print "Goodbye" DestroyWindow(self.hwnd) elif id==1003: # Our 'checkbox' item state = GetMenuState(self.sub_menu, id, win32con.MF_BYCOMMAND) if state==-1: raise RuntimeError, "No item found" if state & win32con.MF_CHECKED: check_flags = ... |
raise RuntimeError, "Menu is neither checked nor unchecked!" CheckMenuItem(self.sub_menu, id, win32con.MF_BYCOMMAND & check_flags) if GetMenuState(self.sub_menu, id, win32con.MF_BYCOMMAND) & win32con.MF_CHECKED != check_flags: raise RuntimeError, "The new item didn't get the new checked state!" elif id==1004 or id==10... | rc = CheckMenuRadioItem(self.sub_menu, 1004, 1005, id, win32con.MF_BYCOMMAND) new_state = GetMenuState(self.sub_menu, id, win32con.MF_BYCOMMAND) if new_state & win32con.MF_CHECKED != check_flags: | def OnCommand(self, hwnd, msg, wparam, lparam): id = LOWORD(wparam) if id == 1000: print "Goodbye" DestroyWindow(self.hwnd) elif id==1003: # Our 'checkbox' item state = GetMenuState(self.sub_menu, id, win32con.MF_BYCOMMAND) if state==-1: raise RuntimeError, "No item found" if state & win32con.MF_CHECKED: check_flags = ... |
if self.scriptSite: raise Exception(scode=winerror.E_UNEXPECTED) | def SetScriptSite(self, site): if self.scriptSite: raise Exception(scode=winerror.E_UNEXPECTED) self.scriptSite = site import traceback try: import debug self.debugManager = debug.DebugManager(self) except pythoncom.com_error: # COM errors will occur if the debugger interface has never been # seen on the target system ... | |
if self.scriptState==axscript.SCRIPTSTATE_CLOSED: | if state==axscript.SCRIPTSTATE_UNINITIALIZED: if self.scriptState in [axscript.SCRIPTSTATE_CONNECTED, axscript.SCRIPTSTATE_DISCONNECTED]: self.Stop() if self.scriptState in [axscript.SCRIPTSTATE_CONNECTED, axscript.SCRIPTSTATE_DISCONNECTED,axscript.SCRIPTSTATE_STARTED]: self.Reset() self.scriptState = state elif self... | def SetScriptState(self, state): |
if state==axscript.SCRIPTSTATE_INITIALIZED: | elif state==axscript.SCRIPTSTATE_INITIALIZED: | def SetScriptState(self, state): |
if not hasattr(sys, "frozen") and sys.platform.startswith("win") and \ sys.hexversion < 0x2040000: print >> self.file, ' | print >> self.file, ' | def do_gen_file_header(self): la = self.typelib.GetLibAttr() moduleDoc = self.typelib.GetDocumentation(-1) docDesc = "" if moduleDoc[1]: docDesc = moduleDoc[1] |
edit.SetDefaultCharFormat(interact.formatInput) | format = eval(win32ui.GetProfileVal(interact.sectionProfile, interact.STYLE_INTERACTIVE_PROMPT, str(interact.formatInput))) edit.SetDefaultCharFormat(format) | def OnInitDialog(self): |
edit.SetDefaultCharFormat(interact.formatOutput) | format = eval(win32ui.GetProfileVal(interact.sectionProfile, interact.STYLE_INTERACTIVE_OUTPUT, str(interact.formatOutput))) edit.SetDefaultCharFormat(format) | def OnInitDialog(self): |
edit.SetDefaultCharFormat(interact.formatOutputError) | format = eval(win32ui.GetProfileVal(interact.sectionProfile, interact.STYLE_INTERACTIVE_ERROR, str(interact.formatOutputError))) edit.SetDefaultCharFormat(format) | def OnInitDialog(self): |
controlAttrs = [(win32ui.IDC_EDIT1, "formatInput"), (win32ui.IDC_EDIT2, "formatOutput"), (win32ui.IDC_EDIT3, "formatOutputError")] for id, attr in controlAttrs: | controlAttrs = [ (win32ui.IDC_EDIT1, interact.STYLE_INTERACTIVE_PROMPT), (win32ui.IDC_EDIT2, interact.STYLE_INTERACTIVE_OUTPUT), (win32ui.IDC_EDIT3, interact.STYLE_INTERACTIVE_ERROR)] for id, key in controlAttrs: | def OnOK(self): # Handle the edit controls - get all the fonts, put them back into interact, then # get interact to save its stuff! controlAttrs = [(win32ui.IDC_EDIT1, "formatInput"), (win32ui.IDC_EDIT2, "formatOutput"), (win32ui.IDC_EDIT3, "formatOutputError")] for id, attr in controlAttrs: control = self.GetDlgItem(i... |
setattr(interact, attr, fmt) interact.SaveFontPreferences() | win32ui.WriteProfileVal(interact.sectionProfile, key, str(fmt)) | def OnOK(self): # Handle the edit controls - get all the fonts, put them back into interact, then # get interact to save its stuff! controlAttrs = [(win32ui.IDC_EDIT1, "formatInput"), (win32ui.IDC_EDIT2, "formatOutput"), (win32ui.IDC_EDIT3, "formatOutputError")] for id, attr in controlAttrs: control = self.GetDlgItem(i... |
try: items = items + dir(ob) except AttributeError: pass try: items = items + dir(ob.__class__) except AttributeError: pass items = filter(lambda word: word[0]!='_', items) try: list = ob.__class__._prop_map_get_.keys() for i in ob.__class__._prop_map_put_.keys(): if i not in list: list.append(i) items = items +... | try: try: items = items + dir(ob) except AttributeError: pass try: items = items + dir(ob.__class__) except AttributeError: pass items = filter(lambda word: word[0]!='_', items) try: list = ob.__class__._prop_map_get_.keys() for i in ob.__class__._prop_map_put_.keys(): if i not in list: list.append(i) items = it... | def _AutoComplete(self): self.SCIAutoCCancel() # Cancel old auto-complete lists. # First try and get an object without evaluating calls ob = self._GetObjectAtPos(bAllowCalls = 0) # If that failed, try and process call or indexing to get the object. if ob is None: ob = self._GetObjectAtPos(bAllowCalls = 1) if ob is not ... |
win32ui.SetRegistryKey("Python") | win32ui.SetRegistryKey("Python %s" % (sys.winver,)) | def InitInstance(self): # Use a registry path of "Python\Pythonwin Debugger win32ui.SetAppName(win32ui.LoadString(win32ui.IDR_DEBUGGER)) win32ui.SetRegistryKey("Python") # We _need_ the Scintilla color editor. # (and we _always_ get it now :-) |
interface = pUnk.QueryInterface(self._connect_interfaces_[0],1) interface = interface.QueryInterface(pythoncom.IID_IDispatch) | interface = pUnk.QueryInterface(self._connect_interfaces_[0],pythoncom.IID_IDispatch) | def Advise(self, pUnk): # Creates a connection to the client. Simply allocate a new cookie, # find the clients interface, and store it in a dictionary. try: interface = pUnk.QueryInterface(self._connect_interfaces_[0],1) interface = interface.QueryInterface(pythoncom.IID_IDispatch) except pythoncom.com_error: raise Ex... |
return Exception(scode=winerror.E_UNEXPECTED) | raise Exception(scode=winerror.E_UNEXPECTED) | def Unadvise(self, cookie): # Destroy a connection - simply delete interface from the map. try: del self.connections[cookie] except KeyError: return Exception(scode=winerror.E_UNEXPECTED) |
print "Interrupted!" | def RunScript(defName=None, defArgs=None, bShowDialog = 1, debuggingType=None): global lastScript, lastArgs, lastDebuggingType # Get the debugger - may be None! debugger = GetDebugger() if defName is None: try: pathName = GetActiveFileName() except KeyboardInterrupt: return # User cancelled save. else: pathName = def... | |
self.assertEqual(self.cur.execute("create table users " "(userid varchar(5), username varchar(25))"),-1) | self.assertEqual(self.cur.execute( """create table users ( userid varchar(5), username varchar(25), bitfield bit, intfield integer, floatfield float )"""),-1) | def setUp(self): self.db_filename = os.path.join(tempfile.gettempdir(), "test_odbc.mdb") if os.path.isfile(self.db_filename): os.unlink(self.db_filename) |
self.cur.close() self.cur = None self.conn.close() self.conn = None | if self.cur is not None: self.cur.close() self.cur = None if self.conn is not None: self.conn.close() self.conn = None | def tearDown(self): self.cur.close() self.cur = None self.conn.close() self.conn = None os.unlink(self.db_filename) |
self.assertEqual(self.cur.execute("insert into users \ | self.assertEqual(self.cur.execute("insert into users (userid, username) \ | def test_insert_select(self, userid='Frank', username='Frank Millman'): self.assertEqual(self.cur.execute("insert into users \ values (?,?)", [userid, username]),1) self.assertEqual(self.cur.execute("select * from users \ where userid = ?", [userid.lower()]),0) self.assertEqual(self.cur.execute("select * from users \ w... |
self.assertEqual(self.cur.execute("insert into users \ | self.assertEqual(self.cur.execute("insert into users (userid, username)\ | def test_insert_select_unicode(self, userid=u'Frank', username=u"Frank Millman"): self.assertEqual(self.cur.execute("insert into users \ values (?,?)", [userid, username]),1) self.assertEqual(self.cur.execute("select * from users \ where userid = ?", [userid.lower()]),0) self.assertEqual(self.cur.execute("select * from... |
if item.bIsDispatch: key = item.python_name | if item.bWritten: key = item.python_name | def WriteClass(self, generator): generator.checkWriteCoClassBaseClass() doc = self.doc stream = generator.file if generator.generate_type == GEN_DEMAND_CHILD: # Some special imports we must setup. referenced_items = [] for ref, flag in self.sources: referenced_items.append(ref) for ref, flag in self.interfaces: referen... |
if defItem.bIsDispatch: defName = defItem.python_name | if defItem.bWritten: defName = defItem.python_name | def WriteClass(self, generator): generator.checkWriteCoClassBaseClass() doc = self.doc stream = generator.file if generator.generate_type == GEN_DEMAND_CHILD: # Some special imports we must setup. referenced_items = [] for ref, flag in self.sources: referenced_items.append(ref) for ref, flag in self.interfaces: referen... |
if item is not None and item.bWritten and item.bIsDispatch: | if item is not None and item.bWritten: | print >> stream, "\t###%s: %s, # Typedef disabled because it doesn't have a non-null GUID" % (`record.doc[0]`, `str(record.clsid)`) |
if oleitem.bIsDispatch: | if oleitem.bWritten: | def do_gen_child_item(self, oleitem): moduleDoc = self.typelib.GetDocumentation(-1) docDesc = "" if moduleDoc[1]: docDesc = moduleDoc[1] self.progress.Starting(docDesc) self.progress.SetDescription("Building definitions from type library...") self.do_gen_file_header() oleitem.WriteClass(self) if oleitem.bIsDispatch: pr... |
self.EnsureCharsVisible(notify.position, notify.position + notify.length) | self.EnsureCharsVisible(notify.position) | def OnNeedShown(self, std, extra): notify = self.SCIUnpackNotifyMessage(extra) self.EnsureCharsVisible(notify.position, notify.position + notify.length) |
for path in sys.path: | for path in [sys.prefix] + sys.path: | def LocatePythonServiceExe(exeName = None): # Try and find the specified EXE somewhere. If specifically registered, # use it. Otherwise look down sys.path, and the global PATH environment. if exeName is None: if os.path.splitext(win32service.__file__)[0].endswith("_d"): exeName = "PythonService_d.exe" else: exeName =... |
found = doc[0]==child | found = build.MakePublicAttributeName(doc[0])==child | def generate_child(self, child, dir): "Generate a single child. May force a few children to be built as we generate deps" self.generate_type = GEN_DEMAND_CHILD oldOut = sys.stdout |
if doc[0] == child: | if build.MakePublicAttributeName(doc[0]) == child: | def generate_child(self, child, dir): "Generate a single child. May force a few children to be built as we generate deps" self.generate_type = GEN_DEMAND_CHILD oldOut = sys.stdout |
libraries = ['user32', 'odbc32', 'advapi32', | libraries = ['user32', 'odbc32', 'advapi32', 'version', | def __init__ (self, name, sources=None, include_dirs=[], define_macros=None, undef_macros=None, library_dirs=[], libraries=[], runtime_library_dirs=None, extra_objects=None, extra_compile_args=None, extra_link_args=None, export_symbols=None, export_symbol_file=None, dsp_file=None, ): assert dsp_file or sources, "Either... |
if os.path.splitext(fields[1])[1].lower() in ['.cpp', '.c']: | if os.path.splitext(fields[1])[1].lower() in ['.cpp', '.c', '.i']: | def get_source_files(self, dsp): result = [] dsp_path = os.path.dirname(dsp) for line in open(dsp, "r"): fields = line.strip().split("=", 2) if fields[0]=="SOURCE": if os.path.splitext(fields[1])[1].lower() in ['.cpp', '.c']: pathname = os.path.normpath(os.path.join(dsp_path, fields[1])) result.append(pathname) return ... |
class my_install_lib (install_lib): def finalize_options(self): install_lib.finalize_options(self) self.install_dir = os.getenv("windir") + '\\system32' WINVER = tuple(map(int, string.split(sys.winver, '.'))) REGNAMES = {'pywintypes': 'PyWinTypes%d%d' % WINVER, 'pythoncom': 'PythonCOM%d%d' % WINVER, } class my_bu... | win32api = WinExt('win32api', dsp_file = r"win32\win32api.dsp") win32file = WinExt('win32file', dsp_file = r"win32\win32file.dsp") win32event = WinExt('win32event', dsp_file = r"win32\win32event.dsp") | def get_source_files(self, dsp): result = [] dsp_path = os.path.dirname(dsp) for line in open(dsp, "r"): fields = line.strip().split("=", 2) if fields[0]=="SOURCE": if os.path.splitext(fields[1])[1].lower() in ['.cpp', '.c']: pathname = os.path.normpath(os.path.join(dsp_path, fields[1])) result.append(pathname) return ... |
cmdclass = { 'install_lib': my_install_lib, | cmdclass = { | def get_ext_filename(self, name): fname = build_ext.get_ext_filename(self, name) base, ext = os.path.splitext(fname) newbase = REGNAMES.get(name, fname) if self.debug: return newbase + '_d' + '.dll' return newbase + '.dll' |
ext_modules = [pywintypes, pythoncom], | ext_modules = [pywintypes, win32api, win32file, win32event, pythoncom], | def get_ext_filename(self, name): fname = build_ext.get_ext_filename(self, name) base, ext = os.path.splitext(fname) newbase = REGNAMES.get(name, fname) if self.debug: return newbase + '_d' + '.dll' return newbase + '.dll' |
state = stylePyStart | if ch in '\r\n': state = STYLE_INTERACTIVE_EOL else: state = stylePyStart | def ColorizeInteractiveCode(self, cdoc, styleStart, stylePyStart): lengthDoc = len(cdoc) if lengthDoc == 0: return state = styleStart chNext = cdoc[0] startSeg = 0 i = 0 lastState=state # debug only while i < lengthDoc: ch = chNext chNext = cdoc[i+1:i+2] |
if ch in '\r\n' and chNext and chNext in ">[": | if ch in '\r\n' and (chNext=='' or chNext in ">["): | def ColorizeInteractiveCode(self, cdoc, styleStart, stylePyStart): lengthDoc = len(cdoc) if lengthDoc == 0: return state = styleStart chNext = cdoc[0] startSeg = 0 i = 0 lastState=state # debug only while i < lengthDoc: ch = chNext chNext = cdoc[i+1:i+2] |
if spec is None and policySpec in [None, 'DynamicPolicy', 'DesignatedWrapPolicy', 'DefaultPolicy']: | if spec is None: | def RegisterClasses(*classes, **flags): quiet = flags.has_key('quiet') and flags['quiet'] debugging = flags.has_key('debug') and flags['debug'] for cls in classes: clsid = cls._reg_clsid_ progID = _get(cls, '_reg_progid_') desc = _get(cls, '_reg_desc_', progID) spec = _get(cls, '_reg_class_spec_') verProgID = _get(cls,... |
lFiles = lFiles + glob.glob(g) | new = glob.glob(g) if len(new)==0: print "The pattern '%s' yielded no files!" % (g,) lFiles = lFiles + new | def handle_globs(lGlobs): lFiles = [] for g in lGlobs: lFiles = lFiles + glob.glob(g) # lFiles is now the list of origin files. # Normalize all of the paths: cFiles = len(lFiles) for i in range(cFiles): lFiles[i] = os.path.normpath(lFiles[i]) # If it isn't a file, ignore it. i = 0 while i < cFiles: if not os.path.isfil... |
sCmd = "copy %s %s > NUL" % (lSrcFiles[i], file) os.system(sCmd) | shutil.copyfile(lSrcFiles[i], file) | def main(): output = os.path.abspath(sys.argv[1]) target = sys.argv[2] f = open(output + ".hhp", "w") html_files = "" if len(sys.argv) > 2: # sys.argv[3] == html_dir # sys.argv[4:] == html_files (globbed) html_dir = os.path.abspath(sys.argv[3]) lGlobs = sys.argv[4:] lDestFiles, lSrcFiles = handle_globs(lGlobs) # ensu... |
self.set_title(element.props.name) | title = element.props.name + " - Parameters" self.set_title(title) | def __init__(self, element=None): gtk.Window.__init__(self) if element: self.set_title(element.props.name) self.element = element self.set_position(gtk.WIN_POS_MOUSE) self.set_default_size(350, 500) |
self.set_default_size(350, 500) | self.set_default_size(380, 500) | def __init__(self, element=None): gtk.Window.__init__(self) if element: self.set_title(element.props.name) self.element = element self.set_position(gtk.WIN_POS_MOUSE) self.set_default_size(350, 500) |
self.element.set_property(property.name, adj.get_value()) | self.element.set_property(property.name, value) | def onValueChanged(self, adj, property): "Update element parameter when slider is moved" |
tooltip = goocanvas.Text(x= leftx - 20, y = lefty, font = "Sans 9", text=pad.get_name(), anchor=gtk.ANCHOR_E) | tooltip = goocanvas.Group() tipwidth = 8 * len(pad.get_name()) tiptext = goocanvas.Text(x= leftx - (tipwidth + 16), y = lefty, font = "Sans 9", text=pad.get_name(), anchor=gtk.ANCHOR_W) tipbg = goocanvas.Rect(x = leftx - (tipwidth + 18), y = lefty - 8, height = 16, width = tipwidth, line_width = 1, stroke_color = "red... | def _makePads(self): "Creates a Group containing individual pad widgets" #TODO: color code based on caps pgroup = goocanvas.Group() pgroup lefty = 109 righty = 109 leftx = 109 rightx = 191 factory = self.element.get_factory() templist = factory.get_static_pad_templates() #workaround for empty elements #if not padlist:... |
tooltip = goocanvas.Text(x= rightx + 20, y = righty, font = "Sans 9", | tooltip = goocanvas.Group() tiptext = goocanvas.Text(x= rightx + 20, y = righty, font = "Sans 9", | def _makePads(self): "Creates a Group containing individual pad widgets" #TODO: color code based on caps pgroup = goocanvas.Group() pgroup lefty = 109 righty = 109 leftx = 109 rightx = 191 factory = self.element.get_factory() templist = factory.get_static_pad_templates() #workaround for empty elements #if not padlist:... |
print "pad: " + pad.get_name() | tooltip.set_property("visibility", goocanvas.VISIBLE) | def onPadEnter(self, view, target, event): "mouse over callback for pads" #highlight stroke color item = target.get_item() item.set_property("stroke_color", "green") pad = item.get_data("pad") tooltip = item.get_data("tooltip") #TODO: show tooltip: print "pad: " + pad.get_name() return True |
pad = item.get_data("pad") tooltip = item.get_data("tooltip") tooltip.set_property("visibility", goocanvas.INVISIBLE) | def onPadLeave(self, view, target, event): "mouse-out callback for pads" #reset the stroke color item = target.get_item() item.set_property("stroke_color", "black") #TODO: hide tooltip return True | |
entry.set_text(text) | if text: entry.set_text(text) | def __init__(self, element=None): gtk.Window.__init__(self) if element: title = element.props.name + " - Parameters" self.set_title(title) self.element = element self.set_position(gtk.WIN_POS_MOUSE) self.set_default_size(380, 500) |
storeObjects = store.fetchObjectsOfClass(self.storeName,'WHERE %s = "%s"' % (self.indexField,account)) if len(storeObjects) == 1: member = storeObjects[0] for attr in memberAttrs: if (attr not in standardAttrs) and self.transaction.request().field(attr,None) != None: if memberFields[attr][memberType] == 'string': me... | storeObjects = store.fetchObjectsOfClass(self.storeName,'WHERE %s LIKE "%s_"' % (self.indexField,account[:-1])) print storeObjects for member in storeObjects: print "Change %s" % member.ID() print member if austrittsdatum and not member.Austrittsdatum(): member.setAustrittsdatum(DateTime.DateTimeFrom(austrittsdatum)) m... | def writeContent(self, trans=None): # # this servlet changes Member data # |
if member.valueForKey('BeitragsartAb'+str(x)) == DateTime.DateTimeFrom(beitragsartFreiAb): beitragsartNb = x - 1 else: beitragsartNb = x elif beitragsartAb != '': for x in range(1,Anzahl_Beitragsarten+1): if (member.valueForKey('Beitragsart'+str(x)) == '') and (beitragsartNb == 0): beitragsartNb = x - 1 if beitragsa... | if beitragsart != '': member.setValueForKey('Beitragsart'+str(beitragsartNb % 5 + 1), beitragsart) member.setValueForKey('BeitragsartAb'+str(beitragsartNb % 5 + 1), DateTime.DateTimeFrom(beitragsartAb)) member.setValueForKey('BeitragsartFreiAb'+str(beitragsartNb % 5 + 1), None) member.setValueForKey('BeitragsartErhebun... | def writeContent(self, trans=None): # # this servlet changes Member data # |
remove_oldfloat(file.body, opt) | remove_oldfloat(file.body, file) | def convert(file): change_preamble(file.header) change_listof(file.body) fix_oldfloatinset(file.body) update_tabular(file.body) remove_pextra(file.body) remove_oldfloat(file.body, opt) remove_figinset(file.body) remove_oldertinset(file.body) remove_oldert(file.body) combine_ert(file.body) change_infoinset(file.body) fi... |
font_rexp = re.compile(r"\\(family|series|shape|size|emph|numeric|bar|noun)") | move_rexp = re.compile(r"\\(family|series|shape|size|emph|numeric|bar|noun|end_deeper)") | def is_empty(lines): return filter(is_nonempty_line, lines) == [] |
if font_rexp.match(line): | if move_rexp.match(line): | def remove_oldert(lines): i = 0 while 1: i = find_tokens(lines, ["\\latex latex", "\\layout LaTeX"], i) if i == -1: break j = i+1 while 1: j = find_tokens(lines, ["\\latex default", "\\begin_inset", "\\layout", "\\end_float", "\\the_end"], j) if check_token(lines[j], "\\begin_inset"): j = find_end_of_inset(lines, j) el... |
if input and input != '-': self.input = self.open(input) else: self.input = sys.stdin if output: self.output = open(output, "w") else: self.output = sys.stdout | self.choose_io(input, output) | def __init__(self, end_format = 0, input = "", output = "", error = "", debug = default_debug_level, try_hard = 0): """Arguments: end_format: final format that the file should be converted. (integer) input: the name of the input source, if empty resort to standard input. output: the name of the output file, if empty us... |
def open(self, file): """Transparently deals with compressed files.""" self.dir = os.path.dirname(os.path.abspath(file)) try: gzip.open(file).readline() self.output = gzip.GzipFile("","wb",6,self.output) return gzip.open(file) except: return open(file) | def choose_io(self, input, output): """Choose input and output streams, dealing transparently with compressed files.""" if output: self.output = open(output, "wb") else: self.output = sys.stdout if input and input != '-': self.dir = os.path.dirname(os.path.abspath(input)) try: gzip.open(input).readline() self.input =... | def open(self, file): """Transparently deals with compressed files.""" |
file.body[i] = 'inner_pos "%s"' % inner_pos[int(file.body[i][15])] | innerpos = inner_pos[int(file.body[i][15])] del file.body[i] | def convert_minipage(file): """ Convert minipages to the box inset. We try to use the same order of arguments as lyx does. """ pos = ["t","c","b"] inner_pos = ["c","t","b","s"] i = 0 while 1: i = find_token(file.body, "\\begin_inset Minipage", i) if i == -1: return file.body[i] = "\\begin_inset Box Frameless" i = i +... |
file.body.insert('inner_pos "%s"' % inner_pos[0]) i = i + 1 | innerpos = inner_pos[0] | def convert_minipage(file): """ Convert minipages to the box inset. We try to use the same order of arguments as lyx does. """ pos = ["t","c","b"] inner_pos = ["c","t","b","s"] i = 0 while 1: i = find_token(file.body, "\\begin_inset Minipage", i) if i == -1: return file.body[i] = "\\begin_inset Box Frameless" i = i +... |
lyxwidth = string.split(lines[i])[3]+"pt" lyxheight = string.split(lines[i])[4]+"pt" | if ( len(string.split(lines[i])) > 2 ): lyxwidth = string.split(lines[i])[3]+"pt" lyxheight = string.split(lines[i])[4]+"pt" else: lyxwidth = "" lyxheight = "" | def remove_figinset(lines): i = 0 while 1: i = find_token(lines, "\\begin_inset Figure", i) if i == -1: break j = find_end_of_inset(lines, i) lyxwidth = string.split(lines[i])[3]+"pt" lyxheight = string.split(lines[i])[4]+"pt" filename = get_value(lines, "file", i+1, j) width = get_length(lines, "width", i+1, j) # w... |
wfd, wtmpfname = mkstemp(suffix='.ltx') | def checkTeXPaths(): ''' Determine the path-style needed by the TeX engine on Win32 (Cygwin) ''' windows_style_tex_paths = '' if os.name == 'nt' or sys.platform == 'cygwin': from tempfile import mkstemp fd, tmpfname = mkstemp(suffix='.ltx') # a wrapper file wfd, wtmpfname = mkstemp(suffix='.ltx') if os.name == 'nt': in... | |
wtmpfname = wtmpfname.replace('\\', '/') | def checkTeXPaths(): ''' Determine the path-style needed by the TeX engine on Win32 (Cygwin) ''' windows_style_tex_paths = '' if os.name == 'nt' or sys.platform == 'cygwin': from tempfile import mkstemp fd, tmpfname = mkstemp(suffix='.ltx') # a wrapper file wfd, wtmpfname = mkstemp(suffix='.ltx') if os.name == 'nt': in... | |
wtmpfname = cmdOutput('cygpath -m ' + wtmpfname) os.write(fd, r''' \relax ''') | inpname = inpname.replace('~', '\\string~') os.write(fd, r'\relax') | def checkTeXPaths(): ''' Determine the path-style needed by the TeX engine on Win32 (Cygwin) ''' windows_style_tex_paths = '' if os.name == 'nt' or sys.platform == 'cygwin': from tempfile import mkstemp fd, tmpfname = mkstemp(suffix='.ltx') # a wrapper file wfd, wtmpfname = mkstemp(suffix='.ltx') if os.name == 'nt': in... |
os.write(wfd, r'\nonstopmode\input{' + inpname.replace('~', '\\string~') + '}' ) os.close(wfd) if cmdOutput('latex ' + wtmpfname).find('Error') != -1: | latex_out = cmdOutput(r'latex "\nonstopmode\input{%s}"' % inpname) if 'Error' in latex_out: | def checkTeXPaths(): ''' Determine the path-style needed by the TeX engine on Win32 (Cygwin) ''' windows_style_tex_paths = '' if os.name == 'nt' or sys.platform == 'cygwin': from tempfile import mkstemp fd, tmpfname = mkstemp(suffix='.ltx') # a wrapper file wfd, wtmpfname = mkstemp(suffix='.ltx') if os.name == 'nt': in... |
tmpbname,ext = os.path.splitext(os.path.basename(tmpfname)) wtmpbname,ext = os.path.splitext(os.path.basename(wtmpfname)) removeFiles( [ tmpfname, wtmpfname, tmpbname + '.log', \ tmpbname + '.aux', wtmpbname + '.log', wtmpbname + '.aux' ] ) | removeFiles([tmpfname, 'texput.log']) | def checkTeXPaths(): ''' Determine the path-style needed by the TeX engine on Win32 (Cygwin) ''' windows_style_tex_paths = '' if os.name == 'nt' or sys.platform == 'cygwin': from tempfile import mkstemp fd, tmpfname = mkstemp(suffix='.ltx') # a wrapper file wfd, wtmpfname = mkstemp(suffix='.ltx') if os.name == 'nt': in... |
j = find_tokens(lines, ["\\latex default", "\\begin_inset", "\\layout", "\\end_float", "\\the_end"], | j = find_tokens(lines, ["\\latex default", "\\begin_inset", "\\layout", "\\end_inset", "\\end_float", "\\the_end"], | def remove_oldert(lines): i = 0 while 1: i = find_tokens(lines, ["\\latex latex", "\\layout LaTeX"], i) if i == -1: break j = i+1 while 1: j = find_tokens(lines, ["\\latex default", "\\begin_inset", "\\layout", "\\end_float", "\\the_end"], j) if check_token(lines[j], "\\begin_inset"): j = find_end_of_inset(lines, j) el... |
latextype = "" | latextype_line = -1 | def convert(lines): " Convert to new format." re_Comment = re.compile(r'^(\s*)#') re_Empty = re.compile(r'^(\s*)$') re_Format = re.compile(r'^(\s*)(Format)(\s+)(\S+)', re.IGNORECASE) re_Preamble = re.compile(r'^(\s*)Preamble', re.IGNORECASE) re_EndPreamble = re.compile(r'^(\s*)EndPreamble', re.IGNORECASE) re_MaxCounter... |
latextype = match.group(4) lines[i] = re_LatexType.sub(r'\1\2\3Bib_Environment', lines[i]) | latextype_line = i | def convert(lines): " Convert to new format." re_Comment = re.compile(r'^(\s*)#') re_Empty = re.compile(r'^(\s*)$') re_Format = re.compile(r'^(\s*)(Format)(\s+)(\S+)', re.IGNORECASE) re_Preamble = re.compile(r'^(\s*)Preamble', re.IGNORECASE) re_EndPreamble = re.compile(r'^(\s*)EndPreamble', re.IGNORECASE) re_MaxCounter... |
if (latextype == ""): | if (latextype_line < 0): | def convert(lines): " Convert to new format." re_Comment = re.compile(r'^(\s*)#') re_Empty = re.compile(r'^(\s*)$') re_Format = re.compile(r'^(\s*)(Format)(\s+)(\S+)', re.IGNORECASE) re_Preamble = re.compile(r'^(\s*)Preamble', re.IGNORECASE) re_EndPreamble = re.compile(r'^(\s*)EndPreamble', re.IGNORECASE) re_MaxCounter... |
writeToFile(os.path.join('src', 'config.h'), lines + '\n\n', append = True) | writeToFile(config_h, lines + '\n\n', append = True) | def addToConfig(lines): ''' utility function: shortcut for appending lines to outfile add newline at the end of lines. ''' if lines.strip() != '': writeToFile(os.path.join('src', 'config.h'), lines + '\n\n', append = True) |
for (k, v) in env.items(): try: contents = re.sub('%'+k+'%', v, contents) except: pass | for k in env.get('SUBST_KEYS', []): if not env.has_key(k): print "Failed to subst key ", k, " from file", str(source[0]) raise contents = re.sub('@'+k+'@', env.subst('$'+k).replace('\n',r'\\n\\\n'), contents) | def env_subst(target, source, env): ''' subst variables in source by those in env, and output to target source and target are scons File() objects %key% (not key itself) is an indication of substitution ''' assert len(target) == 1 assert len(source) == 1 target_file = file(str(target[0]), "w") source_file = file(str(s... |
def startConfigH(config_h): | def startConfigH(): | def startConfigH(config_h): ''' Write the first part of config.h ''' writeToFile(config_h, |
def endConfigH(config_h): | def endConfigH(): | def endConfigH(config_h): ''' Write the last part of config.h ''' writeToFile(config_h, ''' |
file.warning("Malformed LyX file.") | file.warning("Malformed LyX file: Missing 'collapsed'.") | def convert_collapsable(file): i = 0 while 1: i = find_tokens(file.body, ["\\begin_inset Box", "\\begin_inset Branch", "\\begin_inset CharStyle", "\\begin_inset Float", "\\begin_inset Foot", "\\begin_inset Marginal", "\\begin_inset Note", "\\begin_inset OptArg", "\\begin_inset Wrap"], i) if i == -1: break # Seach for ... |
file.warning("Malformed LyX file.") | file.warning("Malformed LyX file: Missing 'status'.") | def revert_collapsable(file): i = 0 while 1: i = find_tokens(file.body, ["\\begin_inset Box", "\\begin_inset Branch", "\\begin_inset CharStyle", "\\begin_inset Float", "\\begin_inset Foot", "\\begin_inset Marginal", "\\begin_inset Note", "\\begin_inset OptArg", "\\begin_inset Wrap"], i) if i == -1: break # Seach for a... |
file.warning("Malformed LyX file.") | file.warning("Malformed LyX file: Missing 'status'.") | def convert_ert(file): i = 0 while 1: i = find_token(file.body, "\\begin_inset ERT", i) if i == -1: break # Seach for a line starting 'status' # If, however, we find a line starting '\begin_layout' # (_always_ present) then break with a warning message i = i + 1 while 1: if (file.body[i] == "status Open"): file.body[i... |
file.warning("Malformed LyX file.") | file.warning("Malformed LyX file : Missing 'status'.") | def revert_ert(file): i = 0 while 1: i = find_token(file.body, "\\begin_inset ERT", i) if i == -1: break # Seach for a line starting 'status' # If, however, we find a line starting '\begin_layout' # (_always_ present) then break with a warning message i = i + 1 while 1: if (file.body[i] == "status open"): file.body[i]... |
def convert_ertlen(body, i, len, special): | def convert_len(len, special): | def convert_vspace(file): # Get default spaceamount i = find_token(file.header, '\\defskip', 0) if i == -1: defskipamount = 'medskip' else: defskipamount = split(file.header[i])[1] # Convert the insets i = 0 while 1: i = find_token(file.body, '\\begin_inset VSpace', i) if i == -1: return spaceamount = split(file.body... |
return convert_ertbackslash(body, i, len) | return convert_ertbackslash(body, i, convert_len(len, special)) | def convert_ertlen(body, i, len, special): units = {"text%":"\\textwidth", "col%":"\\columnwidth", "page%":"\\pagewidth", "line%":"\\linewidth", "theight%":"\\textheight", "pheight%":"\\pageheight"} # Convert special lengths if special != 'none': len = '%f\\' % len2value(len) + special # Convert LyX units to LaTeX un... |
if params['collapsed'] == 'true': params['collapsed'] = 'Collapsed' else: params['collapsed'] = 'Open' file.body[i : i] = ['\\begin_inset ERT', 'status ' + params['collapsed'], '', '\\layout Standard', '', '\\backslash '] i = i + 6 if params['use_parbox'] == '1': file.body.insert(i, 'parbox') else: file.body.insert(i, ... | add_to_preamble(file, ['% Commands inserted by lyx2lyx for frameless boxes', '% Save the original minipage environment', '\\let\\lyxtolyxrealminipage\\minipage', '\\let\\endlyxtolyxrealminipage\\endminipage', '% Define an empty lyxtolyximinipage environment', '% with 3 optional arguments', '\\newenvironment{lyxtolyxiii... | def convert_frameless_box(file): pos = ['t', 'c', 'b'] inner_pos = ['c', 't', 'b', 's'] i = 0 while 1: i = find_token(file.body, '\\begin_inset Frameless', i) if i == -1: return j = find_end_of_inset(file.body, i) if j == -1: file.warning("Malformed LyX file: Missing '\\end_inset'.") i = i + 1 continue del file.body[i]... |
file.body[i] = file.body[i] + '}' i = i + 1 file.body[i:i] = ['', '\\end_inset'] i = i + 2 j = find_end_of_inset(file.body, i) if j == -1: file.warning("Malformed LyX file: Missing '\\end_inset'.") break file.body[j-1:j-1] = ['\\begin_inset ERT', 'status ' + params['collapsed'], '', '\\layout Standard', ''] j = j + 4 i... | ert = '\\begin{lyxtolyxrealminipage}' if (pos[params['position']] != 'c' or inner_pos[params['inner_pos']] != pos[params['position']] or params['height_special'] != 'totalheight' or len2value(params['height']) != 1.0): ert = ert + '[' + pos[params['position']] + ']' if (inner_pos[params['inner_pos']] != pos[params['p... | def convert_frameless_box(file): pos = ['t', 'c', 'b'] inner_pos = ['c', 't', 'b', 's'] i = 0 while 1: i = find_token(file.body, '\\begin_inset Frameless', i) if i == -1: return j = find_end_of_inset(file.body, i) if j == -1: file.warning("Malformed LyX file: Missing '\\end_inset'.") i = i + 1 continue del file.body[i]... |
file.warning("Malformed lyx file.") | file.warning("Malformed lyx file: Missing 'wide'.") | def convert_float(file): i = 0 while 1: i = find_token(file.body, '\\begin_inset Float', i) if i == -1: return # Seach for a line starting 'wide' # If, however, we find a line starting '\begin_layout' # (_always_ present) then break with a warning message i = i + 1 while 1: if (file.body[i][:4] == "wide"): file.body.in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.