Skip to content

Removal of master/slave words #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _2016/MobileBlogger.py
Original file line number Diff line number Diff line change
@@ -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']
2 changes: 1 addition & 1 deletion _2016/main.py
Original file line number Diff line number Diff line change
@@ -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 #
4 changes: 2 additions & 2 deletions _2016/mysql-connector-pythonista/client_error.py
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion _2016/mysql-connector-pythonista/constants.py
Original file line number Diff line number Diff line change
@@ -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'),
}


8 changes: 4 additions & 4 deletions _2016/nav.py
Original file line number Diff line number Diff line change
@@ -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'
22 changes: 11 additions & 11 deletions _2016/number-bonds-game.py
Original file line number Diff line number Diff line change
@@ -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)

4 changes: 2 additions & 2 deletions _2016/ptinstaller.py
Original file line number Diff line number Diff line change
@@ -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:
6 changes: 3 additions & 3 deletions _2016/to-sort/AddKeyCommands.py
Original file line number Diff line number Diff line change
@@ -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()
28 changes: 14 additions & 14 deletions _2016/to-sort/RobbiDaten.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion _2016/to-sort/domains.py
Original file line number Diff line number Diff line change
@@ -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"
)


6 changes: 3 additions & 3 deletions _2017/set-a-gradient-as-a-background-kivy-pythonista.py
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 2 additions & 2 deletions appex/MobileBlogger.py
Original file line number Diff line number Diff line change
@@ -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']
4 changes: 2 additions & 2 deletions blog/MobileBlogger.py
Original file line number Diff line number Diff line change
@@ -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']
2 changes: 1 addition & 1 deletion blog/post_to_GitHub.py
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions cloud/Cloud.Import.File.py
Original file line number Diff line number Diff line change
@@ -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']

6 changes: 3 additions & 3 deletions cloud/cloud-file-with-aes-encryption.py
Original file line number Diff line number Diff line change
@@ -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']

6 changes: 3 additions & 3 deletions cloud/cloud-file.py
Original file line number Diff line number Diff line change
@@ -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']

2 changes: 1 addition & 1 deletion cloud/cloud-import.py
Original file line number Diff line number Diff line change
@@ -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] == '<?xml': urlZ = plistlib.readPlistFromString(s)[sTarget] + '/archive/master.zip'
if s[:5] == '<?xml': urlZ = plistlib.readPlistFromString(s)[sTarget] + '/archive/main.zip'
sZ = os.path.expanduser('~/Documents/'+ urlZ.split('/')[-1])
shutil.copyfileobj(urllib2.urlopen(urlZ), open(sZ, 'wb'), length=512*1024)
with open(sZ, 'rb') as f:
4 changes: 2 additions & 2 deletions cloud/cloud.py
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@

Credits:

- cloud.Import: 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

'''

@@ -74,7 +74,7 @@ def Import(sTarget):

if iNow > 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
2 changes: 1 addition & 1 deletion database/DatabaseSizeSummary-Muller.py
Original file line number Diff line number Diff line change
@@ -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())

2 changes: 1 addition & 1 deletion database/DatabaseSizeSummary.py
Original file line number Diff line number Diff line change
@@ -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())

2 changes: 1 addition & 1 deletion database/DatabaseSizeSummaryUpdated.py
Original file line number Diff line number Diff line change
@@ -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())

6 changes: 3 additions & 3 deletions database/Shape2Sqlite.py
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion database/sqlite_table_layout.py
Original file line number Diff line number Diff line change
@@ -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))
Loading
Oops, something went wrong.