Closed trevor closed 11 years ago
Yes, i haven't came around updating this for ST3. I know wbond have made some changes for the .json file so you can tell what suits which version.
I'll go ahead and port it when i am done with exams, have to prioritize. I will tho try too add the .json file! :)
hi @Foxboron - I agree with your prioritization strategy, good luck with finals!
Woohooo! Approval!
I recommend writing conditionals to support both versions instead of maintaining two branches. This is way easier for a small plugin like this.
I agree with @FichteFoll HOWEVER! bs4 is not fucking compitable with the python3 Sublime uses.
class NamespacedAttribute(unicode):
def __new__(cls, prefix, name, namespace=None):
if name is None:
obj = unicode.__new__(cls, prefix)
elif prefix is None:
# Not really namespaced.
obj = unicode.__new__(cls, name)
else:
obj = unicode.__new__(cls, prefix + ":" + name)
obj.prefix = prefix
obj.name = name
obj.namespace = namespace
return obj
Inherit unicode in python3, yay. How the fuck do i even solve this? Atm i am fixing the import so its works with ST2 and ST3, but i am still baffeled with this code.
and that is not the only code. Looking at several lines reading: unicode.__new__(cls, original_value)
if sys.version_info >= (3,):
unicode = str
or similarly. I do that regularly with basestring = str
when I need to check if a parameter is a string using isinstance()
.
Pushing a experimental build too the branch python3
. I wont promis it works at this very moment.
Now i have fixed everything, i hope. Please give feedback if there re any errors!
SB3 uses python 3 exclusively, may want to put in python 2 vs 3 conditionals: