Forum Archive

Classes

[deleted]

image (c) @tony

'Classes' a family of classes (tap the class names), to:

(1) support project development and delivery:

  • a CommentView etc. ui wrapper class for the standard comment/replace/indent/rename code, with action preview
  • a ReplaceView ui wrapper as above
  • a WebBrowser class, simple, but with attribute for a local web server to close on exit.
  • a MultiBrowser class, 3 panes, any bumpable to full screen, 1 with video, refresh on demand or every 4 min
  • a Menu class to add to the Actions menu that auto populates from directories
  • a ForumCodeBlock class that returns either the first python script in a Pythonista Forum thread, or the first plist.
  • a ForumCodeBlockAdmin class that updates source code in a Pythonista Forum thread, or a plist
  • a Classes class that can manage the classes installed and offer downloads of others or of updates available

(2) provide reusable building blocks to projects:

  • a Settings class that persists to a plist embedded in the .py file, other text file, or retrieves them from a URL
  • a SettingsSheet class that multiply inherits from ui.View and Settings
  • a Documents class to add document handling capabilities to a project
  • an Edit class for a JavaScript based WYSIWYG editor hosted in a web view
  • a Projects class that brings together Documents, Edit, Settings and SettingsSheet into a single project template
[deleted]

Here is my Classes class project. A class that can manage the classes installed and offer downloads of others or of updates available.

Off the shelf it manages my set of classes... but nothing is hard coded and the class can be re-used in any project to manage the classes involved.

Parameters are defined in a plist that can be in a .py file, any other text file, or (as in this case) posted to a code block at any URL.

It doesn't have version checking yet, but that's next to add.

This is a "work in progress" and I'll post code here soon.


image (c) @tony .... (for more classes in this family see... Classes )


image (c) @tony

Classes.py

# placeholder
[deleted]

This is the plist for use with my Classes class... it lists my main classes, files, versions and urls...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>-- ClassesPlist_url 1.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/5866848084033536</string>
    <key>00 Classes Classes 3.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/6151216794959872</string>
    <key>01 CommentView Comment 2.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/5772187004829696</string>
    <key>02 ReplaceView Replace 2.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/5266920341241856</string>
    <key>03 WebBrowser WebBrowser 2.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/5885813317435392</string>
    <key>04 MultiBrowser MultiBrowser 3.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/5866392280629248</string>
    <key>05 BaseMenu Menu 3.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/6432563593740288</string>
    <key>06 MenuController Menu 3.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/6432563593740288</string>
    <key>07 ForumCodeBlock ForumCodeBlock 3.1</key>
    <string>http://omz-forums.appspot.com/pythonista/post/5910314025484288</string>
    <key>08 ForumCodeBlockAdmin ForumCodeBlockAdmin 5.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/5825453289897984</string>
    <key>09 Settings Settings 4.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/5885488242098176</string>
    <key>10 SettingsSheet SettingsSheet 4.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/6458521839206400</string>
    <key>11 SettingsSheetDataSource SettingsSheet 4.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/6458521839206400</string>
    <key>12 Documents Documents 4.1</key>
    <string>http://omz-forums.appspot.com/pythonista/post/5252173302595584</string>
    <key>13 EditView Edit 4.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/5860313022857216</string>
    <key>14 EditRequestHandler Edit 4.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/5860313022857216</string>
    <key>15 Project Projects 4.0</key>
    <string>http://omz-forums.appspot.com/pythonista/post/5323307960238080</string>
</dict>
</plist>