-
Notifications
You must be signed in to change notification settings - Fork 509
Expand file tree
/
Copy path__init__.py
More file actions
56 lines (52 loc) · 1.91 KB
/
__init__.py
File metadata and controls
56 lines (52 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 2011-2013 Bitcraze AB
#
# Crazyflie Nano Quadcopter Client
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import json
import os
from appdirs import AppDirs
import sys
# Path used all over the application
if not hasattr(sys, 'frozen'):
module_path = os.path.dirname(__file__)
else:
module_path = os.path.join(os.path.dirname(sys.executable),
'lib', 'cfclient')
config_path = AppDirs("cfclient", "Bitcraze").user_config_dir
if not hasattr(sys, 'frozen'):
from importlib.metadata import version, PackageNotFoundError
try:
VERSION = version("cfclient")
except PackageNotFoundError:
VERSION = "dev"
else:
try:
from .version import __version__ as imported_version
VERSION = imported_version
except ImportError:
VERSION = "dev"
try:
with open(os.path.join(module_path, "resources/log_param_doc.json")) as f:
log_param_doc = json.load(f)
except: # noqa
log_param_doc = None