rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
return self.getSyndicationTool().syndicateSomething(self.absolute_url(), syndication_tool.get_local_channels())
syndication_tool = self.getSyndicationTool() return syndication_tool.syndicateSomething(self.absolute_url(), syndication_tool.get_local_channels())
def localchannels_rdf(self): """ """ return self.getSyndicationTool().syndicateSomething(self.absolute_url(), syndication_tool.get_local_channels())
results_folders.append((del_permission, edit_permission, version_status, x))
results_folders.append((del_permission, edit_permission, version_status, copy_permission, x))
def checkPermissionManageObjects(self): """ This function is called on the folder index and it checkes whether or not to display the various buttons on that form """ results_folders = [] results_objects = [] btn_select, btn_delete, btn_copy, btn_cut, btn_paste, can_operate = 0, 0, 0, 0, 0, 0 # btn_select - if there is ...
results_objects.append((del_permission, edit_permission, version_status, x))
results_objects.append((del_permission, edit_permission, version_status, copy_permission, x))
def checkPermissionManageObjects(self): """ This function is called on the folder index and it checkes whether or not to display the various buttons on that form """ results_folders = [] results_objects = [] btn_select, btn_delete, btn_copy, btn_cut, btn_paste, can_operate = 0, 0, 0, 0, 0, 0 # btn_select - if there is ...
return self.query_objects_ex(meta_type=METATYPE_NYNETCHANNEL, q=q, lang=lang, path=self.absolute_url(1), language=l, type=t)
return self.query_objects_ex(meta_type=METATYPE_NYNETCHANNEL, q=q, lang=lang, path='/'.join(self.getPhysicalPath()), language=l, type=t)
def search_channels(self, q='', l='', t=''): #search channels lang = self.gl_get_selected_language() if q == '': q = None if l == '': l = None if t == '': t = None return self.query_objects_ex(meta_type=METATYPE_NYNETCHANNEL, q=q, lang=lang, path=self.absolute_url(1), language=l, type=t)
automatically defined baded on the class.
automatically defined based on the class.
def addMenuItem(_context, title, class_=None, factory=None, description='', permission=None, filter=None, view=None): """Create an add menu item for a given class or factory As a convenience, a class can be provided, in which case, a factory is automatically defined baded on the class. """ if class_ is None: if factor...
response = self.request.response
def HEAD(self): file = self.chooseContext() response = self.request.response response = self.request.response response.setHeader('Content-Type', file.content_type) response.setHeader('Last-Modified', file.lmh) # Cache for one day response.setHeader('Cache-Control', 'public,max-age=86400') return ''
self.request.response.redirect(item['action']) return u''
redirect_url = item['action'] if not (redirect_url.startswith('../') or \ redirect_url.lower().startswith('javascript:') or \ redirect_url.lower().startswith('++')): self.request.response.redirect(redirect_url) return u''
def __call__(self): item = getFirstMenuItem('zmi_views', self.context, self.request)
rname = posixpath.join(self.]__name__, name)
rname = posixpath.join(self.__name__, name)
def get(self, name, default=_marker): path = self.context.path filename = os.path.join(path, name) if not os.path.isfile(filename): if default is _marker: raise NotFoundError(name) return default ext = os.path.splitext(os.path.normcase(name))[1] factory = self.resource_factories.get(ext, self.default_factory) rname = p...
u'layer1'
'layer1'
... def action(self, **kw): self.actions.append(kw)
u'skin1'
'skin1'
... def action(self, **kw): self.actions.append(kw)
def proxyView(context, request, class_=class_, checker=checker):
def proxyView(context, request):
def proxyView(context, request, class_=class_, checker=checker): view = class_(context, request) # We need this in case the resource gets unwrapped and # needs to be rewrapped view.__Security_checker__ = checker return view
class_ = proxyView
class_ = proxyView class_.factory = original_class
def proxyView(context, request, class_=class_, checker=checker): view = class_(context, request) # We need this in case the resource gets unwrapped and # needs to be rewrapped view.__Security_checker__ = checker return view
discriminator = ('defaultViewName', for_, type, name),
discriminator = ('defaultViewName', for_, layer, name),
def defaultView(_context, name, for_=None, layer=IBrowserRequest): _context.action( discriminator = ('defaultViewName', for_, type, name), callable = handler, args = ('provideAdapter', (for_, layer), IDefaultViewName, '', name, _context.info) ) if for_ is not None: _context.action( discriminator = None, callable = pr...
class simple(BrowserView):
class simple(BrowserView, ContextAware):
def _handle_for(_context, for_, actions): if for_ == '*': for_ = None if for_ is not None: for_ = _context.resolve(for_) actions .append( Action(discriminator = None, callable = handler, args = ('Interfaces', 'provideInterface', None, for_) )) return for_
""" <browser:menu id="test_menu" title="Test menu" /> <browser:pages for="zope.app.component.tests.views.IC" permission="zope.Public"> <browser:page name="test" template="%s" menu="test_menu" title="Test View" />
''' <browser:menu id="test_menu" title="Test menu" /> <browser:pages for="zope.app.component.tests.views.IC" permission="zope.Public"> <browser:page name="test" template="%s" menu="test_menu" title="Test View" />
def testPageInPagesWithTemplateWithMenu(self): self.assertEqual(queryView(ob, 'test', request), None) testtemplate = os.path.join(tests_path, 'testfiles', 'test.pt')
""" % testtemplate
''' % testtemplate
def testPageInPagesWithTemplateWithMenu(self): self.assertEqual(queryView(ob, 'test', request), None) testtemplate = os.path.join(tests_path, 'testfiles', 'test.pt')
""" <browser:menu id="test_menu" title="Test menu" /> <browser:pages for="zope.app.component.tests.views.IC" class="zope.app.component.tests.views.V1" permission="zope.Public"> <browser:page name="test" template="%s" menu="test_menu" title="Test View" />
''' <browser:menu id="test_menu" title="Test menu" /> <browser:pages for="zope.app.component.tests.views.IC" class="zope.app.component.tests.views.V1" permission="zope.Public"> <browser:page name="test" template="%s" menu="test_menu" title="Test View" />
def testPageInPagesWithClassWithMenu(self): self.assertEqual(queryView(ob, 'test', request), None) testtemplate = os.path.join(tests_path, 'testfiles', 'test.pt')
""" % testtemplate
''' % testtemplate
def testPageInPagesWithClassWithMenu(self): self.assertEqual(queryView(ob, 'test', request), None) testtemplate = os.path.join(tests_path, 'testfiles', 'test.pt')
"""
'''
def testSkinPage(self): self.assertEqual(queryView(ob, 'test', request, None), None)
class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" attribute="index" /> """
class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" attribute="index" /> '''
def testSkinPage(self): self.assertEqual(queryView(ob, 'test', request, None), None)
"""
'''
def testI18nResource(self): self.assertEqual(queryResource('test', request, None), None)
""" % (path1, path2)
''' % (path1, path2)
def testI18nResource(self): self.assertEqual(queryResource('test', request, None), None)
"""
'''
def testInterfaceProtectedPage(self): xmlconfig(StringIO(template % """ <browser:page name="test" class="zope.app.component.tests.views.V1" attribute="index" for="zope.app.component.tests.views.IC" permission="zope.Public" allowed_interface="zope.app.component.tests.views.IV" /> """ ))
class="zope.app.component.tests.views.V1" attribute="index" for="zope.app.component.tests.views.IC" permission="zope.Public" allowed_interface="zope.app.component.tests.views.IV" /> """
class="zope.app.component.tests.views.V1" attribute="index" for="zope.app.component.tests.views.IC" permission="zope.Public" allowed_interface="zope.app.component.tests.views.IV" /> '''
def testInterfaceProtectedPage(self): xmlconfig(StringIO(template % """ <browser:page name="test" class="zope.app.component.tests.views.V1" attribute="index" for="zope.app.component.tests.views.IC" permission="zope.Public" allowed_interface="zope.app.component.tests.views.IV" /> """ ))
"""
'''
def testAttributeProtectedPage(self): xmlconfig(StringIO(template % """ <browser:page name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" attribute="action" permission="zope.Public" allowed_attributes="action" /> """ ))
class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" attribute="action" permission="zope.Public" allowed_attributes="action" /> """
class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" attribute="action" permission="zope.Public" allowed_attributes="action" /> '''
def testAttributeProtectedPage(self): xmlconfig(StringIO(template % """ <browser:page name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" attribute="action" permission="zope.Public" allowed_attributes="action" /> """ ))
"""
'''
def testInterfaceAndAttributeProtectedPage(self): xmlconfig(StringIO(template % """ <browser:page name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" attribute="index" allowed_attributes="action" allowed_interface="zope.app.component.tests.views.IV" /> ...
class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" attribute="index" allowed_attributes="action" allowed_interface="zope.app.component.tests.views.IV" /> """
class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" attribute="index" allowed_attributes="action" allowed_interface="zope.app.component.tests.views.IV" /> '''
def testInterfaceAndAttributeProtectedPage(self): xmlconfig(StringIO(template % """ <browser:page name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" attribute="index" allowed_attributes="action" allowed_interface="zope.app.component.tests.views.IV" /> ...
"""
'''
def testDuplicatedInterfaceAndAttributeProtectedPage(self): xmlconfig(StringIO(template % """ <browser:page name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" attribute="index" permission="zope.Public" allowed_attributes="action index" allowed_interface="zope.app.component.tes...
class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" attribute="index" permission="zope.Public" allowed_attributes="action index" allowed_interface="zope.app.component.tests.views.IV" /> """
class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" attribute="index" permission="zope.Public" allowed_attributes="action index" allowed_interface="zope.app.component.tests.views.IV" /> '''
def testDuplicatedInterfaceAndAttributeProtectedPage(self): xmlconfig(StringIO(template % """ <browser:page name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" attribute="index" permission="zope.Public" allowed_attributes="action index" allowed_interface="zope.app.component.tes...
"""
'''
def test_class_w_implements(self): xmlconfig(StringIO(template % """ <browser:page name="test" class=" zope.app.publisher.browser.tests.test_directives.C_w_implements" for="zope.app.component.tests.views.IC" attribute="index" permission="zope.Public" /> """ ))
for="zope.app.component.tests.views.IC" attribute="index" permission="zope.Public" /> """
for="zope.app.component.tests.views.IC" attribute="index" permission="zope.Public" /> '''
def test_class_w_implements(self): xmlconfig(StringIO(template % """ <browser:page name="test" class=" zope.app.publisher.browser.tests.test_directives.C_w_implements" for="zope.app.component.tests.views.IC" attribute="index" permission="zope.Public" /> """ ))
"""
'''
def testIncompleteProtectedPageNoPermission(self): self.assertRaises( ConfigurationError, xmlconfig, StringIO(template % """ <browser:page name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" attribute="index" allowed_attributes="action index" /> """ ))
class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" attribute="index" allowed_attributes="action index" /> """
class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" attribute="index" allowed_attributes="action index" /> '''
def testIncompleteProtectedPageNoPermission(self): self.assertRaises( ConfigurationError, xmlconfig, StringIO(template % """ <browser:page name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" attribute="index" allowed_attributes="action index" /> """ ))
"""
'''
def testPageViews(self): self.assertEqual(queryView(ob, 'test', request), None) test3 = os.path.join(tests_path, 'testfiles', 'test3.pt')
""" % test3
''' % test3
def testPageViews(self): self.assertEqual(queryView(ob, 'test', request), None) test3 = os.path.join(tests_path, 'testfiles', 'test3.pt')
""" <browser:view name="test" class="zope.app.publisher.browser.tests.test_directives.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" > <browser:page name="index.html" attribute="index" /> <browser:page name="action.html" attribute="action" />
''' <browser:view name="test" class="zope.app.publisher.browser.tests.test_directives.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" > <browser:page name="index.html" attribute="index" /> <browser:page name="action.html" attribute="action" />
def testNamedViewPageViewsCustomTraversr(self): self.assertEqual(queryView(ob, 'test', request), None)
"""
'''
def testNamedViewPageViewsCustomTraversr(self): self.assertEqual(queryView(ob, 'test', request), None)
""" <browser:view name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" > <browser:page name="index.html" attribute="index" /> <browser:page name="action.html" attribute="action" /> <browser:page name="test.html" template="%s" />
''' <browser:view name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" > <browser:page name="index.html" attribute="index" /> <browser:page name="action.html" attribute="action" /> <browser:page name="test.html" template="%s" />
def testNamedViewPageViewsNoDefault(self): self.assertEqual(queryView(ob, 'test', request), None) test3 = os.path.join(tests_path, 'testfiles', 'test3.pt')
""" % test3
''' % test3
def testNamedViewPageViewsNoDefault(self): self.assertEqual(queryView(ob, 'test', request), None) test3 = os.path.join(tests_path, 'testfiles', 'test3.pt')
""" <browser:view name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" > <browser:defaultPage name="test.html" /> <browser:page name="index.html" attribute="index" /> <browser:page name="action.html" attribute="action" /> <browser:page name="test.html" ...
''' <browser:view name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" > <browser:defaultPage name="test.html" /> <browser:page name="index.html" attribute="index" /> <browser:page name="action.html" attribute="action" /> <browser:page name="test.html" ...
def testNamedViewPageViewsWithDefault(self): self.assertEqual(queryView(ob, 'test', request), None) test3 = os.path.join(tests_path, 'testfiles', 'test3.pt')
""" % test3
''' % test3
def testNamedViewPageViewsWithDefault(self): self.assertEqual(queryView(ob, 'test', request), None) test3 = os.path.join(tests_path, 'testfiles', 'test3.pt')
""" <browser:view name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" />
''' <browser:view name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" />
def testTraversalOfPageForView(self): """Tests proper traversal of a page defined for a view.""" xmlconfig(StringIO(template % """ <browser:view name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" />
"""
'''
def testTraversalOfPageForView(self): """Tests proper traversal of a page defined for a view.""" xmlconfig(StringIO(template % """ <browser:view name="test" class="zope.app.component.tests.views.V1" for="zope.app.component.tests.views.IC" permission="zope.Public" />
""" <browser:view name="test" class="zope.app.publisher.browser.tests.test_directives.VT" for="zope.app.component.tests.views.IC" permission="zope.Public" />
''' <browser:view name="test" class="zope.app.publisher.browser.tests.test_directives.VT" for="zope.app.component.tests.views.IC" permission="zope.Public" />
def testTraversalOfPageForViewWithPublishTraverse(self): """Tests proper traversal of a page defined for a view. This test is different from testTraversalOfPageForView in that it tests the behavior on a view that has a publishTraverse method -- the implementation of the lookup is slightly different in such a case. """...
"""
'''
def testTraversalOfPageForViewWithPublishTraverse(self): """Tests proper traversal of a page defined for a view. This test is different from testTraversalOfPageForView in that it tests the behavior on a view that has a publishTraverse method -- the implementation of the lookup is slightly different in such a case. """...
""" <directives namespace="http://namespaces.zope.org/zope"> <directive name="permission" attributes="id title description" handler=" zope.app.security.metaconfigure.definePermission" /> </directives>
''' <include package="zope.app.security" file="meta.zcml" />
def testProtectedPageViews(self): ztapi.provideUtility(IPermission, Permission('p', 'P'), 'p')
"""
'''
def testProtectedPageViews(self): ztapi.provideUtility(IPermission, Permission('p', 'P'), 'p')
""" <directives namespace="http://namespaces.zope.org/zope"> <directive name="permission" attributes="id title description" handler=" zope.app.security.metaconfigure.definePermission" /> </directives>
''' <include package="zope.app.security" file="meta.zcml" />
def testProtectedNamedViewPageViews(self): self.assertEqual(queryView(ob, 'test', request), None)
"""
'''
def testProtectedNamedViewPageViews(self): self.assertEqual(queryView(ob, 'test', request), None)
"""
'''
def testSkinnedPageView(self): self.assertEqual(queryView(ob, 'test', request), None)
"""
'''
def testFile(self): path = os.path.join(tests_path, 'testfiles', 'test.pt')
name="index.html" file="%s" /> """ % path
name="index.html" file="%s" /> ''' % path
def testFile(self): path = os.path.join(tests_path, 'testfiles', 'test.pt')
"""
'''
def testSkinResource(self): self.assertEqual( queryResource('test', request, None), None)
""" % path
''' % path
def testSkinResource(self): self.assertEqual( queryResource('test', request, None), None)
"""
'''
def test_template_page(self): path = os.path.join(tests_path, 'testfiles', 'test.pt')
name="index.html" template="%s" permission="zope.Public" for="zope.app.component.tests.views.IC" /> """ % path
name="index.html" template="%s" permission="zope.Public" for="zope.app.component.tests.views.IC" /> ''' % path
def test_template_page(self): path = os.path.join(tests_path, 'testfiles', 'test.pt')
"""
'''
def testtemplateWClass(self): path = os.path.join(tests_path, 'testfiles', 'test2.pt')
for="zope.app.component.tests.views.IC" /> """ % path
for="zope.app.component.tests.views.IC" /> ''' % path
def testtemplateWClass(self): path = os.path.join(tests_path, 'testfiles', 'test2.pt')
""" <directives namespace="http://namespaces.zope.org/zope"> <directive name="permission" attributes="id title description" handler=" zope.app.security.metaconfigure.definePermission" /> </directives>
''' <include package="zope.app.security" file="meta.zcml" />
def testProtectedtemplate(self):
name="xxx.html" template="%s" permission="zope.TestPermission" for="zope.app.component.tests.views.IC" /> """ % path )) xmlconfig(StringIO(template % """
name="xxx.html" template="%s" permission="zope.TestPermission" for="zope.app.component.tests.views.IC" /> ''' % path )) xmlconfig(StringIO(template % '''
def testProtectedtemplate(self):
name="index.html" template="%s" permission="zope.Public" for="zope.app.component.tests.views.IC" /> """ % path
name="index.html" template="%s" permission="zope.Public" for="zope.app.component.tests.views.IC" /> ''' % path
def testProtectedtemplate(self):
"""
'''
def testtemplateNoName(self): path = os.path.join(tests_path, 'testfiles', 'test.pt') self.assertRaises( ConfigurationError, xmlconfig, StringIO(template % """ <browser:page template="%s" for="zope.app.component.tests.views.IC" /> """ % path ))
template="%s" for="zope.app.component.tests.views.IC" /> """ % path
template="%s" for="zope.app.component.tests.views.IC" /> ''' % path
def testtemplateNoName(self): path = os.path.join(tests_path, 'testfiles', 'test.pt') self.assertRaises( ConfigurationError, xmlconfig, StringIO(template % """ <browser:page template="%s" for="zope.app.component.tests.views.IC" /> """ % path ))
""" <browser:view name="index.html" template="%s" for="zope.app.component.tests.views.IC" permission="zope.Public" > <browser:page name="foo.html" attribute="index" />
''' <browser:view name="index.html" template="%s" for="zope.app.component.tests.views.IC" permission="zope.Public" > <browser:page name="foo.html" attribute="index" />
def testtemplateAndPage(self): path = os.path.join(tests_path, 'testfiles', 'test.pt') self.assertRaises( ConfigurationError, xmlconfig, StringIO(template % """ <browser:view name="index.html" template="%s" for="zope.app.component.tests.views.IC" permission="zope.Public" > <browser:page name="foo.html" attribute="index...
""" % path
''' % path
def testtemplateAndPage(self): path = os.path.join(tests_path, 'testfiles', 'test.pt') self.assertRaises( ConfigurationError, xmlconfig, StringIO(template % """ <browser:view name="index.html" template="%s" for="zope.app.component.tests.views.IC" permission="zope.Public" > <browser:page name="foo.html" attribute="index...
"""
'''
def testViewThatProvidesAnInterface(self): request = TestRequest() self.assertEqual(queryView(ob, 'test', request, None), None)
"""
'''
def testUnnamedViewThatProvidesAnInterface(self): request = TestRequest() self.assertEqual(queryView(ob, '', request, None, providing=IV), None)
class BaseBrowserMenuService(object):
class BaseBrowserMenuService:
def getMenuItems(self, object=None): """See zope.app.interfaces.publisher.browser.IMenuItem""" results = [] if object is None: for items in self.registry._reg.values(): results += items else: for items in self.registry.getAllForObject(object): results += items return results
self.path=path file=open(path, 'rb') data=file.read() file.close() self.content_type, enc = guess_content_type(path, data) self.__name__=path[path.rfind('/')+1:] self.lmt=float(stat(path)[8]) or time() self.lmh=rfc1123_date(self.lmt) class Image(File): def __init__(self, path):
def __init__(self, path):
((('adapter',
((None, <function _checkViewFor>, (<InterfaceClass zope.app.container.interfaces.IAdding>, <InterfaceClass zope.publisher.interfaces.browser.IDefaultBrowserLayer>, 'AddX')), (('adapter',
def test_w_factory_and_view(): """ >>> context = Context() >>> addMenuItem(context, factory="x.y.z", title="Add an X", ... permission="zope.ManageContent", description="blah blah", ... filter="context/foo", view="AddX") >>> context ((('adapter', (<InterfaceClass zope.app.container.interfaces.IAd...
print " Insane ---+++//**Wow! This is insane!**//+++//"
print " Insane ---+++//**Wow! This is insane!**//+++---"
def showSyntax(): print print "Syntax" print "Syntax is Vim Outliner's normal syntax. The following are supported:" print print " Text" print " : Body text marker. This text will wrap in the output." print " ; Preformmated text. This text will will not wrap." print print " Tables" print " || Table header line." pri...
print " $Revision: 1.41 $" print " $Date: 2005/05/23 22:04:45 $"
print " $Revision: 1.42 $" print " $Date: 2005/06/06 14:10:55 $"
def showVersion(): print print "RCS" print " $Revision: 1.41 $" print " $Date: 2005/05/23 22:04:45 $" print " $Author: noel $" print
print"<!-- $Revision: 1.41 $ -->" print"<!-- $Date: 2005/05/23 22:04:45 $ -->"
print"<!-- $Revision: 1.42 $ -->" print"<!-- $Date: 2005/06/06 14:10:55 $ -->"
def printHeader(linein): global styleSheet, inlineStyle print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" print "<html><head><title>" + getTitleText(linein) + "</title>" print"<!-- $Revision: 1.41 $ -->" print"<!-- $Date: 2005/05/23 22:04:45 $ -->" pri...
print "otlsplit.py [options] inputfile > outputfile"
print "otlsplit.py [options] inputfile"
def showUsage(): print print "Usage:" print "otlsplit.py [options] inputfile > outputfile" print "Options" print " -l level The number of levels to split down to. The default is 1" print " -D dir Specifiy a target directory for the output files" print " -t Include a title line (the parerent heading)...
print " $Revision: 1.6 $" print " $Date: 2005/10/20 13:13:21 $"
print " $Revision: 1.7 $" print " $Date: 2005/11/02 21:42:10 $"
def showVersion(): print print "RCS" print " $Revision: 1.6 $" print " $Date: 2005/10/20 13:13:21 $" print " $Author: noel $" print
print "otl2html.py inputfile" print "otl2html.py [-t type] [-s] inputfile" print "otl2html.py [-v]" print " -t Specify the format type" print " Types: simple - uses HTML tags <H1> through <H9>" print " bullets - uses HTML tags <UL> and <LI>" print " numeric - uses HTML tags <OL> and <LI> f...
print "otl2html.py [options] inputfile > outputfile" print "Options" print " -t type Specify the format type." print " Types:" print " simple - uses HTML tags <H1> through <H9>" print " bullets - uses HTML tags <UL> and <LI>" print " ...
def showUsage(): print print "Usage:" print "otl2html.py inputfile" print "otl2html.py [-t type] [-s] inputfile" print "otl2html.py [-v]" print " -t Specify the format type" print " Types: simple - uses HTML tags <H1> through <H9>" print " bullets - uses HTML tags <UL> and <LI>" print " nu...
print " $Revision: 1.14 $" print " $Date: 2002/09/12 16:20:09 $"
print " $Revision: 1.15 $" print " $Date: 2003/10/24 22:28:13 $"
def showVersion(): print print "RCS" print " $Revision: 1.14 $" print " $Date: 2002/09/12 16:20:09 $" print " $Author: noel $" print " $Source: /home/noel/apps/NoelOTL/RCS/otl2html.py,v $" print
global inputfile, debug, formatMode, slides, hideComments, copyright
global inputfile, debug, formatMode, slides, hideComments, copyright, styleSheet, inlineStyle
def getArgs(): global inputfile, debug, formatMode, slides, hideComments, copyright if (len(sys.argv) == 1): showUsage() sys.exit()() else: for i in range(len(sys.argv)): if (i != 0): if (sys.argv[i] == "-d"): debug = 1 # test for debug flag elif (sys.argv[i] == "-?"): # test for help flag showUsage() # show the ...
elif (sys.argv[i] == "-s"):
elif (sys.argv[i] == "-p"):
def getArgs(): global inputfile, debug, formatMode, slides, hideComments, copyright if (len(sys.argv) == 1): showUsage() sys.exit()() else: for i in range(len(sys.argv)): if (i != 0): if (sys.argv[i] == "-d"): debug = 1 # test for debug flag elif (sys.argv[i] == "-?"): # test for help flag showUsage() # show the ...
elif (sys.argv[i] == "-C"): copyright = sys.argv[i+1]
elif (sys.argv[i] == "-C"): copyright = sys.argv[i+1] i = i + 1 elif (sys.argv[i] == "-s"): styleSheet = sys.argv[i+1] formatMode = "indent" i = i + 1 elif (sys.argv[i] == "-S"): styleSheet = sys.argv[i+1] formatMode = "indent" inlineStyle = 1
def getArgs(): global inputfile, debug, formatMode, slides, hideComments, copyright if (len(sys.argv) == 1): showUsage() sys.exit()() else: for i in range(len(sys.argv)): if (i != 0): if (sys.argv[i] == "-d"): debug = 1 # test for debug flag elif (sys.argv[i] == "-?"): # test for help flag showUsage() # show the ...
global level, formatMode, slides, hideComments, inBodyText
global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle if (lstrip(linein) == ""): return
def processLine(linein): global level, formatMode, slides, hideComments, inBodyText lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein) + "</H" + str(lineLevel) + ">" else: if (lineLevel > level...
print "<p>" + lstrip(linein)
print "<p>" + rstrip(lstrip(linein)),
def processLine(linein): global level, formatMode, slides, hideComments, inBodyText lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein) + "</H" + str(lineLevel) + ">" else: if (lineLevel > level...
else: print lstrip(linein)
else: print rstrip(lstrip(linein)),
def processLine(linein): global level, formatMode, slides, hideComments, inBodyText lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein) + "</H" + str(lineLevel) + ">" else: if (lineLevel > level...
print "<LI>" + lstrip(linein)
print "<LI", if (styleSheet != ""): print " class=\"L" + str(lineLevel) + "\"", print ">" + rstrip(lstrip(linein)),
def processLine(linein): global level, formatMode, slides, hideComments, inBodyText lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein) + "</H" + str(lineLevel) + ">" else: if (lineLevel > level...
print lstrip(linein)
print rstrip(lstrip(linein)),
def processLine(linein): global level, formatMode, slides, hideComments, inBodyText lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein) + "</H" + str(lineLevel) + ">" else: if (lineLevel > level...
print "<LI>" + lstrip(linein)
print "<LI", if (styleSheet != ""): print " class=\"LI.L" + str(lineLevel) + "\"", print ">" + rstrip(lstrip(linein)),
def processLine(linein): global level, formatMode, slides, hideComments, inBodyText lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein) + "</H" + str(lineLevel) + ">" else: if (lineLevel > level...
print"<!-- $Revision:$ -->" print"<!-- $Date: 2002/09/12 16:20:09 $ -->"
print"<!-- $Revision: 1.15 $ -->" print"<!-- $Date: 2003/10/24 22:28:13 $ -->"
def printHeader(linein): print "<HTML><TITLE>" + linein + "</TITLE>" print"<!-- $Revision:$ -->" print"<!-- $Date: 2002/09/12 16:20:09 $ -->" print"<!-- $Author: noel $ -->"
print "<H1>" + lstrip(linein) +"</H1>"
print "<H1>" + rstrip(lstrip(linein)) +"</H1>"
def printStyle(linein): print "<BODY>" print "<DIV TITLE=\"DocTitle\">" print "<H1>" + lstrip(linein) +"</H1>" print "</DIV>" print "<DIV TITLE=\"Main\">"
print "</ul></DIV>"
print "</DIV>"
def printFooter(): global slides print "</ul></DIV>" if (slides == 0): print "<br><br><br><font size=1>" print copyright print "</font><br>" print inputfile + "&nbsp&nbsp " + strftime("%Y/%m/%d %H:%M",localtime(time())) print "</BODY></HTML>"
print "<br><br><br><font size=1>"
print "<hr><font size=1>"
def printFooter(): global slides print "</ul></DIV>" if (slides == 0): print "<br><br><br><font size=1>" print copyright print "</font><br>" print inputfile + "&nbsp&nbsp " + strftime("%Y/%m/%d %H:%M",localtime(time())) print "</BODY></HTML>"
print " $Revision: 1.35 $" print " $Date: 2005/01/25 00:38:43 $"
print " $Revision: 1.36 $" print " $Date: 2005/02/09 16:15:00 $"
def showVersion(): print print "RCS" print " $Revision: 1.35 $" print " $Date: 2005/01/25 00:38:43 $" print " $Author: noel $" print " $Source: /home/noel/active/NoelOTL/RCS/otl2html.py,v $" print
print " $Source: /home/noel/active/NoelOTL/RCS/otl2html.py,v $"
def showVersion(): print print "RCS" print " $Revision: 1.35 $" print " $Date: 2005/01/25 00:38:43 $" print " $Author: noel $" print " $Source: /home/noel/active/NoelOTL/RCS/otl2html.py,v $" print
global inputfile, debug, formatMode, slides, hideComments, copyright, styleSheet, inlineStyle, div
global inputfile, debug, formatMode, slides, hideComments, copyright, styleSheet, inlineStyle, div, showTitle
def getArgs(): global inputfile, debug, formatMode, slides, hideComments, copyright, styleSheet, inlineStyle, div if (len(sys.argv) == 1): showUsage() sys.exit()() else: for i in range(len(sys.argv)): if (i != 0): if (sys.argv[i] == "-d"): debug = 1 # test for debug flag elif (sys.argv[i] == "-?"): # test for help f...
if (inBodyText == 0): handleBodyText(linein,lineLevel)
if (inBodyText != 1): handleBodyText(linein,lineLevel)
def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle, div, silentdiv if (lstrip(linein) == ""): return linein = beautifyLine(linein) lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (lineLevel > level): # increa...
if (inBodyText == 0): handlePreformattedText(linein,lineLevel)
if (inBodyText != 2): handlePreformattedText(linein,lineLevel)
def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle, div, silentdiv if (lstrip(linein) == ""): return linein = beautifyLine(linein) lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (lineLevel > level): # increa...
if (inBodyText == 0): handleTable(linein,lineLevel)
if (inBodyText != 3): handleTable(linein,lineLevel)
def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle, div, silentdiv if (lstrip(linein) == ""): return linein = beautifyLine(linein) lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (lineLevel > level): # increa...
print"<!-- $Revision: 1.35 $ -->" print"<!-- $Date: 2005/01/25 00:38:43 $ -->"
print"<!-- $Revision: 1.36 $ -->" print"<!-- $Date: 2005/02/09 16:15:00 $ -->"
def printHeader(linein): global styleSheet, inlineStyle print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" print "<html><head><title>" + linein + "</title>" print"<!-- $Revision: 1.35 $ -->" print"<!-- $Date: 2005/01/25 00:38:43 $ -->" print"<!-- $Author: noel $ --...
linein = beautifyLine(lstrip(rstrip(file.readline())))
if (showTitle == 1): printFirstLine(firstLine) linein = beautifyLine(lstrip(rstrip(file.readline()))) else: linein = firstLine
def main(): getArgs() flatouline = [] file = open(inputfile,"r") if (slides == 0): firstLine = beautifyLine(lstrip(rstrip(file.readline()))) printHeader(firstLine) linein = beautifyLine(lstrip(rstrip(file.readline()))) while linein != "": processLine(linein) linein = file.readline() closeLevels() else: linein = beautif...
print " $Revision: 1.29 $" print " $Date: 2004/11/28 17:31:34 $"
print " $Revision: 1.30 $" print " $Date: 2004/12/02 01:02:48 $"
def showVersion(): print print "RCS" print " $Revision: 1.29 $" print " $Date: 2004/11/28 17:31:34 $" print " $Author: noel $" print " $Source: /home/noel/active/NoelOTL/RCS/otl2html.py,v $" print