From 4d310cba1a0f1457f1885204eb45d9c14464427c Mon Sep 17 00:00:00 2001 From: Bogdan Popescu <68062990+bopopescu@users.noreply.github.com> Date: Fri, 24 Jul 2020 08:52:26 +0300 Subject: [PATCH] Removal of master-slave vocabulary --- _2016/MobileBlogger.py | 4 +- _2016/main.py | 2 +- .../client_error.py | 4 +- _2016/mysql-connector-pythonista/constants.py | 2 +- _2016/nav.py | 8 +- _2016/number-bonds-game.py | 22 ++-- _2016/ptinstaller.py | 4 +- _2016/to-sort/AddKeyCommands.py | 6 +- _2016/to-sort/RobbiDaten.py | 28 ++--- _2016/to-sort/domains.py | 2 +- ...radient-as-a-background-kivy-pythonista.py | 6 +- appex/MobileBlogger.py | 4 +- blog/MobileBlogger.py | 4 +- blog/post_to_GitHub.py | 2 +- cloud/Cloud.Import.File.py | 6 +- cloud/cloud-file-with-aes-encryption.py | 6 +- cloud/cloud-file.py | 6 +- cloud/cloud-import.py | 2 +- cloud/cloud.py | 4 +- database/DatabaseSizeSummary-Muller.py | 2 +- database/DatabaseSizeSummary.py | 2 +- database/DatabaseSizeSummaryUpdated.py | 2 +- database/Shape2Sqlite.py | 6 +- database/sqlite_table_layout.py | 2 +- download/download-git-repo.py | 2 +- editorial/pystuff-downloader-editorial.py | 4 +- encryption/ssa.py | 8 +- finder/addnewfileshowchooser.py | 2 +- games/Color Defense temp-share/gameobjects.py | 2 +- .../Phantom/ai/pos_eval/piece_tables.py | 2 +- games/PhantomChess/Phantom_installer.py | 8 +- git/Get Github Library.py | 4 +- git/Repo downloader.py | 4 +- git/_gitrepo.py | 2 +- git/download-git-repo.py | 2 +- git/github_downloader.py | 2 +- git/github_downloader_Mr-Coxall.py | 2 +- git/igithub.py | 2 +- git/pulling-from-github-with-pythonista.py | 2 +- git/pulling-from-github.py | 2 +- git/stash-ui-for-git-cmds.py | 2 +- hash/entropy-builder-finger-dragging-ui.py | 4 +- image/ui-image-to-PIL.py | 2 +- installer/Get Github Library.py | 4 +- installer/InstallPyimgur.py | 4 +- installer/installNyamuk.py | 12 +- installer/install_evergreencal.py | 8 +- installer/ptinstaller.py | 4 +- .../markdown2pdf/reportlab/lib/randomtext.py | 4 +- menu/SlideMenu.py | 50 ++++---- menu/pythonista_slidemenu.py | 54 ++++----- menu/pythonista_slidemenu_danrcook.py | 114 +++++++++--------- reminders/reminders_style_ui.py | 52 ++++---- .../Structural/Proxy.py | 2 +- view/ui-view-slide-menu.py | 50 ++++---- weather/WeatherAnywhereScene-coomlata.py | 2 +- youtube/Youtube-dl-downloader.py | 2 +- 57 files changed, 278 insertions(+), 278 deletions(-) diff --git a/_2016/MobileBlogger.py b/_2016/MobileBlogger.py index 90a545cd..b090ea11 100644 --- a/_2016/MobileBlogger.py +++ b/_2016/MobileBlogger.py @@ -115,7 +115,7 @@ def create_new_post(self, title, text, metas): self._gh.git_data.references.update(ref, dict( sha=commit.sha)) - def undo_last_post(self, branch='master'): + def undo_last_post(self, branch='main'): if self._latest_commit is None: return @@ -178,7 +178,7 @@ def main(): metas = { 'tags': results['tags'], - 'branch': 'master', + 'branch': 'main', 'author': results['author'], 'layout': results['layout'], 'filename': results['filename'] diff --git a/_2016/main.py b/_2016/main.py index a8aa4a24..412f852f 100644 --- a/_2016/main.py +++ b/_2016/main.py @@ -20,7 +20,7 @@ # https://github.com/tlinnet/hotspotsystem/tree/master/api/pythonista # # # # Inspired by: https://github.com/khilnani/pythonista-scripts/blob/ # -# master/thirdparty/UI/ui-tutorial/Three-Column-Sortable-TableView.py # +# main/thirdparty/UI/ui-tutorial/Three-Column-Sortable-TableView.py # # # # # # This program is free software; you can redistribute it and/or modify # diff --git a/_2016/mysql-connector-pythonista/client_error.py b/_2016/mysql-connector-pythonista/client_error.py index de9c2477..0994fd00 100644 --- a/_2016/mysql-connector-pythonista/client_error.py +++ b/_2016/mysql-connector-pythonista/client_error.py @@ -52,8 +52,8 @@ CR_EMBEDDED_CONNECTION = u"Embedded server" CR_PROBE_SLAVE_STATUS = u"Error on SHOW SLAVE STATUS:" CR_PROBE_SLAVE_HOSTS = u"Error on SHOW SLAVE HOSTS:" -CR_PROBE_SLAVE_CONNECT = u"Error connecting to slave:" -CR_PROBE_MASTER_CONNECT = u"Error connecting to master:" +CR_PROBE_SLAVE_CONNECT = u"Error connecting to subordinate:" +CR_PROBE_MASTER_CONNECT = u"Error connecting to main:" CR_SSL_CONNECTION_ERROR = u"SSL connection error: %-.100s" CR_MALFORMED_PACKET = u"Malformed packet" CR_WRONG_LICENSE = u"This client library is licensed only for use with MySQL servers having '%s' license" diff --git a/_2016/mysql-connector-pythonista/constants.py b/_2016/mysql-connector-pythonista/constants.py index bbd2f9b4..3ccda9bf 100644 --- a/_2016/mysql-connector-pythonista/constants.py +++ b/_2016/mysql-connector-pythonista/constants.py @@ -413,7 +413,7 @@ class RefreshOption(_constants): 'HOSTS': (1 << 3, 'Flush host cache'), 'STATUS': (1 << 4, 'Flush status variables'), 'THREADS': (1 << 5, 'Flush thread cache'), - 'SLAVE': (1 << 6, 'Reset master info and restart slave thread'), + 'SLAVE': (1 << 6, 'Reset main info and restart subordinate thread'), } diff --git a/_2016/nav.py b/_2016/nav.py index 612c66c1..d812fdcf 100644 --- a/_2016/nav.py +++ b/_2016/nav.py @@ -3,14 +3,14 @@ import ui class SplitView (ui.View): - def __init__(self, master_width=300, child_min=300, mv=ui.View()): + def __init__(self, main_width=300, child_min=300, mv=ui.View()): ''' - :master_width: the width of the master view + :main_width: the width of the main view :child_min: the minimum size of the child before going to a nav view ''' self.width = 800 self.height = 800 - self.master_width = master_width + self.main_width = main_width self.mv = mv self.child = ui.View() self.mv.name = 'mv' @@ -21,7 +21,7 @@ def __init__(self, master_width=300, child_min=300, mv=ui.View()): self.mv.y=0 self.mv.flex = 'H' self.mv.height = self.height - self.mv.width = self.master_width + self.mv.width = self.main_width self.mv.height = self.height self.mv.background_color = 'blue' self.child.flex='WHL' diff --git a/_2016/number-bonds-game.py b/_2016/number-bonds-game.py index c9d880c0..a2215162 100644 --- a/_2016/number-bonds-game.py +++ b/_2016/number-bonds-game.py @@ -83,15 +83,15 @@ def setup(self): check_label.color = 'black' check_label.scale = 2 - self.master = random.randrange(30,100) - self.num1 = random.randrange(1,self.master-10) - self.answer = self.master - self.num1 + self.main = random.randrange(30,100) + self.num1 = random.randrange(1,self.main-10) + self.answer = self.main - self.num1 self.guess = 0 - self.master_label = LabelNode(str(self.master),parent=self) - self.master_label.position = circle1.position - self.master_label.color = 'black' - self.master_label.scale = 2 + self.main_label = LabelNode(str(self.main),parent=self) + self.main_label.position = circle1.position + self.main_label.color = 'black' + self.main_label.scale = 2 self.num1_label = LabelNode(str(self.num1),parent=self) self.num1_label.position = circle2.position @@ -109,12 +109,12 @@ def setup(self): self.correct_messages = ['well done','excellent','your the best','fandabidozee','boom ting','bang on','bet you do this in your sleep'] def reset(self): - self.master = random.randrange(30,100) - self.num1 = random.randrange(1,self.master-10) - self.answer = self.master - self.num1 + self.main = random.randrange(30,100) + self.num1 = random.randrange(1,self.main-10) + self.answer = self.main - self.num1 self.guess = 0 - self.master_label.text = str(self.master) + self.main_label.text = str(self.main) self.num1_label.text = str(self.num1) self.guess_label.text = str(self.guess) diff --git a/_2016/ptinstaller.py b/_2016/ptinstaller.py index ac8e7baa..c75bbb79 100644 --- a/_2016/ptinstaller.py +++ b/_2016/ptinstaller.py @@ -114,8 +114,8 @@ def get_github_user_repo(url): def download(self, url): user_name, repo_name = self.get_github_user_repo(url) - zipfile_url = urljoin(url, '/%s/%s/archive/master.zip' % (user_name, repo_name)) - tmp_zipfile = os.path.join(os.environ['TMPDIR'], '%s-master.zip' % repo_name) + zipfile_url = urljoin(url, '/%s/%s/archive/main.zip' % (user_name, repo_name)) + tmp_zipfile = os.path.join(os.environ['TMPDIR'], '%s-main.zip' % repo_name) r = requests.get(zipfile_url) with open(tmp_zipfile, 'wb') as outs: diff --git a/_2016/to-sort/AddKeyCommands.py b/_2016/to-sort/AddKeyCommands.py index 614d216c..56108cb8 100644 --- a/_2016/to-sort/AddKeyCommands.py +++ b/_2016/to-sort/AddKeyCommands.py @@ -37,11 +37,11 @@ def handleCommandS(_cmd,_sel): time.sleep(0.1) @on_main_thread def showChooser(): - vc.showMasterWithAnimationDuration_(0.3) + vc.showMainWithAnimationDuration_(0.3) @on_main_thread def hideChooser(): - vc.hideMasterWithAnimationDuration_(0.3) - if vc.masterVisible(): + vc.hideMainWithAnimationDuration_(0.3) + if vc.mainVisible(): hideChooser() else: showChooser() diff --git a/_2016/to-sort/RobbiDaten.py b/_2016/to-sort/RobbiDaten.py index e7328e93..910c1eeb 100644 --- a/_2016/to-sort/RobbiDaten.py +++ b/_2016/to-sort/RobbiDaten.py @@ -25,20 +25,20 @@ def __init__(self,roboter): # GUI-Objekte definieren self.fenster = Tk() self.fenster.title("Robbi Roboter") - self.frame1 = Frame(master=self.fenster) - self.frame2 = Frame(master=self.fenster) - self.welt2d = Canvas(master=self.frame1, width=511, height=511, bg="white") - self.eingabe = Text(master=self.frame1, width=40, height=36, bg = "#f0f0f0") - self.buttonQuit = Button(master=self.frame2, text="Quit", command=self.fenster.quit) - self.buttonNeueWelt = Button(master=self.frame2, text="Neue Welt", command=self.welt2dzeichnen) - self.buttonSchritt = Button(master=self.frame2, text="Schritt", command=self.schritt) - self.buttonLinks = Button(master=self.frame2, text="Linksdrehen", command=self.linksdrehen) - self.buttonRechts = Button(master=self.frame2, text="Rechtsdrehen", command=self.rechtsdrehen) - self.buttonHinlegen = Button(master=self.frame2, text="Hinlegen", command=self.hinlegen) - self.buttonAufheben = Button(master=self.frame2, text="Aufheben", command=self.aufheben) - self.buttonAusfuehren = Button(master=self.frame1, text ="Ausführen", command=self.ausfuehrenclick) - self.buttonLaden = Button(master=self.frame1, text ="Laden", command=self.laden) - self.buttonSpeichern = Button(master=self.frame1, text ="Speichern", command=self.speichern) + self.frame1 = Frame(main=self.fenster) + self.frame2 = Frame(main=self.fenster) + self.welt2d = Canvas(main=self.frame1, width=511, height=511, bg="white") + self.eingabe = Text(main=self.frame1, width=40, height=36, bg = "#f0f0f0") + self.buttonQuit = Button(main=self.frame2, text="Quit", command=self.fenster.quit) + self.buttonNeueWelt = Button(main=self.frame2, text="Neue Welt", command=self.welt2dzeichnen) + self.buttonSchritt = Button(main=self.frame2, text="Schritt", command=self.schritt) + self.buttonLinks = Button(main=self.frame2, text="Linksdrehen", command=self.linksdrehen) + self.buttonRechts = Button(main=self.frame2, text="Rechtsdrehen", command=self.rechtsdrehen) + self.buttonHinlegen = Button(main=self.frame2, text="Hinlegen", command=self.hinlegen) + self.buttonAufheben = Button(main=self.frame2, text="Aufheben", command=self.aufheben) + self.buttonAusfuehren = Button(main=self.frame1, text ="Ausführen", command=self.ausfuehrenclick) + self.buttonLaden = Button(main=self.frame1, text ="Laden", command=self.laden) + self.buttonSpeichern = Button(main=self.frame1, text ="Speichern", command=self.speichern) # GUI-Objekte anordnen diff --git a/_2016/to-sort/domains.py b/_2016/to-sort/domains.py index d8d98c37..d47ff272 100644 --- a/_2016/to-sort/domains.py +++ b/_2016/to-sort/domains.py @@ -9,7 +9,7 @@ GH_BASE = "https://raw.githubusercontent.com/" TLD_URL = os.path.join( GH_BASE, - "publicsuffix/list/master/public_suffix_list.dat" + "publicsuffix/list/main/public_suffix_list.dat" ) diff --git a/_2017/set-a-gradient-as-a-background-kivy-pythonista.py b/_2017/set-a-gradient-as-a-background-kivy-pythonista.py index 2896f8eb..ac2c424f 100644 --- a/_2017/set-a-gradient-as-a-background-kivy-pythonista.py +++ b/_2017/set-a-gradient-as-a-background-kivy-pythonista.py @@ -58,12 +58,12 @@ def __init__(self, platform, gradient, *args, **kwargs): from Tkinter import Frame from Tkinter import Label from Tkinter import NW - self.master = Tk() - self.root = Canvas(self.master, width=kwargs['frame'][2], \ + self.main = Tk() + self.root = Canvas(self.main, width=kwargs['frame'][2], \ height=kwargs['frame'][3]) self.root.pack() self.frame = kwargs['frame'] - contour = Frame(self.master, height=30, width=60) + contour = Frame(self.main, height=30, width=60) contour.pack_propagate(0) # don't shrink label = Label(contour, text='NEXT', fg='white', bg='#585858', \ height=30, width=60) diff --git a/appex/MobileBlogger.py b/appex/MobileBlogger.py index 89c012ef..854340b1 100644 --- a/appex/MobileBlogger.py +++ b/appex/MobileBlogger.py @@ -115,7 +115,7 @@ def create_new_post(self, title, text, metas): self._gh.git_data.references.update(ref, dict( sha=commit.sha)) - def undo_last_post(self, branch='master'): + def undo_last_post(self, branch='main'): if self._latest_commit is None: return @@ -172,7 +172,7 @@ def main(): metas = { 'tags': results['tags'], - 'branch': 'master', + 'branch': 'main', 'author': results['author'], 'layout': results['layout'], 'filename': results['filename'] diff --git a/blog/MobileBlogger.py b/blog/MobileBlogger.py index 89c012ef..854340b1 100644 --- a/blog/MobileBlogger.py +++ b/blog/MobileBlogger.py @@ -115,7 +115,7 @@ def create_new_post(self, title, text, metas): self._gh.git_data.references.update(ref, dict( sha=commit.sha)) - def undo_last_post(self, branch='master'): + def undo_last_post(self, branch='main'): if self._latest_commit is None: return @@ -172,7 +172,7 @@ def main(): metas = { 'tags': results['tags'], - 'branch': 'master', + 'branch': 'main', 'author': results['author'], 'layout': results['layout'], 'filename': results['filename'] diff --git a/blog/post_to_GitHub.py b/blog/post_to_GitHub.py index 22aad3f7..47934448 100644 --- a/blog/post_to_GitHub.py +++ b/blog/post_to_GitHub.py @@ -12,7 +12,7 @@ import json import base64 -SITE_BRANCH = 'master' # either master or gh-pages +SITE_BRANCH = 'main' # either main or gh-pages COMMITTER = {'name': 'Joe Bloggs', 'email': 'email@example.com'} #keychain.delete_password('GitHub', 'username') # Uncomment these lines diff --git a/cloud/Cloud.Import.File.py b/cloud/Cloud.Import.File.py index 8234ba19..34d095b0 100644 --- a/cloud/Cloud.Import.File.py +++ b/cloud/Cloud.Import.File.py @@ -12,8 +12,8 @@ Credits: -- cloud.Import: idea and first version by @guerito, future versions on @webmaster4o's GitHub -- cloud.File: idea and first version by @guerito, future versions on @webmaster4o's GitHub +- cloud.Import: idea and first version by @guerito, future versions on @webmain4o's GitHub +- cloud.File: idea and first version by @guerito, future versions on @webmain4o's GitHub ''' @@ -151,7 +151,7 @@ def readline(self, size = -1): class __CloudProvider(object): - """default implementation using Gist can be subclassed for: GitHub, @webmaster4o server, Googledrive, Dropbox, Box, OneDrive, WebDav, etc """ + """default implementation using Gist can be subclassed for: GitHub, @webmain4o server, Googledrive, Dropbox, Box, OneDrive, WebDav, etc """ def putFileToURL(self, f): return json.loads(urllib.urlopen('https://api.github.com/gists', json.dumps({ "description": "-", "public": False, "files": { '-': { "content": f.read()} } })).read())['files']['-']['raw_url'] diff --git a/cloud/cloud-file-with-aes-encryption.py b/cloud/cloud-file-with-aes-encryption.py index 88d1b93e..8bf3793e 100644 --- a/cloud/cloud-file-with-aes-encryption.py +++ b/cloud/cloud-file-with-aes-encryption.py @@ -12,8 +12,8 @@ Credits: -- cloud.Import: idea and first version by @guerito, future versions on @webmaster4o's GitHub -- cloud.File: idea and first version by @guerito, future versions on @webmaster4o's GitHub +- cloud.Import: idea and first version by @guerito, future versions on @webmain4o's GitHub +- cloud.File: idea and first version by @guerito, future versions on @webmain4o's GitHub ''' @@ -154,7 +154,7 @@ def readline(self, size = -1): class __CloudProvider(object): - """default implementation using Gist can be subclassed for: GitHub, @webmaster4o server, Googledrive, Dropbox, Box, OneDrive, WebDav, etc """ + """default implementation using Gist can be subclassed for: GitHub, @webmain4o server, Googledrive, Dropbox, Box, OneDrive, WebDav, etc """ def putFileToURL(self, f): return json.loads(urllib.urlopen('https://api.github.com/gists', json.dumps({ "description": "-", "public": False, "files": { '-': { "content": f.read()} } })).read())['files']['-']['raw_url'] diff --git a/cloud/cloud-file.py b/cloud/cloud-file.py index 66d29452..c3561712 100644 --- a/cloud/cloud-file.py +++ b/cloud/cloud-file.py @@ -15,8 +15,8 @@ Credits: -- cloud.Import: idea and first version by @guerito, future versions on @webmaster4o's GitHub -- cloud.File: idea and first version by @guerito, future versions on @webmaster4o's GitHub +- cloud.Import: idea and first version by @guerito, future versions on @webmain4o's GitHub +- cloud.File: idea and first version by @guerito, future versions on @webmain4o's GitHub ''' from __future__ import print_function @@ -150,7 +150,7 @@ def readline(self, size = -1): class __CloudProvider(object): - """default implementation using Gist can be subclassed for: GitHub, @webmaster4o server, Googledrive, Dropbox, Box, OneDrive, WebDav, etc """ + """default implementation using Gist can be subclassed for: GitHub, @webmain4o server, Googledrive, Dropbox, Box, OneDrive, WebDav, etc """ def putFileToURL(self, f): return json.loads(urllib.urlopen('https://api.github.com/gists', json.dumps({ "description": "-", "public": False, "files": { '-': { "content": f.read()} } })).read())['files']['-']['raw_url'] diff --git a/cloud/cloud-import.py b/cloud/cloud-import.py index eee33f87..53b895c1 100644 --- a/cloud/cloud-import.py +++ b/cloud/cloud-import.py @@ -50,7 +50,7 @@ def Import(sTarget): for code in bs4.BeautifulSoup(urllib2.urlopen('http://forum.omz-software.com/topic/2775/cloud-import').read()).find_all('code'): s = code.getText() - if s[:5] == ' iOld or nonexistant: console.hud_alert('updating ' + sTarget + ' ...') - urlZ += '/archive/master.zip' # URL for downloading a zip of the repo + urlZ += '/archive/main.zip' # URL for downloading a zip of the repo # Download zipfile and extract content = requests.get(urlZ, stream=True).content # Load into a StringIO file-like object to avoid having to save locally diff --git a/database/DatabaseSizeSummary-Muller.py b/database/DatabaseSizeSummary-Muller.py index 9642fba9..af510898 100644 --- a/database/DatabaseSizeSummary-Muller.py +++ b/database/DatabaseSizeSummary-Muller.py @@ -31,7 +31,7 @@ def Describe(dbFile): totalCells = 0 # Get List of Tables: - tableListQuery = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY Name" + tableListQuery = "SELECT name FROM sqlite_main WHERE type='table' ORDER BY Name" cursor.execute(tableListQuery) tables = map(lambda t: t[0], cursor.fetchall()) diff --git a/database/DatabaseSizeSummary.py b/database/DatabaseSizeSummary.py index f0057f51..c51b0375 100644 --- a/database/DatabaseSizeSummary.py +++ b/database/DatabaseSizeSummary.py @@ -31,7 +31,7 @@ def Describe(dbFile): totalCells = 0 # Get List of Tables: - tableListQuery = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY Name" + tableListQuery = "SELECT name FROM sqlite_main WHERE type='table' ORDER BY Name" cursor.execute(tableListQuery) tables = map(lambda t: t[0], cursor.fetchall()) diff --git a/database/DatabaseSizeSummaryUpdated.py b/database/DatabaseSizeSummaryUpdated.py index 120ef8f6..3b97526f 100644 --- a/database/DatabaseSizeSummaryUpdated.py +++ b/database/DatabaseSizeSummaryUpdated.py @@ -31,7 +31,7 @@ def Describe(dbFile): totalCells = 0 # Get List of Tables: - tableListQuery = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY Name" + tableListQuery = "SELECT name FROM sqlite_main WHERE type='table' ORDER BY Name" cursor.execute(tableListQuery) tables = map(lambda t: t[0], cursor.fetchall()) diff --git a/database/Shape2Sqlite.py b/database/Shape2Sqlite.py index 3473f16e..0a2588f0 100644 --- a/database/Shape2Sqlite.py +++ b/database/Shape2Sqlite.py @@ -36,7 +36,7 @@ def check_tables(self): #ID_Shape = For each shape(file/table) #ID_Poly = For each poly(line/gon or for many points like cities) #ID_Point = For each point per poly - cursor = self.sqlcur.execute("SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='Shapes'") + cursor = self.sqlcur.execute("SELECT COUNT(*) FROM sqlite_main WHERE type='table' AND name='Shapes'") if cursor.fetchone()[0] == 0: self.sqlcur.execute("CREATE TABLE 'Shapes' ('ID_Shape' INTEGER, 'Name' TEXT)") #print 'Table Shapes is created' @@ -47,7 +47,7 @@ def check_tables(self): if self.shapes_count == None: self.shapes_count = 0 - cursor = self.sqlcur.execute("SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='Polys'") + cursor = self.sqlcur.execute("SELECT COUNT(*) FROM sqlite_main WHERE type='table' AND name='Polys'") if cursor.fetchone()[0] == 0: self.sqlcur.execute("CREATE TABLE 'Polys' ('ID_Shape' INTEGER, 'ID_Poly' INTEGER, 'ShapeType' INTEGER, 'Xmin' REAL, 'Ymin' REAL, 'Xmax' REAL, 'Ymax' REAL, 'NumParts' INTEGER, 'NumPoints' INTEGER, 'Name' TEXT)") self.sqlcon.commit() @@ -59,7 +59,7 @@ def check_tables(self): if self.polys_count == None: self.polys_count = 0 - cursor = self.sqlcur.execute("SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='Points'") + cursor = self.sqlcur.execute("SELECT COUNT(*) FROM sqlite_main WHERE type='table' AND name='Points'") if cursor.fetchone()[0] == 0: self.sqlcur.execute("CREATE TABLE 'Points' ('ID_Poly' INTEGER,'ID_Point' INTEGER,'X' REAL,'Y' REAL, 'Name' TEXT)") #print 'Table Points is created' diff --git a/database/sqlite_table_layout.py b/database/sqlite_table_layout.py index 3729d089..ae8cd1ef 100644 --- a/database/sqlite_table_layout.py +++ b/database/sqlite_table_layout.py @@ -12,7 +12,7 @@ def row_count_and_column_names(table_name): cursor.execute("SELECT * FROM {}".format(table_name)) return len(cursor.fetchall()), ', '.join(x[0] for x in cursor.description) cursor = sqlite_connection.cursor() - cursor.execute("SELECT name FROM sqlite_master WHERE type='table'") + cursor.execute("SELECT name FROM sqlite_main WHERE type='table'") table_dict = {x[0] : row_count_and_column_names(x[0]) for x in cursor.fetchall()} fmt = 'Table "{}" contains {} records with columns:\n {}' return '\n'.join(fmt.format(x, *table_dict[x]) for x in sorted(table_dict)) diff --git a/download/download-git-repo.py b/download/download-git-repo.py index 4aacde4b..fd310e05 100644 --- a/download/download-git-repo.py +++ b/download/download-git-repo.py @@ -39,7 +39,7 @@ def git_download(url): if m: g=m.groupdict() if not g['branch']: - g['branch']='master' + g['branch']='main' u= '/'.join((base,g['user'],g['repo'],archive, g['branch'])) diff --git a/editorial/pystuff-downloader-editorial.py b/editorial/pystuff-downloader-editorial.py index 9116f8dd..551fb5e8 100644 --- a/editorial/pystuff-downloader-editorial.py +++ b/editorial/pystuff-downloader-editorial.py @@ -54,7 +54,7 @@ url = 'https://github.com/html5lib/html5lib-python/archive/master.zip' -fname='html5lib-python-master' +fname='html5lib-python-main' sname='html5lib' dname='Scripts/html5lib' print('Downloading '+dname+'...') @@ -73,7 +73,7 @@ os.remove(fname+'.zip') url='https://github.com/chrisglass/xhtml2pdf/archive/master.zip' -fname='xhtml2pdf-master' +fname='xhtml2pdf-main' sname='xhtml2pdf' dname='Scripts/xhtml2pdf' print('Downloading '+dname+'...') diff --git a/encryption/ssa.py b/encryption/ssa.py index 0724c280..3e69d199 100644 --- a/encryption/ssa.py +++ b/encryption/ssa.py @@ -287,9 +287,9 @@ def __init__(self, title='', txt_instruct='', but_command='', but_lbl='', lbl_li self.but_lbl = but_lbl self.lbl_list = lbl_list def open_lb(self): - master = Tk.Tk() - master.title(self.title) - F1 = Tk.Frame(master) + main = Tk.Tk() + main.title(self.title) + F1 = Tk.Frame(main) lab = Tk.Label(F1) lab.config(text=self.txt_instruct) lab.pack() @@ -301,7 +301,7 @@ def open_lb(self): L['yscrollcommand'] = s.set for id in self.lbl_list: L.insert(Tk.END, id) F1.pack(side=Tk.TOP) - F2 = Tk.Frame(master) + F2 = Tk.Frame(main) def run_command(): rid = L.get(Tk.ACTIVE) eval(self.but_command.format(rid)) diff --git a/finder/addnewfileshowchooser.py b/finder/addnewfileshowchooser.py index 0df90b50..1991fb7b 100644 --- a/finder/addnewfileshowchooser.py +++ b/finder/addnewfileshowchooser.py @@ -24,7 +24,7 @@ def show_file_chooser_panel(newTab=False): time.sleep(0.1) @on_main_thread def showChooser(): - vc.showMasterWithAnimationDuration_(0.3) + vc.showMainWithAnimationDuration_(0.3) showChooser() def add_new_file(): diff --git a/games/Color Defense temp-share/gameobjects.py b/games/Color Defense temp-share/gameobjects.py index 0eca2e0e..66090703 100644 --- a/games/Color Defense temp-share/gameobjects.py +++ b/games/Color Defense temp-share/gameobjects.py @@ -21,7 +21,7 @@ def __init__(self, parent): self.w = self.tilew * self.numx self.h = self.tileh * self.numy - # The important lists. The master map, the shortest path, and tiles which need to be reset. + # The important lists. The main map, the shortest path, and tiles which need to be reset. self.map = [] self.shortestpath = [] self.tilestoreset = [] diff --git a/games/PhantomChess/Phantom/ai/pos_eval/piece_tables.py b/games/PhantomChess/Phantom/ai/pos_eval/piece_tables.py index 51437c31..dfcaa4ea 100644 --- a/games/PhantomChess/Phantom/ai/pos_eval/piece_tables.py +++ b/games/PhantomChess/Phantom/ai/pos_eval/piece_tables.py @@ -22,7 +22,7 @@ This file is import clean. The idea behind the lists in this file is to represent a chessboard. Each list with in a list is 8 pieces long -and each 'master' list is 8 lists long. This means there are 64 elements total in each list. Those elements +and each 'main' list is 8 lists long. This means there are 64 elements total in each list. Those elements are the ratings of the squares for the piece type (that the list is named for). For example, a white pawn at the coordinate (3, 3) will recieve a bonus of 20 points. """ diff --git a/games/PhantomChess/Phantom_installer.py b/games/PhantomChess/Phantom_installer.py index cb19a175..40b97a87 100644 --- a/games/PhantomChess/Phantom_installer.py +++ b/games/PhantomChess/Phantom_installer.py @@ -16,7 +16,7 @@ print('=' * 31) module_name = 'Phantom' print('Preparing to install {}...'.format(module_name)) -master_name = module_name + 'Chess-master' +main_name = module_name + 'Chess-main' zip_filename = module_name + '.zip' url = 'https://github.com/671620616/PhantomChess/archive/master.zip' @@ -34,7 +34,7 @@ except OSError: pass try: - shutil.copytree(os.path.join(master_name, module_name), copy_to) + shutil.copytree(os.path.join(main_name, module_name), copy_to) print('Successfully copied {} to: {}'.format(module_name, copy_to)) # a homebrew installed Python on Mac OS X has a read-only /Library/Python/2.7/site-packages except OSError as e: @@ -46,8 +46,8 @@ shutil.rmtree(module_name) except OSError: pass -shutil.copytree(os.path.join(master_name, module_name), module_name) -shutil.rmtree(master_name) +shutil.copytree(os.path.join(main_name, module_name), module_name) +shutil.rmtree(main_name) os.remove(zip_filename) diff --git a/git/Get Github Library.py b/git/Get Github Library.py index 1864c16c..45000b0b 100644 --- a/git/Get Github Library.py +++ b/git/Get Github Library.py @@ -98,7 +98,7 @@ def getPyGithub(): for file in pyGithubFiles: print 'Downloading', file localFile = open(os.path.join(githubDir, file), 'w') - resource = urllib2.urlopen('https://raw.github.com/' + githubUser + '/PyGithub/master/github/' + file) + resource = urllib2.urlopen('https://raw.github.com/' + githubUser + '/PyGithub/main/github/' + file) localFile.write(resource.read()) localFile.close() resource.close() @@ -129,7 +129,7 @@ def getGithubista(): for file in files: print 'Downloading', file localFile = open(os.path.join(githubDir, file), 'w') - resource = urllib2.urlopen('https://raw.github.com/' + githubUser + '/githubista/master/' + file) + resource = urllib2.urlopen('https://raw.github.com/' + githubUser + '/githubista/main/' + file) localFile.write(resource.read()) localFile.close() resource.close() diff --git a/git/Repo downloader.py b/git/Repo downloader.py index 543319ad..26c28331 100644 --- a/git/Repo downloader.py +++ b/git/Repo downloader.py @@ -14,13 +14,13 @@ import random print "Getting URL..." -url_format = 'https://www.github.com/{user}/{repo}/archive/master.zip' +url_format = 'https://www.github.com/{user}/{repo}/archive/main.zip' user = raw_input('Please enter the name of the user > ') repo = raw_input('Please enter the name of the repo > ') print "Preparing..." url = url_format.format(user=user, repo=repo) -downloadname = str(random.randint(0x000000, 0xFFFFFF)) + "_master.zip" +downloadname = str(random.randint(0x000000, 0xFFFFFF)) + "_main.zip" print "Downloading..." urllib.urlretrieve(url, downloadname) diff --git a/git/_gitrepo.py b/git/_gitrepo.py index efdd1957..85d852e1 100644 --- a/git/_gitrepo.py +++ b/git/_gitrepo.py @@ -17,7 +17,7 @@ def tableview_did_select(self, tableview, section, row): self.selected_item = tableview.data_source.items[row] tableview.superview.close() -repolink = "https://github.com/{}/{}/archive/master.zip" +repolink = "https://github.com/{}/{}/archive/main.zip" gistslink = "https://api.github.com/users/{}/gists" browselink = "https://api.github.com/users/{}/repos" releaselink = "https://api.github.com/repos/{}/{}/releases" diff --git a/git/download-git-repo.py b/git/download-git-repo.py index 4aacde4b..fd310e05 100644 --- a/git/download-git-repo.py +++ b/git/download-git-repo.py @@ -39,7 +39,7 @@ def git_download(url): if m: g=m.groupdict() if not g['branch']: - g['branch']='master' + g['branch']='main' u= '/'.join((base,g['user'],g['repo'],archive, g['branch'])) diff --git a/git/github_downloader.py b/git/github_downloader.py index ed17ec78..900a129b 100644 --- a/git/github_downloader.py +++ b/git/github_downloader.py @@ -71,7 +71,7 @@ def git_download(url): if m: g = m.groupdict() if not g['branch']: - g['branch'] = 'master' + g['branch'] = 'main' u = '/'.join((base,g['user'],g['repo'],archive, g['branch'])) #print u diff --git a/git/github_downloader_Mr-Coxall.py b/git/github_downloader_Mr-Coxall.py index e79291a9..54658121 100644 --- a/git/github_downloader_Mr-Coxall.py +++ b/git/github_downloader_Mr-Coxall.py @@ -69,7 +69,7 @@ def git_download(url): if m: g = m.groupdict() if not g['branch']: - g['branch'] = 'master' + g['branch'] = 'main' u = '/'.join((base,g['user'],g['repo'],archive, g['branch'])) #print u diff --git a/git/igithub.py b/git/igithub.py index a4045dfa..8c91e547 100644 --- a/git/igithub.py +++ b/git/igithub.py @@ -82,7 +82,7 @@ def did_load(self): def getrepo(sender): usr = sender.superview["usr"].text rep = sender.superview["rep"].text - url = 'https://codeload.github.com/{}/{}/zip/master'.format(usr, rep) + url = 'https://codeload.github.com/{}/{}/zip/main'.format(usr, rep) filename, headers = urllib.urlretrieve(url) with zipfile.ZipFile(filename) as zip_file: zip_file.extractall() diff --git a/git/pulling-from-github-with-pythonista.py b/git/pulling-from-github-with-pythonista.py index af500f12..8169786b 100644 --- a/git/pulling-from-github-with-pythonista.py +++ b/git/pulling-from-github-with-pythonista.py @@ -18,7 +18,7 @@ def tableview_did_select(self, tableview, section, row): self.selected_item = tableview.data_source.items[row] tableview.superview.close() -repolink = "https://github.com/{}/{}/archive/master.zip" +repolink = "https://github.com/{}/{}/archive/main.zip" gistslink = "https://api.github.com/users/{}/gists" browselink = "https://api.github.com/users/{}/repos" releaselink = "https://api.github.com/repos/{}/{}/releases" diff --git a/git/pulling-from-github.py b/git/pulling-from-github.py index 185f402e..b9155294 100644 --- a/git/pulling-from-github.py +++ b/git/pulling-from-github.py @@ -17,7 +17,7 @@ def tableview_did_select(self, tableview, section, row): self.selected_item = tableview.data_source.items[row] tableview.superview.close() -repolink = "https://github.com/{}/{}/archive/master.zip" +repolink = "https://github.com/{}/{}/archive/main.zip" gistslink = "https://api.github.com/users/{}/gists" browselink = "https://api.github.com/users/{}/repos" releaselink = "https://api.github.com/repos/{}/{}/releases" diff --git a/git/stash-ui-for-git-cmds.py b/git/stash-ui-for-git-cmds.py index 17c05876..12c7dbdb 100644 --- a/git/stash-ui-for-git-cmds.py +++ b/git/stash-ui-for-git-cmds.py @@ -37,4 +37,4 @@ # commit _stash(_cmd_git_commit.format()) # push the commits to the remote -_stash(_cmd_git_push.format(branch = 'master', remote_url = _remote, username = 'xxx')) +_stash(_cmd_git_push.format(branch = 'main', remote_url = _remote, username = 'xxx')) diff --git a/hash/entropy-builder-finger-dragging-ui.py b/hash/entropy-builder-finger-dragging-ui.py index 22c1d6af..fb2f3956 100644 --- a/hash/entropy-builder-finger-dragging-ui.py +++ b/hash/entropy-builder-finger-dragging-ui.py @@ -27,7 +27,7 @@ def do_hash_generation(self, location): #do what is necessary to generate your hash, when complete (100%) do self.complete=True #use the hashlib module???? (included and has documentation on pythonista) #I've never used this. If you want it like that website, my guess is that they string together coordinate information - #from the touches and then generate a hash from that. @Webmaster4o may be able to decipher what they are doing. He's pro with JS. + #from the touches and then generate a hash from that. @Webmain4o may be able to decipher what they are doing. He's pro with JS. self.hash = '' #update it self.textview.text = self.hash #show the text in the textview @@ -73,7 +73,7 @@ def do_hash_generation(self, location): #do what is necessary to generate your hash, when complete (100%) do self.complete=True #use the hashlib module???? (included and has documentation on pythonista) #I've never used this. If you want it like that website, my guess is that they string together coordinate information - #from the touches and then generate a hash from that. @Webmaster4o may be able to decipher what they are doing. He's pro with JS. + #from the touches and then generate a hash from that. @Webmain4o may be able to decipher what they are doing. He's pro with JS. self.hash = '' #update it self.textview.text = self.hash #show the text in the textview diff --git a/image/ui-image-to-PIL.py b/image/ui-image-to-PIL.py index 4cc0e34c..672f5dc7 100644 --- a/image/ui-image-to-PIL.py +++ b/image/ui-image-to-PIL.py @@ -23,7 +23,7 @@ def pil2ui(pil_image): return ui.Image.from_data(buffer.getvalue()) def main(): - pilimg = ui.Image.named('ShapeRender-master/image.png') + pilimg = ui.Image.named('ShapeRender-main/image.png') img = ui2pil(pilimg) sketch(img).show() img1 = pil2ui(img) diff --git a/installer/Get Github Library.py b/installer/Get Github Library.py index 4bd454e2..f8bdccfd 100644 --- a/installer/Get Github Library.py +++ b/installer/Get Github Library.py @@ -96,7 +96,7 @@ def getPyGithub(): for file in pyGithubFiles: print 'Downloading', file localFile = open(os.path.join(githubDir, file), 'w') - resource = urllib2.urlopen('https://raw.github.com/' + githubUser + '/PyGithub/master/github/' + file) + resource = urllib2.urlopen('https://raw.github.com/' + githubUser + '/PyGithub/main/github/' + file) localFile.write(resource.read()) localFile.close() resource.close() @@ -127,7 +127,7 @@ def getGithubista(): for file in files: print 'Downloading', file localFile = open(os.path.join(githubDir, file), 'w') - resource = urllib2.urlopen('https://raw.github.com/' + githubUser + '/githubista/master/' + file) + resource = urllib2.urlopen('https://raw.github.com/' + githubUser + '/githubista/main/' + file) localFile.write(resource.read()) localFile.close() resource.close() diff --git a/installer/InstallPyimgur.py b/installer/InstallPyimgur.py index 5d77ef69..356eb1ba 100644 --- a/installer/InstallPyimgur.py +++ b/installer/InstallPyimgur.py @@ -9,5 +9,5 @@ z=zipfile.ZipFile(os.path.expanduser('~/Documents/pyimgur.zip')) z.extractall() os.remove(os.path.expanduser('~/Documents/pyimgur.zip')) -shutil.copytree(os.path.expanduser('~/Documents/PyImgur-master/pyimgur'), os.path.expanduser('~/Documents/site-packages/pyimgur')) -shutil.rmtree(os.path.expanduser('~/Documents/PyImgur-master')) \ No newline at end of file +shutil.copytree(os.path.expanduser('~/Documents/PyImgur-main/pyimgur'), os.path.expanduser('~/Documents/site-packages/pyimgur')) +shutil.rmtree(os.path.expanduser('~/Documents/PyImgur-main')) \ No newline at end of file diff --git a/installer/installNyamuk.py b/installer/installNyamuk.py index 0eb200aa..17b3c0ea 100644 --- a/installer/installNyamuk.py +++ b/installer/installNyamuk.py @@ -11,7 +11,7 @@ moduleName = 'nyamuk' zipFileName = moduleName + '.zip' -masterDir = moduleName + '-master' +mainDir = moduleName + '-main' url = 'http://nodeload.github.com/iwanbk/nyamuk/zip/master' print('Downloading ' + zipFileName + '...') @@ -24,13 +24,13 @@ print('Moving files to ' + moduleName + '...') if os.path.isdir(moduleName): shutil.rmtree(moduleName) -shutil.move(masterDir + '/' + moduleName, './' + moduleName) -shutil.move(masterDir + '/test/pass-sub.py', './' + moduleName + 'Pass-sub.py') -shutil.move(masterDir + '/test/pubnya.py', './' + moduleName + 'Pubnya.py') -shutil.move(masterDir + '/test/subnya.py', './' + moduleName + 'Subnya.py') +shutil.move(mainDir + '/' + moduleName, './' + moduleName) +shutil.move(mainDir + '/test/pass-sub.py', './' + moduleName + 'Pass-sub.py') +shutil.move(mainDir + '/test/pubnya.py', './' + moduleName + 'Pubnya.py') +shutil.move(mainDir + '/test/subnya.py', './' + moduleName + 'Subnya.py') print('Cleaning up...') -shutil.rmtree(masterDir) +shutil.rmtree(mainDir) os.remove(zipFileName) print('Done.') diff --git a/installer/install_evergreencal.py b/installer/install_evergreencal.py index 1a4145d0..29fd4165 100644 --- a/installer/install_evergreencal.py +++ b/installer/install_evergreencal.py @@ -130,10 +130,10 @@ t.extractall() t.close() - shutil.move('parsedatetime-master/parsedatetime/__init__.py', 'parsedatetime') - shutil.move('parsedatetime-master/parsedatetime/parsedatetime.py', 'parsedatetime') - shutil.move('parsedatetime-master/parsedatetime/pdt_locales.py', 'parsedatetime') - shutil.rmtree('parsedatetime-master') + shutil.move('parsedatetime-main/parsedatetime/__init__.py', 'parsedatetime') + shutil.move('parsedatetime-main/parsedatetime/parsedatetime.py', 'parsedatetime') + shutil.move('parsedatetime-main/parsedatetime/pdt_locales.py', 'parsedatetime') + shutil.rmtree('parsedatetime-main') print('parsedatetime installed.') except: pass diff --git a/installer/ptinstaller.py b/installer/ptinstaller.py index 41797ee4..9fcc6145 100644 --- a/installer/ptinstaller.py +++ b/installer/ptinstaller.py @@ -114,8 +114,8 @@ def get_github_user_repo(url): def download(self, url): user_name, repo_name = self.get_github_user_repo(url) - zipfile_url = urljoin(url, '/%s/%s/archive/master.zip' % (user_name, repo_name)) - tmp_zipfile = os.path.join(os.environ['TMPDIR'], '%s-master.zip' % repo_name) + zipfile_url = urljoin(url, '/%s/%s/archive/main.zip' % (user_name, repo_name)) + tmp_zipfile = os.path.join(os.environ['TMPDIR'], '%s-main.zip' % repo_name) r = requests.get(zipfile_url) with open(tmp_zipfile, 'wb') as outs: diff --git a/markdown/markdown2pdf/reportlab/lib/randomtext.py b/markdown/markdown2pdf/reportlab/lib/randomtext.py index fc905de9..8e5b4c1e 100644 --- a/markdown/markdown2pdf/reportlab/lib/randomtext.py +++ b/markdown/markdown2pdf/reportlab/lib/randomtext.py @@ -83,7 +83,7 @@ 'peel the onion', 'goal', 'downsize', 'result-driven', 'conceptualize', 'multidisciplinary', 'gap analysis', 'dysfunctional', 'networking', 'knowledge management', 'goal-setting', - 'mastery learning', 'communication', 'real-estate', 'quarterly', + 'mainy learning', 'communication', 'real-estate', 'quarterly', 'scalable', 'Total Quality Management', 'best of breed', 'nimble', 'monetize', 'benchmark', 'hardball', 'client-centered', 'vision statement', 'empowerment', @@ -95,7 +95,7 @@ 'gap analysis', 'morale', 'objective', 'projection', 'contribution', 'proactive', 'go the extra mile', 'dynamic', 'world class', 'real estate', 'quality vector', 'credibility', - 'appropriate', 'platform', 'projection', 'mastery learning', + 'appropriate', 'platform', 'projection', 'mainy learning', 'recognition', 'quality', 'scenario', 'performance based', 'solutioning', 'go the extra mile', 'downsize', 'phase', 'networking', 'experiencing slippage', 'knowledge management', diff --git a/menu/SlideMenu.py b/menu/SlideMenu.py index 9f331825..4a99fd48 100644 --- a/menu/SlideMenu.py +++ b/menu/SlideMenu.py @@ -9,20 +9,20 @@ from Gestures import Gestures class SideMenuSlideView(ui.View): - def __init__(self, master_view, detail_view): - #need to instantiate with master and detail subviews as args. + def __init__(self, main_view, detail_view): + #need to instantiate with main and detail subviews as args. self.touch_enabled=False # using gestures instead self.g=Gestures() self.prev_location=None self.g.add_pan(self,self.did_pan) - self.master = ui.View() - self.master.frame = (0,0,250,200) - self.master.flex = 'H' - self.master.background_color = 0.3 - self.master.touch_enabled = True - master_view.width = self.master.width #otherwise it's at the default 100. - self.master.add_subview(master_view) + self.main = ui.View() + self.main.frame = (0,0,250,200) + self.main.flex = 'H' + self.main.background_color = 0.3 + self.main.touch_enabled = True + main_view.width = self.main.width #otherwise it's at the default 100. + self.main.add_subview(main_view) self.detail = ui.View() self.detail.frame = (0,0,200,200) @@ -31,7 +31,7 @@ def __init__(self, master_view, detail_view): self.detail.touch_enabled = True self.detail.add_subview(detail_view) - self.add_subview(self.master) + self.add_subview(self.main) self.add_subview(self.detail) self.background_color = 0.8 self.present('panel') @@ -56,39 +56,39 @@ def touch_moved(self, touch): self.x_movement = 'left' if touch.location[0] > self.touch_start[0]: diff = int(touch.location[0] - self.touch_start[0]) - if diff < self.master.width and self.detail.x != self.master.width: + if diff < self.main.width and self.detail.x != self.main.width: self.detail.x = diff - slide_percent = self.detail.x / self.master.width - self.master.alpha = slide_percent + slide_percent = self.detail.x / self.main.width + self.main.alpha = slide_percent elif touch.location[0] < self.touch_start[0]: diff = int(self.touch_start[0] - touch.location[0]) - if self.detail.x > 0 and diff < self.master.width: - self.detail.x = self.master.width - diff - slide_percent = self.detail.x / self.master.width - self.master.alpha = slide_percent + if self.detail.x > 0 and diff < self.main.width: + self.detail.x = self.main.width - diff + slide_percent = self.detail.x / self.main.width + self.main.alpha = slide_percent def touch_ended(self, touch): def slide_left(): self.detail.x = 0 - self.master.alpha = 0 + self.main.alpha = 0 def slide_right(): - self.detail.x = self.master.width - self.master.alpha = 1 + self.detail.x = self.main.width + self.main.alpha = 1 if self.x_movement == 'right': ui.animate(slide_right, duration=0.4) elif self.x_movement == 'left': ui.animate(slide_left, duration=0.4) -master = ui.TableView() +main = ui.TableView() L=ui.ListDataSource(['A','B']) -master.flex = 'WH' -master.data_source=L -master.delegate=L +main.flex = 'WH' +main.data_source=L +main.delegate=L detail = ui.WebView() detail.load_url('http://www.google.com/') detail.flex = 'WH' detail.scales_page_to_fit = False -a = SideMenuSlideView(master, detail) +a = SideMenuSlideView(main, detail) diff --git a/menu/pythonista_slidemenu.py b/menu/pythonista_slidemenu.py index cf1afe77..c50b9cb8 100644 --- a/menu/pythonista_slidemenu.py +++ b/menu/pythonista_slidemenu.py @@ -11,8 +11,8 @@ from Gestures import Gestures class SideMenuSlideView(ui.View): - def __init__(self, master_view, detail_view): - #need to instantiate with master and detail subviews as args. + def __init__(self, main_view, detail_view): + #need to instantiate with main and detail subviews as args. self.touch_enabled=False # using gestures instead self.g=Gestures() self.prev_location=None @@ -20,17 +20,17 @@ def __init__(self, master_view, detail_view): self.small_screen_size = False self.menu_is_visible = False #used for redrawing with small_screen_size and for slide events - self.master = ui.View(frame=(-60,0,320,200), flex='H', touch_enabled=True) #-60 for effect + self.main = ui.View(frame=(-60,0,320,200), flex='H', touch_enabled=True) #-60 for effect if ui.get_screen_size()[0] < 768 or ui.get_screen_size()[1] < 768: #adjust for smaller screen - self.master.width = ui.get_screen_size()[0] - 45 #leave some space to swipe back (..need to test on iphone!) + self.main.width = ui.get_screen_size()[0] - 45 #leave some space to swipe back (..need to test on iphone!) self.small_screen_size = True - master_view.width = self.master.width #otherwise it's at the default 100. - self.master.add_subview(master_view) + main_view.width = self.main.width #otherwise it's at the default 100. + self.main.add_subview(main_view) self.detail = ui.View(frame=(0,0,100,100), flex='WH', touch_enabled=True) self.detail.add_subview(detail_view) - self.add_subview(self.master) + self.add_subview(self.main) self.add_subview(self.detail) self.background_color = 0.4 @@ -38,10 +38,10 @@ def __init__(self, master_view, detail_view): def draw(self): if self.scr_orientation == 'portrait' and self.small_screen_size: - self.master.width = ui.get_screen_size()[0] - 45 + self.main.width = ui.get_screen_size()[0] - 45 elif self.scr_orientation == 'landscape' and self.small_screen_size: - self.master.width = ui.get_screen_size()[0] - 45 - self.detail.x = self.master.width if self.menu_is_visible else 0 + self.main.width = ui.get_screen_size()[0] - 45 + self.detail.x = self.main.width if self.menu_is_visible else 0 def layout(self): self.scr_orientation = 'landscape' if self.width > self.height else 'portrait' @@ -69,44 +69,44 @@ def touch_moved(self, touch): elif touch.location[0] < touch.prev_location[0] and x_distance > y_distance: self.x_movement = 'left' - #setting self.master attributes during slide for visual effect - slide_percent = self.detail.x / self.master.width - self.master.alpha = slide_percent - self.master.x = int(-60*(1-slide_percent)) + #setting self.main attributes during slide for visual effect + slide_percent = self.detail.x / self.main.width + self.main.alpha = slide_percent + self.main.x = int(-60*(1-slide_percent)) #moving self.detail according to the touch slide - if touch.location[0] > self.touch_start[0] and x_distance < self.master.width and self.detail.x != self.master.width: #movement right + if touch.location[0] > self.touch_start[0] and x_distance < self.main.width and self.detail.x != self.main.width: #movement right self.detail.x = x_distance - elif touch.location[0] < self.touch_start[0] and self.detail.x > 0 and x_distance < self.master.width: #movement left - self.detail.x = self.master.width - x_distance + elif touch.location[0] < self.touch_start[0] and self.detail.x > 0 and x_distance < self.main.width: #movement left + self.detail.x = self.main.width - x_distance def touch_ended(self, touch): def slide_left(): self.detail.x = 0 - self.master.alpha = 0 - self.master.x = -60 + self.main.alpha = 0 + self.main.x = -60 def slide_right(): - self.detail.x = self.master.width - self.master.alpha = 1 - self.master.x = 0 + self.detail.x = self.main.width + self.main.alpha = 1 + self.main.x = 0 if self.x_movement == 'right': self.menu_is_visible = True if self.detail.x > 40 else False elif self.x_movement == 'left': - self.menu_is_visible = True if self.detail.x > self.master.width-40 else False + self.menu_is_visible = True if self.detail.x > self.main.width-40 else False ui.animate(slide_right, duration=0.4) if self.menu_is_visible else ui.animate(slide_left, duration=0.4) -master = ui.TableView() -master.data_source = master.delegate = ui.ListDataSource(['lorem ipsum' for i in range(100)]) -master.flex = 'WH' +main = ui.TableView() +main.data_source = main.delegate = ui.ListDataSource(['lorem ipsum' for i in range(100)]) +main.flex = 'WH' detail = ui.WebView() detail.load_url('http://www.google.com') detail.flex = 'WH' detail.scales_page_to_fit = False -a = SideMenuSlideView(master, detail) +a = SideMenuSlideView(main, detail) diff --git a/menu/pythonista_slidemenu_danrcook.py b/menu/pythonista_slidemenu_danrcook.py index 86899081..a3ee5f82 100644 --- a/menu/pythonista_slidemenu_danrcook.py +++ b/menu/pythonista_slidemenu_danrcook.py @@ -15,40 +15,40 @@ x add button; - button with @property? x arg for menu button visibility -x rename self.menu_is_visible to self.master_is_visible for consistency +x rename self.menu_is_visible to self.main_is_visible for consistency x arg for full-screen on small_screen or leave a little grab room. x get a nice example going - web bookmarks? x rename class to SlideMenuView, makes more sense x add docstrings for class -- add toggle for master is visible (on start) -- good way for master button to be visible if full_screen=true on small screens +- add toggle for main is visible (on start) +- good way for main button to be visible if full_screen=true on small screens ''' class SlideMenuView(ui.View): - def __init__(self, master_view, detail_view, full_width=False, master_button_visible=True): - '''A custom view to show a master view (likely a tableview or some list) with the detail showing - in the detail view. Must be instantiated with two views: master and detail. Those views will be fitted appropriatey. + def __init__(self, main_view, detail_view, full_width=False, main_button_visible=True): + '''A custom view to show a main view (likely a tableview or some list) with the detail showing + in the detail view. Must be instantiated with two views: main and detail. Those views will be fitted appropriatey. - Can toggle full width on a small screen for the slide over with full_width=True/False - - Can toggle the menu button visibility with master_button_visible=True/False''' + - Can toggle the menu button visibility with main_button_visible=True/False''' self.touch_enabled=False # using gestures instead self.g=Gestures() self.prev_location=None self.g.add_pan(self,self.did_pan) self.small_screen_size = False - self.full_width = full_width #full width toggle for small screen sizes when master view is visible - self.master_is_visible = False #used for redrawing with small_screen_size and for slide events - self.master_button_visible = master_button_visible + self.full_width = full_width #full width toggle for small screen sizes when main view is visible + self.main_is_visible = False #used for redrawing with small_screen_size and for slide events + self.main_button_visible = main_button_visible - self.master = ui.View(frame=(-60,0,320,200), flex='H', touch_enabled=True) #-60 for effect + self.main = ui.View(frame=(-60,0,320,200), flex='H', touch_enabled=True) #-60 for effect if ui.get_screen_size()[0] < 768 or ui.get_screen_size()[1] < 768: #adjust for smaller screen - self.master.width = ui.get_screen_size()[0] - 45 if not self.full_width else ui.get_screen_size()[0] + self.main.width = ui.get_screen_size()[0] - 45 if not self.full_width else ui.get_screen_size()[0] self.small_screen_size = True - master_view.width = self.master.width #otherwise it's at the default 100. - master_view.y = 50 - self.master.background_color = 1 - self.master.add_subview(master_view) + main_view.width = self.main.width #otherwise it's at the default 100. + main_view.y = 50 + self.main.background_color = 1 + self.main.add_subview(main_view) self.detail = ui.View(frame=(0,0,100,100), flex='WH', touch_enabled=True) self.detail.border_width=0.5 @@ -57,14 +57,14 @@ def __init__(self, master_view, detail_view, full_width=False, master_button_vis detail_view.y = 50 self.detail.add_subview(detail_view) - if self.master_button_visible: - self.master_button = ui.Button(image=ui.Image.named('iob:ios7_arrow_right_32')) - self.master_button.action = self.master_button_action - self.master_button.x = 8 - self.master_button.y = 50 - self.master_button.height - self.detail.add_subview(self.master_button) + if self.main_button_visible: + self.main_button = ui.Button(image=ui.Image.named('iob:ios7_arrow_right_32')) + self.main_button.action = self.main_button_action + self.main_button.x = 8 + self.main_button.y = 50 - self.main_button.height + self.detail.add_subview(self.main_button) - self.add_subview(self.master) + self.add_subview(self.main) self.add_subview(self.detail) self.background_color = 0.35 @@ -72,10 +72,10 @@ def __init__(self, master_view, detail_view, full_width=False, master_button_vis def draw(self): if self.scr_orientation == 'portrait' and self.small_screen_size: - self.master.width = ui.get_screen_size()[0] - 45 if not self.full_width else ui.get_screen_size()[0] + self.main.width = ui.get_screen_size()[0] - 45 if not self.full_width else ui.get_screen_size()[0] elif self.scr_orientation == 'landscape' and self.small_screen_size: - self.master.width = ui.get_screen_size()[0] - 45 if not self.full_width else ui.get_screen_size()[0] - self.detail.x = self.master.width if self.master_is_visible else 0 + self.main.width = ui.get_screen_size()[0] - 45 if not self.full_width else ui.get_screen_size()[0] + self.detail.x = self.main.width if self.main_is_visible else 0 def layout(self): self.scr_orientation = 'landscape' if self.width > self.height else 'portrait' @@ -103,50 +103,50 @@ def touch_moved(self, touch): elif touch.location[0] < touch.prev_location[0] and x_distance > y_distance: self.x_movement = 'left' - #setting self.master attributes during slide for visual effect - slide_percent = self.detail.x / self.master.width - self.master.alpha = slide_percent - self.master.x = int(-60*(1-slide_percent)) + #setting self.main attributes during slide for visual effect + slide_percent = self.detail.x / self.main.width + self.main.alpha = slide_percent + self.main.x = int(-60*(1-slide_percent)) #moving self.detail according to the touch slide - if touch.location[0] > self.touch_start[0] and x_distance < self.master.width and self.detail.x != self.master.width: #movement right + if touch.location[0] > self.touch_start[0] and x_distance < self.main.width and self.detail.x != self.main.width: #movement right self.detail.x = x_distance - elif touch.location[0] < self.touch_start[0] and self.detail.x > 0 and x_distance < self.master.width: #movement left - self.detail.x = self.master.width - x_distance + elif touch.location[0] < self.touch_start[0] and self.detail.x > 0 and x_distance < self.main.width: #movement left + self.detail.x = self.main.width - x_distance def touch_ended(self, touch): try: #occasionally getting an error when closing the view with two finger swipe down if self.x_movement == 'right': - self.master_is_visible = True if self.detail.x > 40 else False + self.main_is_visible = True if self.detail.x > 40 else False elif self.x_movement == 'left': - self.master_is_visible = True if self.detail.x > self.master.width-40 else False - ui.animate(self.slide_right, duration=0.4) if self.master_is_visible else ui.animate(self.slide_left, duration=0.4) + self.main_is_visible = True if self.detail.x > self.main.width-40 else False + ui.animate(self.slide_right, duration=0.4) if self.main_is_visible else ui.animate(self.slide_left, duration=0.4) except: pass def slide_left(self): self.detail.x = 0 - self.master.alpha = 0 - self.master.x = -60 - if self.master_button_visible: - self.master_button.image = ui.Image.named('iob:ios7_arrow_right_32') + self.main.alpha = 0 + self.main.x = -60 + if self.main_button_visible: + self.main_button.image = ui.Image.named('iob:ios7_arrow_right_32') def slide_right(self): - self.detail.x = self.master.width - self.master.alpha = 1 - self.master.x = 0 - if self.master_button_visible: - self.master_button.image = ui.Image.named('iob:ios7_arrow_left_32') + self.detail.x = self.main.width + self.main.alpha = 1 + self.main.x = 0 + if self.main_button_visible: + self.main_button.image = ui.Image.named('iob:ios7_arrow_left_32') @ui.in_background #in case of loading times for webpages... def toggle_menu(self, slide_duration=0.7): '''Can be called with one argument 'slide_duration'. Example: a.toggle_menu(slide_duration=0.3) Note: the value is in seconds. - Use Case: hiding the menu after selecting an item in master for display in detail''' - ui.animate(self.slide_left, duration=slide_duration) if self.master_is_visible\ + Use Case: hiding the menu after selecting an item in main for display in detail''' + ui.animate(self.slide_left, duration=slide_duration) if self.main_is_visible\ else ui.animate(self.slide_right, duration=slide_duration) - self.master_is_visible = True if not self.master_is_visible else False + self.main_is_visible = True if not self.main_is_visible else False - def master_button_action(self, sender): + def main_button_action(self, sender): self.toggle_menu(0.4) def detail_title_text(self, text): @@ -156,8 +156,8 @@ def detail_title_text(self, text): if __name__ == '__main__': - #simple example of a few bookmarks in master (tableview) that load in detail (webview) when tapped. - #all of the master and detail views' functions etc lay outside of SlideMenuView. SlideMenuView simply controls the view. + #simple example of a few bookmarks in main (tableview) that load in detail (webview) when tapped. + #all of the main and detail views' functions etc lay outside of SlideMenuView. SlideMenuView simply controls the view. bookmark_list = ['http://www.google.com/', 'http://www.apple.com/', 'http://www.yahoo.com/'] @@ -166,16 +166,16 @@ def open_page(sender): slide_menu_view.toggle_menu() slide_menu_view.detail_title_text(sender.items[sender.selected_row]) - master = ui.TableView() - master_datasource = ui.ListDataSource(bookmark_list) - master_datasource.action = open_page - master.data_source = master.delegate = master_datasource - master.flex = 'WH' + main = ui.TableView() + main_datasource = ui.ListDataSource(bookmark_list) + main_datasource.action = open_page + main.data_source = main.delegate = main_datasource + main.flex = 'WH' detail = ui.WebView() detail.load_url('http://www.google.com') detail.flex = 'WH' detail.scales_page_to_fit = False - slide_menu_view = SlideMenuView(master, detail) + slide_menu_view = SlideMenuView(main, detail) diff --git a/reminders/reminders_style_ui.py b/reminders/reminders_style_ui.py index 649654a9..07957630 100644 --- a/reminders/reminders_style_ui.py +++ b/reminders/reminders_style_ui.py @@ -7,7 +7,7 @@ from collections import namedtuple import string -MasterRec = namedtuple('MasterRec', 'title,image,accessory_type') +MainRec = namedtuple('MainRec', 'title,image,accessory_type') _interface_bg = 'navy' _interface_text_color = 'black' @@ -17,7 +17,7 @@ def get_recs(nb_recs) : lst = [] for i in range(nb_recs): - x = MasterRec(title = str(i), image = None, accessory_type = 'disclosure_indicator') + x = MainRec(title = str(i), image = None, accessory_type = 'disclosure_indicator') lst.append(x._asdict()) return lst @@ -43,7 +43,7 @@ def layout(self): -class MasterView(ui.View): +class MainView(ui.View): def __init__(self, parent, width_percent = .33): self.parent = parent @@ -70,7 +70,7 @@ def create_view(self): #self.table.data_source.accessory_action = #self.table.data_source.action = self.parent.hit - #master.add_subview(search) + #main.add_subview(search) self.add_subview(self.table) self.add_subview(self.search) @@ -135,16 +135,16 @@ def textfield_should_change(self, textfield, range, replacement): class UiRemindersStyle (ui.View): - def __init__(self , master_width = .33, **kwargs): + def __init__(self , main_width = .33, **kwargs): ui.View.__init__(self, **kwargs) - self.master_percent = master_width + self.main_percent = main_width - self.master = None + self.main = None self.detail = None self.search = None self.table = None - self.master_width = 0 + self.main_width = 0 #create the views self.create_views() @@ -152,15 +152,15 @@ def __init__(self , master_width = .33, **kwargs): def create_views(self): # create the views, dont worry about sizes yet.. do it in layout - # create master view - master = MasterView(self, self.master_percent) - self.master = master + # create main view + main = MainView(self, self.main_percent) + self.main = main # create search view - self.search = SearchView(self.master) + self.search = SearchView(self.main) #self.add_subview(self.search) - self.add_subview(master) + self.add_subview(main) self.detail = DetailView(self) self.add_subview(self.detail) @@ -168,30 +168,30 @@ def create_views(self): def layout(self): - # master view + # main view r = ui.Rect(*self.bounds) - r.width = r.width * self.master_percent - self.master.frame = r + r.width = r.width * self.main_percent + self.main.frame = r r = ui.Rect(*self.bounds) - r.width -= self.master.width - r.x = self.master.width + r.width -= self.main.width + r.x = self.main.width self.detail.bounds = r.inset(10,10, 44, 0) - def set_master_data(self, items): - print(self.master.table) - tbl = self.master.table + def set_main_data(self, items): + print(self.main.table) + tbl = self.main.table tbl.data_source = ui.ListDataSource(items = get_recs(40)) - tbl.data_source.action = self.hit_master + tbl.data_source.action = self.hit_main - def hit_master(self, sender): - print('inside hit callback master') + def hit_main(self, sender): + print('inside hit callback main') print(sender.name) if __name__ == '__main__': f = ui.Rect(0,0,768, 768) - rem = UiRemindersStyle(frame = f, master_width =.5, name = 'Reminders') - rem.set_master_data(range(40)) + rem = UiRemindersStyle(frame = f, main_width =.5, name = 'Reminders') + rem.set_main_data(range(40)) rem.present('sheet') \ No newline at end of file diff --git a/seDP/Design-Patterns-In-Python-master/Structural/Proxy.py b/seDP/Design-Patterns-In-Python-master/Structural/Proxy.py index b66970ff..603ea810 100644 --- a/seDP/Design-Patterns-In-Python-master/Structural/Proxy.py +++ b/seDP/Design-Patterns-In-Python-master/Structural/Proxy.py @@ -11,7 +11,7 @@ # a different address space. This is what the "stub" code in RPC and CORBA # provides. -# A protective proxy controls access to a sensitive master object. The +# A protective proxy controls access to a sensitive main object. The # "surrogate" object checks that the caller has the access permissions required # prior to forwarding the request. diff --git a/view/ui-view-slide-menu.py b/view/ui-view-slide-menu.py index 88aea872..98ac1524 100644 --- a/view/ui-view-slide-menu.py +++ b/view/ui-view-slide-menu.py @@ -5,15 +5,15 @@ import ui class SideMenuSlideView(ui.View): - def __init__(self, master_view, detail_view): - #need to instantiate with master and detail subviews as args. - self.master = ui.View() - self.master.frame = (0,0,250,200) - self.master.flex = 'H' - self.master.background_color = 0.3 - self.master.touch_enabled = False - master_view.width = self.master.width #otherwise it's at the default 100. - self.master.add_subview(master_view) + def __init__(self, main_view, detail_view): + #need to instantiate with main and detail subviews as args. + self.main = ui.View() + self.main.frame = (0,0,250,200) + self.main.flex = 'H' + self.main.background_color = 0.3 + self.main.touch_enabled = False + main_view.width = self.main.width #otherwise it's at the default 100. + self.main.add_subview(main_view) self.detail = ui.View() self.detail.frame = (0,0,200,200) @@ -22,7 +22,7 @@ def __init__(self, master_view, detail_view): self.detail.touch_enabled = False self.detail.add_subview(detail_view) - self.add_subview(self.master) + self.add_subview(self.main) self.add_subview(self.detail) self.background_color = 0.8 self.present() @@ -37,40 +37,40 @@ def touch_moved(self, touch): self.x_movement = 'left' if touch.location[0] > self.touch_start[0]: diff = int(touch.location[0] - self.touch_start[0]) - if diff < self.master.width and self.detail.x != self.master.width: + if diff < self.main.width and self.detail.x != self.main.width: self.detail.x = diff - slide_percent = self.detail.x / self.master.width - self.master.alpha = slide_percent + slide_percent = self.detail.x / self.main.width + self.main.alpha = slide_percent elif touch.location[0] < self.touch_start[0]: diff = int(self.touch_start[0] - touch.location[0]) - if self.detail.x > 0 and diff < self.master.width: - self.detail.x = self.master.width - diff - slide_percent = self.detail.x / self.master.width - self.master.alpha = slide_percent + if self.detail.x > 0 and diff < self.main.width: + self.detail.x = self.main.width - diff + slide_percent = self.detail.x / self.main.width + self.main.alpha = slide_percent def touch_ended(self, touch): def slide_left(): self.detail.x = 0 - self.master.alpha = 0 + self.main.alpha = 0 def slide_right(): - self.detail.x = self.master.width - self.master.alpha = 1 + self.detail.x = self.main.width + self.main.alpha = 1 if self.x_movement == 'right': ui.animate(slide_right, duration=0.4) elif self.x_movement == 'left': ui.animate(slide_left, duration=0.4) -master = ui.WebView() -master.load_html('master') -master.flex = 'WH' -master.scales_page_to_fit = False +main = ui.WebView() +main.load_html('main') +main.flex = 'WH' +main.scales_page_to_fit = False detail = ui.WebView() detail.load_url('http://www.google.com/') detail.flex = 'WH' detail.scales_page_to_fit = False -a = SideMenuSlideView(master, detail) +a = SideMenuSlideView(main, detail) # -------------------- diff --git a/weather/WeatherAnywhereScene-coomlata.py b/weather/WeatherAnywhereScene-coomlata.py index cb2c88e6..eb7f1a5c 100644 --- a/weather/WeatherAnywhereScene-coomlata.py +++ b/weather/WeatherAnywhereScene-coomlata.py @@ -34,7 +34,7 @@ backward compatible with Pythonista 1.5. Thanks to @cclauss for function to determine Pythonista version available at 'https://github.com/cclauss -/Ten-lines-or-less/blob/master/pythonista_version.py' +/Ten-lines-or-less/blob/main/pythonista_version.py' v1.8: 02/15/2016-Front End Menu is now presented from the ui inside the scene rather than in the diff --git a/youtube/Youtube-dl-downloader.py b/youtube/Youtube-dl-downloader.py index 09484945..0189db32 100644 --- a/youtube/Youtube-dl-downloader.py +++ b/youtube/Youtube-dl-downloader.py @@ -17,7 +17,7 @@ youtubedl_location = './site-packages/' backup_location = './backup/youtube_dl/' youtubedl_downloadurl = 'https://github.com/rg3/youtube-dl/archive/master.zip' -youtubedl_unarchive_location = './youtube-dl-master/' +youtubedl_unarchive_location = './youtube-dl-main/' files_to_change = [('utils.py','import ctypes','#import ctypes'), ('utils.py','import pipes','#import pipes'), ('YoutubeDL.py','self._err_file.isatty() and ',''),