Skip to content

Commit

Permalink
Fixed another things.
Browse files Browse the repository at this point in the history
Strange lines. What's wrong with you, GitHub? 0_o
  • Loading branch information
ALLZ committed Feb 26, 2014
1 parent 2676821 commit 9100ca6
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 52 deletions.
9 changes: 0 additions & 9 deletions bin_to_dec.py
Expand Up @@ -8,13 +8,8 @@ class BinToDecCommand(sublime_plugin.TextCommand):
def run(self, edit):
v = self.view
reglist = list(v.sel())
<<<<<<< HEAD
for j in range(0, len(reglist)):
bin = v.substr(v.sel()[j])
=======
for item in reglist:
bin = v.substr(v.sel()[reglist.index(item)])
>>>>>>> 736565c4382dadd2d10eeb9626dae94fe68a70a3
bin = bin.strip()
l = True
if bin == '':
Expand All @@ -23,11 +18,7 @@ def run(self, edit):
if not((i == '1') or (i == '0')):
l = False
if l:
<<<<<<< HEAD
v.replace(edit, v.sel()[j], str(int(bin, 2)))
=======
v.replace(edit, v.sel()[reglist.index(item)], str(int(bin, 2)))
>>>>>>> 736565c4382dadd2d10eeb9626dae94fe68a70a3
else:
if len(bin) > self.MAX_STR_LEN:
logMsg = bin[0:self.MAX_STR_LEN] + "..."
Expand Down
9 changes: 0 additions & 9 deletions bin_to_hex.py
Expand Up @@ -8,13 +8,8 @@ class BinToHexCommand(sublime_plugin.TextCommand):
def run(self, edit):
v = self.view
reglist = list(v.sel())
<<<<<<< HEAD
for j in range(0, len(reglist)):
bin = v.substr(v.sel()[j])
=======
for item in reglist:
bin = v.substr(v.sel()[reglist.index(item)])
>>>>>>> 736565c4382dadd2d10eeb9626dae94fe68a70a3
bin = bin.strip()
l = True
if bin == '':
Expand All @@ -23,11 +18,7 @@ def run(self, edit):
if not((i == '1') or (i == '0')):
l = False
if l:
<<<<<<< HEAD
v.replace(edit, v.sel()[j], '{0:X}'.format(int(bin, 2)))
=======
v.replace(edit, v.sel()[reglist.index(item)], str(hex(int(bin, 2))[2:].upper()))
>>>>>>> 736565c4382dadd2d10eeb9626dae94fe68a70a3
else:
if len(bin) > self.MAX_STR_LEN:
logMsg = bin[0:self.MAX_STR_LEN] + "..."
Expand Down
8 changes: 0 additions & 8 deletions dec_to_bin.py
Expand Up @@ -8,19 +8,11 @@ class DecToBinCommand(sublime_plugin.TextCommand):
def run(self, edit):
v = self.view
reglist = list(v.sel())
<<<<<<< HEAD
for i in range(0, len(reglist)):
dec = v.substr(v.sel()[i])
dec = dec.strip()
if dec.isdigit():
v.replace(edit, v.sel()[i], '{0:b}'.format(int(dec)))
=======
for item in reglist:
dec = v.substr(v.sel()[reglist.index(item)])
dec = dec.strip()
if dec.isdigit():
v.replace(edit, v.sel()[reglist.index(item)], bin(int(dec))[2:].upper())
>>>>>>> 736565c4382dadd2d10eeb9626dae94fe68a70a3
else:
if len(dec) > self.MAX_STR_LEN:
logMsg = dec[0:self.MAX_STR_LEN] + "..."
Expand Down
8 changes: 0 additions & 8 deletions dec_to_hex.py
Expand Up @@ -8,19 +8,11 @@ class DecToHexCommand(sublime_plugin.TextCommand):
def run(self, edit):
v = self.view
reglist = list(v.sel())
<<<<<<< HEAD
for i in range(0, len(reglist)):
dec = v.substr(v.sel()[i])
dec = dec.strip()
if dec.isdigit():
v.replace(edit, v.sel()[i], '{0:X}'.format(int(dec)))
=======
for item in reglist:
dec = v.substr(v.sel()[reglist.index(item)])
dec = dec.strip()
if dec.isdigit():
v.replace(edit, v.sel()[reglist.index(item)], str.strip(hex(int(dec))[2:].upper(), 'L'))
>>>>>>> 736565c4382dadd2d10eeb9626dae94fe68a70a3
else:
if len(dec) > self.MAX_STR_LEN:
logMsg = dec[0:self.MAX_STR_LEN] + "..."
Expand Down
9 changes: 0 additions & 9 deletions hex_to_bin.py
Expand Up @@ -8,13 +8,8 @@ class HexToBinCommand(sublime_plugin.TextCommand):
def run(self, edit):
v = self.view
reglist = list(v.sel())
<<<<<<< HEAD
for j in range(0, len(reglist)):
hx = v.substr(v.sel()[j])
=======
for item in reglist:
hx = v.substr(v.sel()[reglist.index(item)])
>>>>>>> 736565c4382dadd2d10eeb9626dae94fe68a70a3
hx = hx.strip()
hexdig = '0123456789abcdefABCDEF'
l = True
Expand All @@ -25,11 +20,7 @@ def run(self, edit):
l = False

if l:
<<<<<<< HEAD
v.replace(edit, v.sel()[j], '{0:b}'.format(int(hx, 16)))
=======
v.replace(edit, v.sel()[reglist.index(item)], bin(int(hx, 16))[2:].upper())
>>>>>>> 736565c4382dadd2d10eeb9626dae94fe68a70a3
else:
if len(hx) > self.MAX_STR_LEN:
logMsg = hx[0:self.MAX_STR_LEN] + "..."
Expand Down
9 changes: 0 additions & 9 deletions hex_to_dec.py
Expand Up @@ -8,13 +8,8 @@ class HexToDecCommand(sublime_plugin.TextCommand):
def run(self, edit):
v = self.view
reglist = list(v.sel())
<<<<<<< HEAD
for j in range(0, len(reglist)):
hx = v.substr(v.sel()[j])
=======
for item in reglist:
hx = v.substr(v.sel()[reglist.index(item)])
>>>>>>> 736565c4382dadd2d10eeb9626dae94fe68a70a3
hx = hx.strip()
hexdig = '0123456789abcdefABCDEF'
l = True
Expand All @@ -25,11 +20,7 @@ def run(self, edit):
l = False

if l:
<<<<<<< HEAD
v.replace(edit, v.sel()[j], str(int(hx, 16)))
=======
v.replace(edit, v.sel()[reglist.index(item)], str(int(hx, 16)))
>>>>>>> 736565c4382dadd2d10eeb9626dae94fe68a70a3
else:
if len(hx) > self.MAX_STR_LEN:
logMsg = hx[0:self.MAX_STR_LEN] + "..."
Expand Down

0 comments on commit 9100ca6

Please sign in to comment.